diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fa5887e13f3..14c9a7dee5b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2457,7 +2457,7 @@ if ($id > 0) { } elseif ($valuetoshow == 2) { $valuetoshow = $langs->trans('CurrentNext'); } - $class = "center"; + $class = "center tdoverflowmax125"; } elseif ($value == 'price' || preg_match('/^amount/i', $value)) { $valuetoshow = price($valuetoshow); } @@ -2469,6 +2469,8 @@ if ($id > 0) { $key = $langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value); $valuetoshow = nl2br($valuetoshow); + $titletoshow = $valuetoshow; + $class = 'small tdoverflowmax200'; } elseif ($value == 'label' && $tabname[$id] == 'c_country') { $key = $langs->trans("Country".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->$value); @@ -2496,6 +2498,8 @@ if ($id > 0) { } elseif ($value == 'libelle' && $tabname[$id] == 'c_payment_term') { $key = $langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value); + $titletoshow = $key; + $class = "tdoverflowmax150"; } elseif ($value == 'libelle' && $tabname[$id] == 'c_paiement') { $transavailableforcode = $langs->tab_translate["PaymentType".strtoupper($obj->code)]; $key = $langs->trans("PaymentType".strtoupper($obj->code)); @@ -2641,7 +2645,7 @@ if ($id > 0) { // Favorite, EEC & Sepa // Only for country dictionary if ($id == DICT_COUNTRY) { - print ''; + print ''; // Is in EEC if ($iserasable) { print ''.$actl[$obj->eec].''; @@ -2649,7 +2653,7 @@ if ($id > 0) { print ''.$langs->trans("AlwaysActive").''; } print ''; - print ''; + print ''; // Is in Sepa if ($iserasable) { print ''.$actl[$obj->sepa].''; @@ -2657,7 +2661,7 @@ if ($id > 0) { print ''.$langs->trans("AlwaysActive").''; } print ''; - print ''; + print ''; // Favorite if ($iserasable) { print ''.$actl[$obj->favorite].''; @@ -2669,7 +2673,7 @@ if ($id > 0) { } // Active - print ''; + print ''; if ($canbedisabled) { print ''.$actl[$obj->active].''; } else { diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index d3ce6b98013..a7413028b3d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -70,6 +70,7 @@ $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $mode = GETPOST('mode', 'aZ09'); $optioncss = GETPOST('optioncss', 'alpha'); +$backtopage = GETPOST('backtopage'); $contextpage = GETPOST('contextpage', 'aZ09'); $id = $rowid = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('rowid')); @@ -290,15 +291,21 @@ if ($rowid > 0) { * Actions */ -if (GETPOST('cancel', 'alpha')) { +if (GETPOST('cancel', 'alpha') || GETPOST('actioncancel', 'alpha')) { $action = 'list'; $massaction = ''; + + if (!empty($backtopage)) { + header("Location: ".$backtopage); + exit(1); + } } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } $parameters = array(); +$object = null; $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -442,6 +449,11 @@ if (empty($reshook)) { if ($result) { // Add is ok setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST = array('id' => 25); // Clean $_POST array, we keep only id + + if (!empty($backtopage)) { + header("Location: ".$backtopage); + exit(1); + } } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); @@ -743,6 +755,7 @@ if ($action == 'create') { print ''; print ''; print ''; + print ''; print '
'; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 444fdcfa455..ded66298a6c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2106,7 +2106,7 @@ if ($action == 'create') { print ''; // Validaty duration - print ''; + print ''; // Terms of payment print ''; + $result .= ''; - $result .= '
'.$langs->trans("ValidityDuration").''.img_picto('', 'clock', 'class="pictofixedwidth"').' '.$langs->trans("days").'
'.$langs->trans("ValidityDuration").''.img_picto('', 'clock', 'class="pictofixedwidth"').' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9fe0895d2ad..ce23b7d5edb 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3422,9 +3422,14 @@ class Facture extends CommonInvoice $num = $this->ref; } - $this->newref = dol_sanitizeFileName($num); + if (!$num) { + $error++; + } else { + $this->oldref = $this->ref; + $this->newref = dol_sanitizeFileName($num); + } - if ($num) { + if (!$error) { $this->update_price(1); // Validate @@ -3442,132 +3447,125 @@ class Facture extends CommonInvoice $this->error = $this->db->lasterror(); $error++; } + } - // We check if the invoice was provisional - /* - if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref))) { - // La verif qu'une remise n'est pas utilisee 2 fois est faite au moment de l'insertion de ligne - } - */ + if (!$error) { + // Define third party as a customer + $result = $this->thirdparty->setAsCustomer(); - if (!$error) { - // Define third party as a customer - $result = $this->thirdparty->setAsCustomer(); + // If active (STOCK_CALCULATE_ON_BILL), we decrement the main product and its components at invoice validation + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $idwarehouse > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); - // If active (STOCK_CALCULATE_ON_BILL), we decrement the main product and its components at invoice validation - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $idwarehouse > 0) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); + // Loop on each line + $cpt = count($this->lines); + for ($i = 0; $i < $cpt; $i++) { + if ($this->lines[$i]->fk_product > 0) { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; // deprecated + $mouvP->setOrigin($this->element, $this->id); - // Loop on each line - $cpt = count($this->lines); - for ($i = 0; $i < $cpt; $i++) { - if ($this->lines[$i]->fk_product > 0) { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; // deprecated - $mouvP->setOrigin($this->element, $this->id); + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) { + // TODO If warehouseid has been set into invoice line, we should use this value in priority + // $newidwarehouse = $this->lines[$i]->fk_warehouse ? $this->lines[$i]->fk_warehouse : $idwarehouse; + $result = $mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr", $num), '', '', $this->lines[$i]->batch); + if ($result < 0) { + $error++; + $this->error = $mouvP->error; + $this->errors = array_merge($this->errors, $mouvP->errors); + } + } else { + // TODO If warehouseid has been set into invoice line, we should use this value in priority + // $newidwarehouse = $this->lines[$i]->fk_warehouse ? $this->lines[$i]->fk_warehouse : $idwarehouse; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) { - // TODO If warehouseid has been set into invoice line, we should use this value in priority - // $newidwarehouse = $this->lines[$i]->fk_warehouse ? $this->lines[$i]->fk_warehouse : $idwarehouse; - $result = $mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr", $num), '', '', $this->lines[$i]->batch); - if ($result < 0) { - $error++; - $this->error = $mouvP->error; - $this->errors = array_merge($this->errors, $mouvP->errors); - } - } else { - // TODO If warehouseid has been set into invoice line, we should use this value in priority - // $newidwarehouse = $this->lines[$i]->fk_warehouse ? $this->lines[$i]->fk_warehouse : $idwarehouse; + $is_batch_line = false; + if ($batch_rule > 0) { + $productStatic->fetch($this->lines[$i]->fk_product); + if ($productStatic->hasbatch() && is_object($productbatch)) { + $is_batch_line = true; + $product_qty_remain = $this->lines[$i]->qty; - $is_batch_line = false; - if ($batch_rule > 0) { - $productStatic->fetch($this->lines[$i]->fk_product); - if ($productStatic->hasbatch() && is_object($productbatch)) { - $is_batch_line = true; - $product_qty_remain = $this->lines[$i]->qty; + $sortfield = ''; + $sortorder = ''; + // find lot/serial by sellby (DLC) and eatby dates (DLUO) first + if ($batch_rule == Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST) { + $sortfield = 'pl.sellby,pl.eatby,pb.qty,pl.rowid'; + $sortorder = 'ASC,ASC,ASC,ASC'; + } - $sortfield = ''; - $sortorder = ''; - // find lot/serial by sellby (DLC) and eatby dates (DLUO) first - if ($batch_rule == Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST) { - $sortfield = 'pl.sellby,pl.eatby,pb.qty,pl.rowid'; - $sortorder = 'ASC,ASC,ASC,ASC'; - } + $resBatchList = $productbatch->findAllForProduct($productStatic->id, $idwarehouse, (getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER') ? 0 : null), $sortfield, $sortorder); + if (!is_array($resBatchList)) { + $error++; + $this->error = $this->db->lasterror(); + } - $resBatchList = $productbatch->findAllForProduct($productStatic->id, $idwarehouse, (getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER') ? 0 : null), $sortfield, $sortorder); - if (!is_array($resBatchList)) { + if (!$error) { + $batchList = $resBatchList; + if (empty($batchList)) { $error++; - $this->error = $this->db->lasterror(); + $langs->load('errors'); + $warehouseStatic->fetch($idwarehouse); + $this->error = $langs->trans('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref); + dol_syslog(__METHOD__.' Error: '.$langs->transnoentitiesnoconv('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR); } - if (!$error) { - $batchList = $resBatchList; - if (empty($batchList)) { + foreach ($batchList as $batch) { + if ($batch->qty <= 0) { + continue; // try to decrement only batches have positive quantity first + } + + // enough quantity in this batch + if ($batch->qty >= $product_qty_remain) { + $product_batch_qty = $product_qty_remain; + } else { + // not enough (take all in batch) + $product_batch_qty = $batch->qty; + } + $result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_batch_qty, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch); + if ($result < 0) { + $error++; + $this->error = $mouvP->error; + $this->errors = array_merge($this->errors, $mouvP->errors); + break; + } + + $product_qty_remain -= $product_batch_qty; + // all product quantity was decremented + if ($product_qty_remain <= 0) { + break; + } + } + + if (!$error && $product_qty_remain > 0) { + if (getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) { $error++; $langs->load('errors'); $warehouseStatic->fetch($idwarehouse); - $this->error = $langs->trans('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref); - dol_syslog(__METHOD__.' Error: '.$langs->transnoentitiesnoconv('ErrorBatchNoFoundForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR); - } - - foreach ($batchList as $batch) { - if ($batch->qty <= 0) { - continue; // try to decrement only batches have positive quantity first - } - - // enough quantity in this batch - if ($batch->qty >= $product_qty_remain) { - $product_batch_qty = $product_qty_remain; - } else { - // not enough (take all in batch) - $product_batch_qty = $batch->qty; - } - $result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_batch_qty, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch); + $this->error = $langs->trans('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref); + dol_syslog(__METHOD__.' Error: '.$langs->transnoentitiesnoconv('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR); + } else { + // take in the first batch + $batch = $batchList[0]; + $result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_qty_remain, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch); if ($result < 0) { $error++; $this->error = $mouvP->error; $this->errors = array_merge($this->errors, $mouvP->errors); - break; - } - - $product_qty_remain -= $product_batch_qty; - // all product quantity was decremented - if ($product_qty_remain <= 0) { - break; - } - } - - if (!$error && $product_qty_remain > 0) { - if (getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) { - $error++; - $langs->load('errors'); - $warehouseStatic->fetch($idwarehouse); - $this->error = $langs->trans('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref); - dol_syslog(__METHOD__.' Error: '.$langs->transnoentitiesnoconv('ErrorBatchNoFoundEnoughQuantityForProductInWarehouse', $productStatic->label, $warehouseStatic->ref), LOG_ERR); - } else { - // take in the first batch - $batch = $batchList[0]; - $result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_qty_remain, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch); - if ($result < 0) { - $error++; - $this->error = $mouvP->error; - $this->errors = array_merge($this->errors, $mouvP->errors); - } } } } } } + } - if (!$is_batch_line) { // If stock move not yet processed - $result = $mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr", $num)); - if ($result < 0) { - $error++; - $this->error = $mouvP->error; - $this->errors = array_merge($this->errors, $mouvP->errors); - } + if (!$is_batch_line) { // If stock move not yet processed + $result = $mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr", $num)); + if ($result < 0) { + $error++; + $this->error = $mouvP->error; + $this->errors = array_merge($this->errors, $mouvP->errors); } } } @@ -3605,8 +3603,6 @@ class Facture extends CommonInvoice } if (!$error) { - $this->oldref = $this->ref; - // Rename directory if dir was a temporary ref if (preg_match('/^[\(]?PROV/i', $this->ref)) { // Now we rename also files into index @@ -3624,28 +3620,6 @@ class Facture extends CommonInvoice $error++; $this->error = $this->db->lasterror(); } - - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($num); - $dirsource = $conf->facture->dir_output.'/'.$oldref; - $dirdest = $conf->facture->dir_output.'/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->facture->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); - } - } - } } } @@ -3689,8 +3663,31 @@ class Facture extends CommonInvoice $this->setFinal($user); } } - } else { - $error++; + } + + // Rename directory if dir was a temporary ref + if (!$error && preg_match('/^[\(]?PROV/i', $this->oldref)) { + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->oldref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->facture->dir_output.'/'.$oldref; + $dirdest = $conf->facture->dir_output.'/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->facture->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } } if (!$error) { diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index cd5a8c98eae..c57dc8f1148 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -229,7 +229,7 @@ class box_factures_fourn_imp extends ModeleBoxes 'text' => " ", ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right liste_total" ', + 'td' => 'class="nowraponall right liste_total"', 'text' => price($totalamount, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index a4f91c30985..c59f62a80d9 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -235,7 +235,7 @@ class box_factures_imp extends ModeleBoxes // Add the sum à the bottom of the boxes $this->info_box_contents[$line][] = array( - 'tr' => 'class="liste_total_wrap"', + 'tr' => 'class="liste_total"', 'td' => 'class="liste_total"', 'text' => $langs->trans("Total"), ); @@ -244,7 +244,7 @@ class box_factures_imp extends ModeleBoxes 'text' => " ", ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right liste_total" ', + 'td' => 'class="nowraponall right liste_total" ', 'text' => price($totalamount, 0, $langs, 0, -1, -1, $conf->currency), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 164856bc428..bf4623828be 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -957,6 +957,7 @@ class Notify } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); + // Note the substitution array should contains __REF__, __NEWREF__ .... $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); $message = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs); } else { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 218fb832749..6354e8e0604 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1906,6 +1906,8 @@ function form_constantes($tableau, $strictw3c = 2, $helptext = '', $text = 'Valu //var_dump($arraydefaultmessage); //var_dump($arrayofmessagename); print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1); + + print ''.img_picto('', 'add').''; } elseif (preg_match('/MAIL_FROM$/i', $const)) { print img_picto('', 'email', 'class="pictofixedwidth"').''; } else { // type = 'string' ou 'chaine' diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index f23489eeab4..2c36229efab 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -927,9 +927,9 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.$filename; - $result .= '
'; + $result .= ''; $result .= ''; $result .= ''; @@ -942,7 +942,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $result .= ''; $result .= ''; - $result .= ''; + $result .= ''; $result .= ''; // Load amount of existing payment of invoice (needed for complete status) @@ -1207,7 +1207,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) print ''; - print '
'.$companystatic->getNomUrl(1, 'customer').''.dol_print_date($db->jdate($obj->datec), 'day').''.dol_print_date($db->jdate($obj->datec), 'day').''.price($obj->total_ttc).''; print $societestatic->getNomUrl(1, 'customer'); print ''; + print ''; print dol_print_date($db->jdate($obj->datelimite), 'day'); if ($tmpinvoice->hasDelay()) { print img_warning($langs->trans("Late")); diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 86bf821cd36..e2efbf55e37 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -99,7 +99,7 @@ class InterfaceNotification extends DolibarrTriggers $notify = new Notify($this->db); $resultSend = $notify->send($action, $object); if ($resultSend < 0) { - $this->errors = array_merge($this->errors, $notify->errors); + $this->errors = array_merge(empty($this->errors) ? array() : $this->errors, $notify->errors); return $resultSend; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index efe048b4887..1bd78f84e59 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -132,7 +132,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', // Common permissions $usercanread = ($user->hasRight("fournisseur", "facture", "lire") || $user->hasRight("supplier_invoice", "lire")); $usercancreate = ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer")); -$usercandelete = ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer")); +$usercandelete = (($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer")) || ($usercancreate && $object->is_erasable() == 1)); $usercancreatecontract = $user->hasRight("contrat", "creer"); // Advanced permissions @@ -279,7 +279,7 @@ if (empty($reshook)) { $isErasable = $object->is_erasable(); - if (($usercandelete && $isErasable > 0) || ($usercancreate && $isErasable == 1)) { + if ($usercandelete && $isErasable > 0) { $revertstock = GETPOST('revertstock'); if ($revertstock) { @@ -4175,8 +4175,9 @@ if ($action == 'create') { } // Delete - $isErasable = $object->is_erasable(); - if ($action != 'confirm_edit' && ($usercandelete || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) + if ($action != 'confirm_edit' && $usercandelete) { + $isErasable = $object->is_erasable(); + $enableDelete = false; $htmltooltip = ''; $params = (empty($conf->use_javascript_ajax) ? array() : array('attr' => array('class' => 'reposition'))); diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index bf9ee344cd1..8b158a80ccc 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -249,7 +249,7 @@ if ($result > 0) { // Add notification form - print '
'; + print ''; print ''; print ''; if ($action == 'create') { @@ -276,7 +276,7 @@ if ($result > 0) { dol_print_error($db); } - $param = ''; + $param = "&socid=".$socid; $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->hasRight("societe", "creer")); @@ -290,12 +290,6 @@ if ($result > 0) { // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, (empty($nbtotalofrecords) ? -1 : $nbtotalofrecords), 'email', 0, $newcardbutton, '', $limitforsubscription, 0, 0, 1); - print ''; - print ''; - print ''; - - $param = "&socid=".$socid; - // Line with titles print '
'; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index cce01be1d61..c7b24b7d7fa 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -319,7 +319,7 @@ th.liste_titre a div div:hover, th.liste_titre_sel a div div:hover { text-decora tr.liste_titre th.liste_titre_sel:not(.maxwidthsearch), tr.liste_titre td.liste_titre_sel:not(.maxwidthsearch), tr.liste_titre th.liste_titre:not(.maxwidthsearch), tr.liste_titre td.liste_titre:not(.maxwidthsearch) { opacity: 0.8; } /* th.liste_titre_sel a, th.liste_titre a, td.liste_titre_sel a, td.liste_titre a { color: #766; } */ -tr.liste_titre_filter th.liste_titre { text-align: unset; } +tr.liste_titre_filter th.liste_titre:not(.center) { text-align: unset; } .liste_titre.trheight5em { height: 4em !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 90ecc18e5f1..8c8fb6913bb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4984,7 +4984,7 @@ tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_tit /* border-bottom: 1px solid var(--colortopbordertitle1); */ border-bottom: none; } -tr.liste_titre_filter th.liste_titre { text-align: unset; } +tr.liste_titre_filter th.liste_titre:not(.center) { text-align: unset; } /* div.liste_titre { diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 59a6ef82aa7..6ea312fadad 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -299,6 +299,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) { } else { $nbofjobslaunchedok++; $resultstring = 'OK'; + echo " - "; } echo "Result of run_jobs ".$resultstring." result = ".$result;