From f518bafda9e83acba2f42d61312ad234ee0afe33 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 19 May 2020 15:17:06 +0200 Subject: [PATCH 01/18] 11.0 - Add Hook "SelectWarehouses" --- htdocs/product/class/html.formproduct.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index af78ab5b59d..3f95a5fdaff 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -237,13 +237,23 @@ class FormProduct */ public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') { - global $conf,$langs,$user; + global $conf,$langs,$user, $hookmanager; dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG); $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; if (!empty($fk_product)) $this->cache_warehouses = array(); + if(empty($exclude)) $exclude = array(); + + $parameters = array( + 'exclude' =>& $exclude, + 'htmlname' =>& $htmlname + ); + + $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); From 987fb806c67b3931bafcc2aefc069428cde104cb Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 19 May 2020 15:24:53 +0200 Subject: [PATCH 02/18] Exclude array param --- htdocs/product/class/html.formproduct.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 3f95a5fdaff..75dbf5d1176 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -235,7 +235,7 @@ class FormProduct * * @throws Exception */ - public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') + public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = array(), $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') { global $conf,$langs,$user, $hookmanager; @@ -244,7 +244,6 @@ class FormProduct $out=''; if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; if (!empty($fk_product)) $this->cache_warehouses = array(); - if(empty($exclude)) $exclude = array(); $parameters = array( 'exclude' =>& $exclude, From 3f28c9a4610dbfb356efd8a72af19511e05f979f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 19 May 2020 15:31:37 +0200 Subject: [PATCH 03/18] Add parameters to hook --- htdocs/product/class/html.formproduct.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 75dbf5d1176..19abade42ae 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -246,8 +246,21 @@ class FormProduct if (!empty($fk_product)) $this->cache_warehouses = array(); $parameters = array( + 'selected' => & $selected, + 'htmlname' =>& $htmlname, + 'filterstatus' =>& $filterstatus, + 'empty' =>& $empty, + 'disabled ' =>& $disabled, + 'fk_product' =>& $fk_product, + 'empty_label' =>& $empty_label, + 'showstock' =>& $showstock, + 'forcecombo' =>& $forcecombo, + 'events' =>& $events, + 'morecss' =>& $morecss, 'exclude' =>& $exclude, - 'htmlname' =>& $htmlname + 'showfullpath' =>& $showfullpath, + 'stockMin' =>& $stockMin, + 'orderBy' =>& $orderBy ); $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters); From e042807b3245c2b1ad3331b1fe7e1122a4fb6fd9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 19 May 2020 15:58:16 +0200 Subject: [PATCH 04/18] Add $this to parameters --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 19abade42ae..8dc86f394a3 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -263,7 +263,7 @@ class FormProduct 'orderBy' =>& $orderBy ); - $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters); + $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters, $this); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); From 3213148d8717b5e8f6410b2da1225c059532927a Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 1 Jun 2020 17:12:02 +0200 Subject: [PATCH 05/18] FIX 11.0 - when using pdftk as per hidden conf USE_PDFTK_FOR_PDF_CONCAT, check that the file exists before displaying a success message --- htdocs/core/actions_massactions.inc.php | 16 ++++++++++------ htdocs/langs/en_US/main.lang | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b86e7bd692c..dc5b02286eb 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1030,14 +1030,18 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $input_files .= ' '.escapeshellarg($f); } - $cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file); + $cmd = 'pdftk ' . $input_files . ' cat output '.escapeshellarg($file); exec($cmd); - if (!empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); - - $langs->load("exports"); - setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); + // check if pdftk is installed + if (file_exists($file)) { + if (!empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); + } else { + setEventMessages($langs->trans('ErrorPDFTkOutputFileNotFound'), null, 'errors'); + } } else { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 31e0d5a1c8d..051dde11ff7 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -837,6 +837,7 @@ Sincerely=Sincerely ConfirmDeleteObject=Are you sure you want to delete this object? DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line? +ErrorPDFTkOutputFileNotFound=Error: the file was not generated. Please check that the 'pdftk' command is installed in a directory included in the $PATH environment variable (linux/unix only) or contact your system administrator. NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record TooManyRecordForMassAction=Too many records selected for mass action. The action is restricted to a list of %s records. NoRecordSelected=No record selected @@ -1017,4 +1018,4 @@ ContactDefault_ticket=Ticket ContactAddedAutomatically=Contact added from contact thirdparty roles More=More ShowDetails=Show details -CustomReports=Custom reports \ No newline at end of file +CustomReports=Custom reports From 2984edc752de5b9f719228ee941d8d9f903dc675 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Tue, 12 May 2020 15:39:17 +0100 Subject: [PATCH 06/18] fix:bad database quotation for booleans --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fd5e70c3669..8bec3f79099 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7915,6 +7915,10 @@ abstract class CommonObject { if (is_null($value)) return 'NULL'; elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) return $this->db->escape("$value"); + elseif($fieldsentry['type']=='boolean'){ + if($value) return 'true'; + else return 'false'; + } else return "'".$this->db->escape($value)."'"; } From 0f5eed60a2cd8ed355aeee2d69df2fea210fe7b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jun 2020 20:39:49 +0200 Subject: [PATCH 07/18] Update commonobject.class.php --- 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 8bec3f79099..f2b669d4e92 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7915,8 +7915,8 @@ abstract class CommonObject { if (is_null($value)) return 'NULL'; elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) return $this->db->escape("$value"); - elseif($fieldsentry['type']=='boolean'){ - if($value) return 'true'; + elseif ($fieldsentry['type'] == 'boolean') { + if ($value) return 'true'; else return 'false'; } else return "'".$this->db->escape($value)."'"; From cb551cfd5a070c4e19fa63346fcac6b7e922dbaa Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Mon, 11 May 2020 14:55:37 +0100 Subject: [PATCH 08/18] fix:non editable fields must not be editable in creation either --- htdocs/core/tpl/commonfields_add.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index a31cd3eb778..0bf2a60d0fe 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -56,7 +56,8 @@ foreach ($object->fields as $key => $val) if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none'); else $value = GETPOST($key, 'alpha'); - print $object->showInputField($val, $key, $value, '', '', '', 0); + if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); + else print $object->showInputField($val, $key, $value, '', '', '', 0); print ''; print ''; } From f2c7db63cfd5643d1703d7653bbc73a4eb37541c Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Sun, 10 May 2020 19:30:28 +0100 Subject: [PATCH 09/18] =?UTF-8?q?fix:le=20r=C3=A9sultat=20de=20explode=20e?= =?UTF-8?q?st=20troujours=20un=20array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 f2b669d4e92..8aad7b864b3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6316,7 +6316,7 @@ abstract class CommonObject // Several field into label (eq table:code|libelle:rowid) $notrans = false; $fields_label = explode('|', $InfoFieldList[1]); - if (is_array($fields_label)) + if (count($fields_label)>1) { $notrans = true; foreach ($fields_label as $field_toshow) @@ -6488,7 +6488,7 @@ abstract class CommonObject $notrans = false; // Several field into label (eq table:code|libelle:rowid) $fields_label = explode('|', $InfoFieldList[1]); - if (is_array($fields_label)) { + if (count($fields_label)>1) { $notrans = true; foreach ($fields_label as $field_toshow) { $labeltoshow .= $obj->$field_toshow.' '; From 6ddabd51c083e7c88c05ce374b214d726e02d0e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jun 2020 21:02:05 +0200 Subject: [PATCH 10/18] Update commonobject.class.php --- 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 8aad7b864b3..fd6a11998ed 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6316,7 +6316,7 @@ abstract class CommonObject // Several field into label (eq table:code|libelle:rowid) $notrans = false; $fields_label = explode('|', $InfoFieldList[1]); - if (count($fields_label)>1) + if (count($fields_label) > 1) { $notrans = true; foreach ($fields_label as $field_toshow) @@ -6488,7 +6488,7 @@ abstract class CommonObject $notrans = false; // Several field into label (eq table:code|libelle:rowid) $fields_label = explode('|', $InfoFieldList[1]); - if (count($fields_label)>1) { + if (count($fields_label) > 1) { $notrans = true; foreach ($fields_label as $field_toshow) { $labeltoshow .= $obj->$field_toshow.' '; From 99b4bfc91e1a149285b9439e63f5464399c36fd9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 2 Jun 2020 09:53:30 +0200 Subject: [PATCH 11/18] Movement of hook "selectwarehouse" --- .../product/class/html.formproduct.class.php | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 8dc86f394a3..f033e91ceff 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -245,27 +245,6 @@ class FormProduct if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = ''; if (!empty($fk_product)) $this->cache_warehouses = array(); - $parameters = array( - 'selected' => & $selected, - 'htmlname' =>& $htmlname, - 'filterstatus' =>& $filterstatus, - 'empty' =>& $empty, - 'disabled ' =>& $disabled, - 'fk_product' =>& $fk_product, - 'empty_label' =>& $empty_label, - 'showstock' =>& $showstock, - 'forcecombo' =>& $forcecombo, - 'events' =>& $events, - 'morecss' =>& $morecss, - 'exclude' =>& $exclude, - 'showfullpath' =>& $showfullpath, - 'stockMin' =>& $stockMin, - 'orderBy' =>& $orderBy - ); - - $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters, $this); - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - $this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude, $stockMin, $orderBy); $nbofwarehouses=count($this->cache_warehouses); @@ -304,6 +283,27 @@ class FormProduct $out.=''; if ($disabled) $out.=''; + $parameters = array( + 'selected' => $selected, + 'htmlname' => $htmlname, + 'filterstatus' => $filterstatus, + 'empty' => $empty, + 'disabled ' => $disabled, + 'fk_product' => $fk_product, + 'empty_label' => $empty_label, + 'showstock' => $showstock, + 'forcecombo' => $forcecombo, + 'events' => $events, + 'morecss' => $morecss, + 'exclude' => $exclude, + 'showfullpath' => $showfullpath, + 'stockMin' => $stockMin, + 'orderBy' => $orderBy + ); + + $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters, $this); + if ($reshook > 0) $out = $hookmanager->resPrint; + return $out; } From 88a831c05abba711908df2b17e28dade35b9f1b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 12:12:07 +0200 Subject: [PATCH 12/18] Update html.formproduct.class.php --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index f033e91ceff..56601accebe 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -235,7 +235,7 @@ class FormProduct * * @throws Exception */ - public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = array(), $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') + public function selectWarehouses($selected = '', $htmlname = 'idwarehouse', $filterstatus = '', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $showstock = 0, $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = '', $showfullpath = 1, $stockMin = false, $orderBy = 'e.ref') { global $conf,$langs,$user, $hookmanager; From 009780b895d4dfb8c7b22e76250f86df368763a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 12:13:55 +0200 Subject: [PATCH 13/18] Update html.formproduct.class.php --- htdocs/product/class/html.formproduct.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 56601accebe..5030722bb73 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -303,6 +303,7 @@ class FormProduct $reshook = $hookmanager->executeHooks('selectWarehouses', $parameters, $this); if ($reshook > 0) $out = $hookmanager->resPrint; + elseif ($reshook == 0) $out .= $hookmanager->resPrint; return $out; } From a9973ad60eba9d5cd97ca8a3dc2c33a221440fd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 15:30:07 +0200 Subject: [PATCH 14/18] Fix language key and css --- htdocs/barcode/codeinit.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- htdocs/theme/eldy/global.inc.php | 6 ++++-- htdocs/theme/eldy/theme_vars.inc.php | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index d2afa5e6871..1bfb1836a39 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -211,7 +211,7 @@ if ($conf->societe->enabled) { $nbno = $nbtotal = 0; - print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'title_companies'); + print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); print '
'."\n"; $sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a7fa6d2aa55..b42195c02f7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -452,7 +452,7 @@ SetAsDefault=Set as default ValueOverwrittenByUserSetup=Warning, this value may be overwritten by user specific setup (each user can set his own clicktodial url) ExternalModule=External module InstalledInto=Installed into directory %s -BarcodeInitForthird-parties=Mass barcode init for third-parties +BarcodeInitForThirdparties=Mass barcode init for third-parties BarcodeInitForProductsOrServices=Mass barcode init or reset for products or services CurrentlyNWithoutBarCode=Currently, you have %s record on %s %s without barcode defined. InitEmptyBarCode=Init value for next %s empty records diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 19c513dff28..7a92b97e446 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3995,8 +3995,10 @@ div.titre { .tertiary { color: var(--colortexttitlenotab2); } -table.table-fiche-title:first-of-type div { - color: var(--colortexttitlenotab); +div.fiche > table.table-fiche-title:first-of-type div { + /* color: var(--colortexttitlenotab); */ + color: #606060; + font-weight: 600; } table.table-fiche-title .col-title div.titre{ diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 0677c8e4918..e76f0bcf56c 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,8 +67,8 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '248,247,244'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,123,140'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 -$colortexttitlenotab2 = '100,0,100'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 +$colortexttitlenotab = '0,123,140'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,123,140, violet: 0,50,120 +$colortexttitlenotab2 = '100,0,100'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,123,140, violet: 0,50,120 $colortexttitle = '0,0,0'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; From 054d5c5f4c2e4c7d08a7657df8fb95fc659397fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 17:00:08 +0200 Subject: [PATCH 15/18] css --- htdocs/theme/eldy/global.inc.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 7a92b97e446..15a58295949 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3989,17 +3989,20 @@ div.titre { padding-top: 5px; padding-bottom: 5px; } -.secondary, div.titre { +div.fiche > table.table-fiche-title:first-of-type div { + color: var(--colortexttitlenotab); + /* font-weight: 600; */ +} +div.titre { + color: var(--colortexttitlenotab); +} + +.secondary { color: var(--colortexttitlenotab); } .tertiary { color: var(--colortexttitlenotab2); } -div.fiche > table.table-fiche-title:first-of-type div { - /* color: var(--colortexttitlenotab); */ - color: #606060; - font-weight: 600; -} table.table-fiche-title .col-title div.titre{ line-height: 40px; From 9e6bb6f784c69749ce56f378c6f86a87c077f917 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 20:19:45 +0200 Subject: [PATCH 16/18] Sanitize params --- htdocs/commande/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 21f558219eb..795602cd95d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1160,7 +1160,7 @@ if (empty($reshook)) elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse'); + $idwarehouse = GETPOST('idwarehouse', 'int'); $qualified_for_stock_change = 0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) @@ -1269,7 +1269,7 @@ if (empty($reshook)) elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse'); + $idwarehouse = GETPOST('idwarehouse', 'int'); $qualified_for_stock_change = 0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) From 71cb17b58b8cf07710bd90851a9f0d6293bf39b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jun 2020 20:58:18 +0200 Subject: [PATCH 17/18] css --- htdocs/admin/company.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f33a3ea6f93..d7761557f22 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -495,7 +495,9 @@ if (!empty($mysoc->logo_mini)) { } print ''; } else { + print '
'; print ''; + print '
'; } print ''; print ''; @@ -513,7 +515,9 @@ if (!empty($mysoc->logo_squarred_mini)) { } print ''; } else { + print '
'; print ''; + print '
'; } print ''; print ''; From a37a4031e9878abf3f1ce884e569b701dcfb3fff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 3 Jun 2020 00:46:09 +0200 Subject: [PATCH 18/18] FIX Delete of website page need permission. Conflict with mass action. Conflicts: htdocs/core/actions_massactions.inc.php htdocs/website/index.php --- htdocs/core/actions_massactions.inc.php | 5 +- htdocs/core/class/html.form.class.php | 28 +++--- htdocs/core/lib/website2.lib.php | 4 +- htdocs/website/index.php | 123 ++++++++++++++++++------ 4 files changed, 116 insertions(+), 44 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e19530ec209..40e6849d494 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -913,9 +913,10 @@ if (!$error && $massaction == 'cancelorders') setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidToBeCanceled", $cmd->ref), null, 'errors'); $error++; break; - } - else + } else { + // TODO We do not provide warehouse so no stock change here for the moment. $result = $cmd->cancel(); + } if ($result < 0) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5d7e008e062..9540c9eef84 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4194,18 +4194,18 @@ class Form * print '});'."\n"; * print ''."\n"; * - * @param string $page Url of page to call if confirmation is OK. Can contains parameters (param 'action' and 'confirm' will be reformated) - * @param string $title Title - * @param string $question Question - * @param string $action Action - * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) - * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ... - * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' - * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx - * @param int $height Force height of box (0 = auto) - * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. - * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a
section. - * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form + * @param string $page Url of page to call if confirmation is OK. Can contains parameters (param 'action' and 'confirm' will be reformated) + * @param string $title Title + * @param string $question Question + * @param string $action Action + * @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) + * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ... + * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' + * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx + * @param int $height Force height of box (0 = auto) + * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. + * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a section. + * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0) { @@ -4359,7 +4359,7 @@ class Form } // Show JQuery confirm box. $formconfirm .= ''; // Close current websitebar to open a new one @@ -2915,7 +2973,10 @@ if ($action == 'editcss') // JS file print ''; - print $langs->trans('WEBSITE_JS_INLINE'); + $textwithhelp = $langs->trans('WEBSITE_JS_INLINE'); + $htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'
'; + print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmljstooltip2'); + print ''; $doleditor = new DolEditor('WEBSITE_JS_INLINE', $jscontent, '', '220', 'ace', 'In', true, false, 'ace', 0, '100%', ''); @@ -3210,6 +3271,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $objectpage->fk_user_creat; $pageusermodifid = $objectpage->fk_user_modif; $pageauthoralias = $objectpage->author_alias; + $pagestatus = $objectpage->status; } else { @@ -3218,6 +3280,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $user->id; $pageusermodifid = 0; $pageauthoralias = ''; + $pagestatus = 1; } if (GETPOST('WEBSITE_TITLE', 'alpha')) $pagetitle = GETPOST('WEBSITE_TITLE', 'alpha'); if (GETPOST('WEBSITE_PAGENAME', 'alpha')) $pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha'); @@ -3228,20 +3291,6 @@ if ($action == 'editmeta' || $action == 'createcontainer') if (GETPOST('WEBSITE_LANG', 'aZ09')) $pagelang = GETPOST('WEBSITE_LANG', 'aZ09'); if (GETPOST('htmlheader', 'none')) $pagehtmlheader = GETPOST('htmlheader', 'none'); - // Title - print ''; - print $langs->trans('WEBSITE_TITLE'); - print ''; - print ''; - print ''; - - // Alias - print ''; - print $langs->trans('WEBSITE_PAGENAME'); - print ''; - print ''; - print ''; - // Type of container print ''; print $langs->trans('WEBSITE_TYPE_CONTAINER'); @@ -3258,6 +3307,20 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; } + // Title + print ''; + print $langs->trans('WEBSITE_TITLE'); + print ''; + print ''; + print ''; + + // Alias + print ''; + print $langs->trans('WEBSITE_PAGENAME'); + print ''; + print ''; + print ''; + print ''; print $langs->trans('WEBSITE_DESCRIPTION'); print ''; @@ -3548,7 +3611,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print ''; - print ''."\n"; + print ''."\n"; print '

'; print load_fiche_titre($langs->trans("ReplaceWebsiteContent"), '', 'search'); @@ -3556,7 +3619,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print '
'; print '
'; - print '
'; + print '
'; print $langs->trans("SearchReplaceInto"); print '
'; print '
'; @@ -3593,15 +3656,15 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $param = ''; $nbtotalofrecords = count($listofpages['list']); $num = $limit; - $permissiontodelete = 0; + $permissiontodelete = $user->rights->website->delete; // List of mass actions available $arrayofmassactions = array(); - if ($user->rights->website->writephp) $arrayofmassactions['replace'] = $langs->trans("Replace"); - if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + if ($user->rights->website->writephp && $searchkey) $arrayofmassactions['replace'] = $langs->trans("Replace"); + //if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); - $massactionbutton .= '