diff --git a/ChangeLog b/ChangeLog index ddda40a0e31..2b29cf60bdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,48 @@ Following changes may create regressions for some external modules, but were nec * The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. +***** ChangeLog for 14.0.3 compared to 14.0.2 ***** + +FIX: #18698 Supplier invoice list - "alert" checkbox not working +FIX: #18735 +FIX: #18767 : Member delete +FIX: #18854 +FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds. +FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label +FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it +FIX: Accountancy - Option of export popup are inverted +FIX: Accountancy - Some correction on export name +FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) +FIX: add warehouse in projects' overview count +FIX: autocalculation of the supplier price in main currency. +FIX: avoid warning if $categories is an id +FIX: Bad use of a forced contact of another company on PDF/ODT documents +FIX: Button text on proposal card to create a invoice +FIX: calculateCosts of BOM must not be included into fetch +FIX: check if greater 0 +FIX: default language defined for IN country +FIX: fetch of product with modulebuilder load too much data +FIX: Filter on categories +FIX: indentation +FIX: init hookmanager after loading $conf values +FIX: legal issue on expense report pdf (must also show price without tax) +FIX: missing filter status=1 on rss feeds +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: payment using wrong type in takepos when too many payment mode +FIX: Product accountancy affectation with product_perentity activated (PR #18620) +FIX: products/services card: hidden extrafields were overridden +FIX: Propal list - Problem of pagination on date +FIX: selected lines on supplier invoice create +FIX: Selection of type "people" for membership must hide the company +FIX: select list of orders not complete when field type of company is on +FIX: support of localtax on expense report +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: Test when date of invoie is in future (pb with TZ and offset) +FIX: translation into email for member at membership validation. +FIX: unprivileged user can see task associated with a not allowed project +FIX: user without permission can set ticket subject + ***** ChangeLog for 14.0.2 compared to 14.0.1 ***** FIX: #18353 Invoice list translation issue diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d0a699ef979..9251ead9041 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1457,6 +1457,10 @@ if ($id) { print $tdsoffields; + // Line to enter new values + print ''; + print ''; + $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. if (GETPOST('actionadd')) { @@ -1476,9 +1480,6 @@ if ($id) { unset($fieldlist[2]); // Remove field ??? if dictionary Regions } - // Line to enter new values - print ''; - print ''; if (empty($reshook)) { fieldList($fieldlist, $obj, $tabname[$id], 'add'); diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 46f455f86d4..2413364426f 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -390,7 +390,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; print "\n"; diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 44b812b4d96..ec3d75dee1a 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e56a2e89fcf..88b804f6a48 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1298,7 +1298,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 614bedb8268..1ba96690f2a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -726,7 +726,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index decabedc2e8..2195f88f13c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1737,7 +1737,7 @@ if ($action == 'create' && $usercancreate) { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 32b0ec5cb8a..d2a29a98f30 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -463,7 +463,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d41749577b6..1a4a775fa5e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3651,7 +3651,7 @@ if ($action == 'create') { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 5fe028e1268..a42003e3c2a 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -110,6 +110,10 @@ if ($mode == 'supplier') { if ($object_status != '' && $object_status >= 0) { $stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')'; } + if (is_array($custcats) && !empty($custcats)) { + $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)'; + $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')'; + } } // Build graphic number of object diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 823e90fcac3..3ea7ce8298d 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -792,6 +792,7 @@ class FormMail extends Form if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { $relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))); + if ($conf->entity > 1) { $relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile); } @@ -802,6 +803,7 @@ class FormMail extends Form $out .= '
'; // Preview of attachment $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1a2823fb933..d34a8e5ee30 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2719,13 +2719,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/sending/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file; + //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/receipt/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 4d0772225c7..75daecbf38e 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -99,12 +99,9 @@ if ($massaction == 'presend') { print ''; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - print dol_get_fiche_head(null, '', ''); - // Cree l'objet formulaire mail + // Create mail form include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->withform = -1; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 8ff0fa62e6c..88525776811 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -517,7 +517,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b9061b463ef..a35a7739144 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2566,8 +2566,8 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; - $defaulttopic = 'SendShippingRef'; - $diroutput = $conf->expedition->dir_output; + $defaulttopic = $langs->trans('SendShippingRef'); + $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6e40b6b3a77..983a355b867 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1465,7 +1465,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 6613ea0ed9d..9fb15bac425 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -945,7 +945,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Show link to origin object diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 99ef4e54e87..5da4ad4b08b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2936,11 +2936,11 @@ class CommandeFournisseur extends CommonOrder $this->user_approve_id2 = $obj->fk_user_approve2; } - $this->date_creation = $this->db->idate($obj->datec); - $this->date_modification = $this->db->idate($obj->datem); - $this->date_approve = $this->db->idate($obj->datea); - $this->date_approve2 = $this->db->idate($obj->datea2); - $this->date_validation = $this->db->idate($obj->date_validation); + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_approve = $this->db->jdate($obj->datea); + $this->date_approve2 = $this->db->jdate($obj->datea2); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($result); } else { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 32150131314..f025e3ce6c7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1786,7 +1786,7 @@ if ($action == 'create') { print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Bouton "Create Draft" diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 02e52c8164b..d03b93e439b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2285,7 +2285,7 @@ if ($action == 'create') { } if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Public note diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b4c951a953f..28c7b0d1d5d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1403,7 +1403,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Note (private, no output on invoices, propales...) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3be832dcea3..f95869d5d83 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5335,7 +5335,7 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { - $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '2,3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; + $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 4f25a281890..65f1c23d7c0 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -873,7 +873,7 @@ if ($action == 'create') { if ($objectsrc->fetch_optionals() > 0) { $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Incoterms diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index f32e09aa580..7e8e2e725ca 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -623,7 +623,7 @@ if ($search_array_options) { $crit = $val; $tmpkey = preg_replace('/search_options_/', '', $key); if ($val != '') { - $param .= '&search_options_' . $tmpkey . '=' . urlencode($val); + $param .= '&search_options_'.$tmpkey.'='.urlencode($val); } } } diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 322ffcd4942..b2da534fda8 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -579,7 +579,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index f8b5f5d64ca..7c8f16f59db 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1261,7 +1261,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 59ee28ade94..687bd9ff19a 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -269,38 +269,33 @@ if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) {
- -
-
trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
+
+ trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> +
+ total_ttc) { ?> +
+ trans('RemainToPay'); ?>: multicurrency_code); ?> +
+ +
+ trans("Received"); ?>: multicurrency_code); ?> +
+
+ trans("Change"); ?>: multicurrency_code); ?> +
+ global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + print '
'; + $filter = ''; + $form = new Form($db); + print ''.$langs->trans("BankAccount").': '; + $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); + print ajax_combobox('selectaccountid'); + print '
'; + } + ?>
-total_ttc) { ?> -
-
trans('RemainToPay'); ?>: multicurrency_code); ?>
-
- -
-
trans("Received"); ?>: multicurrency_code); ?>
-
-
-
trans("Change"); ?>: multicurrency_code); ?>
-
-global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - print '
-
'; - $filter = ''; - $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; - $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); - print ajax_combobox('selectaccountid'); - print '
-
'; -} -?> - -
-
loadLangs(array('main', 'admin', 'cron', 'dict')); - /* * Main @@ -130,7 +127,7 @@ if ($userlogin == 'firstadmin') { // Check user login $user = new User($db); -$result = $user->fetch('', $userlogin); +$result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "User Error: ".$user->error; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); @@ -142,6 +139,19 @@ if ($result < 0) { exit(-1); } } + +// Reload langs +$langcode = (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT); +if (!empty($user->conf->MAIN_LANG_DEFAULT)) { + $langcode = $user->conf->MAIN_LANG_DEFAULT; +} +if ($langs->getDefaultLang() != $langcode) { + $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); +} +// Language Management +$langs->loadLangs(array('main', 'admin', 'cron', 'dict')); + $user->getrights(); if (isset($argv[3]) && $argv[3]) { @@ -200,8 +210,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { $mysoc->setMysoc($conf); // Force recheck that user is ok for the entity to process and reload permission for entity - if ($conf->entity != $user->entity && $user->entity != 0) { - $result = $user->fetch('', $userlogin, '', 0, $conf->entity); + if ($conf->entity != $user->entity) { + $result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "\nUser Error: ".$user->error."\n"; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); @@ -223,6 +233,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { } if ($langs->getDefaultLang() != $langcode) { $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); + $langs->loadLangs(array('main', 'admin', 'cron', 'dict')); } }