From d300b943e122df7e4793fdf86c5c73dba3693335 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 23 Feb 2018 15:10:25 +0100 Subject: [PATCH 01/61] Fix wrong price on supplier order line --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d952eb771da..4441d7159af 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1089,7 +1089,7 @@ if (empty($reshook)) $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0, - $productsupplier->product_fourn_price_id, + 0, $productsupplier->ref_supplier, $lines[$i]->remise_percent, 'HT', From ebb4da8417549128c4e358aae38bf94f4908a4c2 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Mon, 5 Mar 2018 16:58:35 +0100 Subject: [PATCH 02/61] Fix keep supplier proposal price in supplier order --- .../class/fournisseur.commande.class.php | 2 +- htdocs/fourn/commande/card.php | 68 +++++++++---------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7c7837e75fe..4d492bf2bbe 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1417,7 +1417,7 @@ class CommandeFournisseur extends CommonOrder if ($fk_product > 0) { - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED) && $origin !== 'supplier_proposal') { // Check quantity is enough dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4441d7159af..aa833d49b6e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1044,8 +1044,6 @@ if (empty($reshook)) $fk_parent_line = 0; $num = count($lines); - $productsupplier = new ProductFournisseur($db); - for($i = 0; $i < $num; $i ++) { @@ -1068,45 +1066,41 @@ if (empty($reshook)) $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_option = $lines[$i]->array_options; } + + $tva_tx = $lines[$i]->tva_tx; - $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid); - if ($result>=0) + if ($origin=="commande") { - $tva_tx = $lines[$i]->tva_tx; - - if ($origin=="commande") - { - $soc=new societe($db); - $soc->fetch($socid); - $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); - } - - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0, - 0, - $productsupplier->ref_supplier, - $lines[$i]->remise_percent, - 'HT', - 0, - $lines[$i]->product_type, - '', - '', - null, - null, - array(), - $lines[$i]->fk_unit, - 0, - $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid - ); + $soc=new societe($db); + $soc->fetch($socid); + $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); } + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0, + 0, + $lines[$i]->ref_fourn, + $lines[$i]->remise_percent, + 'HT', + 0, + $lines[$i]->product_type, + '', + '', + null, + null, + array(), + $lines[$i]->fk_unit, + 0, + $element, + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + ); + if ($result < 0) { $error++; break; From 5971cd8e59d435c15e5f0b30531a60d87e038a85 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Mon, 5 Mar 2018 17:18:03 +0100 Subject: [PATCH 03/61] Fix label goes in desc and lost fourn ref --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/commande/card.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4d492bf2bbe..eacc27e29c1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1368,7 +1368,7 @@ class CommandeFournisseur extends CommonOrder * @param int $origin_id Id of origin object * @return int <=0 if KO, >0 if OK */ - public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0) + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0, $label='') { global $langs,$mysoc,$conf; @@ -1401,7 +1401,7 @@ class CommandeFournisseur extends CommonOrder $pu=$pu_ttc; } $desc=trim($desc); - $ref_supplier=''; // Ref of supplier price when we add line + $ref_supplier=$fourn_ref; // Ref of supplier price when we add line // Check parameters if ($qty < 1 && ! $fk_product) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index aa833d49b6e..fe26bcdc672 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1050,8 +1050,8 @@ if (empty($reshook)) if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; - $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); - $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); + $label = (! empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); + $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); // Reset fk_parent_line for no child products and special product @@ -1098,7 +1098,8 @@ if (empty($reshook)) $lines[$i]->fk_unit, 0, $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid, + $label ); if ($result < 0) { From 53ce297ab343ac6f00d66b9c23850f68de6e1473 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 9 Mar 2018 09:30:11 +0100 Subject: [PATCH 04/61] Fix travis - missing documentation of new param --- htdocs/fourn/class/fournisseur.commande.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index eacc27e29c1..0aa6acc1ede 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1366,6 +1366,7 @@ class CommandeFournisseur extends CommonOrder * @param string $pu_ht_devise Amount in currency * @param string $origin 'order', ... * @param int $origin_id Id of origin object + * @param string $label Label * @return int <=0 if KO, >0 if OK */ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0, $label='') From 34145ed4432416943ee2d00532822a674b9fa7c2 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sun, 11 Mar 2018 21:58:32 +0100 Subject: [PATCH 05/61] Do not display multicurrency cols if currency of object is same as main currency --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/objectline_create.tpl.php | 6 +++--- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4d44a4b6fec..9c1cd3cb6bd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3370,7 +3370,7 @@ abstract class CommonObject print ''.$langs->trans('PriceUHT').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; if ($inputalsopricewithtax) print ''.$langs->trans('PriceUTTC').''; @@ -3409,7 +3409,7 @@ abstract class CommonObject print ''.$langs->trans('TotalHTShort').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f14af2b838f..1deef2e2412 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -65,7 +65,7 @@ if ($nolinesbefore) { trans('VAT'); ?> trans('PriceUHT'); ?> - multicurrency->enabled)) { $colspan++;?> + multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?> trans('PriceUHTCurrency'); ?> @@ -266,7 +266,7 @@ else { "> - multicurrency->enabled)) { $colspan++;?> + multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?> "> @@ -402,7 +402,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da } } - if (!empty($conf->multicurrency->enabled)) $colspan+=2; + if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) $colspan+=2; if (! empty($usemargins)) { diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index d982516bd67..80d8c617c44 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -122,7 +122,7 @@ $coldisplay=-1; // We remove first td if ($this->situation_counter > 1) print ' readonly'; print '>'; - if (!empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++; print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 0a20c2679a1..984af537ea9 100755 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -138,7 +138,7 @@ if (empty($usemargins)) $usemargins=0; subprice); ?> - multicurrency->enabled)) { ?> + multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?> multicurrency_subprice); ?> @@ -204,7 +204,7 @@ if (empty($usemargins)) $usemargins=0; trans('Option'); ?> total_ht); ?> - multicurrency->enabled)) { ?> + multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?> multicurrency_total_ht); ?> From 657fa48c3f6270f6095d1c3209b15bb6d9fde24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 23 Apr 2018 15:31:55 +0200 Subject: [PATCH 06/61] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index b21a6a34046..2e53237659d 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -289,7 +289,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve category list : '.$categories->error); + throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); } return $result; @@ -323,7 +323,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } return array( @@ -365,7 +365,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } throw new RestException(501, 'Feature not yet available'); @@ -400,7 +400,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } return array( From 736c56705b98d364be3e17d1b881523fee70ca93 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Tue, 24 Apr 2018 10:02:26 +0200 Subject: [PATCH 07/61] FIX : Related contact printed in societe agenda --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 663821db0c2..b38f770e071 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1468,7 +1468,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder); $out.=getTitleFieldOfList(''); - $out.=getTitleFieldOfList(''); + $out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], 'a.fk_contact', '', $param, '', $sortfield, $sortorder); $out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder); $out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch '); $out.=''; @@ -1609,7 +1609,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; // Contact pour cette action - if (! empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0) + if (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0) { $contactstatic->lastname=$histo[$key]['lastname']; $contactstatic->firstname=$histo[$key]['firstname']; From 67329b8805ca46805b39246974ceadff978c2a78 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 24 Apr 2018 12:33:07 +0200 Subject: [PATCH 08/61] fix commonobject double style --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 21631b86cac..1b888efc8ca 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4847,7 +4847,8 @@ abstract class CommonObject $type = 'varchar'; // convert varchar(xx) int varchar $size = $reg[1]; } - elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar + elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) into varchar + elseif (preg_match('/double/', $type)) $type = 'double'; // convert double(xx) into double if (is_array($val['arrayofkeyval'])) $type='select'; if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link'; @@ -4922,7 +4923,6 @@ abstract class CommonObject } } //var_dump($showsize.' '.$size); - if (in_array($type,array('date','datetime'))) { $tmp=explode(',',$size); From 70961bd075ae7417fbabad17ed52cfd6967c46be Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 24 Apr 2018 12:46:16 +0200 Subject: [PATCH 09/61] fix perms --- htdocs/modulebuilder/template/myobject_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 68cefa714c3..c4f92994d7a 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -112,7 +112,7 @@ if (empty($reshook)) { $error=0; - $permissiontoadd = $user->rights->mymodule->create; + $permissiontoadd = $user->rights->mymodule->write; $permissiontodelete = $user->rights->mymodule->delete; $backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1); From 83b762b681c6dfdceb809d26ce95f3667b614739 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Apr 2018 16:01:06 +0200 Subject: [PATCH 10/61] FIX CVE-2018-9019 --- htdocs/accountancy/admin/accountmodel.php | 40 +++-------------- htdocs/accountancy/admin/categories.php | 2 +- htdocs/accountancy/admin/categories_list.php | 45 +++++++------------- htdocs/accountancy/admin/journals_list.php | 23 ++-------- htdocs/admin/dict.php | 14 +++--- htdocs/admin/mails_templates.php | 21 ++------- htdocs/admin/website.php | 19 +-------- htdocs/core/lib/functions.lib.php | 8 ++-- 8 files changed, 42 insertions(+), 130 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f3924f73a76..df4f5d7c3f5 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -45,7 +45,7 @@ $langs->loadLangs(array("errors","admin","companies","resource","holiday","compt $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); +$id=31; $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); @@ -58,8 +58,8 @@ $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); +$sortfield = GETPOST("sortfield",'aZ09comma'); +$sortorder = GETPOST("sortorder",'aZ09comma'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; @@ -84,59 +84,48 @@ $hookmanager->initHooks(array('admin')); $tabname=array(); $tabname[31]= MAIN_DB_PREFIX."accounting_system"; -$tabname[32]= MAIN_DB_PREFIX."c_accounting_category"; // Dictionary labels $tablib=array(); $tablib[31]= "Pcg_version"; -$tablib[32]= "DictionaryAccountancyCategory"; // Requests to extract data $tabsql=array(); $tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.fk_country as country_id, c.code as country_code, c.label as country, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_country=c.rowid and c.active=1"; -$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; // Criteria to sort dictionaries $tabsqlsort=array(); $tabsqlsort[31]="pcg_version ASC"; -$tabsqlsort[32]="position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); $tabfield[31]= "pcg_version,label,country_id,country"; -$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); $tabfieldvalue[31]= "pcg_version,label,country"; -$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); $tabfieldinsert[31]= "pcg_version,label,fk_country"; -$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on // "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid=array(); $tabrowid[31]= ""; -$tabrowid[32]= ""; // Condition to show dictionary in setup page $tabcond=array(); $tabcond[31]= ! empty($conf->accounting->enabled); -$tabcond[32]= ! empty($conf->accounting->enabled); // List of help for fields $tabhelp=array(); $tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); $tabfieldcheck[31] = array(); -$tabfieldcheck[32] = array(); // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") @@ -484,7 +473,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.urlencode($page).'&':'').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -503,24 +492,9 @@ if ($id) $sql.= " c.rowid = ".$search_country_id; } - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 7ab463e3179..9c40802c925 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -88,7 +88,7 @@ $formaccounting = new FormAccounting($db); llxheader('', $langs->trans('AccountingCategory')); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; print load_fiche_titre($langs->trans('AccountingCategory'), $linkback); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index fb7561dda94..40ea103a12f 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -54,8 +54,8 @@ $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); +$sortfield = GETPOST("sortfield",'aZ09comma'); +$sortorder = GETPOST("sortorder",'aZ09comma'); $page = GETPOST("page",'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; @@ -300,7 +300,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -324,10 +324,10 @@ if ($action == $acts[0]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -344,10 +344,10 @@ if ($action == $acts[1]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -364,10 +364,10 @@ if ($action == 'activate_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -384,10 +384,10 @@ if ($action == 'disable_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; } elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$this->db->escape($code)."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape($code)."'"; } $result = $db->query($sql); @@ -437,24 +437,9 @@ if ($id) $sql.= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)"; } - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; @@ -793,7 +778,7 @@ if ($id) print ''; if (empty($obj->formula)) { - print ''; + print ''; print $langs->trans("ListOfAccounts"); print ''; } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 7612e7b261a..971fdc20811 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -36,7 +36,7 @@ $langs->load("accountancy"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); +$id=35; $rowid=GETPOST('rowid','alpha'); $code=GETPOST('code','alpha'); @@ -400,24 +400,9 @@ if ($id) $sql=$tabsql[$id]; $sql.= " WHERE a.entity = ".$conf->entity; - if ($sortfield) - { - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); $fieldlist=explode(',',$tabfield[$id]); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 438c7cd5227..72ac51e1799 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -965,14 +965,14 @@ if (empty($id)) print "
\n"; -$param = '&id='.$id; -if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; +$param = '&id='.urlencode($id); +if ($search_country_id > 0) $param.= '&search_country_id='.urlencode($search_country_id); if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); if ($entity != '') $param.= '&entity=' . (int) $entity; $paramwithsearch = $param; -if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; -if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; -if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); +if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); +if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); +if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); // Confirmation de la suppression de la ligne @@ -999,10 +999,10 @@ if ($id) { // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; + $sql.= " ORDER BY ".$db->escape($sortfield); if ($sortorder) { - $sql.=" ".strtoupper($sortorder); + $sql.=" ".strtoupper($db->escape($sortorder)); } $sql.=", "; // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index fb2729bb77b..24bd6a7b8fe 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -430,24 +430,9 @@ if ($search_type_template != '' && $search_type_template != '-1') $sql.=natural_ if ($search_lang) $sql.=natural_search('lang', $search_lang); if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_user', $search_fk_user, 2); if ($search_topic) $sql.=natural_search('topic', $search_topic); -if ($sortfield) -{ - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') $sortfield='country_code'; - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); -} -else { - $sql.=" ORDER BY "; -} -$sql.=$tabsqlsort[$id]; +// If sort order is "country", we use country_code instead +if ($sortfield == 'country') $sortfield='country_code'; +$sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($listlimit+1,$offset); //print $sql; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 9811052509a..e13bd4a2312 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -419,24 +419,7 @@ if ($id) { // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - - if ($sortfield) - { - // If sort order is "country", we use country_code instead - $sql.= " ORDER BY ".$sortfield; - if ($sortorder) - { - $sql.=" ".strtoupper($sortorder); - } - $sql.=", "; - // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); - } - else { - $sql.=" ORDER BY "; - } - $sql.=$tabsqlsort[$id]; + $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($limit+1, $offset); //print $sql; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 37e957c868c..a22a9675ff6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -578,12 +578,12 @@ function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NU { //var_dump($paramname.' - '.$out.' '.$user->default_values[$relativepathstring]['filters'][$paramname]); - // We save search key only if: - // - not empty, or - // - if value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). + // We save search key only if $out not empty that means: + // - posted value not empty, or + // - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). //if (! empty($out) || ! empty($user->default_values[$relativepathstring]['filters'][$paramname])) - if (! empty($out)) + if ($out != '') // $out = '0' like 'abc' is a search criteria to keep { $user->lastsearch_values_tmp[$relativepathstring][$paramname]=$out; } From c044d9ab584705e231a1ee03ad87b13fb5d60730 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 25 Apr 2018 16:20:09 +0200 Subject: [PATCH 11/61] FIX: actioncomm export: type filtering not working --- htdocs/core/modules/modAgenda.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 83175bcdefc..5f78b229461 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -378,7 +378,7 @@ class modAgenda extends DolibarrModules $this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", 'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Numeric", 'ac.durationp'=>"Duree", - 'cac.libelle'=>"List:c_actioncomm:libelle:id", + 'cac.libelle'=>"List:c_actioncomm:libelle:libelle", 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text', 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text'); @@ -400,7 +400,7 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda',1).')'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); - $this->export_sql_end[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r]=' ORDER BY ac.datep'; } From 761d2b3667dc6bddb8c0ecf6ca950532be548f85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Apr 2018 17:44:36 +0200 Subject: [PATCH 12/61] FIX Not approved holidays must not be visible into timesheet --- htdocs/holiday/class/holiday.class.php | 10 ++++++---- htdocs/projet/activity/perday.php | 3 ++- htdocs/projet/activity/perweek.php | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 950c297fb3b..c8f73111021 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -779,25 +779,27 @@ class Holiday extends CommonObject /** - * Check a user is not on holiday for a particular timestamp + * Check that a user is not on holiday for a particular timestamp * * @param int $fk_user Id user * @param timestamp $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) + * @param string $status Filter on holiday status. '-1' = no filter. * @return array array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp. * @see verifDateHolidayCP */ - function verifDateHolidayForTimestamp($fk_user, $timestamp) + function verifDateHolidayForTimestamp($fk_user, $timestamp, $status='-1') { global $langs, $conf; $isavailablemorning=true; $isavailableafternoon=true; - $sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday"; + $sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday, cp.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql.= " AND cp.fk_user = ".(int) $fk_user; - $sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'"; + $sql.= " AND cp.date_debut <= '".$this->db->idate($timestamp)."' AND cp.date_fin >= '".$this->db->idate($timestamp)."'"; + if ($status != '-1') $sql.=" AND cp.statut IN (".$this->db->escape($status).")"; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index f30b0ac4757..7615ee75c20 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -496,7 +496,8 @@ $restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED $holiday = new Holiday($db); $isavailable=array(); -$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse); // $daytoparse is a date with hours = 0 +$statusofholidaytocheck = '3'; +$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, $statusofholiday); // $daytoparse is a date with hours = 0 $isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day if (count($tasksarray) > 0) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index a3c8c9ebe54..f60eaf89375 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -503,7 +503,8 @@ for ($i=0;$i<7;$i++) //print dol_print_date($dayinloopwithouthours, 'dayhour').' '; //print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'
'; - $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow); + $statusofholidaytocheck = '3'; + $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, $statusofholidaytocheck); $isavailable[$dayinloopfromfirstdaytoshow]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day print ''.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'
'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').''; } From 4c87cbf6441933396314757e2c66b8c7c179010d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Apr 2018 12:14:51 +0200 Subject: [PATCH 13/61] Update card.php --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fe26bcdc672..fa1cef8fe0e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1050,7 +1050,7 @@ if (empty($reshook)) if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; - $label = (! empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); + $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); From ecd84f6c4592c029f2bd268913f4406ae63a598f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Apr 2018 12:18:45 +0200 Subject: [PATCH 14/61] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0aa6acc1ede..e79d1e06a6e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1418,7 +1418,7 @@ class CommandeFournisseur extends CommonOrder if ($fk_product > 0) { - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED) && $origin !== 'supplier_proposal') + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { // Check quantity is enough dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref); From d179cafa9ce0c7a04772bc22c904875940b2de35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Apr 2018 12:19:32 +0200 Subject: [PATCH 15/61] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e79d1e06a6e..09f47f385f4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1366,10 +1366,9 @@ class CommandeFournisseur extends CommonOrder * @param string $pu_ht_devise Amount in currency * @param string $origin 'order', ... * @param int $origin_id Id of origin object - * @param string $label Label * @return int <=0 if KO, >0 if OK */ - public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0, $label='') + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0) { global $langs,$mysoc,$conf; From 7cedf55c273d36353540c70a5d0fc01f8e94cab4 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 27 Apr 2018 20:54:48 +0200 Subject: [PATCH 16/61] FIX : missing english name for object 'product' is used by API to check perms and return a 401 error even if user has correct permissions --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index a901dd817d5..c9968bb459f 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -384,7 +384,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh if ($feature == 'project') $feature='projet'; if ($feature == 'task') $feature='projet_task'; - $check = array('adherent','banque','don','user','usergroup','produit','service','produit|service','categorie','resource'); // Test on entity only (Objects with no link to company) + $check = array('adherent','banque','don','user','usergroup','product','produit','service','produit|service','categorie','resource'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet','project'); // Test for project object From 9a345e99ef8cca1300474a90ff2175c5e7e27fd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Apr 2018 20:14:57 +0200 Subject: [PATCH 17/61] Fix syntax error --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index aff48655daf..8ea1f249b7e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1104,7 +1104,7 @@ if (empty($reshook)) if ($result > 0) { $ref_supplier = $productsupplier->ref_supplier; - $product_fourn_price_id = $productsupplier->product_fourn_price_id + $product_fourn_price_id = $productsupplier->product_fourn_price_id; } } else From e79c907ae080d8065b6a58920bc957f489a7e6e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Apr 2018 11:01:33 +0200 Subject: [PATCH 18/61] Fix edit of capital --- htdocs/societe/card.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e235f6f431c..40e3083e125 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -60,7 +60,7 @@ $mesg=''; $error=0; $errors=array(); $action = (GETPOST('action','aZ09') ? GETPOST('action','aZ09') : 'view'); $cancel = GETPOST('cancel','alpha'); $backtopage = GETPOST('backtopage','alpha'); -$confirm = GETPOST('confirm'); +$confirm = GETPOST('confirm','alpha'); $socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; @@ -181,12 +181,12 @@ if (empty($reshook)) // Merge categories $static_cat = new Categorie($db); - + $custcats_ori = $static_cat->containing($soc_origin->id, 'customer', 'id'); $custcats = $static_cat->containing($object->id, 'customer', 'id'); $custcats = array_merge($custcats,$custcats_ori); $object->setCategories($custcats, 'customer'); - + $suppcats_ori = $static_cat->containing($soc_origin->id, 'supplier', 'id'); $suppcats = $static_cat->containing($object->id, 'supplier', 'id'); $suppcats = array_merge($suppcats,$suppcats_ori); @@ -1885,7 +1885,9 @@ else // Capital print ''.fieldLabel('Capital','capital').''; - print ' '.$langs->trans("Currency".$conf->currency).''; + print ' '.$langs->trans("Currency".$conf->currency).''; // Default language if (! empty($conf->global->MAIN_MULTILANGS)) From ab85fa87219dd4db9982906c72cf0da85c28bfe1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Apr 2018 17:45:34 +0200 Subject: [PATCH 19/61] Backport EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS to solve blocking situation. --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index f70982fd429..63abda22fed 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -216,7 +216,7 @@ if (empty($reshook)) if ($ret < 0) $error++; } - if ($object->periode_existe($fuser,$object->date_debut,$object->date_fin)) + if (empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS) && $object->periode_existe($fuser,$object->date_debut,$object->date_fin)) { $error++; setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors'); From d975dd507bc64b760d53840224a532b98a77a089 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 May 2018 11:17:47 +0200 Subject: [PATCH 20/61] Revert "No display object line curreny if not necessary" --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/objectline_create.tpl.php | 6 +++--- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9c1cd3cb6bd..4d44a4b6fec 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3370,7 +3370,7 @@ abstract class CommonObject print ''.$langs->trans('PriceUHT').''; // Multicurrency - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; if ($inputalsopricewithtax) print ''.$langs->trans('PriceUTTC').''; @@ -3409,7 +3409,7 @@ abstract class CommonObject print ''.$langs->trans('TotalHTShort').''; // Multicurrency - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 1deef2e2412..f14af2b838f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -65,7 +65,7 @@ if ($nolinesbefore) { trans('VAT'); ?> trans('PriceUHT'); ?> - multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?> + multicurrency->enabled)) { $colspan++;?> trans('PriceUHTCurrency'); ?> @@ -266,7 +266,7 @@ else { "> - multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?> + multicurrency->enabled)) { $colspan++;?> "> @@ -402,7 +402,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da } } - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) $colspan+=2; + if (!empty($conf->multicurrency->enabled)) $colspan+=2; if (! empty($usemargins)) { diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 80d8c617c44..d982516bd67 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -122,7 +122,7 @@ $coldisplay=-1; // We remove first td if ($this->situation_counter > 1) print ' readonly'; print '>'; - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { + if (!empty($conf->multicurrency->enabled)) { $colspan++; print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 984af537ea9..0a20c2679a1 100755 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -138,7 +138,7 @@ if (empty($usemargins)) $usemargins=0; subprice); ?> - multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?> + multicurrency->enabled)) { ?> multicurrency_subprice); ?> @@ -204,7 +204,7 @@ if (empty($usemargins)) $usemargins=0; trans('Option'); ?> total_ht); ?> - multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?> + multicurrency->enabled)) { ?> multicurrency_total_ht); ?> From b5d720651968b2ad26418f2a1713e2d34792a464 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 1 May 2018 12:02:33 +0200 Subject: [PATCH 21/61] fix 6.0 accountancy multientity --- htdocs/accountancy/admin/account.php | 45 ++++++++++--------- htdocs/accountancy/admin/journals_list.php | 4 +- .../core/class/html.formaccounting.class.php | 1 + 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 905fd8b97ef..9b1b6746861 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { if (! empty($cancel)) $action = ''; - + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_account = ""; @@ -106,13 +106,13 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options=array(); } - + if (GETPOST('change_chart')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); - + if (! empty($chartofaccounts)) { - + if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -120,12 +120,12 @@ if (empty($reshook)) $error ++; } } - + if ($action == 'disable') { if ($accounting->fetch($id)) { $result = $accounting->account_desactivate($id); } - + $action = 'update'; if ($result < 0) { setEventMessages($accounting->error, $accounting->errors, 'errors'); @@ -165,6 +165,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_vers if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)"; else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)"; $sql .= " WHERE asy.rowid = " . $pcgver; +$sql .= " AND aa.entity = " . $conf->entity; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); @@ -179,7 +180,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); -} +} $sql .= $db->plimit($limit + 1, $offset); @@ -209,11 +210,11 @@ if ($resql) print ''; print ''; print ''; - + $htmlbuttonadd = '' . $langs->trans("Addanaccount") . ''; - + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd); - + // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; print '"; print ''; - print '
'; + print '
'; print '
'; - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -259,7 +260,7 @@ if ($resql) print $searchpicto; print ''; print ''; - + print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); @@ -274,14 +275,14 @@ if ($resql) $accountparent = new AccountingAccount($db); $i=0; - while ($i < min($num, $limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $accountstatic->id = $obj->rowid; $accountstatic->label = $obj->label; $accountstatic->account_number = $obj->account_number; - + print ''; // Account number @@ -310,7 +311,7 @@ if ($resql) $accountparent->id = $obj->rowid2; $accountparent->label = $obj->label2; $accountparent->account_number = $obj->account_number2; - + print "\n"; @@ -371,11 +372,11 @@ if ($resql) } print '' . "\n"; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } - + print "
"; print $accountparent->getNomUrl(1); print "
"; print "
"; print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a3912aebc89..a4718d556f2 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -86,7 +86,7 @@ $tablib[35]= "DictionaryAccountancyJournal"; // Requests to extract data $tabsql=array(); -$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a"; +$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -102,7 +102,7 @@ $tabfieldvalue[35]= "code,label,nature"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[35]= "code,label,nature"; +$tabfieldinsert[35]= "code,label,nature,entity"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index e3e6e9a4f20..3ae53f44fff 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -273,6 +273,7 @@ class FormAccounting extends Form $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; + $sql .= " AND aa.entity=".$conf->entity; $sql .= " ORDER BY aa.account_number"; dol_syslog(get_class($this) . "::select_account", LOG_DEBUG); From 3340598cf8256a74dd9dad0b01646e8ffa4da838 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 May 2018 14:15:11 +0200 Subject: [PATCH 22/61] FIX Projet is not prefilled when created from overwiew page --- htdocs/commande/card.php | 14 ++++++-------- htdocs/compta/bank/various_payment/card.php | 2 +- htdocs/supplier_proposal/card.php | 11 +++++------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0844facca69..9f55311444b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -28,9 +28,9 @@ */ /** - * \file htdocs/commande/card.php + * \file htdocs/commande/card.php * \ingroup commande - * \brief Page to show customer order + * \brief Page to show customer order */ require '../main.inc.php'; @@ -76,6 +76,7 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $lineid = GETPOST('lineid', 'int'); +$projectid = GETPOST('projectid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility @@ -228,7 +229,7 @@ if (empty($reshook)) // Link to a project else if ($action == 'classin' && $user->rights->commande->creer) { - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('projectid','int')); } // Add order @@ -259,8 +260,8 @@ if (empty($reshook)) $object->note_private = GETPOST('note_private','none'); $object->note_public = GETPOST('note_public','none'); $object->source = GETPOST('source_id'); - $object->fk_project = GETPOST('projectid'); - $object->ref_client = GETPOST('ref_client'); + $object->fk_project = GETPOST('projectid','int'); + $object->ref_client = GETPOST('ref_client','alpha'); $object->modelpdf = GETPOST('model'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); @@ -1389,7 +1390,6 @@ if ($action == 'create' && $user->rights->commande->creer) if ($socid > 0) $res = $soc->fetch($socid); - $projectid = 0; $remise_absolue = 0; $currency_code = $conf->currency; @@ -1486,7 +1486,6 @@ if ($action == 'create' && $user->rights->commande->creer) $remise_percent = $soc->remise_percent; $remise_absolue = 0; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; - $projectid = 0; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; @@ -1494,7 +1493,6 @@ if ($action == 'create' && $user->rights->commande->creer) $note_public = $object->getDefaultCreateValueFor('note_public'); } - print '
'; print ''; print ''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index b6649250e64..2828963d889 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -349,7 +349,7 @@ if ($action == 'create') print '
'; print ''; print '   '; - print ''; + print ''; print '
'; print '
'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index a5488959016..8c2bfb8090a 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -67,6 +67,7 @@ $action = GETPOST('action', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOST('originid', 'int'); $confirm = GETPOST('confirm', 'alpha'); +$projectid = GETPOST('projectid', 'int'); $lineid = GETPOST('lineid', 'int'); $contactid = GETPOST('contactid','int'); @@ -265,7 +266,7 @@ if (empty($reshook)) $object->remise_percent = GETPOST('remise_percent'); $object->remise_absolue = GETPOST('remise_absolue'); $object->socid = GETPOST('socid'); - $object->fk_project = GETPOST('projectid'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note = GETPOST('note','none'); @@ -283,7 +284,7 @@ if (empty($reshook)) $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); - $object->fk_project = GETPOST('projectid'); + $object->fk_project = GETPOST('projectid','int'); $object->modelpdf = GETPOST('model'); $object->author = $user->id; // deprecated $object->note = GETPOST('note','none'); @@ -890,7 +891,7 @@ if (empty($reshook)) // Set project else if ($action == 'classin' && $user->rights->supplier_proposal->creer) { - $object->setProject($_POST['projectid']); + $object->setProject(GETPOST('projectid'),'int'); } // Delai de livraison @@ -1103,9 +1104,7 @@ if ($action == 'create') $formproject = new FormProjets($db); - $projectid = 0; - if ($origin == 'project') - $projectid = ($originid ? $originid : 0); + if ($origin == 'project') $projectid = ($originid ? $originid : 0); print ''; print '' . $langs->trans("Project") . ''; From 886ad9d4b644b295bbc673b98ec437d84f5945f5 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 08:45:18 +0200 Subject: [PATCH 23/61] check eldy message --- htdocs/accountancy/admin/account.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 9b1b6746861..1c845716e6b 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -160,12 +160,11 @@ $pcgver = $conf->global->CHARTOFACCOUNTS; $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, "; $sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity; // Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid -if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)"; -else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)"; +if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER) AND a2.entity = " . $conf->entity; +else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED) AND a2.entity = " . $conf->entity; $sql .= " WHERE asy.rowid = " . $pcgver; -$sql .= " AND aa.entity = " . $conf->entity; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); From 942e2f40bf6afe5e16d6dfd9543ad50aa963a626 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 2 May 2018 17:07:27 +0200 Subject: [PATCH 24/61] addline manage rank on its own if not provided --- htdocs/fourn/class/fournisseur.facture.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c1337452d8a..34609a8fa33 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1383,6 +1383,11 @@ class FactureFournisseur extends CommonInvoice if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; + if ($rang < 0) { + $rangmax = $this->line_max(); + $rang = $rangmax + 1; + } + $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty); // Clean vat code From 3657857d2160ba759f0f2429aa5e119d122b3026 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 19:29:18 +0200 Subject: [PATCH 25/61] fix project and task visibility same as list --- htdocs/projet/activity/perday.php | 3 ++- htdocs/projet/activity/perweek.php | 3 ++- htdocs/projet/class/project.class.php | 19 ++++++++------ htdocs/projet/class/task.class.php | 38 ++++++++++++++------------- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 36b55ea79ff..b4329ac9237 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -49,7 +49,8 @@ $projectid=isset($_GET["id"])?$_GET["id"]:$_POST["projectid"]; // Security check $socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; +// For external user, no check is done on company because readability is managed by public status of project and assignement. +//if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); $now=dol_now(); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 438d71cbdba..591f8b3ab6f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -50,7 +50,8 @@ $projectid=isset($_GET["id"])?$_GET["id"]:$_POST["projectid"]; // Security check $socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; +// For external user, no check is done on company because readability is managed by public status of project and assignement. +// if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); $now=dol_now(); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ea304eaabe0..551bdcb9d5f 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1662,23 +1662,26 @@ class Project extends CommonObject { global $conf, $langs; - $mine=0; $socid=$user->societe_id; - - $projectsListId = $this->getProjectsAuthorizedForUser($user,$mine?$mine:($user->rights->projet->all->lire?2:0),1,$socid); + // For external user, no check is done on company because readability is managed by public status of project and assignement. + //$socid=$user->societe_id; + if (! $user->rights->projet->all->lire) $projectsListId = $this->getProjectsAuthorizedForUser($user,0,1,$socid); + $sql = "SELECT p.rowid, p.fk_statut as status, p.fk_opp_status, p.datee as datee"; $sql.= " FROM (".MAIN_DB_PREFIX."projet as p"; $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; + // For external user, no check is done on company permission because readability is managed by public status of project and assignement. + //if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; $sql.= " WHERE p.fk_statut = 1"; $sql.= " AND p.entity IN (".getEntity('project', 0).')'; - if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - + // For external user, no check is done on company permission because readability is managed by public status of project and assignement. + //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; + + //print $sql; $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1c8b1466483..6beafe71a25 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1701,29 +1701,31 @@ class Task extends CommonObject { global $conf, $langs; - $mine=0; $socid=$user->societe_id; - + // For external user, no check is done on company because readability is managed by public status of project and assignement. + //$socid=$user->societe_id; + $projectstatic = new Project($this->db); - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid); - + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid); + // List of tasks (does not care about permissions. Filtering will be done later) $sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,"; $sql.= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,"; $sql.= " t.dateo as date_start, t.datee as datee"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; - $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; - $sql.= " WHERE p.entity IN (".getEntity('project', 0).')'; - $sql.= " AND p.fk_statut = 1"; - $sql.= " AND t.fk_projet = p.rowid"; - $sql.= " AND t.progress < 100"; // tasks to do - if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; - // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser - //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - //print $sql; + $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; + //if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; + $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; + $sql.= " WHERE p.entity IN (".getEntity('project', 0).')'; + $sql.= " AND p.fk_statut = 1"; + $sql.= " AND t.fk_projet = p.rowid"; + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; + // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser + //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser + // if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; + + //print $sql; $resql=$this->db->query($sql); if ($resql) { From 46e94af5949c233dc165b20af77048d0f9852482 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 2 May 2018 19:46:04 +0200 Subject: [PATCH 26/61] fix taskid --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 3d239921c60..c3f1da54a16 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -756,7 +756,7 @@ while ($i < min($num,$limit)) $showlineingray=0;$showproject=1; print ''; if ($showlineingray) print ''; - else print ''; + else print ''; if ($obj->duration_effective) print convertSecondToTime($obj->duration_effective,$timespentoutputformat); else print '--:--'; if ($showlineingray) print ''; From db76fd7895233bb13e1996fd8b800cf1048d9dd5 Mon Sep 17 00:00:00 2001 From: fappels Date: Wed, 2 May 2018 22:33:23 +0200 Subject: [PATCH 27/61] Fix delete all product variants of a parent product User object missing --- htdocs/product/class/product.class.php | 2 +- htdocs/variants/class/ProductCombination.class.php | 9 +++++---- htdocs/variants/generator.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e36d5970e8f..e989b0eb206 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1116,7 +1116,7 @@ class Product extends CommonObject //If it is a parent product, then we remove the association with child products $prodcomb = new ProductCombination($this->db); - if ($prodcomb->deleteByFkProductParent($id) < 0) { + if ($prodcomb->deleteByFkProductParent($user, $id) < 0) { $error++; $this->errors[] = 'Error deleting combinations'; } diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 4f647aa2cb3..92bba2f70f8 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -275,10 +275,11 @@ class ProductCombination /** * Deletes all product combinations of a parent product * - * @param int $fk_product_parent Rowid of parent product + * @param User $user Object user + * @param int $fk_product_parent Rowid of parent product * @return int <0 KO >0 OK */ - public function deleteByFkProductParent($fk_product_parent) + public function deleteByFkProductParent($user, $fk_product_parent) { $this->db->begin(); @@ -289,11 +290,11 @@ class ProductCombination $res = $prodstatic->fetch($prodcomb->fk_product_child); if ($res > 0) { - $res = $prodcomb->delete(); + $res = $prodcomb->delete($user); } if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) { - $res = $prodstatic->delete(); + $res = $prodstatic->delete($user); } if ($res < 0) { diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index d4162899874..4daa2d8f45a 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -95,7 +95,7 @@ if ($_POST) { $delete_prev_comb_res = 1; if (!$donotremove) { - $delete_prev_comb_res = $combination->deleteByFkProductParent($id); + $delete_prev_comb_res = $combination->deleteByFkProductParent($user, $id); } //Current combinations will be deleted From 6245f25deb85cc0ef6cdb92e89ff64fb72e54d79 Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 3 May 2018 11:45:41 +0200 Subject: [PATCH 28/61] FIX label in getnomurl projectlist --- htdocs/projet/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6eaf231a5cb..dc3ab9a58ac 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -668,6 +668,7 @@ while ($i < min($num,$limit)) $object->datee = $db->jdate($obj->date_end); $object->statut = $obj->fk_statut; $object->opp_status = $obj->fk_opp_status; + $object->title = $obj->title; $userAccess = $object->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) From 08cf034e2f35db1ce6cc5e40e6e25606f6948426 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 May 2018 13:39:44 +0200 Subject: [PATCH 29/61] FIX to allow IRPF not null even if main VAT is null. From https://www.javierrguez.com/problema-facturas-irpf-sin-iva-dolibarr/ --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a22a9675ff6..78010725086 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4261,7 +4261,8 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller if ($local == 2) { - if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + if (! $mysoc->localtax2_assuj) return 0; // If main vat is 0, IRPF may be different than 0. if ($thirdparty_seller->id == $mysoc->id) { if (! $thirdparty_buyer->localtax2_assuj) return 0; From f6ca1eb6248e022288a32d25a1c0fa9c53cda556 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 13:24:46 +0200 Subject: [PATCH 30/61] Fix permission name --- htdocs/core/menus/standard/eldy.lib.php | 24 ++++++++++++------------ htdocs/core/modules/modStock.class.php | 10 +++++----- htdocs/product/inventory/card.php | 6 +++--- htdocs/product/inventory/list.php | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e930a0ab8b9..171c2a52f8d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1257,18 +1257,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->stock->enabled)) { $langs->load("stocks"); - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) - { - $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); - $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); - } - else - { - $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->advance_inventory->read, '', $mainmenu, 'stock'); - $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->advance_inventory->write); - $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->advance_inventory->read); - } + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) + { + $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); + $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); + $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); + } + else + { + $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); + $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); + $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); + } } } diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index c23a02eeac1..daeb948fe4a 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -122,31 +122,31 @@ class modStock extends DolibarrModules $this->rights[5][0] = 1011; $this->rights[5][1] = 'inventoryReadPermission'; // Permission label $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[6][0] = 1012; $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[6][5] = 'create'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[7][0] = 1013; $this->rights[7][1] = 'inventoryWritePermission'; // Permission label $this->rights[7][3] = 0; // Permission by default for new user (0/1) - $this->rights[7][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[7][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[7][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[8][0] = 1014; $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label $this->rights[8][3] = 0; // Permission by default for new user (0/1) - $this->rights[8][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[9][0] = 1015; $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label $this->rights[9][3] = 0; // Permission by default for new user (0/1) - $this->rights[9][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 30bb3312576..aaba9e8cdfe 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -42,7 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $result = restrictedArea($user, 'stock', $id, '', 'advance_inventory'); + $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } // Initialize technical objects @@ -82,8 +82,8 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $permissiontoadd = $user->rights->stock->advance_inventory->create; - $permissiontodelete = $user->rights->stock->advance_inventory->write; + $permissiontoadd = $user->rights->stock->inventory_advance->create; + $permissiontodelete = $user->rights->stock->inventory_advance->write; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index f3089099efe..79f0835e991 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -78,7 +78,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) } else { - $result = restrictedArea($user, 'stock', $objectid, '', 'advance_inventory'); + $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); } // Initialize array of search criterias From b958311819231c32d329e96a9d90bf869d49187b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 20:25:06 +0200 Subject: [PATCH 31/61] Prepare 6.0.7 --- ChangeLog | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dcc363d03a9..405aaa9ed9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,22 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 6.0.6 compared to 6.0.6 ***** +***** ChangeLog for 6.0.7 compared to 6.0.6 ***** +FIX: #8023 +FIX: #8259 can't update contact birthday with REST API +FIX: #8478 !empty instead of count to avoid warning +FIX: #8488 +FIX: actioncomm export: type filtering not working +FIX: addline on invoice supplier manage rank on its own if not provided +FIX: issue #8037 +FIX: label in getnomurl projectlist +FIX: payment term doc-specific label was not used +FIX: payment term doc-specific label was not used (issue #8414) +FIX: project category is type 6 not 5 !! +FIX: some localtaxes errors +FIX: weird password autocompletion in Google Chrome (issue #8479) + +***** ChangeLog for 6.0.6 compared to 6.0.5 ***** FIX: #7974 Contract - Invalid reference on the document FIX: #8139 FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php From d4d4f8cc832785b416cf38952272ee32b15c383f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 20:29:06 +0200 Subject: [PATCH 32/61] Prepare 7.0.2 --- ChangeLog | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3ecdc4d0c54..0a2157316b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,96 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 7.0.2 compared to 7.0.1 ***** +FIX: #8023 +FIX: #8259 can't update contact birthday with REST API +FIX: #8359 +FIX: #8389 +FIX: #8478 !empty instead of count to avoid warning +FIX: #8488 +FIX: #8559 Bug to generate cheque receipt +FIX: #8571 +FIX: #8574 +FIX: #8580 +FIX: #8650 +FIX: actioncomm export: type filtering not working +FIX: Add a test to avoid to reset binding by error. +FIX: addline on invoice supplier manage rank on its own if not provided +FIX: Add warning when expense report line not into range +FIX: avoid Error: Call to undefined method mysqli::get_charset() +FIX: avoid focus problem when select2 is in a modal dialog window +FIX: Binding pages must start on fiscal month not calendar month +FIX: button "Classify bill" on supplier order was not visible +FIX: Button receive products not visible +FIX: can bypass the CSRF protection with url with domain inside +FIX: Can't edit option PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY +FIX: commonobject: don't require notnull field if default set +FIX: CommonObject: don't require 'notnull' field if 'default' set +FIX: cron script disabled if module disabled +FIX: CVE-2018-10092 +FIX: CVE-2018-10094 +FIX: CVE-2018-10095 +FIX: CVE-2018-9019 +FIX: CWE-89 +FIX: Data on income/expense report was always 0 +FIX: default addupdatedelete actions: uniformize add/update value checks +FIX: default currency not set on supplier order creation from commercial menu #8459 +FIX: delete all product variants of a parent product +FIX: Detail per account not visible when total < 0 +FIX: DOL_AUTOSET_COOKIE was not correctly setting value of cookie +FIX: don't print empty date in CommonObject::showOutputField +FIX: dont print empty date in CommonObject::showOutputField +FIX: Draft invoice must be excluded from report +FIX: environment shown on cron card +FIX: Error in ContractLigne not return to Contract +FIX: extrafields price and double were lost during a failed post. +FIX: File name not visible in email preview +FIX: filter/sorting on extrafield on contact list from contact tab +FIX: Initial month on report income/expense per predefined group +FIX: issue #8037 +FIX: Issue #8455 +FIX: issue #8470 +FIX: label in getnomurl projectlist +FIX: limit access of email template page to internal users +FIX: look and feel v7 "back to" for bookkeeping record +FIX: Max nb of generation of recurring invoice should not show warning +FIX: missing english name for object +FIX: Missing include +FIX: missing User object with API REST +FIX: modulebuilder: could not create html fields +FIX: modulebuilder: handle 'price' fieldtype +FIX: multiple creation of same event +FIX: Name of user not visible on journalizing expense report payments +FIX: Not approved holidays must not be visible into timesheet +FIX: Only approved expense report must be journalized +FIX: payment term doc-specific label was not used +FIX: payment term doc-specific label was not used (issue #8414) +FIX: project category is type 6 not 5 +FIX: Projet is not prefilled when created from overwiew page +FIX: Related contact printed in societe agenda +FIX: Removed error when no error on accounting setup page +FIX: remove var_dump +FIX: sanitize setup params +FIX: selectForFormsList: entity checked even is object not multi-entity managed +FIX: service creation, right is tested regarding the product type +FIX: some localtaxes errors +FIX: Some report have data when several chart of accounts exists +FIX: sql error using no category +FIX: SQL Injection CWE-89 +FIX: Support or multicompany for sheduled jobs +FIX: Test on mandatory status when closing proposal failed +FIX: to allow IRPF not null even if main VAT is null. +FIX: update wrong datetime extrafield +FIX: Use priority to define order of sheduled jobs +FIX: various modulebuilder-related issues +FIX: view of balance before field +FIX: weird password autocompletion in Goocle Chrome (issue #8479) +FIX: weird password autocompletion in Google Chrome (issue #8479) +FIX: When clearing filter, we must not save tmp criterias in session +FIX: With x extrafields, request for multicompany label was done x times +FIX: several XSS +FIX: zip not filtered + ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php FIX: #8200 From f76df85aec7a18ce137e8f1ef6d9e8629cc93194 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 21:53:02 +0200 Subject: [PATCH 33/61] compatibility with ubuntu 14.04 --- build/makepack-dolibarr.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 7da6d180dcb..62e1b8b6c34 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -849,6 +849,8 @@ if ($nboftargetok) { unlink("$NEWDESTI/${FILENAMEDEB}.changes"); print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n"; unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz"); + print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz"); print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n"; unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz"); @@ -1024,7 +1026,8 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/" 2>/dev/null`; + $ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; } From 19008531bba77484b3fbbe1fefdc5eaf81efffbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 21:56:34 +0200 Subject: [PATCH 34/61] Fix packager --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 62e1b8b6c34..31338e44649 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -466,10 +466,12 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; @@ -1026,7 +1028,6 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/" 2>/dev/null`; $ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; @@ -1171,7 +1172,7 @@ if ($nboftargetok) { "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', @@ -1184,8 +1185,7 @@ if ($nboftargetok) { "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu', - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu', - "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', "$DESTI/standard/$FILENAMETGZ.tgz"=>'standard', From f15da0b980f8c3ed6862d45a654f0ba8ccbe8acf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 May 2018 22:15:19 +0200 Subject: [PATCH 35/61] Fix chart of account initial data for syscohada --- .../install/mysql/migration/6.0.0-7.0.0.sql | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index efb47ede029..cf0a8c8cc49 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -577,21 +577,21 @@ ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile( -- Add new chart of account entries INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 67,'PC-MIPYME', 'The PYME accountancy Chile plan', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 7,'ENG-BASE', 'England plan', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 66,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 66,'SYSCOHADA-TD', 'Plan comptable Ouest-Africain', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); -- Update old chart of account entries From 20c50e809d848a335195df76d54b82964ebd7e18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 May 2018 10:43:40 +0200 Subject: [PATCH 36/61] Start 6.0.8 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7f5b0f5e746..9ab5de809b9 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.8'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From d1fd39936c8079dc642231fe54ff2a2265b91223 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 8 May 2018 09:04:04 +0200 Subject: [PATCH 37/61] Fix: Bug on invoice status list on left menu --- htdocs/core/menus/standard/eldy.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 171c2a52f8d..0104f787bf8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2012-2015 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -802,7 +803,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); - if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|draft|notpaid|paid|canceled)$/', $leftmenu)) + if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire); From 842c6168a25cbd90d3b8d616b8d5841662e3aab9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 May 2018 11:50:35 +0200 Subject: [PATCH 38/61] FIX #8762 --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 05c5982dc00..e09b6cd2bb0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -498,7 +498,7 @@ class FormFile $modellist=ModelePDFCards::liste_modeles($this->db); } } - elseif ($modulepart == 'agenda') + elseif ($modulepart == 'agenda' || $modulepart == 'actions') { if (is_array($genallowed)) $modellist=$genallowed; else From 2f1ac6fad87b6c1dc47f8aba3136772ae976a59c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 13 May 2018 20:35:07 +0200 Subject: [PATCH 39/61] Fix : Double WHERE on admin/journal_list.php --- htdocs/accountancy/admin/journals_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 37c166dabe9..d65f7eeba7d 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -86,7 +86,7 @@ $tablib[35]= "DictionaryAccountancyJournal"; // Requests to extract data $tabsql=array(); -$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity; +$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a"; // Criteria to sort dictionaries $tabsqlsort=array(); From b42c87256c5b716dfbd3efed4b74d983159de597 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 14 May 2018 14:55:33 +0200 Subject: [PATCH 40/61] Fix_situation_discount_used --- htdocs/compta/facture/card.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f31b0be6a38..e3e7dc3665f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1362,11 +1362,26 @@ if (empty($reshook)) $object->origin = $origin; $object->origin_id = $originid; - foreach ($object->lines as &$line) + foreach ($object->lines as $i => &$line) { $line->origin = $object->origin; $line->origin_id = $line->id; $line->fetch_optionals($line->id); + + // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée + if ($line->fk_remise_except) + { + $discount=new DiscountAbsolute($line->db); + $result=$discount->fetch($line->fk_remise_except); + if ($result > 0) + { + // Check if discount not already affected to another invoice + if ($discount->fk_facture_line > 0) + { + unset($object->lines[$i]); + } + } + } } } From ca09fddfb32aa5e583b33277ad4acd7462119cd0 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Mon, 14 May 2018 15:16:07 +0200 Subject: [PATCH 41/61] FIX : Select user on add time spent form --- htdocs/projet/tasks/time.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 79ff8f9d9b0..2da534e53a0 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -568,7 +568,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $contactsoftask=$object->getListContactId('internal'); if (count($contactsoftask)>0) { - $userid=$contactsoftask[0]; + if(in_array($user->id, $contactsoftask)) $userid = $user->id; + else $userid=$contactsoftask[0]; print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask"), 'maxwidth200'); } else From 9552a914d82d233dc928841a5e02c305adf7af8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 May 2018 15:16:19 +0200 Subject: [PATCH 42/61] FIX link for projets not linked to a thirdparties --- htdocs/projet/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index c922ca0514b..1ff9e22041d 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -290,7 +290,10 @@ if ( $resql ) print $langs->trans("OthersNotLinkedToThirdParty"); } print ''; - print ''.$obj->nb.''; + print ''; + if ($obj->socid) print ''.$obj->nb.''; + else print ''.$obj->nb.''; + print ''; print "\n"; $i++; From a46362a71f9709400f90a676e4b800de15ea42b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 May 2018 15:17:10 +0200 Subject: [PATCH 43/61] Prepare 7.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 99a6b550f45..b8126b4fcc8 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 88bc2dd41629710baa007f6852d2e89d6be3d237 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 14 May 2018 20:59:38 +0200 Subject: [PATCH 44/61] Correct insert --- htdocs/accountancy/admin/journals_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index d65f7eeba7d..971fdc20811 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -102,7 +102,7 @@ $tabfieldvalue[35]= "code,label,nature"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[35]= "code,label,nature,entity"; +$tabfieldinsert[35]= "code,label,nature"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on From 630e38072b84c68a3a4dd5ebc927e78f7b11ac74 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 15 May 2018 17:02:54 +0200 Subject: [PATCH 45/61] fix SQL and add hook --- htdocs/projet/contact.php | 37 +++++++++++++++++++------------------ htdocs/projet/element.php | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 72b82ac2bb0..6da1028d473 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -49,6 +49,7 @@ $socid=0; //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. $result = restrictedArea($user, 'projet', $id,'projet&project'); +$hookmanager->initHooks(array('projectcontactcard','globalcard')); /* * Actions @@ -150,26 +151,26 @@ if ($id > 0 || ! empty($ref)) // Project card - + $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
'; // Title $morehtmlref.=$object->title; // Thirdparty - if ($object->thirdparty->id > 0) + if ($object->thirdparty->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref.='
'; - + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -178,7 +179,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - + // Visibility print ''; - + // Opportunity percent print ''; } - + // Date start - end print '
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); @@ -192,7 +193,7 @@ if ($id > 0 || ! empty($ref)) $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print '
'.$langs->trans("OpportunityProbability").''; if (strcmp($object->opp_percent,'')) print price($object->opp_percent,'',$langs,1,0).' %'; @@ -203,7 +204,7 @@ if ($id > 0 || ! empty($ref)) if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start,'dayhour'); @@ -222,40 +223,40 @@ if ($id > 0 || ! empty($ref)) // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print "
"; print ''; print '
'; print '
'; print '
'; - + print ''; - + // Description print ''; - + // Categories if ($conf->categorie->enabled) { print '"; } - + print '
'.$langs->trans("Description").''; print nl2br($object->description); print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id,'project',1); print "
'; - + print '
'; print '
'; print ''; - + print '
'; - + dol_fiche_end(); - + print '
'; - + // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 17b3cbd65f9..85bbf906fef 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -145,7 +145,7 @@ $morehtmlref.=''; if (! $user->rights->projet->all->lire) { $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); - $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; + $object->next_prev_filter=" te.rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); From 5c727c077b34a335f0a4916c18440b3db1464b9c Mon Sep 17 00:00:00 2001 From: alexis Algoud Date: Wed, 16 May 2018 16:34:19 +0200 Subject: [PATCH 46/61] fix task contact card without withproject parameters --- htdocs/projet/tasks/contact.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index a2db82fc0ed..fad5466cb7f 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -303,6 +303,7 @@ if ($id > 0 || ! empty($ref)) // Project if (empty($withproject)) { + $result=$projectstatic->fetch($object->fk_project); $morehtmlref.='
'; $morehtmlref.=$langs->trans("Project").': '; $morehtmlref.=$projectstatic->getNomUrl(1); @@ -310,7 +311,11 @@ if ($id > 0 || ! empty($ref)) // Third party $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + if($projectstatic->socid>0) { + $projectstatic->fetch_thirdparty(); + $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); + } + $morehtmlref.='
'; } From 5804d1d4a302915551f97aef1006d8f4fb7d2a0f Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Thu, 17 May 2018 10:16:44 +0200 Subject: [PATCH 47/61] Fix missing params for commonGenerateDocument ADD param moreparams for compatibility with commonGenerateDocument --- htdocs/compta/facture/class/facture.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b73307277c8..1d4dd3a45a9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -15,6 +15,7 @@ * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3979,9 +3980,10 @@ class Facture extends CommonInvoice * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref + * @param null|array $moreparams Array to provide more information * @return int <0 if KO, >0 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) + public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) { global $conf,$langs; @@ -4000,7 +4002,7 @@ class Facture extends CommonInvoice $modelpath = "core/modules/facture/doc/"; - return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } /** From dc7a1610e78d89e7489eaff5da52214882076f03 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 17 May 2018 18:56:01 +0200 Subject: [PATCH 48/61] Fix: extrafiels is not passing orders to invoice --- htdocs/commande/orderstoinvoice.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 40071a0b21d..49a6a88a78f 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Andreu Bisquerra Gaya * Copyright (C) 2012 David Rodriguez Martinez - * Copyright (C) 2012-2017 Juanjo Menent + * Copyright (C) 2012-2018 Juanjo Menent * Copyright (C) 2015 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -285,6 +285,13 @@ if (($action == 'create' || $action == 'add') && !$error) { $fk_parent_line = 0; } + + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_options = $lines[$i]->array_options; + } + $result = $object->addline( $desc, $lines[$i]->subprice, @@ -309,7 +316,8 @@ if (($action == 'create' || $action == 'add') && !$error) $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, - $lines[$i]->label + $lines[$i]->label, + $array_options ); if ($result > 0) { From 0aa8c6f498eacb95248bb263cc6937ed7921d9d5 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 17 May 2018 19:05:25 +0200 Subject: [PATCH 49/61] Fix: extrafiels is not passing orders to invoice --- htdocs/core/actions_massactions.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5a713168c48..6f07abd2c55 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -601,6 +602,13 @@ if ($massaction == 'confirm_createbills') { $fk_parent_line = 0; } + + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_options = $lines[$i]->array_options; + } + $result = $objecttmp->addline( $desc, $lines[$i]->subprice, @@ -625,7 +633,8 @@ if ($massaction == 'confirm_createbills') $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, - $lines[$i]->label + $lines[$i]->label, + $array_options ); if ($result > 0) { From 90d2ccc79caff16e5efd4275f514bc8679ce743f Mon Sep 17 00:00:00 2001 From: fappels Date: Thu, 17 May 2018 21:29:15 +0200 Subject: [PATCH 50/61] Fix product vat update error handling Product vat update does not show update error if update result negative. --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a2afb5f9bb8..fc5c20c3d1a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -152,7 +152,7 @@ if (empty($reshook)) $db->begin(); $resql = $object->update($object->id, $user); - if (! $resql) + if (! $resql || $resql < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); From 26e10caa7d4fa8ff4ce12b1d2cab6df24621b3c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 May 2018 09:15:18 +0200 Subject: [PATCH 51/61] FIX #8813 --- htdocs/accountancy/class/accountingaccount.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 6b7e925832b..3f5c11691ad 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -84,7 +84,8 @@ class AccountingAccount extends CommonObject * @param int $limittocurrentchart 1=Do not load record if it is into another accounting system * @return int <0 if KO, 0 if not found, Id of record if OK and found */ - function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) { + function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) + { global $conf; if ($rowid || $account_number) { @@ -96,10 +97,10 @@ class AccountingAccount extends CommonObject if ($rowid) { $sql .= " a.rowid = '" . $rowid . "'"; } elseif ($account_number) { - $sql .= " a.account_number = '" . $account_number . "'"; + $sql .= " a.account_number = '" . $this->db->escape($account_number) . "'"; } if (! empty($limittocurrentchart)) { - $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; + $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')'; } dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); @@ -203,7 +204,7 @@ class AccountingAccount extends CommonObject $sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'"); $sql .= ", " . (empty($this->account_parent) ? 'NULL' : "'" . $this->db->escape($this->account_parent) . "'"); $sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'"); - $sql .= ", " . (empty($this->account_category) ? 'NULL' : "'" . $this->db->escape($this->account_category) . "'"); + $sql .= ", " . (empty($this->account_category) ? '0' : $this->db->escape($this->account_category)); $sql .= ", " . $user->id; $sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active)); $sql .= ")"; @@ -274,7 +275,7 @@ class AccountingAccount extends CommonObject $sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'"; $sql .= " , account_parent = '" . $this->db->escape($this->account_parent) . "'"; $sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null"); - $sql .= " , fk_accounting_category = '" . $this->db->escape($this->account_category) . "'"; + $sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category)); $sql .= " , fk_user_modif = " . $user->id; $sql .= " , active = " . $this->active; $sql .= " WHERE rowid = " . $this->id; From dd259043cd3522169081bbfd320597f40fc85ad2 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 18 May 2018 09:20:18 +0200 Subject: [PATCH 52/61] Fix: Cashdesk does not apply multi-price or price per customer --- htdocs/cashdesk/facturation_verif.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index ec21de2225d..8867a61e80a 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2010 Laurent Destailleur + * Copyright (C) 2018 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -145,7 +146,8 @@ switch (GETPOST('action','alpha')) $obj_facturation->id($ret['rowid']); $obj_facturation->ref($ret['ref']); $obj_facturation->stock($ret['reel']); - $obj_facturation->prix($ret['price']); + //$obj_facturation->prix($ret['price']); + $obj_facturation->prix($pu_ht); $vatrate = $tva_tx; From 80bce6b62d43537d56e9baaab4fb11ce573cfbca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 May 2018 09:25:59 +0200 Subject: [PATCH 53/61] Add phpunit for accountingaccount --- test/phpunit/CommandeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 1d0e4fbf616..443bd1d1932 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -174,7 +174,7 @@ class CommandeTest extends PHPUnit_Framework_TestCase * @depends testCommandeFetch * The depends says test is run only if previous is ok */ - public function testCommandUpdate($localobject) + public function testCommandeUpdate($localobject) { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -196,7 +196,7 @@ class CommandeTest extends PHPUnit_Framework_TestCase * @param Object $localobject Order * @return Commande * - * @depends testCommandUpdate + * @depends testCommandeUpdate * The depends says test is run only if previous is ok */ public function testCommandeValid($localobject) From 3dd11e1eaff09e2d5bcfd96897ddb0ce8789ae65 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 18 May 2018 11:02:04 +0200 Subject: [PATCH 54/61] Fix discount id --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e3e7dc3665f..d79b8d0bae5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1378,7 +1378,7 @@ if (empty($reshook)) // Check if discount not already affected to another invoice if ($discount->fk_facture_line > 0) { - unset($object->lines[$i]); + $line->fk_remise_except = 0; } } } From e2369dea295a2d73df3c18660b42aeee006b350c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 May 2018 11:17:21 +0200 Subject: [PATCH 55/61] FIX #8722 --- htdocs/compta/facture/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 56b7adc01d5..e3e0f60ce31 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -720,7 +720,6 @@ if (empty($reshook)) $sql.= ' WHERE pf.fk_facture = '.$object->id; $sql.= ' AND pf.fk_paiement = p.rowid'; $sql.= ' AND p.entity IN (' . getEntity('facture').')'; - $sql.= ' ORDER BY p.datep, p.tms'; $resql = $db->query($sql); if (! $resql) dol_print_error($db); From 79bbeb05aed3cb97981b8391cf598a6d046d38fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 May 2018 11:17:33 +0200 Subject: [PATCH 56/61] Add missing phpunit tests --- test/phpunit/AccountingAccount.php | 225 +++++++++++++++++++++++++++++ test/phpunit/AllTests.php | 3 + 2 files changed, 228 insertions(+) create mode 100644 test/phpunit/AccountingAccount.php diff --git a/test/phpunit/AccountingAccount.php b/test/phpunit/AccountingAccount.php new file mode 100644 index 00000000000..ba7f567b4a0 --- /dev/null +++ b/test/phpunit/AccountingAccount.php @@ -0,0 +1,225 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file test/phpunit/AccountingAccount.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver +//require_once 'PHPUnit/Autoload.php'; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/accountancy/class/accountingaccount.class.php'; + +if (empty($user->id)) { + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class AccountingAccountTest extends PHPUnit_Framework_TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return AccountingAccountTest + */ + function __construct() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + // Static methods + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + if (empty($conf->accounting->enabled)) { print __METHOD__." module accouting must be enabled.\n"; die(); } + + print __METHOD__."\n"; + } + + // tear down after class + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + //print $db->getVersion()."\n"; + } + + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * testAccountingAccountCreate + * + * @return void + */ + public function testAccountingAccountCreate() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new AccountingAccount($this->savdb); + $localobject->fk_pcg_version = 'PCG99-ABREGE'; + $localobject->account_category = 0; + $localobject->pcg_type = 'XXXXX'; + $localobject->pcg_subtype = 'XXXXX'; + $localobject->account_parent = 0; + $localobject->label = 'Account specimen'; + $localobject->active = 0; + $result=$localobject->create($user); + + $this->assertLessThan($result, 0); + print __METHOD__." result=".$result."\n"; + return $result; + } + + /** + * testAccountingAccountFetch + * + * @param int $id Id order + * @return AccountingAccount + * + * @depends testAccountingAccountCreate + * The depends says test is run only if previous is ok + */ + public function testAccountingAccountFetch($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new AccountingAccount($this->savdb); + $result=$localobject->fetch($id); + + $this->assertLessThan($result, 0); + print __METHOD__." id=".$id." result=".$result."\n"; + return $localobject; + } + + /** + * testAccountingAccountUpdate + * + * @param Object $localobject AccountingAccount + * @return AccountingAccount + * + * @depends testAccountingAccountFetch + * The depends says test is run only if previous is ok + */ + public function testAccountingAccountUpdate($localobject) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject->label='New label'; + $result=$localobject->update($user); + + $this->assertLessThan($result, 0); + print __METHOD__." id=".$id." result=".$result."\n"; + return $localobject->id; + } + + /** + * testAccountingAccountDelete + * + * @param int $id Id of order + * @return void + * + * @depends testAccountingAccountUpdate + * The depends says test is run only if previous is ok + */ + public function testAccountingAccountDelete($id) + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new AccountingAccount($this->savdb); + $result=$localobject->fetch($id); + $result=$localobject->delete($user); + + print __METHOD__." id=".$id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; + } + +} diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index d1f0e8b5158..baf6b960e2b 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -200,6 +200,9 @@ class AllTests require_once dirname(__FILE__).'/CategorieTest.php'; $suite->addTestSuite('CategorieTest'); + require_once dirname(__FILE__).'/AccountingAccountTest.php'; + $suite->addTestSuite('AccountingAccountTest'); + require_once dirname(__FILE__).'/RestAPIUserTest.php'; $suite->addTestSuite('RestAPIUserTest'); From 24d353c9a75b80984c685e63d4c0020d0ad3b54c Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Thu, 10 May 2018 16:08:45 +0200 Subject: [PATCH 57/61] inversion of dateo and datee --- htdocs/fichinter/class/fichinter.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 4dee1f94f24..73e71b46398 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -369,8 +369,8 @@ class Fichinter extends CommonObject $this->statut = $obj->fk_statut; $this->duration = $obj->duree; $this->datec = $this->db->jdate($obj->datec); - $this->datee = $this->db->jdate($obj->dateo); - $this->dateo = $this->db->jdate($obj->datee); + $this->dateo = $this->db->jdate($obj->dateo); + $this->datee = $this->db->jdate($obj->datee); $this->datet = $this->db->jdate($obj->datet); $this->datev = $this->db->jdate($obj->datev); $this->datem = $this->db->jdate($obj->datem); From e5561ecdfb92576509bc1892dc7fe0d0ca919ba4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2018 22:14:15 +0200 Subject: [PATCH 58/61] Remove useless files --- .../template/dev/codesniffer/DolibarrPSR2.xml | 12 - .../template/dev/git-hooks/README | 15 - .../template/dev/git-hooks/post-commit | 2 - .../template/dev/git-hooks/pre-commit | 2 - .../template/dev/git-hooks/pre-push | 2 - .../modulebuilder/template/dev/img/README.md | 53 --- .../template/dev/img/gfdl-129x44.png | Bin 4709 -> 0 bytes .../template/dev/img/gfdl-66x23.png | Bin 2453 -> 0 bytes .../template/dev/img/gfdl-logo.svg | 110 ----- .../template/dev/img/gpl-v3-logo.svg | 389 ------------------ .../template/dev/img/gplv3-127x51.png | Bin 3471 -> 0 bytes .../template/dev/img/gplv3-88x31.png | Bin 2666 -> 0 bytes .../template/dev/img/mymodule.svg | 70 ---- 13 files changed, 655 deletions(-) delete mode 100644 htdocs/modulebuilder/template/dev/codesniffer/DolibarrPSR2.xml delete mode 100644 htdocs/modulebuilder/template/dev/git-hooks/README delete mode 100755 htdocs/modulebuilder/template/dev/git-hooks/post-commit delete mode 100755 htdocs/modulebuilder/template/dev/git-hooks/pre-commit delete mode 100755 htdocs/modulebuilder/template/dev/git-hooks/pre-push delete mode 100644 htdocs/modulebuilder/template/dev/img/README.md delete mode 100644 htdocs/modulebuilder/template/dev/img/gfdl-129x44.png delete mode 100644 htdocs/modulebuilder/template/dev/img/gfdl-66x23.png delete mode 100644 htdocs/modulebuilder/template/dev/img/gfdl-logo.svg delete mode 100644 htdocs/modulebuilder/template/dev/img/gpl-v3-logo.svg delete mode 100644 htdocs/modulebuilder/template/dev/img/gplv3-127x51.png delete mode 100644 htdocs/modulebuilder/template/dev/img/gplv3-88x31.png delete mode 100644 htdocs/modulebuilder/template/dev/img/mymodule.svg diff --git a/htdocs/modulebuilder/template/dev/codesniffer/DolibarrPSR2.xml b/htdocs/modulebuilder/template/dev/codesniffer/DolibarrPSR2.xml deleted file mode 100644 index 48d3f5d8d1d..00000000000 --- a/htdocs/modulebuilder/template/dev/codesniffer/DolibarrPSR2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - The PSR2 standard with Dolibarr quirks. - - - - - - - - - \ No newline at end of file diff --git a/htdocs/modulebuilder/template/dev/git-hooks/README b/htdocs/modulebuilder/template/dev/git-hooks/README deleted file mode 100644 index a5d024c1bf5..00000000000 --- a/htdocs/modulebuilder/template/dev/git-hooks/README +++ /dev/null @@ -1,15 +0,0 @@ -# Git hooks - -Optional [GIT hooks](https://git-scm.com/book/it/v2/Customizing-Git-Git-Hooks) are provided. -These are just wrappers calling composer scripts. -They ensure best practices are followed during module development. - -Install: -```sh -composer git_hooks_install -``` - -Remove: -```sh -composer git_hooks_remove -``` diff --git a/htdocs/modulebuilder/template/dev/git-hooks/post-commit b/htdocs/modulebuilder/template/dev/git-hooks/post-commit deleted file mode 100755 index d44ff23047c..00000000000 --- a/htdocs/modulebuilder/template/dev/git-hooks/post-commit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -composer git_post_commit diff --git a/htdocs/modulebuilder/template/dev/git-hooks/pre-commit b/htdocs/modulebuilder/template/dev/git-hooks/pre-commit deleted file mode 100755 index d8bd735325c..00000000000 --- a/htdocs/modulebuilder/template/dev/git-hooks/pre-commit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -composer git_pre_commit diff --git a/htdocs/modulebuilder/template/dev/git-hooks/pre-push b/htdocs/modulebuilder/template/dev/git-hooks/pre-push deleted file mode 100755 index 61848c24831..00000000000 --- a/htdocs/modulebuilder/template/dev/git-hooks/pre-push +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -composer git_pre_push diff --git a/htdocs/modulebuilder/template/dev/img/README.md b/htdocs/modulebuilder/template/dev/img/README.md deleted file mode 100644 index f44c37f30c6..00000000000 --- a/htdocs/modulebuilder/template/dev/img/README.md +++ /dev/null @@ -1,53 +0,0 @@ -Source images -============= - -Used to generate icons and publication assets. - -Icons ------ - -### Dolibarr - -These resides in the [/img](../../img) directory. - -#### Small - -Required. -Name must begin by ```object_```. - -- Sample: ![object_mymodule.png](../../img/object_mymodule.png) [object_mymodule.png](../../img/object_mymodule.png) -- Size: 14×14 pixels -- Type: PNG - -#### Large - -Optional. - -- Sample: ![mymodule.png](../../img/mymodule.png) [mymodule.png](../../img/mymodule.png) -- Size: 32×32 pixels -- Type: PNG - -### Dolistore - -Designed to fit a 512×512 icon + publisher branding. - -- Size: 704×704 -- Type: PNG - -Export to 512×512 - -### Transifex - -- Size: 96×96 -- Type: PNG - -### Others - -To be on the safe side, you may also want to generate all popular sizes: -- 16×16 -- 32×32 -- 48×48 -- 64×64 -- 128×128 -- 256×256 -- 512×512 diff --git a/htdocs/modulebuilder/template/dev/img/gfdl-129x44.png b/htdocs/modulebuilder/template/dev/img/gfdl-129x44.png deleted file mode 100644 index f2bacfd179a99f051654eaa6ba30089dd8691d7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4709 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 diff --git a/htdocs/modulebuilder/template/dev/img/gfdl-66x23.png b/htdocs/modulebuilder/template/dev/img/gfdl-66x23.png deleted file mode 100644 index b43479bf3c817b3f780eb453ef3c4e770e1ddc35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2453 zcmV;G32OFElDZw|yVYEgfW}Cy|k! zgx#J@dYX;&G#ew5FXBW=C5OK*=2TfN#mCEavsn&k0X^XE@ra^mcvn%BC6d8lC^yN* zgv%!6U+9|78#_Pv8yh$6;F+iA^Rt^S=eg(K;ne9GKHv8bT3R{~4F)91KtjBg?~c9+ zKp>zA^B;UpI`(a;w0h+{e!c3A*(XaX3nahaf8umSeE}d`*s{(aZ~lHS27`z_BN>w{ z)8p|{e7u6l2osYhk4831$g&YhGH}an%V}%tqN%AJS(dos@=M5aq|oK^N}8tUONtUG zDJ`w`0p`JiH8*$g$)CTX_;@+BbuEm(IE%|BY65MYMQ97X`-&a1yv0I5Fc+1&5g9wL>%^HzWsL<5pfe~ zt=*3Vlr=Q8nlw#E6wj`X-5(#~-uu^b)spr6vwa1c22VMN#3je)$7vnod)5J63BHW|K@^ zeG8v`euTB_-$N4<7?J-V-tJmJ2oj+N0%C1lGwEqI06bnF%O2Ydz`Cawgh=Rx$z){A z=xkE^BxjB=4VvWAC4~S)3?a|UP3NTz4{`0(MSQsX3r?0)F)}YBXk(V?7{<02KEJ|* z$@8dhXd}uJMRasDu`w26V=cJdUTSI@=;-Jo(h`fwl8GgC9%f5w(AHg#07$y7Hye$T zx1yrn+)KoPgU6_L6VRZl|O&rC@ybMm3RPoi} z??Xg{3$saP{kos?z@pbkaxNyIdT=Xly1IH04JP7p5=fM-gBuG12m&I2*(_I=SJa1O zC8ae06If01i z3@mX@BCVN7Ly-UkDL6xfrs?I?HBBL5d3hZGHe1|zC-lLt131SN;>f!_L})m;C?N&_ zzoMLX%wD|w!a_Q0KSB%m!Z#8`fFKc~ASA}cMTcaGiLn4QHn#V(2?R8HJU%o{M^yv3 zd%Wm+{|)D+8z*!0@ar5q@}DsG$gI0++eBqnhhIr+2jc>Vo!OeUGANHa;ccxK;ueb@=r z)wclPblStV84N2|%)!(4HGWTXcm};h2!asl_4?zoGE+jb3FDm@3?knbms3(&9r{1t z>EM%()-&_w;GVu{;q62YGtuW1O%E%V`i53coUCNb=xioU9QA|xHMK(*X|+bN>WMjY zRPP8YwjhWILU3th3If>e$su7@W(q}x)6jLD^)J3Nz}RG#0Wcb+(0`hyo%tQ~Y&I;` zJ@+<#zsgf9<_s0QT;9;oLqwOL?Amp*6K5xHhRw~=x z`IIMD{uV`10Z`QdE|+_NJC~~mfUd5AGJv+Wu23NW?jA2k|9O(4dsgw*w!LiLxP%+0 zO%Ca+Y9Qpx?e?Oo0ovPL?E2^+lEE-!SqBatW6iVgW6PUQIM=7%86g4Lj?853T!rMM zc)r}fg~dxY^759QY<+bXqef+N{6rk*vS0i+-r9q^#|yxe>lXHt&Aa#J zL5nJ{sORo`o*^-J!LVEAKq5d8MP9z^jvMCxX6vIv(yS;d#m6gXZ+DTFX2W4mMv~5| zd%QkGK}41%R5gIluV9Ia=;y=T<3%<~NRk0X37`f7!_F74&yPVAF&cwD{bw#}vTO`p z-WEN)0k7B3tDBe6?e;Kv$}iBPred{C42uMS?zZDp{%b2zgvmTAD=TH_UL!aQhB{#a zM3_zeboylzUaGDCCSi__;aD_I)!uA;PTl>aZDK2Z(k_hHoDtS z1Y_s|IeoXz9}~ - - - - - - - - - image/svg+xml - - - - - - - - - GFDL - - - - - - - diff --git a/htdocs/modulebuilder/template/dev/img/gpl-v3-logo.svg b/htdocs/modulebuilder/template/dev/img/gpl-v3-logo.svg deleted file mode 100644 index 6754c994bda..00000000000 --- a/htdocs/modulebuilder/template/dev/img/gpl-v3-logo.svg +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/htdocs/modulebuilder/template/dev/img/gplv3-127x51.png b/htdocs/modulebuilder/template/dev/img/gplv3-127x51.png deleted file mode 100644 index 3e9136e626683ac152b73bc8fffcb15d1806091a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3471 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 diff --git a/htdocs/modulebuilder/template/dev/img/gplv3-88x31.png b/htdocs/modulebuilder/template/dev/img/gplv3-88x31.png deleted file mode 100644 index ba78d4c4941dabf2fcac5409a92ac4c57920c69f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2666 zcmV-w3YGPVP)Px#32;bRa{vGVivR!tivi)#(!2lw00(qQO+^RT0uvMpF24YJ`L;(K) z{{a7>y{D4^014_zL_t(&-tC%skW|$b#(x5`77PlZ01Xf|tXfvU1+9P)Nl;9MMIeIW zf~A;|yxWx-F&@d<9Z!mSGK`{-NXD*+V< z1U?qnFHjo71r>243NtglEQV7Q5|M$wwPW#3mU1Xa75(4)}+D^1dj!r-wg;N!7wPTlz6cv~* zaG8PJ%ocdxi%_r(8VF2J2gJd((|x~-stE3f0*?zktgtfz_z{7D0<}|XS^^CmbayaJ zV6ea`S+E+%|4L05^x|!{8+(dT?jEM~Js`$27+y6h2%>GgYF0wJYE0l-O z)7o925Tv&W;2eAZgu;B5;j^dJ8-bz3oKpjkZt1g)zX^66mI| z)j_Xp5wNzxdh2k6HU6=}>lr5fjzC|47oe%aZiQ_MKeNs1Wz;5au`^ddqYxT8_`O0| z2+eKGVG3K)+k_Uu1%|7S@cDv!RA5U0Jp{%pe3tfppM%?rytQ5}8P;njwoMwi^#raG z_|!q~0P19O58V`YC~Ow^rGefh%fweYXuAOFEA&%1pirdH-T=NSi#0u9by^9`QxJv5 zHjl?NEpVEPINjb~s%aLOrIZQ$Er2cpYhwES(!o;>ZWd4fj>h!yt-vP^&Rzf~rSJ-% zg@aKFTLZW-2{m&$=#dIvD=Zf1XvcR*1&`sq0ThV$zmI09^NGMv1M6&ojS7EJsBiOF z8n;M=9{?nvrNFcK_*#Yg1^TDhK}Ke?#C57YX(PO#~hmZ&YIfXpm0?Of77b zcz4lUy){(?;9j;d=Zg=NarIQ8n^{2*frBCRE`gImI7i`?I3Q90+X5fTF_*Oh*9+WO z1x|lZpeTTXIJ}Zj$9dYg#Asf_jNm>ECo6nxzAm326$kDY0%zN14N};eq2A;GS}N34 z_?^POB%Ep+b3>f}wIrZv1mNKjYL#A=I=IZiomF5OUkN;%%t28n`n7hnwKmOUxi!^C z?!7sJ)RYjqCgH3A+6T}!^hf+gd!G=mbKa5;2^2Z#5Q*l| zfdhdl0@EDyF+dtC++#s#w6j4H&?112wh__NE(zy`FhF3r<@t|C0A7{B|L)KTzz$ld zr)$xAGn~&v$ExqQqQD+9qd48hXc$805H1yOr8Q%W^E8V!qcoEr7HA|sO)M9(j7va) zLPO)u<>K8*eH(mXo|E4b6{n4!WlMoas%ZhvALqY1(?UYejX$qum2H*6CFz(2o?R^x zDEv(hmVvj&jg=p^uDHvkZKlwQXnG#Q_KXL#Ubbsr9Nn7x7-IFOx}g0W@Fj z20>x8!ootY1Jtn~{dF~g`?~m)`Q!|iyHa6%kmfQnQM3*U9~p3ePDSc@Q2%*2Wf?S% zmJ%okp_W5IHRG)GOwilcdW(Gu*4g{T~>dyLTd*<7nqH5>P4bO#m15lF^bQk0@fXG4I;>Zi8G4~)h=aS0UnUjaR`^J~?z=+$ zHTWKdViR&!n`TiY-;I@$Nas4sHq*3$R%RqSBP!U};>Y>BK#9N@@vNzKHf)UY&9JQQ zCMxp?bTg|ev(NnmCWO%6!B~MAp&w|lz>EMc4xx`RjCHn%FPzVQekwkb8YeK{!Gi*~ zsNb|P0)6c!`IJklP`iK9vb6vc-7RoHJ0Nq5dRwk5m+UDA)gAo?O?LN0*eFN#QW*D#LIwjzkygL(4{)S zRcNGevoWb@0%ujrt~sxh79Qi@G*o92@TaP*zZ6=F7pc}Mlq8{3Nv<1-3c80vD-#)#iR!fAg3`3i=|n0Ep+VCB*yVN$x?2_YiZ5k$@3&Tcz#W!=Gm9%=?NxpL Y19h*OP%`Tk_W%F@07*qoM6N<$g8#_jNdN!< diff --git a/htdocs/modulebuilder/template/dev/img/mymodule.svg b/htdocs/modulebuilder/template/dev/img/mymodule.svg deleted file mode 100644 index f51ead1a94e..00000000000 --- a/htdocs/modulebuilder/template/dev/img/mymodule.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - M - - From 69141c9493e0c3c0804a359a70d1a5e96d843466 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2018 22:24:27 +0200 Subject: [PATCH 59/61] Fix PSR True->true and GETPOST file name for local checksum check --- htdocs/admin/system/filecheck.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 60c20dfafe7..e730b44821b 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -72,7 +72,7 @@ print '
'; $file_list = array('missing' => array(), 'updated' => array()); // Local file to compare to -$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml'; +$xmlshortfile = GETPOST('xmlshortfile','alpha')?GETPOST('xmlshortfile','alpha'):'/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)?'':$conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)'.xml'; $xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile; // Remote file to compare to $xmlremote = GETPOST('xmlremote'); @@ -83,8 +83,8 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa // Test if remote test is ok -$enableremotecheck = True; -if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False; +$enableremotecheck = true; +if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=false; $enableremotecheck = true; print '
'; From afa57fd66d0bb813dba2c25b4cdc2467ee38e8b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2018 23:33:20 +0200 Subject: [PATCH 60/61] Fix syntax error --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index e730b44821b..fa9d46bf327 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -72,7 +72,7 @@ print '
'; $file_list = array('missing' => array(), 'updated' => array()); // Local file to compare to -$xmlshortfile = GETPOST('xmlshortfile','alpha')?GETPOST('xmlshortfile','alpha'):'/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)?'':$conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)'.xml'; +$xmlshortfile = GETPOST('xmlshortfile','alpha')?GETPOST('xmlshortfile','alpha'):'/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)?'':$conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'; $xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile; // Remote file to compare to $xmlremote = GETPOST('xmlremote'); From 7fce02e72ef4fb3aee3b51078c2dd6b7333321d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2018 23:43:26 +0200 Subject: [PATCH 61/61] Fix phpunit test name --- test/phpunit/{AccountingAccount.php => AccountingAccountTest.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/phpunit/{AccountingAccount.php => AccountingAccountTest.php} (100%) diff --git a/test/phpunit/AccountingAccount.php b/test/phpunit/AccountingAccountTest.php similarity index 100% rename from test/phpunit/AccountingAccount.php rename to test/phpunit/AccountingAccountTest.php