From 02a5c1b8d6a5a0fa334f62e7c5a439d5b81a3224 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 20 Feb 2020 22:40:43 +0100 Subject: [PATCH 01/40] Update card.php --- htdocs/commande/card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d4855e8933f..737a544eda8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -112,6 +112,10 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.i $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +if (!empty($conf->expedition->enabled)){ + if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; + if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse; +} /* * Actions From bbb108133f36989b356f7f0e94dc185769c6be39 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 20 Feb 2020 22:45:03 +0100 Subject: [PATCH 02/40] Update html.formproduct.class.php --- htdocs/product/class/html.formproduct.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index af78ab5b59d..6443b0d03a3 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -254,6 +254,9 @@ class FormProduct $out.= $comboenhancement; } + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; + $out.=''; From 9011b03528eb47518b44b3e6d44b384a37cebe53 Mon Sep 17 00:00:00 2001 From: oscim Date: Wed, 26 Feb 2020 08:18:01 +0100 Subject: [PATCH 12/40] Update emailcollector.class.php add hook in loop action --- .../class/emailcollector.class.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 0c27f710135..0ae0122a887 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1793,6 +1793,40 @@ class EmailCollector extends CommonObject } $tickettocreate->ref = $defaultref; } + // Create event specific on hook + // this code action is hook..... for support this call + elseif (substr($operation['type'],0,4) == 'hook'){ + global $hookmanager; + + if(!is_object($hookmanager)) + $hookmanager->initHooks(array('emailcollectorcard')); + + $parameters = array( + 'connection'=> $connection, + 'imapemail'=>$imapemail, + 'overview'=>$overview, + + 'from' => $from , + 'fromtext' => $fromtext, + + 'actionparam'=> $operation['actionparam'], + + + + 'thirdpartyid' => $thirdpartyid , + 'objectid'=>@$objectid, + 'objectemail'=>@$objectemail, + + 'messagetext'=>$messagetext, + 'subject'=>$subject, + 'header'=>$header, + ) ; + $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); + + if($res < 0 ) + $this->error = $hookmanager->resPrint; + + } if ($errorforthisaction) { From 0e91b9e5ec4b1ecc3d86a5768e96171a529b958a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 26 Feb 2020 07:20:08 +0000 Subject: [PATCH 13/40] Fixing style errors. --- htdocs/admin/emailcollector_card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index f08ff09b136..b149173904b 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -573,18 +573,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 'recordevent'=>'RecordEvent'); if ($conf->projet->enabled) $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; if ($conf->ticket->enabled) $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty'; - - // support hook for add action + + // support hook for add action $parameters = array( 'arrayoftypes' => $arrayoftypes ) ; $res = $hookmanager->executeHooks('addMoreActionsEmailCollector', $parameters, $object, $action); - + if($res) - $arrayoftypes = $hookmanager->resArray; - else + $arrayoftypes = $hookmanager->resArray; + else foreach($hookmanager->resArray as $k=>$desc) - $arrayoftypes[$k]=$desc; - - + $arrayoftypes[$k]=$desc; + + print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300'); print ''; print ''; From ada99b01f95e027534810e36638db95f729c265b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 26 Feb 2020 07:20:28 +0000 Subject: [PATCH 14/40] Fixing style errors. --- .../class/emailcollector.class.php | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 0ae0122a887..b6a295949a7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1794,39 +1794,38 @@ class EmailCollector extends CommonObject $tickettocreate->ref = $defaultref; } // Create event specific on hook - // this code action is hook..... for support this call - elseif (substr($operation['type'],0,4) == 'hook'){ - global $hookmanager; + // this code action is hook..... for support this call + elseif (substr($operation['type'], 0, 4) == 'hook'){ + global $hookmanager; - if(!is_object($hookmanager)) + if(!is_object($hookmanager)) $hookmanager->initHooks(array('emailcollectorcard')); - $parameters = array( + $parameters = array( 'connection'=> $connection, 'imapemail'=>$imapemail, - 'overview'=>$overview, - + 'overview'=>$overview, + 'from' => $from , 'fromtext' => $fromtext, - + 'actionparam'=> $operation['actionparam'], - - - + + + 'thirdpartyid' => $thirdpartyid , 'objectid'=>@$objectid, 'objectemail'=>@$objectemail, - + 'messagetext'=>$messagetext, 'subject'=>$subject, 'header'=>$header, ) ; - $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); - - if($res < 0 ) - $this->error = $hookmanager->resPrint; + $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); - } + if($res < 0 ) + $this->error = $hookmanager->resPrint; + } if ($errorforthisaction) { From 373ab3bc01abb2b1ea133cc8bc9337ebc709a004 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 26 Feb 2020 10:35:43 +0100 Subject: [PATCH 15/40] FIX: excess paid from situation invoices not counted when calculating remain to pay --- htdocs/core/class/discount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index d464e986c32..5793d4a7d89 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -539,14 +539,14 @@ class DiscountAbsolute $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; - $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received + $sql.= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ', ' . Facture::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received } else if ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; - $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess paid + $sql.= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid } else { From 21f1de2deab6ab9f1a3c0ce3f660707d0dee53e6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 26 Feb 2020 11:39:49 +0100 Subject: [PATCH 16/40] update changed mon organsiation to my organsiation --- dev/examples/ldap/ldapadd_sample1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/examples/ldap/ldapadd_sample1.txt b/dev/examples/ldap/ldapadd_sample1.txt index 8a28529acb8..e998d6013a3 100644 --- a/dev/examples/ldap/ldapadd_sample1.txt +++ b/dev/examples/ldap/ldapadd_sample1.txt @@ -11,4 +11,4 @@ objectclass: dcObject objectClass: organization objectClass: top dc: my-domain -o: Mon organisation \ No newline at end of file +o: my organisation From 9be050765dc2915fddb40945d83659d9e39269b6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 26 Feb 2020 11:42:59 +0100 Subject: [PATCH 17/40] Update changed Mon organisation to my organisation --- dev/examples/ldap/ldapmodify_sample1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/examples/ldap/ldapmodify_sample1.txt b/dev/examples/ldap/ldapmodify_sample1.txt index e3a8361ca31..e95d1dc03a7 100644 --- a/dev/examples/ldap/ldapmodify_sample1.txt +++ b/dev/examples/ldap/ldapmodify_sample1.txt @@ -12,4 +12,4 @@ objectclass: dcObject objectClass: organization objectClass: top dc: my-domain -o: Mon organisation \ No newline at end of file +o: my organisation From 5e51369e64817bb9228aabc497a65cf7fa414917 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 26 Feb 2020 12:22:12 +0100 Subject: [PATCH 18/40] http to https --- dev/resources/sepa/text.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/resources/sepa/text.txt b/dev/resources/sepa/text.txt index 0a5336a128e..e6c05276be2 100644 --- a/dev/resources/sepa/text.txt +++ b/dev/resources/sepa/text.txt @@ -1,2 +1,2 @@ -To test a SEPA file: -http://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa \ No newline at end of file +To test a SEPA file: +https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa From ec3c3f0165c352a53cd2f2074d636ed324114f2d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 26 Feb 2020 12:25:25 +0100 Subject: [PATCH 19/40] licence -> license --- dev/resources/licence/Links on GPL.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/resources/licence/Links on GPL.txt b/dev/resources/licence/Links on GPL.txt index bb9c1597f68..0fb3b63c851 100644 --- a/dev/resources/licence/Links on GPL.txt +++ b/dev/resources/licence/Links on GPL.txt @@ -1,7 +1,7 @@ -* Page with licence compatibility +* Page with license compatibility https://www.gnu.org/licenses/quick-guide-gplv3.fr.html -* FAQ on GPL licence +* FAQ on GPL license https://www.fsf.org/licensing/licenses/gpl-faq.html * Questions/Answers on Fork for using Dolibarr as a SaaS From 4c4050c06e782665a4bf5a0fbb8158c6d875a57e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 26 Feb 2020 12:35:17 +0100 Subject: [PATCH 20/40] http -> https: add: for Linux OS --- dev/translation/README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/translation/README b/dev/translation/README index b470e4228d8..9727f91e2e6 100644 --- a/dev/translation/README +++ b/dev/translation/README @@ -3,11 +3,12 @@ README (English) This directory contains tools to generate translation files for a new languages or to update translation files for existing languages. See Dolibarr Wiki page: -http://wiki.dolibarr.org/index.php/Translator_documentation +https://wiki.dolibarr.org/index.php/Translator_documentation For more information on how to use them. +for Linux OS: To install transifex client: sudo pip install --upgrade transifex-client To update transifex client: -sudo pip install --upgrade transifex-client \ No newline at end of file +sudo pip install --upgrade transifex-client From 0622024f6185638d64ee1ec4b2f286b937a93b4b Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 26 Feb 2020 14:37:36 +0100 Subject: [PATCH 21/40] Fix column selection on stocklist --- htdocs/product/stock/list.php | 291 +++++++++++++++++++++++++++------- 1 file changed, 233 insertions(+), 58 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 22f86df95a8..95d57a2f3fc 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -87,15 +87,18 @@ $fieldstosearchall = array( // Definition of fields for list $arrayfields = array( - 'stockqty'=>array('type'=>'float', 'label'=>'PhysicalStock', 'enabled'=>1, 'visible'=>-2, 'position'=>70), - 'estimatedvalue'=>array('type'=>'float', 'label'=>'EstimatedStockValue', 'enabled'=>1, 'visible'=>-2, 'position'=>71), - 'sellvalue'=>array('type'=>'float', 'label'=>'EstimatedStockValueSell', 'enabled'=>1, 'visible'=>-2, 'position'=>72), + 'e.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'e.lieu'=>array('label'=>$langs->trans("LocationSummary"), 'checked'=>1), + 'e.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0), + 'e.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0), + 'e.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), + 'e.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), + 'stockqty'=>array('type'=>'float', 'label'=>$langs->trans("PhysicalStock"), 'enabled'=>1, 'visible'=>-2, 'position'=>70), + 'estimatedvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValue"), 'enabled'=>1, 'visible'=>-2, 'position'=>71), + 'sellvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValueSell"), 'enabled'=>1, 'visible'=>-2, 'position'=>72), + 'e.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>100), ); -foreach ($object->fields as $key => $val) -{ - // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); -} + // Extra fields if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { @@ -337,17 +340,46 @@ print ''; -print ''; - -print ''; - -print ''; -print ''; -print ''; +if (!empty($arrayfields['e.ref']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.lieu']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.description']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.address']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.zip']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.town']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['stockqty']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['estimatedvalue']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['sellvalue']['checked'])) +{ + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -357,9 +389,12 @@ $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $obje print $hookmanager->resPrint; // Status -print ''; +if (!empty($arrayfields['e.statut']['checked'])) +{ + print ''; +} // Action column print ''."\n"; // Fields title label // -------------------------------------------------------------------- print ''; -print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); -print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder); -print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right '); + +if (!empty($arrayfields['e.ref']['checked'])) +{ + print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.lieu']['checked'])) +{ + print_liste_field_titre($arrayfields['e.lieu']['label'], $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.description']['checked'])) +{ + print_liste_field_titre($arrayfields['e.description']['label'], $_SERVER["PHP_SELF"], "e.description", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.address']['checked'])) +{ + print_liste_field_titre($arrayfields['e.address']['label'], $_SERVER["PHP_SELF"], "e.address", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.zip']['checked'])) +{ + print_liste_field_titre($arrayfields['e.zip']['label'], $_SERVER["PHP_SELF"], "e.zip", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.town']['checked'])) +{ + print_liste_field_titre($arrayfields['e.town']['label'], $_SERVER["PHP_SELF"], "e.town", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['stockqty']['checked'])) +{ + print_liste_field_titre($arrayfields['stockqty']['label'], $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['estimatedvalue']['checked'])) +{ + print_liste_field_titre($arrayfields['estimatedvalue']['label'], $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['sellvalue']['checked'])) +{ + print_liste_field_titre($arrayfields['sellvalue']['label'], $_SERVER["PHP_SELF"], "sellvalue", '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['e.statut']['checked'])) +{ + print_liste_field_titre($arrayfields['e.statut']['label'], $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); +} + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); + // Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print ''."\n"; @@ -410,33 +483,84 @@ if ($num) // Show here line of result print ''; - print ''; - if (!$i) $totalarray['nbfield']++; + + //print_r($arrayfields[]); + + // Label (ref) + if (!empty($arrayfields['e.ref']['checked'])) + { + print ''; + } + // Location - print ''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['e.lieu']['checked'])) + { + print ''; + } + + // Description + if (!empty($arrayfields['e.description']['checked'])) + { + print ''; + } + + // Address + if (!empty($arrayfields['e.address']['checked'])) + { + print ''; + } + + // Zip + if (!empty($arrayfields['e.zip']['checked'])) + { + print ''; + } + + if (!empty($arrayfields['e.town']['checked'])) + { + print ''; + } // Stock qty - print ''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['stockqty']['checked'])) + { + print ''; + } // PMP value - print ''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['estimatedvalue']['checked'])) + { + print ''; + } // Selling value - print ''; } - print ''; - if (!$i) $totalarray['nbfield']++; // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; @@ -446,8 +570,10 @@ if ($num) print $hookmanager->resPrint; // Status - print ''; - if (!$i) $totalarray['nbfield']++; + if (!empty($arrayfields['e.statut']['checked'])) + { + print ''; + } // Action column print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if (!empty($arrayfields['e.lieu']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.description']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.address']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.zip']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.town']['checked'])) + { + $emptyColumn++; + } + + for ($i=0; $i < $emptyColumn; $i++) + { + print ''; + } + + print ''; + + if (!empty($arrayfields['stockqty']['checked'])) + { + print ''; + } + if (!empty($arrayfields['estimatedvalue']['checked'])) + { + print ''; + } + + if (!empty($arrayfields['sellvalue']['checked'])) + { + print ''; + } + + if (!empty($arrayfields['e.statut']['checked'])) + { + print ''; + } + print ''; print "\n"; } From 01b9c4267044db0538bde58db8c74243b9110c63 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 26 Feb 2020 15:02:42 +0100 Subject: [PATCH 22/40] FIX : timezone must be tzserver and not tzuser as well as on contract card --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 01cc12dd34a..7859dc5a4f4 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -745,7 +745,7 @@ while ($i < min($num, $limit)) // Date if (! empty($arrayfields['c.date_contrat']['checked'])) { - print ''; + print ''; } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; From 315b434a6e6462a7082718ad169a1f195361f53f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:05:29 +0100 Subject: [PATCH 23/40] FIX No js if javascript off --- htdocs/main.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ef09674f8aa..af0c6a7a579 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1896,7 +1896,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') '; - if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) // This may be set by some pages that use different jquery version to avoid errors + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { $btnUser .= ' @@ -1941,7 +1941,9 @@ function top_menu_bookmark() $html = ''; // Define $bookmarks - if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) return $html; + + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); From 8ceafa2624a3730d1cc9d50e035d87284e8c2755 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:21:52 +0100 Subject: [PATCH 24/40] FIX Use GETPOST instead of POST --- htdocs/admin/ihm.php | 49 ++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index de550c0ac12..b302500ce35 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -58,6 +58,13 @@ if (GETPOST('cancel', 'alpha')) $action=''; } +// Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff) +$regs = array(); +if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) { + if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $regs[2], $conf->entity); +} + if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); @@ -81,15 +88,15 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); - $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); + /*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/ $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); @@ -141,25 +148,27 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); + + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { + $reg = array(); if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -248,7 +257,7 @@ print ''; // Multilingual GUI print ''; print ''; print ''; @@ -267,7 +276,7 @@ print ''; // Disable javascript and ajax print ''; print ''; print ''; From 35e886fb1203b2d259dfefb4a45a357f3c99bc93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:22:23 +0100 Subject: [PATCH 25/40] FIX Disable js if no javascript --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c379d1912d1..3b5dbd664d6 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -742,7 +742,7 @@ class FormOther if (!is_array($arrayofcolors) || count($arrayofcolors) < 1) { $langs->load("other"); - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; @@ -788,7 +788,7 @@ class FormOther } else // In most cases, this is not used. We used instead function with no specific list of colors { - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; From b95d74f84318335cfb1e096120989dd03987e99b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 26 Feb 2020 15:23:59 +0100 Subject: [PATCH 26/40] FIX token in barcode tools page --- htdocs/barcode/printsheet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 828d2ecff50..5cd988a5bed 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -278,6 +278,7 @@ dol_htmloutput_errors($mesg); print '
'; print ''; print ''; +print ''; print '
'; From 1583bed0e418778df4b1efdcbcbd5bb73c6cc9cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:41:46 +0100 Subject: [PATCH 27/40] FIX #13146 #13198 --- htdocs/accountancy/admin/account.php | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c7681c6f9ca..1b83d5eb03f 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -47,6 +47,8 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha'); $search_pcgtype = GETPOST('search_pcgtype', 'alpha'); $search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); +$chartofaccounts = GETPOST('chartofaccounts', 'int'); + // Security check if ($user->socid > 0) accessforbidden(); if (!$user->rights->accounting->chartofaccount) accessforbidden(); @@ -104,11 +106,9 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options = array(); } - - if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) + if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified { - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts @@ -279,21 +279,13 @@ if ($resql) if (!empty($conf->use_javascript_ajax)) { - print ' + print ' '; @@ -340,8 +332,7 @@ if ($resql) else dol_print_error($db); print ""; print ajax_combobox("chartofaccounts"); - print ''; - print ''; + print ''; print '
'; print '
'; From b5aba25b215e40988fabef139150d7b0b69a5d53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:41:55 +0100 Subject: [PATCH 28/40] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 13011cbb5f7..bae65a4fb4c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1537,7 +1537,7 @@ td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto { } .pictotitle { margin-: 8px; - margin-bottom: 4px; + /* margin-bottom: 4px; */ } @media only screen and (max-width: 767px) { From 91e7ff3c8eebbaf16e67c1d2a742ba9a4866a371 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:05:29 +0100 Subject: [PATCH 29/40] FIX No js if javascript off --- htdocs/main.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 438dbcda4ec..fe7ee39f6e8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1876,7 +1876,7 @@ function top_menu_user()
'; - if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) // This may be set by some pages that use different jquery version to avoid errors + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { $btnUser .= ' @@ -1919,7 +1919,9 @@ function top_menu_bookmark() $html = ''; // Define $bookmarks - if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) return $html; + + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); From 4370bf8fdc5e9c2fc7e55b89c104026358fc2ffa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:21:52 +0100 Subject: [PATCH 30/40] FIX Use GETPOST instead of POST Conflicts: htdocs/admin/ihm.php --- htdocs/admin/ihm.php | 49 ++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 44f13173669..1383f6707aa 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -58,6 +58,13 @@ if (GETPOST('cancel', 'alpha')) $action=''; } +// Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff) +$regs = array(); +if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) { + if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $regs[2], $conf->entity); +} + if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); @@ -81,15 +88,15 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); - $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); + /*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/ $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); @@ -141,25 +148,27 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); + + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { + $reg = array(); if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -247,7 +256,7 @@ print ''; // Multilingual GUI print '
'; print ''; print ''; @@ -266,7 +275,7 @@ print ''; // Disable javascript and ajax print ''; print ''; print ''; From b52cfe58d6e9925f8e51705c45bc98e7c187abea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:22:23 +0100 Subject: [PATCH 31/40] FIX Disable js if no javascript --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index a73621faa32..72ac856c31e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -742,7 +742,7 @@ class FormOther if (!is_array($arrayofcolors) || count($arrayofcolors) < 1) { $langs->load("other"); - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; @@ -788,7 +788,7 @@ class FormOther } else // In most cases, this is not used. We used instead function with no specific list of colors { - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; From 9f097b1a0894904ae84f0ee14b4a40d2ed94c120 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:41:46 +0100 Subject: [PATCH 32/40] FIX #13146 #13198 --- htdocs/accountancy/admin/account.php | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index d75d61e347f..47786e62eb2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -46,6 +46,8 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha'); $search_pcgtype = GETPOST('search_pcgtype', 'alpha'); $search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); +$chartofaccounts = GETPOST('chartofaccounts', 'int'); + // Security check if ($user->socid > 0) accessforbidden(); if (! $user->rights->accounting->chartofaccount) accessforbidden(); @@ -101,11 +103,9 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options = array(); } - - if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) + if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified { - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts @@ -274,21 +274,13 @@ if ($resql) if (!empty($conf->use_javascript_ajax)) { - print ' + print ' '; @@ -335,8 +327,7 @@ if ($resql) else dol_print_error($db); print ""; print ajax_combobox("chartofaccounts"); - print ''; - print ''; + print ''; print '
'; print '
'; From aba29207a3d70dcd10a6dff3b8d844b4c03f5606 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:10:12 +0100 Subject: [PATCH 33/40] Fix param lost --- htdocs/admin/ihm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1383f6707aa..85da8c95844 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -90,7 +90,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); From 9c1c0ee08ff517404c75c1fbb51fa90980309e60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:17:31 +0100 Subject: [PATCH 34/40] Fix for nojs interface --- htdocs/core/boxes/box_task.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index ed267493e97..94983ef6bff 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -127,15 +127,17 @@ class box_task extends ModeleBoxes $boxcontent .= ''; $boxcontent .= ''."\n"; $boxcontent .= ''."\n"; - $boxcontent .= ''; - // set cookie by js - $boxcontent .= ''; + '; + // set cookie by js + $boxcontent .= ''; + } $this->info_box_contents[0][] = array( 'tr'=>'class="nohover showiffilter'.$this->boxcode.' hideobject"', 'td' => 'class="nohover"', From 25157649e28c520cb5f56dfc43a8ed7c4febe0e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:53:58 +0100 Subject: [PATCH 35/40] Fix missing column --- htdocs/product/stock/list.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 95d57a2f3fc..491f0979409 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -443,10 +443,6 @@ if (!empty($arrayfields['sellvalue']['checked'])) { print_liste_field_titre($arrayfields['sellvalue']['label'], $_SERVER["PHP_SELF"], "sellvalue", '', $param, '', $sortfield, $sortorder, 'right '); } -if (!empty($arrayfields['e.statut']['checked'])) -{ - print_liste_field_titre($arrayfields['e.statut']['label'], $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); -} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -456,6 +452,11 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$ $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; +if (!empty($arrayfields['e.statut']['checked'])) +{ + print_liste_field_titre($arrayfields['e.statut']['label'], $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right '); +} + // Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print ''."\n"; @@ -651,6 +652,20 @@ if ($num) print ''; } + if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element; + if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) + { + if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.'; + + foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) + { + if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) + { + print '
'; + } + } + } + if (!empty($arrayfields['e.statut']['checked'])) { print ''; From 921dacf695a9270cbbc32221bdee73674cf28571 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:58:45 +0100 Subject: [PATCH 36/40] Fix remove $_POST --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 759ed75df5e..41e4839b88c 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -277,7 +277,7 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { print ''; } From 3fa55a59b72c7df0b8cff0804cdae85dc6832b33 Mon Sep 17 00:00:00 2001 From: javierybar <36415318+javierybar@users.noreply.github.com> Date: Wed, 26 Feb 2020 22:45:32 +0100 Subject: [PATCH 37/40] New TAKEPOS_NUMBERING_PREFIX const --- htdocs/takepos/invoice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 85544d5b837..68a8dd10fdb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -168,6 +168,8 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->update($user); } + if ($conf->global->TAKEPOS_NUMBERING_PREFIX) $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_NUMBERING_PREFIX; + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; if ($invoice->statut != Facture::STATUS_DRAFT) { From 2cfc62d753785654dd99a9a4973903e888f9df0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Feb 2020 00:11:13 +0100 Subject: [PATCH 38/40] Update invoice.php --- htdocs/takepos/invoice.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 68a8dd10fdb..6a919054ee0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -167,8 +167,13 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->fk_facture_source = $fk_source; $invoice->update($user); } - - if ($conf->global->TAKEPOS_NUMBERING_PREFIX) $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_NUMBERING_PREFIX; + + $sav_FACTURE_ADDON=''; + if (! empty($conf->global->TAKEPOS_ADDON)) + { + $sav_FACTURE_ADDON = $conf->global->FACTURE_ADDON; + $conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_ADDON; + } $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]; if ($invoice->statut != Facture::STATUS_DRAFT) @@ -206,6 +211,12 @@ if ($action == 'valid' && $user->rights->facture->creer) $res = $invoice->validate($user); } + // Restore save values + if (! empty($sav_FACTURE_ADDON)) + { + $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; + } + $remaintopay = $invoice->getRemainToPay(); // Add the payment From df87c77cd82c07f1526eb377a638bd73c29d711f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Feb 2020 01:02:55 +0100 Subject: [PATCH 39/40] css --- htdocs/theme/eldy/global.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bae65a4fb4c..34b232adc8b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1638,9 +1638,9 @@ div.statusrefbis { vertical-align: text-bottom; } img.photoref, div.photoref { - border: 1px solid #DDD; - -webkit-box-shadow: 0px 0px 6px #DDD; - box-shadow: 0px 0px 6px #DDD; + /* border: 1px solid #DDD; */ + -webkit-box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); padding: 4px; height: 80px; width: 80px; From afc4d6d60c9286608928e79ae7d16d84e98fd815 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Feb 2020 01:22:17 +0100 Subject: [PATCH 40/40] Fix date of cron --- .github/workflows/stale-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 5b55cdc54c8..633cc53437b 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -3,7 +3,7 @@ name: "Close stale issues (bugs and feature requests)" on: schedule: - - cron: "0 0 * * *" + - cron: "0 20 * * *" jobs: stale:
'; -print ''; -print ''; -print ''; -print ''; + print ''; + print ''; + print ''; + print ''; -print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1); -print ''; + print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1); + print ''; @@ -371,18 +406,56 @@ print '
'.$warehouse->getNomUrl(1).''.$warehouse->getNomUrl(1).''.$obj->lieu.''.$obj->lieu.''.$obj->description.''.$obj->address.''.$obj->zip.''.$obj->town.''.price2num($obj->stockqty, 5).''.price2num($obj->stockqty, 5).''; - if (price2num($obj->estimatedvalue, 'MT')) print price(price2num($obj->estimatedvalue, 'MT'), 1); - else print ''; - print ''; + + if (price2num($obj->estimatedvalue, 'MT')) + { + print price(price2num($obj->estimatedvalue, 'MT'), 1); + } + else + { + print ''; + } + + print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($obj->sellvalue, 'MT'), 1); - else + if (!empty($arrayfields['sellvalue']['checked'])) { - $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + print ''; + + if (empty($conf->global->PRODUIT_MULTIPRICES)) + { + print price(price2num($obj->sellvalue, 'MT'), 1); + } + else + { + $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); + print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + } + + print ''.$warehouse->LibStatut($obj->statut, 5).''.$warehouse->LibStatut($obj->statut, 5).''; @@ -469,18 +595,67 @@ if ($num) if ($totalnboflines - $offset <= $limit) { print '
'.$langs->trans("Total").''.price2num($totalStock, 5).''.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency); - else + + $emptyColumn = -1; + + if (!empty($arrayfields['e.ref']['checked'])) { - $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + $emptyColumn++; } - print ''.$langs->trans("Total").''.price2num($totalStock, 5).''.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency); + else + { + $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); + print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + } + print '
'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').''.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzserver').'
'.$langs->trans("EnableMultilangInterface").''; -print ajax_constantonoff('MAIN_MULTILANGS'); +print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0); print ' 
'.$langs->trans("DisableJavascript").''; -print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); +print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0); print ' 
'.$langs->trans("EnableMultilangInterface").''; -print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); +print ajax_constantonoff("MAIN_MULTILANGS"); print ' 
'.$langs->trans("DisableJavascript").''; -print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); +print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT"); print ' 
'.$langs->trans("BankAccount").''; - $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant + $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 2); // List of bank account available print '