Automated merge from 23.0 to develop
This commit is contained in:
commit
9b3bebcd5e
36 changed files with 115 additions and 58 deletions
|
|
@ -69,10 +69,19 @@ foreach ($dirsyslogs as $reldir) {
|
|||
if (substr($file, 0, 11) == 'mod_syslog_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||
|
||||
require_once $newdir.$file.'.php';
|
||||
try {
|
||||
require_once $newdir.$file.'.php';
|
||||
|
||||
$module = new $file();
|
||||
'@phan-var-force LogHandler $module';
|
||||
if (!class_exists($file)) {
|
||||
dol_syslog('admin/syslog.php skipping stale handler '.$file.' (class not declared)', LOG_WARNING);
|
||||
continue;
|
||||
}
|
||||
$module = new $file();
|
||||
'@phan-var-force LogHandler $module';
|
||||
} catch (Throwable $e) {
|
||||
dol_syslog('admin/syslog.php skipping stale handler '.$file.': '.$e->getMessage(), LOG_WARNING);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->getVersion() == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
|
|
|
|||
|
|
@ -682,6 +682,13 @@ class Categorie extends CommonObject
|
|||
$this->fk_parent = ($this->fk_parent != "" ? intval($this->fk_parent) : 0);
|
||||
$this->visible = ($this->visible != "" ? intval($this->visible) : 0);
|
||||
|
||||
if ($this->fk_parent > 0 && $this->fk_parent == $this->id) {
|
||||
$langs->load('categories');
|
||||
$this->error = $langs->trans("ErrorCategoryCannotBeItsOwnParent");
|
||||
dol_syslog($this->error, LOG_WARNING);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($this->already_exists()) {
|
||||
$this->error = $langs->trans("ImpossibleUpdateCat");
|
||||
$this->error .= " : ".$langs->trans("CategoryExistsAtSameLevel");
|
||||
|
|
|
|||
|
|
@ -1537,7 +1537,7 @@ class ActionComm extends CommonObject
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class AgendaEvents extends DolibarrApi
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (t.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
// Add sql filters
|
||||
|
|
|
|||
|
|
@ -864,7 +864,7 @@ if ($search_sale && $search_sale != '-1') {
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
// Search on socid
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ if ($search_sale && $search_sale != '-1') {
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
// Search on socid
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ if ($search_sale && $search_sale != '-1') {
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
// Search on socid
|
||||
|
|
|
|||
|
|
@ -784,7 +784,7 @@ if ($search_sale && $search_sale != '-1') {
|
|||
if ($search_sale == -2) {
|
||||
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
|
||||
} elseif ($search_sale > 0) {
|
||||
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
|
||||
$sql .= " AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale)."))";
|
||||
}
|
||||
}
|
||||
// Search on socid
|
||||
|
|
|
|||
|
|
@ -788,7 +788,7 @@ class Propal extends CommonObject
|
|||
|
||||
// Rang to use
|
||||
$ranktouse = $rang;
|
||||
if ($ranktouse == -1) {
|
||||
if (empty($ranktouse) || $ranktouse == -1) {
|
||||
$rangmax = $this->line_max($fk_parent_line);
|
||||
$ranktouse = $rangmax + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -514,12 +514,12 @@ if ($socid > 0) {
|
|||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountTTC")).'">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" class="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
|
|
@ -576,12 +576,12 @@ if ($socid > 0) {
|
|||
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ht).'</td>';
|
||||
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right nowraponall">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ttc).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td class="tdoverflowmax100">';
|
||||
|
|
@ -607,7 +607,7 @@ if ($socid > 0) {
|
|||
}
|
||||
} else {
|
||||
$colspan = 8;
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
$colspan += 2;
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
|
|
@ -814,12 +814,12 @@ if ($socid > 0) {
|
|||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountTTC")).'">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" class="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
|
|
@ -871,12 +871,12 @@ if ($socid > 0) {
|
|||
}
|
||||
print '<td class="nowrap"><span class="opacitymedium">'.$langs->trans("NotConsumed").'</span></td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ht).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ttc).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td class="tdoverflowmax100">';
|
||||
|
|
@ -901,7 +901,7 @@ if ($socid > 0) {
|
|||
}
|
||||
} else {
|
||||
$colspan = 8;
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
$colspan += 2;
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
|
|
@ -1142,12 +1142,12 @@ if ($socid > 0) {
|
|||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountTTC")).'">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" class="center">'.$langs->trans("Author").'</td>';
|
||||
|
|
@ -1223,12 +1223,12 @@ if ($socid > 0) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ht).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right nowraponall">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ttc).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td class="tdoverflowmax100">';
|
||||
|
|
@ -1241,7 +1241,7 @@ if ($socid > 0) {
|
|||
}
|
||||
} else {
|
||||
$colspan = 8;
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
$colspan += 2;
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
|
|
@ -1312,12 +1312,12 @@ if ($socid > 0) {
|
|||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountHT")).'">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans("MulticurrencyAmountTTC")).'">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" class="center">'.$langs->trans("Author").'</td>';
|
||||
|
|
@ -1393,12 +1393,12 @@ if ($socid > 0) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ht).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td class="right">'.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($obj->amount_ttc).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
print '<td class="right nowraponall amount">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td class="tdoverflowmax100">';
|
||||
|
|
@ -1412,7 +1412,7 @@ if ($socid > 0) {
|
|||
}
|
||||
} else {
|
||||
$colspan = 8;
|
||||
if (isModEnabled('multicompany')) {
|
||||
if (isModEnabled('multicurrency')) {
|
||||
$colspan += 2;
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
|
|
|
|||
|
|
@ -1780,7 +1780,7 @@ class Commande extends CommonOrder
|
|||
// Rang to use
|
||||
$ranktouse = $rang;
|
||||
|
||||
if ($ranktouse == -1) {
|
||||
if (empty($ranktouse) || $ranktouse == -1) {
|
||||
$rangmax = $this->line_max($fk_parent_line);
|
||||
$ranktouse = $rangmax + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4410,7 +4410,7 @@ class Facture extends CommonInvoice
|
|||
|
||||
// Rank to use
|
||||
$ranktouse = $rang;
|
||||
if ($ranktouse == -1) {
|
||||
if (empty($ranktouse) || $ranktouse == -1) {
|
||||
$rangmax = $this->line_max($fk_parent_line);
|
||||
$ranktouse = $rangmax + 1;
|
||||
}
|
||||
|
|
|
|||
1
htdocs/conf/.gitignore
vendored
1
htdocs/conf/.gitignore
vendored
|
|
@ -7,3 +7,4 @@
|
|||
/conf.php.utf8
|
||||
/conf.php.nov*
|
||||
/.conf.php.swp
|
||||
/conf.sav
|
||||
|
|
|
|||
|
|
@ -1234,6 +1234,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||
// TODO Change signature of delete for Societe
|
||||
$result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
} else {
|
||||
$objecttmp->oldcopy = dol_clone($objecttmp);
|
||||
$result = $objecttmp->delete($user);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,11 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
|||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$signature = GETPOST('signaturebase64');
|
||||
$ref = GETPOST('ref', 'aZ09');
|
||||
// Match the filter the producer uses in newonlinesign.php:97 ('alpha').
|
||||
// Refs such as PR2601-0003 contain a dash, which aZ09 strips. After stripping
|
||||
// the dash, dol_verifyHash fails because the security key was built from the
|
||||
// full reference, so onlineSign answered 403 even on valid submissions (#31464).
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$mode = GETPOST('mode', 'aZ09'); // 'proposal', ...
|
||||
$SECUREKEY = GETPOST("securekey"); // Secure key
|
||||
$online_sign_name = GETPOST("onlinesignname");
|
||||
|
|
|
|||
|
|
@ -1905,14 +1905,15 @@ class FormTicket
|
|||
if (getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO') || getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE')) {
|
||||
$texttooltip .= '<br><br>'.$langs->trans("ForEmailMessageWillBeCompletedWith").'...';
|
||||
}
|
||||
$allowedmailtags = array('a', 'div', 'strong', 'em', 'i', 'u', 'p', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img');
|
||||
if (getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO')) {
|
||||
$mail_intro = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'), $this->substit);
|
||||
print '<input type="hidden" name="mail_intro" value="'.dolPrintHTMLForAttribute($mail_intro).'">';
|
||||
print '<input type="hidden" name="mail_intro" value="'.dolPrintHTMLForAttribute($mail_intro, 0, $allowedmailtags).'">';
|
||||
$texttooltip .= '<br><u>'.$langs->trans("TicketMessageMailIntro").'</u><br>'.$mail_intro;
|
||||
}
|
||||
if (getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE')) {
|
||||
$mail_signature = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'), $this->substit);
|
||||
print '<input type="hidden" name="mail_signature" value="'.dolPrintHTMLForAttribute($mail_signature).'">';
|
||||
print '<input type="hidden" name="mail_signature" value="'.dolPrintHTMLForAttribute($mail_signature, 0, $allowedmailtags).'">';
|
||||
$texttooltip .= '<br><br><u>'.$langs->trans("TicketMessageMailFooter").'</u><br>'.$mail_signature;
|
||||
}
|
||||
print $form->textwithpicto('', $texttooltip, 1, 'help');
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ function generate_random_id($car = 16)
|
|||
for ($i = 0; $i < $car; $i++) {
|
||||
try {
|
||||
$key = random_int(0, $max);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
// Fallback. We let PHP makes the seed automatically (no manual mt_srand)
|
||||
$key = mt_rand(0, $max);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1578,7 +1578,7 @@ if (!empty($object->thirdparty)) {
|
|||
jQuery("#np_markRate, .np_markRate").hide();
|
||||
}
|
||||
|
||||
jQuery("#units, #title_units").hide();
|
||||
jQuery("#units, #title_units, .linecoluseunit .selection").hide();
|
||||
jQuery("#buying_price").show();
|
||||
jQuery('#trlinefordates, .divlinefordates').show();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1083,7 +1083,8 @@ if ($action == 'create') {
|
|||
} else {
|
||||
print '<td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, array(), 0, 'minwidth150 widthcentpercentminusxx maxwidth500');
|
||||
$filter = '(s.status:=:1)';
|
||||
print $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth150 widthcentpercentminusxx maxwidth500');
|
||||
print ' <a href="'.dolBuildUrl(DOL_URL_ROOT . '/societe/card.php', ['action' => 'create', 'customer' => 3, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create'])]).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ class Fichinter extends CommonObject
|
|||
*/
|
||||
public $element = 'fichinter';
|
||||
|
||||
/**
|
||||
* @var string Name of field in database that is used as reference when object is linked to another one.
|
||||
*/
|
||||
public $fk_element = 'fk_fichinter';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ ALTER TABLE llx_partnership ADD COLUMN email_partnership varchar(64) after fk_me
|
|||
|
||||
ALTER TABLE llx_contratdet ADD INDEX idx_contratdet_statut (statut);
|
||||
|
||||
ALTER TABLE fk_product_price_product DROP FOREIGN KEY fk_product_price_product;
|
||||
ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_product;
|
||||
|
||||
ALTER TABLE llx_societe_rib ADD COLUMN ext_payment_site varchar(128);
|
||||
|
||||
|
|
@ -681,7 +681,7 @@ ALTER TABLE llx_product_lot_extrafields CHANGE COLUMN tms tms timestamp DEFAULT
|
|||
ALTER TABLE llx_product_lot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price_by_qty CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_price CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock_entrepot CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_warehouse_properties CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_product_stock CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
ALTER TABLE llx_projet CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
|
@ -723,3 +723,6 @@ ALTER TABLE llx_user CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP O
|
|||
ALTER TABLE llx_salary_extrafields CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
-- 15.0 -> 16.0 rename llx_advtargetemailing to llx_mailing_advtarget
|
||||
ALTER TABLE llx_mailing_advtarget CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
-- 3.6 -> 3.7 typo on llx_adherents ('end with s') and varchar is 128
|
||||
ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
|
||||
|
|
|
|||
|
|
@ -234,3 +234,5 @@ UPDATE llx_menu SET url = CONCAT(url, '&mode=init') WHERE fk_mainmenu = 'ticket'
|
|||
|
||||
-- VMYSQL4.1 ALTER TABLE llx_asset_depreciation_options_economic MODIFY COLUMN accelerated_depreciation_option boolean DEFAULT false;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN llx_asset_depreciation_options_economic DROP DEFAULT, ALTER COLUMN llx_asset_depreciation_options_economic TYPE boolean USING llx_asset_depreciation_options_economic::integer <> 0, ALTER COLUMN llx_asset_depreciation_options_economic SET DEFAULT false;
|
||||
|
||||
ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
|
||||
|
|
|
|||
|
|
@ -451,4 +451,6 @@ CREATE TABLE llx_workstation_workstation_extrafields
|
|||
|
||||
ALTER TABLE llx_workstation_workstation_extrafields ADD INDEX idx_workstation_workstation_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_adherent MODIFY COLUMN societe VARCHAR(128);
|
||||
|
||||
-- end of migration
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ NoSubCat=No subcategory.
|
|||
SubCatOf=Subcategory
|
||||
FoundCats=Found tags/categories
|
||||
ImpossibleAddCat=Impossible to add the tag/category %s
|
||||
ErrorCategoryCannotBeItsOwnParent=A tag/category cannot be its own parent.
|
||||
WasAddedSuccessfully=<b>%s</b> was added successfully.
|
||||
ObjectAlreadyLinkedToCategory=Element is already linked to this tag/category.
|
||||
ProductIsInCategories=Product/service is linked to following tags/categories
|
||||
|
|
|
|||
|
|
@ -1867,7 +1867,7 @@ class Mo extends CommonObject
|
|||
$this->tpl['label'] = '';
|
||||
if (!empty($line->fk_product) && $line->fk_product > 0) {
|
||||
$productstatic->fetch($line->fk_product);
|
||||
$productstatic->load_virtual_stock();
|
||||
$productstatic->load_stock(); // load_virtual_stock() is done in load_stock()
|
||||
$this->tpl['label'] .= $productstatic->getNomUrl(1);
|
||||
//$this->tpl['label'].= ' - '.$productstatic->label;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ class FormProduct
|
|||
if ($mode == 1) {
|
||||
$return .= $lines->short_label;
|
||||
} elseif ($mode == 2) {
|
||||
$return .= $lines->scale;
|
||||
$return .= (int) $lines->scale;
|
||||
} else {
|
||||
$return .= $lines->id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1453,6 +1453,8 @@ class SupplierProposal extends CommonObject
|
|||
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
|
||||
$line->fetch_optionals();
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
$i++;
|
||||
|
|
@ -2721,6 +2723,8 @@ class SupplierProposal extends CommonObject
|
|||
$this->lines[$i]->fk_unit = $obj->fk_unit;
|
||||
$this->lines[$i]->extraparams = !empty($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array();
|
||||
|
||||
$this->lines[$i]->fetch_optionals();
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ $formproduct = new FormProduct($db);
|
|||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_appearance');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database.php?restore_lastsearch_values=1">'.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("GoBack").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
$head = takepos_admin_prepare_head();
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ $arrayofcss = array("/takepos/css/colorbox.css");
|
|||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-takepos page-admin_bar');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database.php?restore_lastsearch_values=1">'.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("GoBack").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
$head = takepos_admin_prepare_head();
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ $form = new Form($db);
|
|||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_receipt');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database.php?restore_lastsearch_values=1">'.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("GoBack").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ $help_url = 'EN:Module_Point_of_sale_(TakePOS)';
|
|||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), $help_url, '', 0, 0, '', '', '', 'mod-takepos page-admin_setup');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database.php?restore_lastsearch_values=1">'.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("GoBack").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ $formproduct = new FormProduct($db);
|
|||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, '', '', '', 'mod-takepos page-admin_terminal');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database.php?restore_lastsearch_values=1">'.img_picto($langs->trans("GoBack"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("GoBack").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
$head = takepos_admin_prepare_head();
|
||||
|
|
|
|||
|
|
@ -238,13 +238,13 @@ $( document ).ready(function() {
|
|||
<div style="position: absolute; left: 25%; bottom: 8%; width:50%; height:3%;">
|
||||
<center>
|
||||
<h1>
|
||||
<?php if ($floor > 1) { ?>
|
||||
<img class="valignmiddle" src="./img/arrow-prev.png" width="5%" onclick="location.href='floors.php?floor=<?php if ($floor > 1) {
|
||||
<?php if ($floor > 0) { ?>
|
||||
<img class="valignmiddle" src="./img/arrow-prev.png" width="5%" onclick="location.href='floors.php?floor=<?php if ($floor > 0) {
|
||||
$floor--;
|
||||
echo $floor;
|
||||
$floor++;
|
||||
} else {
|
||||
echo "1";
|
||||
echo "0";
|
||||
} ?>';">
|
||||
<?php } ?>
|
||||
<span class="valignmiddle"><?php echo $langs->trans("Floor")." ".$floor; ?></span>
|
||||
|
|
|
|||
|
|
@ -1162,11 +1162,14 @@ $( document ).ready(function() {
|
|||
}
|
||||
|
||||
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
|
||||
// Look for any cash control fence created today on this terminal, regardless of its status,
|
||||
// so the auto-open popup only fires on the first cash control of a calendar day. Without this,
|
||||
// refreshing the browser the same day after closing a fence used to immediately re-fire the
|
||||
// popup because the closed fences were filtered out by the status check (#38597).
|
||||
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
|
||||
$sql .= " entity = ".((int) $conf->entity)." AND ";
|
||||
$sql .= " posnumber = ".((int) $_SESSION["takeposterminal"])." AND ";
|
||||
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
|
||||
$sql .= " AND status = 0 ";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
|
@ -1414,7 +1417,9 @@ if (!getDolGlobalString('TAKEPOS_HIDE_HEAD_BAR')) {
|
|||
<button type="button" class="calcbutton" onclick="Edit(0);">0</button>
|
||||
<button type="button" class="calcbutton" onclick="Edit('.')">.</button>
|
||||
<button type="button" class="calcbutton poscolorblue" onclick="Edit('c')">C</button>
|
||||
<?php if ($user->hasRight('takepos', 'editlines')) { ?>
|
||||
<button type="button" class="calcbutton2 poscolordelete" id="delete" onclick="deleteline()"><span class="fa fa-trash"></span></button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -1003,7 +1003,7 @@ if (empty($reshook)) {
|
|||
$invoice->fetch($placeid);
|
||||
}
|
||||
|
||||
if ($action == "deleteline" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
if ($action == "deleteline" && ($user->hasRight('takepos', 'editlines') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) {
|
||||
/*
|
||||
$permissiontoupdateline = ($user->hasRight('takepos', 'editlines') && ($user->hasRight('takepos', 'editorderedlines') || $line->special_code != "4"));
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
|
|
@ -1032,14 +1032,22 @@ if (empty($reshook)) {
|
|||
$db->commit();
|
||||
|
||||
if (count($invoice->lines) == 0) {
|
||||
$invoice->delete($user);
|
||||
// Keep an empty draft invoice alive when a non-default customer was
|
||||
// already attached so deleting the last line does not silently lose
|
||||
// the customer that was just selected (#38219). Only drop the invoice
|
||||
// when it is still on the default cashdesk thirdparty (or none).
|
||||
$defaultsocid = (int) getDolGlobalString('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]);
|
||||
$invoicesocid = (int) $invoice->socid;
|
||||
if ($invoicesocid === 0 || $invoicesocid === $defaultsocid) {
|
||||
$invoice->delete($user);
|
||||
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
header("Location: ".DOL_URL_ROOT."/takepos/public/auto_order.php");
|
||||
} else {
|
||||
header("Location: ".DOL_URL_ROOT."/takepos/invoice.php");
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
header("Location: ".DOL_URL_ROOT."/takepos/public/auto_order.php");
|
||||
} else {
|
||||
header("Location: ".DOL_URL_ROOT."/takepos/invoice.php");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -709,6 +709,9 @@ if (empty($reshook)) {
|
|||
$permissiondellink = $permissiontoadd;
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
|
||||
|
||||
// Actions when printing a doc from card
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
|
||||
|
||||
// Actions to build doc
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue