From 1feb22ea9c0f22ca663d7a6b109baa6b8a58953c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 21 Mar 2018 22:24:11 +0100 Subject: [PATCH 01/11] fix user right on modRessource --- htdocs/core/modules/modResource.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 7ab7afc1e4b..0f6ac3635b3 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -231,7 +231,7 @@ class modResource extends DolibarrModules 'langs'=> 'resource', 'position'=> 101, 'enabled'=> '1', - 'perms'=> '$user->rights->resource->read', + 'perms'=> '$user->rights->resource->write', 'target'=> '', 'user'=> 0 ); @@ -255,7 +255,7 @@ class modResource extends DolibarrModules // Exports //-------- $r=0; - + $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="ResourceSingular"; // Translation key (used only if key ExportDataset_xxx_z not found) @@ -265,19 +265,19 @@ class modResource extends DolibarrModules $this->export_entities_array[$r]=array('r.rowid'=>'resource','r.ref'=>'resource','c.code'=>'resource','c.label'=>'resource','r.description'=>'resource','r.note_private'=>"resource",'r.resource'=>"resource",'r.asset_number'=>'resource','r.datec'=>"resource",'r.tms'=>"resource"); $keyforselect='resource'; $keyforelement='resource'; $keyforaliasextra='extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - + $this->export_dependencies_array[$r]=array('resource'=>array('r.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'resource as r '; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = c.rowid'; $this->export_sql_end[$r] .=' AND r.entity IN ('.getEntity('resource').')'; - + // Imports //-------- $r=0; - + // Import list of third parties and attributes $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; @@ -307,7 +307,7 @@ class modResource extends DolibarrModules $this->import_regex_array[$r]=array('s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$'); $this->import_examplevalues_array[$r]=array('r.ref'=>"REF1",'r.fk_code_type_resource'=>"Code from dictionary resource type",'r.datec'=>"2017-01-01 or 2017-01-01 12:30:00"); $this->import_updatekeys_array[$r]=array('r.rf'=>'ResourceFormLabel_ref'); - + } /** From b5f37301a5a10933b34390766ef003f9a5473ed3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Mar 2018 16:18:11 +0100 Subject: [PATCH 02/11] Fix: uniformize getEntity('intervention') --- .../class/api_interventions.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 23 ++++++++----------- htdocs/fichinter/index.php | 16 ++++++------- htdocs/fichinter/list.php | 4 ++-- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 2cfe14c7197..d840b13ec58 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -124,7 +124,7 @@ class Interventions extends DolibarrApi if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale - $sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')'; + $sql.= ' WHERE t.entity IN ('.getEntity('intervention').')'; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6ee279d2015..4dee1f94f24 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -128,7 +128,7 @@ class Fichinter extends CommonObject $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")"; + $sql.= " ".$clause." fi.entity IN (".getEntity('intervention').")"; $resql=$this->db->query($sql); if ($resql) @@ -348,7 +348,10 @@ class Fichinter extends CommonObject $sql.= " f.tms as datem,"; $sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; - if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'"; + if ($ref) { + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.ref='".$this->db->escape($ref)."'"; + } else $sql.= " WHERE f.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -783,7 +786,6 @@ class Fichinter extends CommonObject $sql.= " f.fk_user_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.rowid = ".$id; - $sql.= " AND f.entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) @@ -887,7 +889,6 @@ class Fichinter extends CommonObject // Delete object $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; dol_syslog("Fichinter::delete", LOG_DEBUG); $resql = $this->db->query($sql); @@ -951,7 +952,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET datei = '".$this->db->idate($date_delivery)."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; $sql.= " AND fk_statut = 0"; if ($this->db->query($sql)) @@ -985,7 +985,6 @@ class Fichinter extends CommonObject $sql.= " SET description = '".$this->db->escape($description)."',"; $sql.= " fk_user_modif = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1018,7 +1017,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET fk_contrat = '".$contractid."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1401,7 +1399,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1463,7 +1461,7 @@ class FichinterLigne extends CommonObjectLine $sql.= ",date='".$this->db->idate($this->datei)."'"; $sql.= ",duree=".$this->duration; $sql.= ",rang='".$this->db->escape($this->rang)."'"; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog("FichinterLigne::update", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1472,7 +1470,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1541,7 +1539,6 @@ class FichinterLigne extends CommonObjectLine $sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null"); $sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null"); $sql.= " WHERE rowid = ".$this->fk_fichinter; - $sql.= " AND entity = ".$conf->entity; dol_syslog("FichinterLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1580,10 +1577,10 @@ class FichinterLigne extends CommonObjectLine if ($this->statut == 0) { - dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid); + dol_syslog(get_class($this)."::deleteline lineid=".$this->id); $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->id; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index d7cae075eb1..1a4068f5911 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -81,8 +81,8 @@ $sql = "SELECT count(f.rowid), f.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND f.entity IN (".getEntity('societe').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY f.fk_statut"; @@ -180,8 +180,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 0"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -228,8 +228,8 @@ $sql.= " s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND f.entity IN (".getEntity('commande').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; //$sql.= " AND c.fk_statut > 2"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -299,8 +299,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 1"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 49cb1837d35..d9f2097a5bf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -194,8 +194,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE f.fk_soc = s.rowid "; -$sql.= " AND f.entity = ".$conf->entity; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($search_ref) { $sql .= natural_search('f.ref', $search_ref); } From 9cf66e53f671c8d3ebeb28fc743ace7e78de9b63 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Mar 2018 16:39:47 +0100 Subject: [PATCH 03/11] Fix: wrong module name --- htdocs/core/lib/company.lib.php | 2 +- htdocs/user/param_ihm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3f7c45dda52..c7b75521a59 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -167,7 +167,7 @@ function societe_prepare_head(Societe $object) } // Related items - if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->fournisseur->enabled)) + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 81e8996aff2..64913683276 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -162,7 +162,7 @@ if (! empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=comp if (! empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu=']='ProjectsArea'; if (! empty($conf->holiday->enabled) || ! empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu=']='HRMArea'; // TODO Complete list with first level of menus if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu=']='ProductsAndServicesArea'; -if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; +if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; if (! empty($conf->compta->enabled) || ! empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu=']='AccountancyTreasuryArea'; if (! empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu=']='MembersArea'; if (! empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu=']='Agenda'; From 9f67bb0aa3b42048a3c58ba6a247f51bdbe317c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 21:58:24 +0100 Subject: [PATCH 04/11] Start 6.0.7 --- 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 660e81e7ee6..7f5b0f5e746 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.6'); // 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.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 46d2b4d62dcd84884d2eb6caaf7db2118f1abb0c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 22 Mar 2018 23:25:54 +0100 Subject: [PATCH 05/11] fix security check on fourn card --- htdocs/fourn/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index d99df78c27c..9a9cdd190a9 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -50,7 +50,7 @@ $cancelbutton = GETPOST('cancel'); // Security check $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe'); +$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid'); $object = new Fournisseur($db); $extrafields = new ExtraFields($db); @@ -107,7 +107,7 @@ if (empty($reshook)) // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - + if ($ret < 0) $error++; if (! $error) { From c12469860aa2564f59626ab512c72d1584ba37a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:10 +0100 Subject: [PATCH 06/11] Update lang --- htdocs/langs/en_NZ/companies.lang | 3 +++ htdocs/langs/en_NZ/compta.lang | 3 +++ htdocs/langs/en_NZ/main.lang | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/htdocs/langs/en_NZ/companies.lang b/htdocs/langs/en_NZ/companies.lang index fd92c40825e..afa8538da3b 100644 --- a/htdocs/langs/en_NZ/companies.lang +++ b/htdocs/langs/en_NZ/companies.lang @@ -3,3 +3,6 @@ VATIsUsed=GST is used VATIsNotUsed=GST is not used VATIntra=GST number VATIntraShort=GST number +VATIntraVeryShort=GST +VATIntraSyntaxIsValid=Syntax is valid +VATIntraValueIsValid=Value is valid diff --git a/htdocs/langs/en_NZ/compta.lang b/htdocs/langs/en_NZ/compta.lang index 90936c6ccf4..7b85434bb5c 100644 --- a/htdocs/langs/en_NZ/compta.lang +++ b/htdocs/langs/en_NZ/compta.lang @@ -9,3 +9,6 @@ VATPaid=GST paid VATCollected=GST collected VATPayment=GST Payment VATPayments=GST Payments +NewVATPayment=New GST payment +TotalToPay=Total to pay +TotalVATReceived=Total GST received \ No newline at end of file diff --git a/htdocs/langs/en_NZ/main.lang b/htdocs/langs/en_NZ/main.lang index 45235b7bf39..2af1b36ceb0 100644 --- a/htdocs/langs/en_NZ/main.lang +++ b/htdocs/langs/en_NZ/main.lang @@ -19,11 +19,16 @@ FormatDateHourShort=%d/%m/%Y %H:%M FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p FormatDateHourTextShort=%d %b %Y %H:%M FormatDateHourText=%d %B %Y %H:%M +UnitPrice=Unit price UnitPriceHT=Unit price (excl GST) +UnitPriceTTC=Unit price AmountHT=Amount (excl GST) AmountTTC=Amount (incl GST) AmountVAT=Amount GST +PriceQtyHT=Price for this quantity excl GST PriceQtyMinHT=Price quantity min. excl GST +PriceQtyTTC=Price for this quantity incl GST +PriceQtyMinTTC=Price quantity min. incl GST TotalHT=Total (excl GST) TotalTTC=Total (incl GST) TotalTTCToYourCredit=Total (incl GST) to your credit From a15abb2dedfb6e49245b36937558c481792e4ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:28 +0100 Subject: [PATCH 07/11] Update lang --- htdocs/langs/en_NZ/sendings.lang | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 htdocs/langs/en_NZ/sendings.lang diff --git a/htdocs/langs/en_NZ/sendings.lang b/htdocs/langs/en_NZ/sendings.lang new file mode 100644 index 00000000000..ceb733e140f --- /dev/null +++ b/htdocs/langs/en_NZ/sendings.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - en_NZ - main +# This file contains only line that must differs from en_US file +SendingSheet=Packing Slip \ No newline at end of file From 83b6dd4cb95adf57035a57321628933e8e26686b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:56 +0100 Subject: [PATCH 08/11] Prepare 7.0.2 --- 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 3fc57df1967..fd2afa56fd1 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.1'); // 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.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From caa43ae2f63ce10d75a917f43854520b1bb09289 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 23 Mar 2018 17:35:46 +0100 Subject: [PATCH 09/11] Make helper methods available for derived classes. Use-case: a module build with modulebuilder can make it's own fetch method using the helper methods. --- htdocs/core/class/commonobject.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 63788a32569..8d08b828fd1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6111,7 +6111,7 @@ abstract class CommonObject * * @return array */ - private function set_save_query() + protected function set_save_query() { global $conf; @@ -6165,7 +6165,7 @@ abstract class CommonObject * * @param stdClass $obj Contain data of object from database */ - private function setVarsFromFetchObj(&$obj) + protected function setVarsFromFetchObj(&$obj) { foreach ($this->fields as $field => $info) { @@ -6210,7 +6210,7 @@ abstract class CommonObject * * @return string */ - private function get_field_list() + protected function get_field_list() { $keys = array_keys($this->fields); return implode(',', $keys); From a3c199e9e3e73422e27d1c8bc8e7e691ec4c03c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:10:04 +0100 Subject: [PATCH 10/11] FIX Missing include --- htdocs/core/class/html.formaccounting.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 5fd67659e15..aaae010c2fe 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -24,6 +24,7 @@ * \ingroup Advanced accountancy * \brief File of class with all html predefined components */ +require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; /** From 224fa1c03ef58da99a9cb2e69a92ad564d821a7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:46:52 +0100 Subject: [PATCH 11/11] Fix external links ko when substitution key are inside domain --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/menus/standard/auguria_menu.php | 11 +++++++++-- htdocs/core/menus/standard/eldy_menu.php | 12 ++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7cb2236524a..20ab5aad7a9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5650,8 +5650,8 @@ 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. + * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval), + * and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. * Example of usage: * $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); * complete_substitutions_array($substitutionarray, $langs, $thirdparty); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 080e9ef81dc..df31b9c9d8f 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -237,9 +237,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 9ef1421daf2..f81d7d36c72 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -185,6 +185,7 @@ class MenuManager $tmpleftmenu='all'; $submenu=new Menu(); print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home) + // Note: $submenu contains menu entry with substitution not yet done //if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; } //if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; } $nexturl=dol_buildpath($submenu->liste[0]['url'],1); @@ -247,9 +248,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';