From ef890a29ebc51c1c228808585c5b5305b414dc42 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Fri, 24 Apr 2020 16:26:48 +0100 Subject: [PATCH 01/29] =?UTF-8?q?fix:Le=20label=20doit=20=C3=AAtre=20une?= =?UTF-8?q?=20cl=C3=A9=20de=20dictionnaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2209dbf92d4..956ceb0cfd3 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -711,7 +711,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', $notnull = ($obj->Null == 'YES' ? 0 : 1); if ($fieldname == 'fk_user_modif') $notnull = -1; // label - $label = preg_replace('/_/', ' ', ucfirst($fieldname)); + $label = $fieldname; if ($fieldname == 'rowid') $label = 'TechnicalID'; if ($fieldname == 'import_key') $label = 'ImportId'; if ($fieldname == 'fk_soc') $label = 'ThirdParty'; From 7da6a063f977dbb5569b2d80455649d8d640a685 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 4 Jun 2020 16:46:36 +0200 Subject: [PATCH 02/29] Update llx_subscription.sql --- htdocs/install/mysql/tables/llx_subscription.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_subscription.sql b/htdocs/install/mysql/tables/llx_subscription.sql index a3562f12c57..03d24c68f6e 100644 --- a/htdocs/install/mysql/tables/llx_subscription.sql +++ b/htdocs/install/mysql/tables/llx_subscription.sql @@ -24,7 +24,7 @@ create table llx_subscription fk_adherent integer, fk_type integer, dateadh datetime, - datef date, + datef datetime, subscription double(24,8), fk_bank integer DEFAULT NULL, fk_user_creat integer DEFAULT NULL, From 319710d6aa7df937a10ad34aa606f035a55b4b35 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 4 Jun 2020 16:50:24 +0200 Subject: [PATCH 03/29] Update 12.0.0-13.0.0.sql --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 58d28dcd6a3..163fec01b3f 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -43,3 +43,4 @@ UPDATE llx_establishment SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_establishment MODIFY COLUMN ref varchar(30) NOT NULL; ALTER TABLE llx_establishment MODIFY COLUMN name varchar(128); +ALTER TABLE llx_subscription MODIFY COLUMN datef DATETIME; From ded7b79a6f69544cbf7b1fe4ab09b83246012191 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 5 Jun 2020 12:10:03 +0200 Subject: [PATCH 04/29] FIX free text on cash desk --- htdocs/takepos/admin/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index f331587723b..e6db38716bc 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -74,8 +74,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'none'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); From 37007d6d1a14d6219b309734f97317d1ad278e52 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 7 Jun 2020 16:12:28 +0200 Subject: [PATCH 05/29] Update subscription.class.php --- htdocs/adherents/class/subscription.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index cdc70cf0cd1..5a75fdbae2e 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -99,7 +99,7 @@ class Subscription extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>20), 'fk_adherent' =>array('type'=>'integer', 'label'=>'Member', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'dateadh' =>array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'datef' =>array('type'=>'date', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'datef' =>array('type'=>'datetime', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35), 'subscription' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'position'=>40, 'isameasure'=>1), 'fk_bank' =>array('type'=>'integer', 'label'=>'BankId', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'note' =>array('type'=>'text', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>50), From 7bba9db2f0c5fc514414e269e9c48f920a0189cf Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 8 Jun 2020 11:28:05 +0200 Subject: [PATCH 06/29] FIX replace filter parameter "none" by "restricthtml" --- htdocs/takepos/admin/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index e6db38716bc..e79faf17de0 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -74,8 +74,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'none'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity); From f01018400846e18fcd519307b052f6c08094b557 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 8 Jun 2020 11:48:31 +0200 Subject: [PATCH 07/29] FIX replace filter parameter "none" by "restricthtml" --- htdocs/takepos/admin/terminal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 54e5de37a5c..49b99daf280 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -95,8 +95,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_ADDON".$terminaltouse, GETPOST('TAKEPOS_ADDON'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity); // add free text on each terminal of cash desk - $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); From e628730a3f73effe351b38988343c0e94aa51e24 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 9 Jun 2020 11:32:34 +0200 Subject: [PATCH 08/29] Add show preview for mail attachement on form mail --- htdocs/core/class/html.formmail.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 29ccbde0f02..96c99ebba36 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -319,6 +319,10 @@ class FormMail extends Form // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; + // Required to show preview of mail attachments + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new Formfile($this->db); + if (!is_object($form)) $form = new Form($this->db); // Load translation files required by the page @@ -845,7 +849,10 @@ class FormMail extends Form foreach ($listofpaths as $key => $val) { $out .= '
'; + // Preview of attachment + preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT)-strlen($val))), $formfile_params); $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; From 0a2099e0ac22763d9f3f23dba6df03f6b50be7a5 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 9 Jun 2020 14:22:32 +0200 Subject: [PATCH 09/29] FIX 10.0 - undefined $langs if template file copy fails during activation of modContrat --- htdocs/core/modules/modContrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index b3053cceae0..e29868e6994 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -214,7 +214,7 @@ class modContrat extends DolibarrModules */ public function init($options = '') { - global $conf; + global $conf, $langs; // Nettoyage avant activation $this->remove($options); From 1ac341e6519555d97d0c0a2f27d303a6ef8e96b3 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 9 Jun 2020 15:33:10 +0200 Subject: [PATCH 10/29] Fix undef func measuringUnitString() in From::select_produits_fournisseurs_list --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 13db485ec70..1e1bbdf58d2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2802,6 +2802,7 @@ class Form if ($result) { require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; $num = $this->db->num_rows($result); From d19febc2ca56836269075f95568b10ea8aa3ad2d Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 9 Jun 2020 17:34:24 +0200 Subject: [PATCH 11/29] FIX: missing translation value for key "NoMorePredefinedProductToDispatch" --- htdocs/langs/en_US/receptions.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 010a7521846..760ff884fa0 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -43,3 +43,5 @@ ProductQtyInSuppliersReceptionAlreadyRecevied=Product quantity from open supplie ValidateOrderFirstBeforeReception=You must first validate the order before being able to make receptions. ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions +NoMorePredefinedProductToDispatch=No more predefined products to dispatch + From 9bbdaffe9ddf09b95bbce53ab8df4d53e465a09f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 00:01:41 +0200 Subject: [PATCH 12/29] FIX Sharing buttons --- htdocs/core/lib/website.lib.php | 74 ++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index f3a4f738927..be3d1dea56d 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -732,45 +732,51 @@ function getSocialNetworkSharingLinks() { global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. - $fullurl = $website->alias.'/'.$websitepage->pageurl.'.php'; - $hashtags = trim(join(' #', array_map('trim', explode(',', $websitepage->keywords)))); - $out = ''."\n"; - $out .= '\n"; + } + else { + $out .= ''."\n"; + } $out .= ''."\n"; return $out; From 760fb4b0e3fbcc6ec28983a365a274b74452b727 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 00:34:00 +0200 Subject: [PATCH 13/29] Remove custom issues --- .github/ISSUE_TEMPLATE/custom.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/custom.md diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md deleted file mode 100644 index 48d5f81fa42..00000000000 --- a/.github/ISSUE_TEMPLATE/custom.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Custom issue template -about: Describe this issue template's purpose here. -title: '' -labels: '' -assignees: '' - ---- - - From 5794b1abea74dd5c972ef1c77d45c726a457cbb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 12:35:39 +0200 Subject: [PATCH 14/29] Fix for use with text browser Conflicts: htdocs/main.inc.php --- htdocs/blockedlog/lib/blockedlog.lib.php | 2 +- htdocs/bom/lib/bom.lib.php | 4 ++-- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/agenda.lib.php | 4 ++-- htdocs/core/lib/functions.lib.php | 6 +++-- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/tpl/login.tpl.php | 1 + htdocs/main.inc.php | 23 +++++++++---------- .../template/lib/mymodule_myobject.lib.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 2 ++ htdocs/theme/eldy/badges.inc.php | 3 ++- htdocs/website/lib/websiteaccount.lib.php | 4 ++-- 12 files changed, 30 insertions(+), 25 deletions(-) diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index afb0323304e..11b85567a41 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -46,7 +46,7 @@ function blockedlogadmin_prepare_head() $b = new BlockedLog($db); if ($b->alreadyUsed()) { - $head[$h][1] .= '...'; + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '...' : ''); } $head[$h][2] = 'fingerprints'; $h++; diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 4d5f980de83..1eb5fc52a5b 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -90,7 +90,7 @@ function bomPrepareHead($object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.''; + if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); $head[$h][2] = 'note'; $h++; } @@ -102,7 +102,7 @@ function bomPrepareHead($object) $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles + $nbLinks).'' : ''); $head[$h][2] = 'document'; $h++; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b78c0478370..adb1201df1d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -663,7 +663,7 @@ function security_prepare_head() $head[$h][0] = DOL_URL_ROOT."/admin/perms.php"; $head[$h][1] = $langs->trans("DefaultRights"); - if ($nbPerms > 0) $head[$h][1] .= ''.$nbPerms.''; + if ($nbPerms > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbPerms.'' : ''); $head[$h][2] = 'default'; $h++; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 5d450aa4b04..6eff2772014 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -481,7 +481,7 @@ function actions_prepare_head($object) $listofresourcelinked = $resource->getElementResources($object->element, $object->id); $nbResources = (is_array($listofresourcelinked) ?count($listofresourcelinked) : 0); $head[$h][1] = $langs->trans("Resources"); - if ($nbResources > 0) $head[$h][1] .= ''.($nbResources).''; + if ($nbResources > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbResources).'' : ''); $head[$h][2] = 'resources'; $h++; } @@ -494,7 +494,7 @@ function actions_prepare_head($object) $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles + $nbLinks).'' : ''); $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 169d979cc8b..9cecd9e3be6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1216,7 +1216,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab { $limittitle = 30; $out .= ''; - if ($picto) $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; + if ($picto && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; $out .= ''.dol_trunc($title, $limittitle).''; $out .= ''; } @@ -2246,6 +2246,8 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $newemail = $email; + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) $withpicto = 0; + if (empty($email)) return ' '; if (!empty($addlink)) @@ -2279,7 +2281,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } //$rep = '
'; - $rep = ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; + $rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; //$rep .= '
'; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 9ac9383e516..0b07e96ab50 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -64,7 +64,7 @@ function user_prepare_head($object) if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; - $head[$h][1] = $langs->trans("Rights").''.($object->nb_rights).''; + $head[$h][1] = $langs->trans("Rights").(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($object->nb_rights).'' : ''); $head[$h][2] = 'rights'; $h++; } diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 97bece99852..e10c311cf05 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -54,6 +54,7 @@ $titleofloginpage = $langs->trans('Login').' @ '.$titletruedolibarrversion; // $ $disablenofollow = 1; if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenofollow = 0; +if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $disablenofollow = 0; print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 679e565cf0e..cf53d994ece 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -257,6 +257,12 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1; } +// Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part) +if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks')) // If we must enable text browser +{ + $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1; +} + // Force HTTPS if required ($conf->file->main_force_https is 0/1 or 'https dolibarr root url') // $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off' if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on')) @@ -343,7 +349,6 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE } } - // Creation of a token against CSRF vulnerabilities if (!defined('NOTOKENRENEWAL')) { @@ -868,7 +873,6 @@ if (GETPOST('theme', 'alpha')) $conf->css = "/theme/".$conf->theme."/style.css.php"; } - // Set javascript option if (!GETPOST('nojs', 'int')) // If javascript was not disabled on URL { @@ -876,19 +880,14 @@ if (!GETPOST('nojs', 'int')) // If javascript was not disabled on URL { $conf->use_javascript_ajax = !$user->conf->MAIN_DISABLE_JAVASCRIPT; } -} -else $conf->use_javascript_ajax = 0; -// Set MAIN_OPTIMIZEFORTEXTBROWSER -if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks') || !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) // If we must enable text browser -{ - $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1; -} -elseif (!empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) -{ +} else $conf->use_javascript_ajax = 0; + +// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part) +if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER; } -// set MAIN_OPTIMIZEFORCOLORBLIND +// set MAIN_OPTIMIZEFORCOLORBLIND for user $conf->global->MAIN_OPTIMIZEFORCOLORBLIND = $user->conf->MAIN_OPTIMIZEFORCOLORBLIND; // Set terminal output option according to conf->browser. diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index bd574e837db..ebd5b837e3d 100644 --- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -48,7 +48,7 @@ function myobjectPrepareHead($object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.''; + if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); $head[$h][2] = 'note'; $h++; } diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index ce7e4e1b949..8193cf78934 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -714,6 +714,8 @@ class Entrepot extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) $withpicto = 0; + $result = ''; $label = ''.$langs->trans("Warehouse").''; diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index ae02a8e7f73..d2a59447bb9 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -1,5 +1,6 @@ +if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); +?> /* Badge style is based on boostrap framework */ .badge { diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index e0538e73a99..bf229dd650d 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.php @@ -46,7 +46,7 @@ function websiteaccountPrepareHead($object) if(!empty($object->fields['note_public'])) $nbNote++; $head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); $head[$h][2] = 'note'; $h++; }*/ @@ -59,7 +59,7 @@ function websiteaccountPrepareHead($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles+$nbLinks).'' : ''); $head[$h][2] = 'document'; $h++; From 5bc80f8626d06adcf6a7eb1f225b86fd32214598 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 10 Jun 2020 16:22:48 +0200 Subject: [PATCH 15/29] FIX 11.0 - fatal with postgres because empty string literals are assigned to fields typed as integers as per UNION syntax --- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/ticket.lib.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 30a1b80c232..48a641e2fdc 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1448,7 +1448,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $langs->load("mails"); $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; - $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id"; + $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname"; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fe7fb4ba5a7..48b9a7d9089 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -427,7 +427,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $langs->load("mails"); $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; - $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id"; + $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname"; From 58ff96af30546bf37256c5daced837e89a7decf4 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 10 Jun 2020 16:48:02 +0200 Subject: [PATCH 16/29] FIX : $arraydefaultmessage is an object, as well as in /htdocs/core/class/html.formmail.class.php --- htdocs/core/class/html.formticket.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 7a6b4ec38a2..72673abb323 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -991,9 +991,7 @@ class FormTicket // MESSAGE $defaultmessage=""; - if (is_array($arraydefaultmessage) && count($arraydefaultmessage) > 0 && $arraydefaultmessage->content) { - $defaultmessage=$arraydefaultmessage->content; - } + if ($arraydefaultmessage && $arraydefaultmessage->content) $defaultmessage = $arraydefaultmessage->content; $defaultmessage=str_replace('\n', "\n", $defaultmessage); // Deal with format differences between message and signature (text / HTML) From 564b9df1e7a525edd6b0d5610bd39a770ed85e01 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 10 Jun 2020 17:01:57 +0200 Subject: [PATCH 17/29] Fix ticket file save --- htdocs/ticket/class/ticket.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index f112cdc7e4e..8ba9351d053 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2455,8 +2455,9 @@ class Ticket extends CommonObject // If destination file already exists, we add a suffix to avoid to overwrite if (is_file($destfile)) { - $now = dol_now(); - $destfile .= '.'.dol_print_date($now, 'dayhourlog'); + $pathinfo = pathinfo($filename[$i]); + $now = dol_now(); + $destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension']; } $res = dol_move($filepath[$i], $destfile, 0, 1); From 5e13a7f1e2427f4006439e6c71477d2ba1720677 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 22:05:49 +0200 Subject: [PATCH 18/29] css --- htdocs/theme/eldy/global.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4f16c52800c..78dccbeeea4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -155,6 +155,9 @@ input[name=duration_value] input[type=submit], input[type=submit]:hover { margin-left: 5px; } +input[type=checkbox], input[type=radio] { + margin: 0 3px 0 3px; +} input, input.flat, form.flat select, select, select.flat, .dataTables_length label select { border: none; } From e94ef09977717d1c3c72ffc85956aa64d09f1357 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 22:24:15 +0200 Subject: [PATCH 19/29] css --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 40fbcab737b..5b3ddefa0f5 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -430,7 +430,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on $s .= ''."\n"; // Local calendar - $s .= '
'.$langs->trans("LocalAgenda").'  
'; + $s .= '
'.$langs->trans("LocalAgenda").'  
'; // External calendars if (is_array($showextcals) && count($showextcals) > 0) From 5b882e333d932b084cd95cec7d82f4c76f59a167 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Jun 2020 23:00:17 +0200 Subject: [PATCH 20/29] Fix tooltip on localtaxes --- htdocs/core/tpl/objectline_view.tpl.php | 18 ++++++++++++------ htdocs/societe/class/societe.class.php | 1 - 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8849020b885..0e705f4f844 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -285,13 +285,19 @@ if ($line->special_code == 3) { ?> $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); if (!$senderissupplier && is_object($object->thirdparty)) { - if ($object->thirdparty->useLocalTax(1)) { - if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); - else $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + if ($mysoc->useLocalTax(1)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(1)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } } - if ($object->thirdparty->useLocalTax(1)) { - if (price2num($line->total_localtax2)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); - else $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + if ($mysoc->useLocalTax(2)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } } } $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index df408473627..fb51c5d152b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3881,7 +3881,6 @@ class Societe extends CommonObject elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; - dol_syslog("useLocalTax", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { From 503206af88f4511658e81a1d96ac05fa8f4a2e93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 16:38:58 +0200 Subject: [PATCH 21/29] Fix analytics tag --- htdocs/core/lib/functions.lib.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9cecd9e3be6..7db8f730e41 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7721,17 +7721,22 @@ function printCommonFooter($zone = 'private') // TODO Add a hook here if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { - print "\n"; - print "/* JS CODE TO ENABLE for google analtics tag */\n"; - print ' var _gaq = _gaq || [];'."\n"; - print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n"; - print ' _gaq.push([\'_trackPageview\']);'."\n"; - print ''."\n"; - print ' (function() {'."\n"; - print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n"; - print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n"; - print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n"; - print ' })();'."\n"; + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "/* JS CODE TO ENABLE for google analtics tag */\n"; + print " + + + "; + print "\n"; + } } // End of tuning From 997cb214f1536fd8dba5434486a35ded2abf95fb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 11 Jun 2020 16:52:24 +0200 Subject: [PATCH 22/29] FIX avoid error "Call to undefined function measuringUnitString()" --- htdocs/fourn/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 948fd389b60..984e5ec6cf4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; } if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; From 58fdd8a59a4394ab378005615fabffce7c286da7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 16:59:24 +0200 Subject: [PATCH 23/29] Fix tag at bad place --- htdocs/core/lib/functions.lib.php | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7db8f730e41..30ac36c4d5b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7717,28 +7717,6 @@ function printCommonFooter($zone = 'private') print '});'."\n"; - // Google Analytics - // TODO Add a hook here - if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) - { - $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); - foreach($tmptagarray as $tmptag) { - print "\n"; - print "/* JS CODE TO ENABLE for google analtics tag */\n"; - print " - - - "; - print "\n"; - } - } - // End of tuning if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO)) { @@ -7767,6 +7745,28 @@ function printCommonFooter($zone = 'private') } print "\n".''."\n"; + + // Google Analytics + // TODO Add a hook here + if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) + { + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "/* JS CODE TO ENABLE for google analtics tag */\n"; + print " + + + "; + print "\n"; + } + } } // Add Xdebug coverage of code From 78204f92e6500bec7325b21da9d52bf58238ce53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 17:00:22 +0200 Subject: [PATCH 24/29] Fix tag --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 30ac36c4d5b..b912fb5a31a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7753,7 +7753,7 @@ function printCommonFooter($zone = 'private') $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); foreach($tmptagarray as $tmptag) { print "\n"; - print "/* JS CODE TO ENABLE for google analtics tag */\n"; + print "\n"; print " From 3831b564236f49512bbe8a753612a411a3c66bf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 17:07:41 +0200 Subject: [PATCH 25/29] Missing tags --- htdocs/core/tpl/login.tpl.php | 30 +++++++------ htdocs/core/tpl/passwordforgotten.tpl.php | 53 ++++++++++++++++++++++- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index e10c311cf05..db62e79738b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -337,23 +337,25 @@ elseif (!empty($moreloginextracontent)) { echo $moreloginextracontent; } -// Google Analytics (need Google module) +// Google Analytics +// TODO Add a hook here if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { - if (empty($conf->dol_use_jmobile)) - { + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "\n"; + print " + + + "; print "\n"; - print ''."\n"; } } diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 63ff6a8a0a7..0845e33a80a 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -206,7 +206,13 @@ if (!empty($morelogincontent)) {
- + +global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; + +if (!empty($morelogincontent) && is_array($morelogincontent)) { foreach ($morelogincontent as $format => $option) { if ($format == 'js') { @@ -219,8 +225,53 @@ elseif (!empty($moreloginextracontent)) { echo ''; echo $moreloginextracontent; } + +// Google Analytics +// TODO Add a hook here +if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) +{ + $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); + foreach($tmptagarray as $tmptag) { + print "\n"; + print "\n"; + print " + + + "; + print "\n"; + } +} + +// Google Adsense +if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) +{ + if (empty($conf->dol_use_jmobile)) + { + ?> +

+ + +
+ + From c70cd01971b8d39636388f81e5bbdc878f8c3add Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 17:58:00 +0200 Subject: [PATCH 26/29] Fix css --- htdocs/theme/eldy/main_menu_fa_icons.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index b77dc86765c..2286f19e355 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -124,7 +124,7 @@ div.mainmenu.tools::before { } div.mainmenu.website::before { - content: "\f542"; + content: "\f57d"; } div.mainmenu.generic1::before { From ee611fa7a04bb052359b52759d692195bdef1c09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 18:31:26 +0200 Subject: [PATCH 27/29] Fix bad definition of field for parent --- htdocs/core/class/commonobject.class.php | 4 +++- htdocs/societe/class/societe.class.php | 2 +- htdocs/website/class/websitepage.class.php | 15 +++++++++++---- htdocs/website/index.php | 1 - 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 681e20b18c3..d6fcbd0f7b4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8340,7 +8340,9 @@ abstract class CommonObject break; } } else { - $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $table . ' WHERE ' . $this->fk_element . ' = ' . $this->id; + // Delete record in child table + $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $table . ' WHERE ' . $this->fk_element . ' = ' . $this->id; + $resql = $this->db->query($sql); if (!$resql) { $error++; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fb51c5d152b..2f84ab6c795 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -55,7 +55,7 @@ class Societe extends CommonObject public $table_element = 'societe'; /** - * @var int Field with ID of parent key if this field has a parent + * @var int Field with ID of parent key if this field has a parent or for child tables */ public $fk_element = 'fk_soc'; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 61ec8376414..eb707e3010d 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -173,9 +173,9 @@ class WebsitePage extends CommonObject //public $table_element_line = 'mymodule_myobjectline'; /** - * @var int Field with ID of parent key if this object has a parent + * @var int Field with ID of parent key if this field has a parent or for child tables */ - public $fk_element = 'fk_website'; + public $fk_element = 'fk_website_page'; /** * @var int Name of subtable class that manage subtable lines @@ -573,7 +573,7 @@ class WebsitePage extends CommonObject if (!$error) { $result = $this->deleteCommon($user, $trigger); - if ($result > 0) + if ($result <= 0) { $error++; } @@ -594,10 +594,17 @@ class WebsitePage extends CommonObject dol_delete_file($filealias); dol_delete_file($filetpl); + } else { + $this->error = $websiteobj->error; + $this->errors = $websiteobj->errors; } } - return $result; + if (! $error) { + return 1; + } else { + return -1; + } } /** diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2a3b50df2f6..d539572bc11 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -85,7 +85,6 @@ if (GETPOST('createfromclone', 'alpha')) { $action = 'createfromclone'; } if (GETPOST('createpagefromclone', 'alpha')) { $action = 'createpagefromclone'; } if (empty($action) && $file_manager) $action = 'file_manager'; if (empty($action) && $replacesite) $action = 'replacesite'; - if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x')) $pageid = 0; // Load variable for pagination From b36e658b20195e8797b52f1e25b60c584eb4e587 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 22:58:58 +0200 Subject: [PATCH 28/29] Update html.formticket.class.php --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 72673abb323..60574d12d3c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -991,7 +991,7 @@ class FormTicket // MESSAGE $defaultmessage=""; - if ($arraydefaultmessage && $arraydefaultmessage->content) $defaultmessage = $arraydefaultmessage->content; + if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) $defaultmessage = $arraydefaultmessage->content; $defaultmessage=str_replace('\n', "\n", $defaultmessage); // Deal with format differences between message and signature (text / HTML) From 4b47a270afb55ff6c85f1b39c844ec57b9f7e281 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Jun 2020 23:15:00 +0200 Subject: [PATCH 29/29] Update index.php --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 956ceb0cfd3..2ef9d991c84 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -711,7 +711,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', $notnull = ($obj->Null == 'YES' ? 0 : 1); if ($fieldname == 'fk_user_modif') $notnull = -1; // label - $label = $fieldname; + $label = preg_replace('/_/', '', ucfirst($fieldname)); if ($fieldname == 'rowid') $label = 'TechnicalID'; if ($fieldname == 'import_key') $label = 'ImportId'; if ($fieldname == 'fk_soc') $label = 'ThirdParty';