From e9441f7881360dc47ec6e67f215f92562b480989 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 17:53:02 +0100 Subject: [PATCH 01/11] Fix name of log module to avoid confusion with blocked log --- htdocs/blockedlog/class/blockedlog.class.php | 4 +++- htdocs/core/modules/modBlockedLog.class.php | 2 ++ htdocs/core/modules/modSyslog.class.php | 2 ++ htdocs/langs/en_US/admin.lang | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index b4c0c8e6ef8..2f3c5d60640 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -742,7 +742,9 @@ class BlockedLog } /** - * Return a string for signature + * Return a string for signature. + * Note: rowid of line not included as it is not a business data and this allow to make backup of a year + * and restore it into another database with different id wihtout comprimising checksums * * @return string Key for signature */ diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index eece7323c68..9b3f4e16e9b 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -46,6 +46,8 @@ class modBlockedLog extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "base"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '90'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries."; diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 6ef7648531a..5f7ad0f387f 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -45,6 +45,8 @@ class modSyslog extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "base"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '50'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6d38cf87a99..8cf66be9e26 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -488,7 +488,7 @@ Module30Name=Invoices Module30Desc=Invoice and credit note management for customers. Invoice management for suppliers Module40Name=Suppliers Module40Desc=Supplier management and buying (orders and invoices) -Module42Name=Logs +Module42Name=Debug Logs Module42Desc=Logging facilities (file, syslog, ...). Such logs are for technical/debug purposes. Module49Name=Editors Module49Desc=Editor management @@ -588,8 +588,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=GeoIP Maxmind conversions capabilities Module3100Name=Skype Module3100Desc=Add a Skype button into users / third parties / contacts / members cards -Module3200Name=Non Reversible Logs -Module3200Desc=Activate log of some business events into a non reversible log. Events are archived in real-time. The log is a table of chained event that can be then read and exported. This module may be mandatory for some countries. +Module3200Name=Unalterable logs +Module3200Desc=Activate log of some business events into an unalterable log. Events are archived in real-time. The log is a table of chained events that can be read only and exported. This module may be mandatory for some countries. Module4000Name=HRM Module4000Desc=Human resources management (management of department, employee contracts and feelings) Module5000Name=Multi-company From cff1dc68275afb804f3d53ae2da3e2c3ad6a6e98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 17:57:49 +0100 Subject: [PATCH 02/11] Rename --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8cf66be9e26..f07f79b9cea 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -588,7 +588,7 @@ Module2900Name=GeoIPMaxmind Module2900Desc=GeoIP Maxmind conversions capabilities Module3100Name=Skype Module3100Desc=Add a Skype button into users / third parties / contacts / members cards -Module3200Name=Unalterable logs +Module3200Name=Unalterable Archives Module3200Desc=Activate log of some business events into an unalterable log. Events are archived in real-time. The log is a table of chained events that can be read only and exported. This module may be mandatory for some countries. Module4000Name=HRM Module4000Desc=Human resources management (management of department, employee contracts and feelings) From c922498e79d905b8fc86f41a1ba887a69a72da55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 20:35:25 +0100 Subject: [PATCH 03/11] Code comment --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fa8dadc4a65..bd7fa7b6fd4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5634,7 +5634,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob /** * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). - * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced + * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. + * Example of usage: + * $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); + * complete_substitutions_array($substitutionarray, $langs, $thirdparty); + * $mesg = make_substitutions($mesg, $substitutionarray, $langs); * * @param string $text Source string in which we must do substitution * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...) From 2c0eeaf8dedf15f7a84c4dbbc272d68c307130ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 20:57:51 +0100 Subject: [PATCH 04/11] FIX #8093 --- .../fourn/class/fournisseur.product.class.php | 9 ++++-- htdocs/product/fournisseurs.php | 29 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 17f8b2615ee..d34441ffd75 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -468,9 +468,11 @@ class ProductFournisseur extends Product * @param int $prodid Id of product * @param string $sortfield Sort field * @param string $sortorder Sort order + * @param int $limit Limit + * @param int $offset Offset * @return array Array of Products with new properties to define supplier price */ - function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='') + function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $limit=0, $offset=0) { global $conf; @@ -484,7 +486,8 @@ class ProductFournisseur extends Product $sql.= " AND s.status=1"; // only enabled company selected $sql.= " AND pfp.fk_product = ".$prodid; if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price"; - else $sql.= $this->db->order($sortfield,$sortorder); + else $sql.= $this->db->order($sortfield, $sortorder); + $sql.=$this->db->plimit($limit, $offset); dol_syslog(get_class($this)."::list_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); @@ -516,7 +519,7 @@ class ProductFournisseur extends Product $prodfourn->id = $prodid; $prodfourn->fourn_tva_npr = $record["info_bits"]; $prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; - $prodfourn->supplier_reputation = $record["supplier_reputation"]; + $prodfourn->supplier_reputation = $record["supplier_reputation"]; if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index cb295012795..2c49319fc19 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -65,6 +65,17 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product&product','','',$fieldtype); +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="s.nom"; +if (! $sortorder) $sortorder="ASC"; + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('pricesuppliercard','globalcard')); @@ -589,13 +600,21 @@ if ($id > 0 || $ref) print "\n\n"; print '
'; - if ($user->rights->fournisseur->lire) { + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + $param.='&ref='.urlencode($object->ref); + $product_fourn = new ProductFournisseur($db); - $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder); - $nbtotalofrecords = count($product_fourn_list); - print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($product_fourn_list), $nbtotalofrecords, 'title_accountancy.png'); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, $limit, $offset); + $product_fourn_list_all = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, 0, 0); + $nbtotalofrecords = count($product_fourn_list_all); + $num = count($product_fourn_list); + if (($num + ($offset * $limit)) < $nbtotalofrecords) $num++; + + print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); // Suppliers list title print '
'; @@ -606,7 +625,7 @@ if ($id > 0 || $ref) $param="&id=".$object->id; print ''; print_liste_field_titre("Suppliers",$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("SupplierRef"); + print_liste_field_titre("SupplierRef",$_SERVER["PHP_SELF"],"","",$param,"",$sortfield,$sortorder); if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre("Availability",$_SERVER["PHP_SELF"],"pfp.fk_availability","",$param,"",$sortfield,$sortorder); print_liste_field_titre("QtyMin",$_SERVER["PHP_SELF"],"pfp.quantity","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("VATRate",$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); From d3c0414b4f8f7c4b5cf0ce9979289464f3ea7bca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:16:36 +0100 Subject: [PATCH 05/11] Update changelog --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index a5fe90d2bbd..e6d061a58ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable FIX: #7903 FIX: #7933 FIX: #8029 Unable to make leave request in holyday module +FIX: #8093 +FIX: Bad name alias showing in name of third column +FIX: Cashdesk should not sell to inactive third parties FIX: Edit accountancy account and warning message on loan FIX: $accounts[$bid] is a label ! FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false @@ -16,6 +19,10 @@ FIX: product best price on product list FIX: search on contact list FIX: stats trad for customerinvoice FIX: translate unactivate on contractline +FIX: email sent was not in HTML +FIX: missing hook invoice index +FIX: subject mail sepa + ***** ChangeLog for 6.0.4 compared to 6.0.3 ***** FIX: #7737 From 4f9f1b51d7e9c2772c98a11056855d389b2dc662 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:34:49 +0100 Subject: [PATCH 06/11] Fix translation --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/ecm.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f07f79b9cea..cae43a9e3b5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -573,8 +573,8 @@ Module2300Name=Scheduled jobs Module2300Desc=Scheduled jobs management (alias cron or chrono table) Module2400Name=Events/Agenda Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. -Module2500Name=Electronic Content Management -Module2500Desc=Save and share documents +Module2500Name=DMS / ECM +Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. Module2600Name=API/Web services (SOAP server) Module2600Desc=Enable the Dolibarr SOAP server providing API services Module2610Name=API/Web services (REST server) diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 7428d226008..95318155813 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -14,8 +14,8 @@ ECMNbOfFilesInDir=Number of files in directory ECMNbOfSubDir=Number of sub-directories ECMNbOfFilesInSubDir=Number of files in sub-directories ECMCreationUser=Creator -ECMArea=EDM area -ECMAreaDesc=The EDM (Electronic Document Management) area allows you to save, share and search quickly all kind of documents in Dolibarr. +ECMArea=DMS/ECM area +ECMAreaDesc=The DMS/ECM (Document Management System / Electronic Content Management) area allows you to save, share and search quickly all kind of documents in Dolibarr. ECMAreaDesc2=* Automatic directories are filled automatically when adding documents from card of an element.
* Manual directories can be used to save documents not linked to a particular element. ECMSectionWasRemoved=Directory %s has been deleted. ECMSectionWasCreated=Directory %s has been created. From c0e719e3d8db0026a28be573abfb36c655e7588a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:39:42 +0100 Subject: [PATCH 07/11] Fix package scripts --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 20dfc2579aa..7ead2228b41 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Cwd; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 40b63be4b968c585423533adc47a57fb513ef809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:40:32 +0100 Subject: [PATCH 08/11] Fix package --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index bc755ef52a3..7da6d180dcb 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Term::ANSIColor; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 1be42a7af8170edad92c88ee79c586f720e5084f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 02:23:26 +0100 Subject: [PATCH 09/11] Fix comment --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 6eeff6cea11..4ff5e2492b7 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -140,7 +140,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex $action=''; } - header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back + header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a redirect to avoid to run twice the job when using back exit; } } From d751f9153fb5311c91782b4b82519d540390dd93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 10:21:53 +0100 Subject: [PATCH 10/11] Fix look and feel v7 --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 4ff5e2492b7..3933a30a54b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -270,7 +270,7 @@ else $buttontoshow.=''.$langs->trans("CronCreateJob").''; } -print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttontoshow, $num, $nbtotalofrecords, 'title_setup', 0, '', '', $limit); +print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_setup', 0, $buttontoshow, '', $limit); print $langs->trans('CronInfo').'
'; From 82c2079d40b9c69837bf517a6555cba474fa3a91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 10:23:24 +0100 Subject: [PATCH 11/11] Fix var not initialized --- htdocs/core/lib/admin.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 8ee3a8054e9..65cc2965bea 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -618,6 +618,7 @@ function security_prepare_head() // Show permissions lines + $nbPerms=0; $sql = "SELECT COUNT(r.id) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"