From 3006cf770c696654456846c54578a57a7aa50856 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 01:06:59 +0100 Subject: [PATCH 01/86] FIX Timeout during import --- htdocs/imports/import.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index c6e2e282778..8cd1b826ab0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1545,6 +1545,14 @@ if ($step == 5 && $datatoimport) } else { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); From 1b559355776147798eceec97db55976bd39a02b7 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 5 Feb 2021 10:39:46 +0100 Subject: [PATCH 02/86] Add critical price patch from 12 to 11. --- htdocs/product/price.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 3f6a89cbddb..c364cd464fc 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1442,11 +1442,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul // Il doit au moins y avoir la ligne de prix initial. // On l'ajoute donc pour remettre a niveau (pb vieilles versions) //$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1); - } else { - $object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min); - } + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1); + } else { + $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min)); + } $result = $db->query($sql); $num = $db->num_rows($result); From 54be4f282b59f879d38d7d3be2fde43e41e0224b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 10:56:33 +0100 Subject: [PATCH 03/86] Fix bad function name --- htdocs/compta/facture/card-rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index c95f3e3c1c3..e070633c7af 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -933,7 +933,7 @@ $companystatic = new Societe($db); $invoicerectmp = new FactureRec($db); $now = dol_now(); -$nowlasthour = dol_last_hour($now); +$nowlasthour = dol_get_last_hour($now); /* From 3f862bf43ee33cfc16ce7a193312efcebae092a9 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 5 Feb 2021 11:34:39 +0100 Subject: [PATCH 04/86] FIX 10.0 - before crediting a withdrawal receipt, check whether it has been credited already --- htdocs/compta/prelevement/card.php | 44 ++++++++++++++++++----------- htdocs/langs/en_US/withdrawals.lang | 1 + htdocs/langs/fr_FR/withdrawals.lang | 1 + 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index bf95a35f1fd..1e3f1f49d23 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -85,16 +85,21 @@ if (empty($reshook)) } } - // Seems to no be used and replaced with $action == 'infocredit' - if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') - { - $res=$object->set_credite(); - if ($res >= 0) - { - header("Location: card.php?id=".$id); - exit; - } - } + // Seems to no be used and replaced with $action == 'infocredit' + if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes') + { + if ($object->statut == 2) { + $res = -1; + setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors'); + } else { + $res=$object->set_credite(); + } + if ($res >= 0) + { + header("Location: card.php?id=".$id); + exit; + } + } if ($action == 'infotrans' && $user->rights->prelevement->bons->send) { @@ -135,14 +140,19 @@ if (empty($reshook)) { $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $error = $object->set_infocredit($user, $dt); + if ($object->statut == 2) { + $error = 1; + setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors'); + } else { + $error = $object->set_infocredit($user, $dt); + } - if ($error) - { - header("Location: card.php?id=".$id."&error=$error"); - exit; - } - } + if ($error) + { + header("Location: card.php?id=".$id."&error=$error"); + exit; + } + } } diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index cbca2b2f103..45cf89c8592 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -27,6 +27,7 @@ MakeWithdrawRequest=Make a direct debit payment request WithdrawRequestsDone=%s direct debit payment requests recorded ThirdPartyBankCode=Third-party bank code NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode %s. +WithdrawalCantBeCreditedTwice=This withdrawal receipt is already marked as credited; this can't be done twice, as this would potentially create duplicate payments and bank entries. ClassCredited=Classify credited ClassCreditedConfirm=Are you sure you want to classify this withdrawal receipt as credited on your bank account? TransData=Transmission date diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index 468cdd8b9f3..ea8fadeedba 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -27,6 +27,7 @@ MakeWithdrawRequest=Faire une demande de prélèvement WithdrawRequestsDone=%s demandes de prélèvements enregistrées ThirdPartyBankCode=Code banque du tiers NoInvoiceCouldBeWithdrawed=Aucune facture traitée avec succès. Vérifiez que les factures sont sur les sociétés avec un BAN par défaut valide et que le BAN a un RUM avec le mode %s . +WithdrawalCantBeCreditedTwice=Ce bon de prélèvement est déjà classé crédité ; cette opération ne peut pas être réalisée deux fois, car cela pourrait engendrer des doublons dans les paiements et les écritures bancaires. ClassCredited=Classer crédité ClassCreditedConfirm=Êtes-vous sûr de vouloir classer ce bon de prélèvement comme crédité sur votre compte bancaire ? TransData=Date de transmission From cdd2c165ef4b706091d0793348a4534524140d28 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 5 Feb 2021 11:36:12 +0100 Subject: [PATCH 05/86] add missing hook addMoreActionsButtons in viewcat.php --- htdocs/categories/viewcat.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 958b77e42e8..5ad45f6b420 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -269,16 +269,19 @@ dol_fiche_end(); */ print "
\n"; +$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if (empty($reshook)) { + if ($user->rights->categorie->creer) + { + $socid = ($object->socid ? "&socid=".$object->socid : ""); + print "".$langs->trans("Modify").""; + } -if ($user->rights->categorie->creer) -{ - $socid = ($object->socid ? "&socid=".$object->socid : ""); - print "".$langs->trans("Modify").""; -} - -if ($user->rights->categorie->supprimer) -{ - print "".$langs->trans("Delete").""; + if ($user->rights->categorie->supprimer) + { + print "".$langs->trans("Delete").""; + } } print "
"; From c441b54521fc83e965852346fe82c055e292cacd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 12:07:39 +0100 Subject: [PATCH 06/86] NEW If not logo defined, can use squarred logo on login page --- htdocs/compta/facture/card-rec.php | 4 +++- htdocs/compta/facture/prelevement.php | 2 ++ htdocs/core/lib/functions.lib.php | 7 ++---- htdocs/core/lib/security2.lib.php | 11 ++++----- htdocs/core/tpl/contacts.tpl.php | 33 ++++++++++++++------------- htdocs/core/tpl/login.tpl.php | 6 ++--- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e070633c7af..a1471f48482 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1245,7 +1245,9 @@ if ($action == 'create') print ''; - print '"; + print '"; print ''; print ''; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index d50813cbea4..26bab3c1984 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -287,7 +287,9 @@ if ($object->id > 0) // Type print ''; +} + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); From df67de08b143fffb692ef41015b470f695f5fc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:16:07 +0100 Subject: [PATCH 38/86] modules can add prefix for menu --- htdocs/core/class/menubase.class.php | 46 +++++++++++-------- htdocs/core/modules/DolibarrModules.class.php | 1 + .../install/mysql/migration/13.0.0-14.0.0.sql | 2 + htdocs/install/mysql/tables/llx_menu.sql | 9 ++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 8695ef88ef4..a31c5245ce0 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -111,6 +111,11 @@ class Menubase */ public $title; + /** + * @var string Prefix + */ + public $prefix; + /** * @var string Lang file to load for translation */ @@ -248,6 +253,7 @@ class Menubase $sql .= "url,"; $sql .= "target,"; $sql .= "titre,"; + $sql .= "prefix,"; $sql .= "langs,"; $sql .= "perms,"; $sql .= "enabled,"; @@ -266,6 +272,7 @@ class Menubase $sql .= " '".$this->db->escape($this->url)."',"; $sql .= " '".$this->db->escape($this->target)."',"; $sql .= " '".$this->db->escape($this->title)."',"; + $sql .= " '".$this->db->escape($this->prefix)."',"; $sql .= " '".$this->db->escape($this->langs)."',"; $sql .= " '".$this->db->escape($this->perms)."',"; $sql .= " '".$this->db->escape($this->enabled)."',"; @@ -319,6 +326,7 @@ class Menubase $this->url = trim($this->url); $this->target = trim($this->target); $this->title = trim($this->title); + $this->prefix = trim($this->prefix); $this->langs = trim($this->langs); $this->perms = trim($this->perms); $this->enabled = trim($this->enabled); @@ -341,6 +349,7 @@ class Menubase $sql .= " url='".$this->db->escape($this->url)."',"; $sql .= " target='".$this->db->escape($this->target)."',"; $sql .= " titre='".$this->db->escape($this->title)."',"; + $sql .= " prefix='".$this->db->escape($this->prefix)."',"; $sql .= " langs='".$this->db->escape($this->langs)."',"; $sql .= " perms='".$this->db->escape($this->perms)."',"; $sql .= " enabled='".$this->db->escape($this->enabled)."',"; @@ -385,6 +394,7 @@ class Menubase $sql .= " t.url,"; $sql .= " t.target,"; $sql .= " t.titre as title,"; + $sql .= " t.prefix,"; $sql .= " t.langs,"; $sql .= " t.perms,"; $sql .= " t.enabled,"; @@ -416,6 +426,7 @@ class Menubase $this->url = $obj->url; $this->target = $obj->target; $this->title = $obj->title; + $this->prefix = $obj->prefix; $this->langs = $obj->langs; $this->perms = $obj->perms; $this->enabled = str_replace("\"", "'", $obj->enabled); @@ -505,8 +516,7 @@ class Menubase $leftmenu = $myleftmenu; // To export to dol_eval function $newTabMenu = array(); - foreach ($tabMenu as $val) - { + foreach ($tabMenu as $val) { if ($val['type'] == 'top') $newTabMenu[] = $val; } @@ -554,15 +564,13 @@ class Menubase // Now complete $this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu) foreach ($tabMenu as $key => $val) { - //var_dump($tabMenu); if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu { //print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].'
'; //var_dump($this->newmenu->liste);exit; - if (empty($val['fk_leftmenu'])) - { - $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position']); + if (empty($val['fk_leftmenu'])) { + $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position'], '', '', '', $val['prefix']); //var_dump($this->newmenu->liste); } else { // Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu) @@ -579,8 +587,7 @@ class Menubase break; } } - if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu']) - { + if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu']) { //print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).'
'; // Now we look to find last subelement of this parent (we add at end) $searchlastsub = ($valparent['level'] + 1); @@ -589,8 +596,9 @@ class Menubase } } //print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.'
'; - if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position']); - else { + if ($found) { + $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu'], $val['position'], '', '', '', $val['prefix']); + } else { dol_syslog("Error. Modules ".$val['module']." has defined a menu entry with a parent='fk_mainmenu=".$val['fk_leftmenu'].",fk_leftmenu=".$val['fk_leftmenu']."' and position=".$val['position'].'. The parent was not found. May be you forget it into your definition of menu, or may be the parent has a "position" that is after the child (fix field "position" of parent or child in this case).', LOG_WARNING); //print "Parent menu not found !!
"; } @@ -620,7 +628,7 @@ class Menubase $mainmenu = $mymainmenu; // To export to dol_eval function $leftmenu = $myleftmenu; // To export to dol_eval function - $sql = "SELECT m.rowid, m.type, m.module, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.url, m.titre, m.langs, m.perms, m.enabled, m.target, m.mainmenu, m.leftmenu, m.position"; + $sql = "SELECT m.rowid, m.type, m.module, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.url, m.titre, m.prefix, m.langs, m.perms, m.enabled, m.target, m.mainmenu, m.leftmenu, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql .= " WHERE m.entity IN (0,".$conf->entity.")"; $sql .= " AND m.menu_handler IN ('".$this->db->escape($menu_handler)."','all')"; @@ -700,12 +708,15 @@ class Menubase $tabMenu[$b]['module'] = $menu['module']; $tabMenu[$b]['fk_menu'] = $menu['fk_menu']; $tabMenu[$b]['url'] = $menu['url']; - if (!preg_match("/^(http:\/\/|https:\/\/)/i", $tabMenu[$b]['url'])) - { - if (preg_match('/\?/', $tabMenu[$b]['url'])) $tabMenu[$b]['url'] .= '&idmenu='.$menu['rowid']; - else $tabMenu[$b]['url'] .= '?idmenu='.$menu['rowid']; + if (!preg_match("/^(http:\/\/|https:\/\/)/i", $tabMenu[$b]['url'])) { + if (preg_match('/\?/', $tabMenu[$b]['url'])) { + $tabMenu[$b]['url'] .= '&idmenu='.$menu['rowid']; + } else { + $tabMenu[$b]['url'] .= '?idmenu='.$menu['rowid']; + } } $tabMenu[$b]['titre'] = $title; + $tabMenu[$b]['prefix'] = $menu['prefix']; $tabMenu[$b]['target'] = $menu['target']; $tabMenu[$b]['mainmenu'] = $menu['mainmenu']; $tabMenu[$b]['leftmenu'] = $menu['leftmenu']; @@ -750,9 +761,8 @@ class Menubase for ($x = 0; $x < $num; $x++) { //si un element a pour pere : $pere - if ((($tab[$x]['fk_menu'] >= 0 && $tab[$x]['fk_menu'] == $pere)) && $tab[$x]['enabled']) - { - $this->newmenu->add($tab[$x]['url'], $tab[$x]['titre'], ($level - 1), $tab[$x]['perms'], $tab[$x]['target'], $tab[$x]['mainmenu'], $tab[$x]['leftmenu']); + if ((($tab[$x]['fk_menu'] >= 0 && $tab[$x]['fk_menu'] == $pere)) && $tab[$x]['enabled']) { + $this->newmenu->add($tab[$x]['url'], $tab[$x]['titre'], ($level - 1), $tab[$x]['perms'], $tab[$x]['target'], $tab[$x]['mainmenu'], $tab[$x]['leftmenu'], 0, '', '', '', $tab[$x]['prefix']); $this->recur($tab, $tab[$x]['rowid'], ($level + 1)); } } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index cfcb85054d2..0903e5f3b3c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1869,6 +1869,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : ''); $menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : ''; $menu->title = $this->menu[$key]['titre']; + $menu->prefix = $this->menu[$key]['prefix']; $menu->url = $this->menu[$key]['url']; $menu->langs = $this->menu[$key]['langs']; $menu->position = $this->menu[$key]['position']; diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index bfdecd334b7..99fa0263f22 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -121,4 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL; + ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 9cff110981a..956a9638102 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -30,17 +30,18 @@ CREATE TABLE llx_menu mainmenu varchar(100) NOT NULL, -- Name family/module for top menu (home, companies, ...) leftmenu varchar(100) NULL, -- Name family/module for left menu (setup, info, ...) fk_menu integer NOT NULL, -- 0 or Id of mother menu line, or -1 if we use fk_mainmenu and fk_leftmenu - fk_mainmenu varchar(100), -- - fk_leftmenu varchar(100), -- + fk_mainmenu varchar(100), -- + fk_leftmenu varchar(100), -- position integer NOT NULL, -- Sort order of entry url varchar(255) NOT NULL, -- Relative (or absolute) url to go target varchar(100) NULL, -- Target of Url link - titre varchar(255) NOT NULL, -- Key for menu translation + titre varchar(255) NOT NULL, -- Key for menu translation + prefix varchar(255) NOT NULL, -- prefix langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. perms text, -- Condition to show enabled or disabled enabled text NULL, -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - + ) ENGINE=innodb; From 38863200f21eca359d988ef1dda895fb39039381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:20:35 +0100 Subject: [PATCH 39/86] modules can add prefix for menu --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 99fa0263f22..b3d61af08f7 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -121,6 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); -ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL; +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; From 874c60035f434a359177ff57f394b4f68792d0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:23:17 +0100 Subject: [PATCH 40/86] modules can add prefix for menu --- htdocs/install/mysql/tables/llx_menu.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 956a9638102..14c36e3a049 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -43,5 +43,4 @@ CREATE TABLE llx_menu enabled text NULL, -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - ) ENGINE=innodb; From b2ea91e0cc52c26b2ddeb8b87623a6e7ad442bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:46:15 +0100 Subject: [PATCH 41/86] prefix can be null --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_menu.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index b3d61af08f7..f12cd42e028 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -121,6 +121,6 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse); ALTER TABLE llx_socpeople MODIFY poste varchar(255); -ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NOT NULL AFTER titre; +ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index 14c36e3a049..52b576411cb 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -36,7 +36,7 @@ CREATE TABLE llx_menu url varchar(255) NOT NULL, -- Relative (or absolute) url to go target varchar(100) NULL, -- Target of Url link titre varchar(255) NOT NULL, -- Key for menu translation - prefix varchar(255) NOT NULL, -- prefix + prefix varchar(255) NULL, -- prefix langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. perms text, -- Condition to show enabled or disabled From b487644cb76739ff8da5ac8af22ea696f07d571f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 10:52:03 +0100 Subject: [PATCH 42/86] sample use for margin module --- htdocs/core/modules/modMargin.class.php | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 3051b68f570..e62e97363c6 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -104,18 +104,20 @@ class modMargin extends DolibarrModules // left menu entry $this->menu[$r] = array( - 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu - 'type'=>'left', // This is a Top menu entry - 'titre'=>'Margins', - 'mainmenu'=>'billing', - 'leftmenu'=>'margins', - 'url'=>'/margin/index.php', - 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu + 'type'=>'left', // This is a Top menu entry + 'titre'=>'Margins', + 'prefix' => '', + 'mainmenu'=>'billing', + 'leftmenu'=>'margins', + 'url'=>'/margin/index.php', + 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>100, + 'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. + 'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $r++; // Permissions From 3dedd81f37dff55c76184d3d43af53d9cc9be2fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 11:56:27 +0100 Subject: [PATCH 43/86] Same width for all picto of menu --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/modules/DolibarrModules.class.php | 14 ++++++-------- htdocs/core/modules/modMargin.class.php | 2 +- htdocs/install/upgrade2.php | 1 + htdocs/theme/eldy/global.inc.php | 3 ++- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a5cb588eff..ae4c843dad8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3267,7 +3267,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', 'help', 'holiday', 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', - 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', + 'margin', 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', @@ -3364,7 +3364,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$pictowithouttext; } if (in_array($pictowithouttext, array('payment', 'loan'))) { - $fasize = '0.85em'; + $fasize = '0.80em'; } // Define $marginleftonlyshort diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 0903e5f3b3c..da1e64ac56e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -353,15 +353,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Enables a module. - * Inserts all informations into database + * Inserts all informations into database. * - * @param array $array_sql SQL requests to be executed when enabling module - * @param string $options String with options when disabling module: - * - 'noboxes' = Do not insert boxes - - * 'newboxdefonly' = For boxes, insert def of - * boxes only and not boxes activation - * - * @return int 1 if OK, 0 if KO + * @param array $array_sql SQL requests to be executed when enabling module + * @param string $options String with options when disabling module: + * - 'noboxes' = Do not insert boxes + * - 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation + * @return int 1 if OK, 0 if KO */ protected function _init($array_sql, $options = '') { diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index e62e97363c6..7a84b401b59 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -107,7 +107,7 @@ class modMargin extends DolibarrModules 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu 'type'=>'left', // This is a Top menu entry 'titre'=>'Margins', - 'prefix' => '', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'billing', 'leftmenu'=>'margins', 'url'=>'/margin/index.php', diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 708d8834123..07c68a498b2 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -477,6 +477,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_FACTURE'=>'newboxdefonly', 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly', 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly', + 'MAIN_MODULE_MARGIN'=>'menuonly', 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly', 'MAIN_MODULE_PAYBOX'=>'newboxdefonly', 'MAIN_MODULE_PRINTING'=>'newboxdefonly', diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 48e3e2765b9..83bb7365109 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1937,7 +1937,8 @@ span.widthpictotitle.pictotitle { } .pictofixedwidth { text-align: left; - width: 16px; + width: 18px; + padding-right: 0; } .colorthumb { From 7b72ac5a7a151f3e34b6b7d1a9ba2bad73753091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 12:10:27 +0100 Subject: [PATCH 44/86] Look and feel v14 --- htdocs/comm/action/index.php | 4 ++-- htdocs/core/lib/functions.lib.php | 5 ++++- htdocs/theme/eldy/global.inc.php | 10 ++++++++++ htdocs/theme/md/style.css.php | 11 +++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5396454667b..e969351c41e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1231,11 +1231,11 @@ if (empty($action) || $action == 'show_month') // View by month print '
'.$langs->trans("Author").''.$author->getFullName($langs)."
'.$langs->trans("Author").''; + print $author->getNomUrl(-1); + print "
'.$langs->trans("AmountHT").''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Type').''; + print ''; print $object->getLibType(); + print ''; if ($object->module_source) { print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f4666c37dc8..2a5cb588eff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3363,11 +3363,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $fakey = 'fa-'.$pictowithouttext; } - if ($pictowithouttext == 'payment') { - $fasize = '0.9em'; - } - if ($pictowithouttext == 'loan') { - $fasize = '0.95em'; + if (in_array($pictowithouttext, array('payment', 'loan'))) { + $fasize = '0.85em'; } // Define $marginleftonlyshort diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index fefe0aa19d5..3527d132cde 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -219,15 +219,14 @@ if (!function_exists('dol_loginfunction')) $width = 0; $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) - { + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) - { + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) - { + } elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index a1abc3a9240..e3c45b788c6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -82,9 +82,8 @@ if ($permission) ?>
-
trans("NatureOfContact"); ?>
trans("ThirdParty"); ?>
-
trans("Users").'/'.$langs->trans("Contacts"); ?>
+
trans("Users").' | '.$langs->trans("Contacts"); ?>
trans("ContactType"); ?>
 
 
@@ -96,14 +95,15 @@ if ($permission) { ?> " /> - - - + + + + '; ?> -
trans("Users"); ?>
+
global->MAIN_INFO_SOCIETE_NOM; ?>
-
select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?>
+ +
select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?>
" /> - - - + + + + '; ?> -
trans("ThirdPartyContacts"); ?>
+
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
+
selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp'); + print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp'); $nbofcontacts = $form->num; $newcardbutton = ''; @@ -277,9 +278,9 @@ print ''; //print ''; print ''; -print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty_name", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder); +print_liste_field_titre($arrayfields['nature']['label'], $_SERVER["PHP_SELF"], "nature", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "statut", "", $param, "", $sortfield, $sortorder, 'center '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch '); @@ -289,9 +290,9 @@ foreach ($list as $entry) { print ''; - print ''; print ''; print ''; + print ''; print ''; print ''; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 821b423aab3..7934bb58009 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2013 Laurent Destailleur +/* Copyright (C) 2009-2015 Regis Houssin + * Copyright (C) 2011-2021 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -// Need global variable $title to be defined by caller (like dol_loginfunction) +// Need global variable $urllogo, $title and $titletruedolibarrversion to be defined by caller (like dol_loginfunction in security2.lib.php) // Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...); From 70c9788a8bf97fb3850dcebe7fe6938238851a26 Mon Sep 17 00:00:00 2001 From: werewolf7160 <31860486+werewolf7160@users.noreply.github.com> Date: Fri, 5 Feb 2021 12:44:55 +0100 Subject: [PATCH 07/86] call to createCommon() return int and not bool with generated Object, the post request call to createCommon() in it and taht function return a int (id or -1 if error). but the test on the returned value is a '!', that don't return false on "-1". a post request with an sql error for example(foreign key error for my test), will always return 200 instead of 500 with the error --- htdocs/modulebuilder/template/class/api_mymodule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 05ca7f27d16..2e04e34dcac 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -203,7 +203,7 @@ class MyModuleApi extends DolibarrApi foreach ($request_data as $field => $value) { $this->myobject->$field = $value; } - if (!$this->myobject->create(DolibarrApiAccess::$user)) { + if ($this->myobject->create(DolibarrApiAccess::$user)<0) { throw new RestException(500, "Error creating MyObject", array_merge(array($this->myobject->error), $this->myobject->errors)); } return $this->myobject->id; From 245fd6168d42b5c9ba36d01d6f8aa21850bdc22b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:11:34 +0100 Subject: [PATCH 08/86] Move text into tab --- htdocs/admin/modules.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 78f06b0ee2e..e6a85894fc4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -472,22 +472,22 @@ if ($nbofactivatedmodules <= 1) { print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page +$deschelp = ''; if ($mode == 'common' || $mode == 'commonkanban') { $desc = $langs->trans("ModulesDesc", '{picto}'); $desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc); - print ''.$desc."

\n"; + $deschelp = ''.$desc."

\n"; } if ($mode == 'marketplace') { - print ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; } if ($mode == 'deploy') { - print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; + $deschelp = ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; } if ($mode == 'develop') { - print ''.$langs->trans("ModulesDevelopDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesDevelopDesc")."

\n"; } - $head = modules_prepare_head(); @@ -512,6 +512,8 @@ if ($mode == 'common' || $mode == 'commonkanban') { print dol_get_fiche_head($head, 'modules', '', -1); + print $deschelp; + $moreforfilter = '
'; $moreforfilter .= ''; } else { - $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined - $max_time = @ini_get("max_execution_time"); - if ($max_time && $max_time < $max_execution_time_for_importexport) - { - dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); - @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 - } - // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); @@ -1603,8 +1603,10 @@ if ($step == 5 && $datatoimport) // Show OK if (!count($arrayoferrors) && !count($arrayofwarnings)) { print '
'.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'


'; + print '
'; print $langs->trans("NbInsert", $obj->nbinsert).'
'; print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print '
'; } else print $langs->trans("NbOfLinesOK", $nbok).'

'; // Show Errors @@ -1692,9 +1694,17 @@ if ($step == 5 && $datatoimport) // STEP 6: Real import if ($step == 6 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); - $importid = $_REQUEST["importid"]; + $importid = GETPOST("importid", 'alphanohtml'); // Create classe to use for import @@ -1970,12 +1980,14 @@ if ($step == 6 && $datatoimport) // Show result print '
'; - print '
'; + print '
'; print $langs->trans("NbOfLinesImported", $nbok).'
'; print $langs->trans("NbInsert", $obj->nbinsert).'
'; print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print '
'; + print '
'; print $langs->trans("FileWasImported", $importid).'
'; - print $langs->trans("YouCanUseImportIdToFindRecord", $importid).'
'; + print ''.$langs->trans("YouCanUseImportIdToFindRecord", $importid).'
'; print '
'; } From e9fa5a647d9bf66dd0ac3f6103cb3c5be9602d85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:35:10 +0100 Subject: [PATCH 10/86] Fix import --- htdocs/imports/import.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 8cd1b826ab0..0ad5bbd7873 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1269,6 +1269,14 @@ if ($step == 4 && $datatoimport) // STEP 5: Summary of choices and launch simulation if ($step == 5 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); @@ -1545,14 +1553,6 @@ if ($step == 5 && $datatoimport) } else { - $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined - $max_time = @ini_get("max_execution_time"); - if ($max_time && $max_time < $max_execution_time_for_importexport) - { - dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); - @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 - } - // Launch import $arrayoferrors = array(); $arrayofwarnings = array(); @@ -1726,6 +1726,14 @@ if ($step == 5 && $datatoimport) // STEP 6: Real import if ($step == 6 && $datatoimport) { + $max_execution_time_for_importexport = (empty($conf->global->IMPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined + $max_time = @ini_get("max_execution_time"); + if ($max_time && $max_time < $max_execution_time_for_importexport) + { + dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically."); + @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300 + } + $model = $format; $liste = $objmodelimport->liste_modeles($db); $importid = $_REQUEST["importid"]; From 2851bac0af27a92f717cf849f09c6d2b8a834bfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:46:20 +0100 Subject: [PATCH 11/86] Fix param urlencode --- htdocs/core/class/html.formactions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 629d71897aa..0cccbe6ad8c 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -204,7 +204,7 @@ class FormActions $newcardbutton = ''; if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'), 'tzuser').'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } From dbfeba661d47f9b130aaf370e5c20cb4294c45b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 14:51:54 +0100 Subject: [PATCH 12/86] Fix value show 0 if empty --- htdocs/imports/import.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 6921db8ce99..344ede7d0cd 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1604,8 +1604,8 @@ if ($step == 5 && $datatoimport) if (!count($arrayoferrors) && !count($arrayofwarnings)) { print '
'.img_picto($langs->trans("OK"), 'tick').' '.$langs->trans("NoError").'


'; print '
'; - print $langs->trans("NbInsert", $obj->nbinsert).'
'; - print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; + print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'

'; print '
'; } else print $langs->trans("NbOfLinesOK", $nbok).'

'; @@ -1982,8 +1982,8 @@ if ($step == 6 && $datatoimport) print '
'; print '
'; print $langs->trans("NbOfLinesImported", $nbok).'
'; - print $langs->trans("NbInsert", $obj->nbinsert).'
'; - print $langs->trans("NbUpdate", $obj->nbupdate).'

'; + print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; + print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'

'; print '
'; print '
'; print $langs->trans("FileWasImported", $importid).'
'; From 7278a8c17f88a574ed5bc1d7a6939ea989b90185 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:07:07 +0100 Subject: [PATCH 13/86] Fix autoselect of category with 'auto' --- htdocs/categories/card.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index feca9c4f204..74e16f9082d 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl); if ($user->rights->categorie->creer) { // Create or add - if ($action == 'create' || $_POST["addcat"] == 'addcat') + if ($action == 'create' || GETPOST("addcat") == 'addcat') { dol_set_focus('#label'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9466228ebc2..e7183d4373e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4249,7 +4249,7 @@ class Form $output .= ''; foreach ($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) + if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1)) { $add = 'selected '; } else { From 653fa38b061875d9a7411f6ce1b77e36e16d72f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:07:07 +0100 Subject: [PATCH 14/86] Fix autoselect of category with 'auto' --- htdocs/categories/card.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index feca9c4f204..74e16f9082d 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl); if ($user->rights->categorie->creer) { // Create or add - if ($action == 'create' || $_POST["addcat"] == 'addcat') + if ($action == 'create' || GETPOST("addcat") == 'addcat') { dol_set_focus('#label'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2482795147a..0348a01de3f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4174,7 +4174,7 @@ class Form $output .= ''; foreach ($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) + if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1)) { $add = 'selected '; } else { From 9843e79bace6ac633a2feeb8293337d49814e158 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 15:43:03 +0100 Subject: [PATCH 15/86] Trans --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cc10b054606..f5770bad737 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -444,8 +444,8 @@ ExtrafieldParamHelpPassword=Leaving this field blank means this value will be st ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
code3,value3
...

In order to have the list depending on another complementary attribute list:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

In order to have the list depending on another list:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')

for example:
1,value1
2,value2
3,value3
... -ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

- id_field is necessarly a primary int key
- filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter which is the current id of current object
To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filter
Example: c_typent:libelle:id::filter

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpsellist=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

- id_field is necessarly a primary int key
- filtersql is a SQL condition. It can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter which is the current id of current object
To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax: table_name:label_field:id_field::filtersql
Example: c_typent:libelle:id::filtersql

filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax: ObjectName:Classpath ExtrafieldParamHelpSeparator=Keep empty for a simple separator
Set this to 1 for a collapsing separator (open by default for new session, then status is kept for each user session)
Set this to 2 for a collapsing separator (collapsed by default for new session, then status is kept fore each user session) LibraryToBuildPDF=Library used for PDF generation From 482ad20a4d6666d4ef25e785e2f9022ffa27d847 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 16:14:42 +0100 Subject: [PATCH 16/86] Log debug before archive logs --- htdocs/core/modules/modBlockedLog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 6a3cd4767f7..7365f55cf7c 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -47,7 +47,7 @@ class modBlockedLog extends DolibarrModules // It is used to group modules in module setup page $this->family = "base"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '75'; + $this->module_position = '76'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries."; From 858e9d1c03b0aafa825c7c7191046feadebe526b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:27:56 +0100 Subject: [PATCH 17/86] update minimum version --- .../doc/pdf_standard_recruitmentjobposition.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 5f257f594cf..9b59eeca09d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -70,9 +70,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * Dolibarr version of the loaded document From 67df1e1b949c7eb39e180235cd5bfe8fd1d3b253 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Feb 2021 17:29:11 +0100 Subject: [PATCH 18/86] Use same visual picto everywhere for nature of thirdparty --- htdocs/comm/card.php | 6 +-- htdocs/fourn/card.php | 5 ++ htdocs/societe/card.php | 14 ++--- htdocs/societe/class/societe.class.php | 74 ++++++++++++++++++++++---- htdocs/societe/index.php | 16 +----- htdocs/societe/list.php | 23 ++------ 6 files changed, 81 insertions(+), 57 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7f4fe6f66c2..1be8d68760e 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -273,9 +273,9 @@ if ($object->id > 0) print '
'; print '
'.$entry->nature.''.$entry->thirdparty_html.''.$entry->contact_html.''.$entry->nature.''.$entry->type.''.$entry->status.'
'; - // Prospect/Customer - print ''; // Prefix diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 807996ddd1c..9d18f3cfd1a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -179,6 +179,11 @@ if ($object->id > 0) print '
'; print '
'.$langs->trans('ProspectCustomer').''; - print $object->getLibCustProspStatut(); + // Type Prospect/Customer/Supplier + print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); print '
'; + // Type Prospect/Customer/Supplier + print ''; + if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b9da05980bf..78972bde66c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2398,19 +2398,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; - // Prospect/Customer - print ''; - // Supplier - if (!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) - { - print ''; - } - // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9c8e93b6567..c4d355ab62c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -126,6 +126,33 @@ class Societe extends CommonObject */ public $restrictiononfksoc = 1; + + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ @@ -152,17 +179,8 @@ class Societe extends CommonObject 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - /*'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>165),*/ 'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175), + 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'), 'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180), 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), 'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190), @@ -2589,6 +2607,41 @@ class Societe extends CommonObject return $result; } + /** + * Return link(s) on type of thirdparty (with picto) + * + * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) + * @param string $option ''=All + * @param int $notooltip 1=Disable tooltip + * @return string String with URL + */ + public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0) + { + global $conf, $langs; + + $s = ''; + if (empty($option) || preg_match('/prospect/', $option)) { + if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; + } + } + if (empty($option) || preg_match('/customer/', $option)) { + if (($this->client == 1 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; + } + } + if (empty($option) || preg_match('/supplier/', $option)) { + if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur) + { + $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; + } + } + return $s; + } + + /** * Return label of status (activity, closed) * @@ -4348,6 +4401,7 @@ class Societe extends CommonObject * Return label of status customer is prospect/customer * * @return string Label + * @see getTypeUrl() */ public function getLibCustProspStatut() { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index ddd865521d7..9ce38458c7f 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -289,21 +289,7 @@ if ($result) print "\n"; // Type print ''; // Last modified date print ''; } // Multiprice level @@ -924,7 +925,7 @@ if (!empty($arrayfields['s.tva_intra']['checked'])) print ''; } -// Type (customer/prospect/supplier) +// Nature (customer/prospect/supplier) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; print "\n"; - print ''; if (!empty($arrayfields['s.rowid']['checked'])) print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); @@ -1012,7 +1012,7 @@ if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'], $_SERVER["PHP_SELF"], "region.nom", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, "", $sortfield, $sortorder, 'center '); if (!empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'], $_SERVER["PHP_SELF"], "staff.code", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s.price_level']['checked'])) print_liste_field_titre($arrayfields['s.price_level']['label'], $_SERVER["PHP_SELF"], "s.price_level", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder); @@ -1266,20 +1266,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; if (!$i) $totalarray['nbfield']++; } From 4477578766bfa1adf6abdfb7fff532b6204a093b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 5 Feb 2021 17:30:41 +0100 Subject: [PATCH 19/86] FIX takepos : load date function fix loading dol_get_first_hour() --- htdocs/takepos/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index b641efd2502..8062368d360 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant or multiple sales $action = GETPOST('action', 'aZ09'); From 03a5f06d50f2bbc055bd8074c187204bd89df218 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 5 Feb 2021 17:37:51 +0100 Subject: [PATCH 20/86] Update libelle as label in shipment method API --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 84d4ddc3679..85a45e9ff45 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -643,7 +643,7 @@ class Setup extends DolibarrApi public function getListOfShipmentMethods($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') { $list = array(); - $sql = "SELECT t.rowid, t.code, t.libelle, t.description, t.tracking"; + $sql = "SELECT t.rowid, t.code, t.libelle as label, t.description, t.tracking"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t"; $sql .= " WHERE t.active = ".$active; // Add sql filters From c96d36cad3b8dd927c13e44207037523ca214989 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:39:22 +0100 Subject: [PATCH 21/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 2b9fb62b1d4..619dcdf84d3 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -55,6 +55,11 @@ class pdf_strato extends ModelePDFContract */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -131,6 +136,7 @@ class pdf_strato extends ModelePDFContract $this->db = $db; $this->name = 'strato'; $this->description = $langs->trans("StandardContractsTemplate"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 998c5b2ec3a3d15c8d662c847124a9226720c5a9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:42:33 +0100 Subject: [PATCH 22/86] Save the name of generated file as the main doc when generating a doc with this template --- .../core/modules/delivery/doc/pdf_storm.modules.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index d6376e6cd17..f6275386cff 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2020 John BOTELLA @@ -54,6 +54,11 @@ class pdf_storm extends ModelePDFDeliveryOrder */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -61,9 +66,9 @@ class pdf_storm extends ModelePDFDeliveryOrder /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * Dolibarr version of the loaded document @@ -127,6 +132,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->db = $db; $this->name = "Storm"; $this->description = $langs->trans("DocumentModelStorm"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From d85c8c44fc673fddef4b75ce3906782546dfe2f9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:49:43 +0100 Subject: [PATCH 23/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 3b8baa107ad..41ed6b22554 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik - * Copyright (C) 2011-2020 Philippe Grand + * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * This program is free software; you can redistribute it and/or modify @@ -53,6 +53,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -126,6 +131,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->db = $db; $this->name = "Typhon"; $this->description = $langs->trans("DocumentModelTyphon"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From c03da95acb10bae0374a582a444b1c73569ff49d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:52:12 +0100 Subject: [PATCH 24/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 165e83a8e87..8441597a967 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -51,6 +51,11 @@ class pdf_espadon extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -122,6 +127,7 @@ class pdf_espadon extends ModelePdfExpedition $this->db = $db; $this->name = "espadon"; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From 7c1342845609ac4aa56854853b2014ff64d30b8f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:53:34 +0100 Subject: [PATCH 25/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index bad252bf799..144167e8912 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -52,6 +52,11 @@ class pdf_merou extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -123,6 +128,7 @@ class pdf_merou extends ModelePdfExpedition $this->db = $db; $this->name = "merou"; $this->description = $langs->trans("DocumentModelMerou"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From e638c238c6ce65a366885cd9de4e9a1c8827cdd0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:54:51 +0100 Subject: [PATCH 26/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index f3cffecdd9c..62213127951 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -52,6 +52,11 @@ class pdf_rouget extends ModelePdfExpedition */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -123,6 +128,7 @@ class pdf_rouget extends ModelePdfExpedition $this->db = $db; $this->name = "rouget"; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; $formatarray = pdf_getFormat(); From 0f196d7f19b9807b06c5609e3088e46637605d5a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:56:57 +0100 Subject: [PATCH 27/86] Save the name of generated file as the main doc when generating a doc with this template --- .../core/modules/expensereport/doc/pdf_standard.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 176b09264d4..8495aba945d 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -59,6 +59,11 @@ class pdf_standard extends ModeleExpenseReport */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -133,6 +138,7 @@ class pdf_standard extends ModeleExpenseReport $this->db = $db; $this->name = ""; $this->description = $langs->trans('PDFStandardExpenseReports'); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 4170332aeeed7d08811cdc84cbf4bc204a7705b6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 17:58:54 +0100 Subject: [PATCH 28/86] Save the name of generated file as the main doc when generating a doc with this template --- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 622cd0b2250..844e468a69d 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -54,6 +54,11 @@ class pdf_soleil extends ModelePDFFicheinter */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -124,6 +129,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->db = $db; $this->name = 'soleil'; $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 5856f9e5cb6a1d4b0a2aba27c6a1867a288fbad7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:04:46 +0100 Subject: [PATCH 29/86] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_baleine.modules.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 6baf416ed64..431e7b6e85c 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -38,6 +38,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_baleine extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + /** * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.6 = array(5, 6) @@ -50,6 +75,41 @@ class pdf_baleine extends ModelePDFProjects */ public $version = 'dolibarr'; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Issuer * @var Societe Object that emits @@ -71,6 +131,7 @@ class pdf_baleine extends ModelePDFProjects $this->db = $db; $this->name = "baleine"; $this->description = $langs->trans("DocumentModelBaleine"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 5b5ea075e787abb34f2c8245ee7423bc9ce5eaa6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:07:02 +0100 Subject: [PATCH 30/86] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_beluga.modules.php | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 0f877428052..80862ba32d8 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -54,6 +54,78 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; class pdf_beluga extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.6 = array(5, 6) + */ + public $phpmin = array(5, 6); + + /** + * Dolibarr version of the loaded document + * @var string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Page orientation * @var string 'P' or 'Portait' (default), 'L' or 'Landscape' @@ -81,6 +153,7 @@ class pdf_beluga extends ModelePDFProjects $this->db = $db; $this->name = "beluga"; $this->description = $langs->trans("DocumentModelBeluga"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From 47ca631193ca561d53b1738dbda89b6514a5a1ee Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:09:36 +0100 Subject: [PATCH 31/86] Save the name of generated file as the main doc when generating a doc with this template and missing declarations --- .../project/doc/pdf_timespent.modules.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 5426e076d33..e6fe76cba16 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -37,6 +37,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_timespent extends ModelePDFProjects { + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + /** * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.6 = array(5, 6) @@ -49,6 +74,41 @@ class pdf_timespent extends ModelePDFProjects */ public $version = 'dolibarr'; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + /** * Issuer * @var Societe Object that emits @@ -70,6 +130,7 @@ class pdf_timespent extends ModelePDFProjects $this->db = $db; $this->name = "timespent"; $this->description = $langs->trans("DocumentModelTimeSpent"); + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; From b2e61aa4994b9ed0069e0d640647ceddb5007daa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 5 Feb 2021 18:23:17 +0100 Subject: [PATCH 32/86] fix typo --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 159898f7256..b9f98adfe04 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4914,7 +4914,7 @@ abstract class CommonObject $this->result['filename']=$ecmfile->filename;*/ //var_dump($obj->update_main_doc_field);exit; - // Update the last_main_doc field into main object (if documenent generator has property ->update_main_doc_field set) + // Update the last_main_doc field into main object (if document generator has property ->update_main_doc_field set) $update_main_doc_field = 0; if (!empty($obj->update_main_doc_field)) $update_main_doc_field = 1; if ($update_main_doc_field && !empty($this->table_element)) From f0e1c02caa040c0e25732ea041c3a856d9094bd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 00:05:24 +0100 Subject: [PATCH 33/86] Look and feel v14 - Use placeholder on combolists --- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formother.class.php | 51 ++++++++++++---------- htdocs/core/js/lib_foot.js.php | 28 ++++++------ htdocs/societe/list.php | 14 +++--- 7 files changed, 54 insertions(+), 47 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 34feb8bbe44..42dfff4ae4d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -263,7 +263,7 @@ print '
'; // ThirdParty Type print '
'; // Category diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 6e7c8ef36fb..1bbe2c11b19 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -271,7 +271,7 @@ print ''; // ThirdParty Type print ''; // Category diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 13378979932..ee96f7c39df 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -264,7 +264,7 @@ print ''; // ThirdParty Type print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e7183d4373e..30a730495e4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6431,7 +6431,7 @@ class Form * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...)) * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is the text if it is a placeholder string), <0 to add an empty value with key that is this value. + * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 to show key into label with format "[key] value" * @param int $value_as_key 1 to use value as key * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c71029769f2..dc6820c56fc 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -332,13 +332,13 @@ class FormOther /** * Return select list for categories (to use in form search selectors) * - * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param integer $selected Preselected value - * @param string $htmlname Name of combo list - * @param int $nocateg Show also an entry "Not categorized" - * @param int $showempty Add also an empty line - * @param string $morecss More CSS - * @return string Html combo list code + * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param integer $selected Preselected value + * @param string $htmlname Name of combo list + * @param int $nocateg Show also an entry "Not categorized" + * @param int|string $showempty Add also an empty line + * @param string $morecss More CSS + * @return string Html combo list code * @see select_all_categories() */ public function select_categories($type, $selected = 0, $htmlname = 'search_categ', $nocateg = 0, $showempty = 1, $morecss = '') @@ -368,7 +368,13 @@ class FormOther // Print a select with each of them $moreforfilter .= ''; - if ($showempty) $out .= ''; + if ($showempty) { + $textforempty = ' '; + if (!empty($conf->use_javascript_ajax)) $textforempty = ' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. + if (!is_numeric($showempty)) $textforempty = $showempty; + $out .= ''."\n"; + } // Get list of users allowed to be viewed $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut as status, u.login, u.photo, u.gender, u.entity, u.admin"; @@ -499,11 +510,7 @@ class FormOther $out .= ''; +} + print "
'.$langs->trans('ProspectCustomer').''; - print $object->getLibCustProspStatut(); + // Type Prospect/Customer/Supplier + print '
'.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); print '
'.$langs->trans('Supplier').''; - print yn($object->fournisseur); - print '
'; - $obj = $thirdparty_static; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $thirdparty_static->getTypeUrl(); print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2553179acb8..6d9feac89c6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -829,7 +829,8 @@ if (!empty($arrayfields['country.code_iso']['checked'])) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1); + // We use showempty=0 here because there is already an unknown value into dictionary. + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth100', 1); print ''; @@ -996,7 +997,6 @@ print $searchpicto; print '
'; - $s = ''; - if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - $s .= ''.dol_substr($langs->trans("Prospect"), 0, 1).''; - } - if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $s .= ''.dol_substr($langs->trans("Customer"), 0, 1).''; - } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) - { - $s .= ''.dol_substr($langs->trans("Supplier"), 0, 1).''; - } - print $s; + print $companystatic->getTypeUrl(1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. - print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); + print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. -print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. -print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$langs->trans("NoRecordFound").'
"; print "
"; print ""; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 5b5e9685628..0df74bc166e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1343,6 +1343,14 @@ while ($i < min($num, $limit)) $i++; } +// If no record found +if ($num == 0) +{ + $colspan = 1; + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print '
'.$langs->trans("NoRecordFound").'
'; print ' '; // Column title of weeks numbers - echo ' '; + echo ' '; $i = 0; while ($i < 7) { - print ' '; - print ''; + print ''; @@ -372,7 +375,8 @@ if ($result > 0) } else { - print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail); + $langs->load("errors"); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail).'; } } print ''; From 5712d255b3d639bdb831f9326d94dc71e62b56f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:31:40 +0100 Subject: [PATCH 59/86] Fix bad html --- htdocs/societe/notify/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 7a6e0aaf92e..7f813bba72d 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -231,9 +231,9 @@ if ($result > 0) // Line with titles print '
##'; + print ' '; $numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7); if (!empty($conf->dol_optimize_smallscreen)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ae4c843dad8..4aead28ffda 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3363,7 +3363,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } else { $fakey = 'fa-'.$pictowithouttext; } - if (in_array($pictowithouttext, array('payment', 'loan'))) { + if (in_array($pictowithouttext, array('contract'))) { + $fasize = '0.92em'; + } + if (in_array($pictowithouttext, array('intervention', 'payment', 'loan'))) { $fasize = '0.80em'; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 83bb7365109..1d155bf0cc9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -807,6 +807,10 @@ span.fa.fa-plus-circle.paddingleft { { border-right: 1px solid #DDD; } +.borderleftlight +{ + border-left: 1px solid #DDD; +} #formuserfile { margin-top: 4px; } @@ -3301,6 +3305,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 76fb0692af1..623ecb2a779 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -875,6 +875,11 @@ body[class*="colorblind-"] .text-success{ { border-right: 1px solid #f4f4f4; } +.borderleftlight +{ + border-left: 1px solid #f4f4f4; +} + #formuserfile { margin-top: 4px; } @@ -3254,6 +3259,12 @@ td.borderright { border-right-color: #BBB !important; border-right-style: solid !important; } +td.borderleft { + border: none; /* to erase value for table.nobordernopadding td */ + border-left-width: 1px !important; + border-left-color: #BBB !important; + border-left-style: solid !important; +} /* For table with no filter before */ table.listwithfilterbefore { From 4411497112faddaddfa3861e0864dcd8e4a37328 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Feb 2021 12:27:27 +0100 Subject: [PATCH 45/86] FIX #16156 --- htdocs/societe/consumption.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 779bf573341..cc00738ebeb 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -433,15 +433,15 @@ if ($sql_select) // Status print ''; - if ($type_element == 'contract') - { - print $documentstaticline->getLibStatut(2); + if ($type_element == 'contract') { + print $documentstaticline->getLibStatut(5); } else { - print $documentstatic->getLibStatut(2); + print $documentstatic->getLibStatut(5); } print ''; + // Label + print ''; // Define text, description and type $text = ''; $description = ''; $type = 0; From 4647f279d12cba1a83e4a4ea6291a56defb33de9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:04:16 +0100 Subject: [PATCH 46/86] fix typo --- .../doc/pdf_standard_recruitmentjobposition.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 9b59eeca09d..918fc9f727d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -128,7 +128,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From bf211c64233be1de36c27c94b57a472a57dc9710 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:10:00 +0100 Subject: [PATCH 47/86] fix typo --- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 9232797a008..3daa5288d7e 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -84,9 +84,9 @@ class pdf_eratosthene extends ModelePDFCommandes */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -126,7 +126,7 @@ class pdf_eratosthene extends ModelePDFCommandes public $emetteur; /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From 04373fb5311641ea4cb2843ff5cb23288cdffb51 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:11:08 +0100 Subject: [PATCH 48/86] fix typo --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 423aa5b79d1..0edcdec536b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -80,9 +80,9 @@ class pdf_sponge extends ModelePDFFactures */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -128,7 +128,7 @@ class pdf_sponge extends ModelePDFFactures /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From ce7a3ae2f0d3757e9c099a63420fd0f067130586 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:11:58 +0100 Subject: [PATCH 49/86] fix typo --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 760e678e839..bc71116081e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -78,9 +78,9 @@ class pdf_cyan extends ModelePDFPropales */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -120,7 +120,7 @@ class pdf_cyan extends ModelePDFPropales public $emetteur; /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From b77398b47663dbdd4dde3c8ece66f74454f46a3d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 6 Feb 2021 13:12:39 +0100 Subject: [PATCH 50/86] fix typo --- .../mymodule/doc/pdf_standard_myobject.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index cb9e4f0a6dd..4546d7044bd 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -80,9 +80,9 @@ class pdf_standard_myobject extends ModelePDFMyObject */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ + /** + * @var int page_largeur + */ public $page_largeur; /** @@ -128,7 +128,7 @@ class pdf_standard_myobject extends ModelePDFMyObject /** - * @var array of document table collumns + * @var array of document table columns */ public $cols; From 7860ffa28eb8c4060f6038cbb5d95a7d097b209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 13:48:31 +0100 Subject: [PATCH 51/86] update phpmin version --- htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/core/modules/modAccounting.class.php | 2 +- htdocs/core/modules/modAdherent.class.php | 2 +- htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/core/modules/modApi.class.php | 2 +- htdocs/core/modules/modAsset.class.php | 2 +- htdocs/core/modules/modBom.class.php | 2 +- htdocs/core/modules/modCashDesk.class.php | 2 +- htdocs/core/modules/modEmailCollector.class.php | 2 +- htdocs/core/modules/modExpenseReport.class.php | 2 +- htdocs/core/modules/modGeoIPMaxmind.class.php | 2 +- htdocs/core/modules/modGravatar.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/core/modules/modImport.class.php | 2 +- htdocs/core/modules/modIncoterm.class.php | 2 +- htdocs/core/modules/modLabel.class.php | 2 +- htdocs/core/modules/modLdap.class.php | 2 +- htdocs/core/modules/modLoan.class.php | 2 +- htdocs/core/modules/modMailing.class.php | 2 +- htdocs/core/modules/modMailmanSpip.class.php | 2 +- htdocs/core/modules/modMargin.class.php | 2 +- htdocs/core/modules/modMultiCurrency.class.php | 2 +- htdocs/core/modules/modNotification.class.php | 2 +- htdocs/core/modules/modOauth.class.php | 2 +- htdocs/core/modules/modOpenSurvey.class.php | 2 +- htdocs/core/modules/modPaybox.class.php | 2 +- htdocs/core/modules/modPaymentByBankTransfer.class.php | 2 +- htdocs/core/modules/modPaypal.class.php | 2 +- htdocs/core/modules/modPrelevement.class.php | 2 +- htdocs/core/modules/modPrinting.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modProductBatch.class.php | 2 +- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 2 +- htdocs/core/modules/modReceiptPrinter.class.php | 2 +- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modSalaries.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSocialNetworks.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- htdocs/core/modules/modStock.class.php | 2 +- htdocs/core/modules/modStripe.class.php | 2 +- htdocs/core/modules/modSupplierProposal.class.php | 2 +- htdocs/core/modules/modSyslog.class.php | 2 +- htdocs/core/modules/modTakePos.class.php | 2 +- htdocs/core/modules/modTax.class.php | 2 +- htdocs/core/modules/modTicket.class.php | 2 +- htdocs/core/modules/modUser.class.php | 2 +- htdocs/core/modules/modVariants.class.php | 2 +- htdocs/core/modules/modWebServices.class.php | 2 +- htdocs/core/modules/modWebServicesClient.class.php | 2 +- htdocs/core/modules/modWebsite.class.php | 2 +- htdocs/core/modules/modWorkflow.class.php | 2 +- 54 files changed, 54 insertions(+), 54 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index da1e64ac56e..a5b58e17dcb 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -316,7 +316,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.4 = array(5, 4) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ public $phpmin; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 811dd57544e..4ba6c61c5e3 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -66,7 +66,7 @@ class modAccounting extends DolibarrModules $this->depends = array("modFacture", "modBanque", "modTax"); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module $this->langfiles = array("accountancy", "compta"); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 1db3e2b7d50..ca2dac95b78 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -74,7 +74,7 @@ class modAdherent extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array('modMailmanSpip'); // List of module class names as string this module is in conflict with $this->langfiles = array("members", "companies"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 559260a77c2..d77c5acc2c4 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -73,7 +73,7 @@ class modAgenda extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("companies"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Module parts $this->module_parts = array(); diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 32b16a74703..f578c9084c2 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -83,7 +83,7 @@ class modApi extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array('modZapier'); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 50fe71ef390..505ed444f55 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -90,7 +90,7 @@ class modAsset extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("assets"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 092ceb17d79..f79d353edc7 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -108,7 +108,7 @@ class modBom extends DolibarrModules $this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - //$this->phpmin = array(5,4); // Minimum version of PHP required by module + //$this->phpmin = array(5, 6)); // Minimum version of PHP required by module $this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index e3368fb636f..ca9ffa87d53 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -66,7 +66,7 @@ class modCashDesk extends DolibarrModules $this->hidden = false; // A condition to hide module $this->depends = array('always'=>"modBanque", 'always'=>"modFacture", 'always'=>"modProduct", 'FR'=>'modBlockedLog'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 4); // Minimum version of Dolibarr required by module $this->langfiles = array("cashdesk"); $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index f71932c93b9..ac4b55011c9 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -91,7 +91,7 @@ class modEmailCollector extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("admin"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index befafbc6767..2d0036faef9 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -65,7 +65,7 @@ class modExpenseReport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled // $this->conflictwith = array("modDeplacement"); // Deactivate for access on old information $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7); // Minimum version of Dolibarr required by module $this->langfiles = array("companies", "trips"); diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php index 10515a78449..06438eefab8 100644 --- a/htdocs/core/modules/modGeoIPMaxmind.class.php +++ b/htdocs/core/modules/modGeoIPMaxmind.class.php @@ -69,7 +69,7 @@ class modGeoIPMaxmind extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); + $this->phpmin = array(5, 6); $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 5aa0c2de5c6..a7d8899b0c2 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -77,7 +77,7 @@ class modGravatar extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 7); // Minimum version of Dolibarr required by module $this->langfiles = array(); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index ad36253fe22..edaa872a369 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -71,7 +71,7 @@ class modHRM extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(/*"modSalaries, modExpenseReport, modHoliday"*/); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module $this->langfiles = array("hrm"); diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 6c6eaba69e0..79a4280017c 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -87,7 +87,7 @@ class modHoliday extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("holiday"); diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 094e4a87aca..d2a636e2ca6 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -64,7 +64,7 @@ class modImport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. + $this->phpmin = array(5, 6); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php index 70e6c738801..e33dbdd8236 100644 --- a/htdocs/core/modules/modIncoterm.class.php +++ b/htdocs/core/modules/modIncoterm.class.php @@ -68,7 +68,7 @@ class modIncoterm extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("incoterm"); diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 88e044f0444..58e735666ab 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -61,7 +61,7 @@ class modLabel extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages // $this->config_page_url = array("label.php"); diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index f6004f18410..5f4860d0149 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -67,7 +67,7 @@ class modLdap extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array( diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index c29658ae0a7..d45987e840d 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -67,7 +67,7 @@ class modLoan extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("loan"); // Constants diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 75d423e3ecd..1db638e782f 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -66,7 +66,7 @@ class modMailing extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index f8a74072bdd..bfd2e25493a 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -66,7 +66,7 @@ class modMailmanSpip extends DolibarrModules $this->depends = array('modAdherent'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array('mailman.php'); diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 7a84b401b59..185a86a86aa 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -72,7 +72,7 @@ class modMargin extends DolibarrModules $this->depends = array("modPropale", "modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 2); // Minimum version of Dolibarr required by module $this->langfiles = array("margins"); diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 605276dee0e..e20c5c77f9d 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -88,7 +88,7 @@ class modMultiCurrency extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("multicurrency"); diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index dbc355ce53e..f9191ce3c8d 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -63,7 +63,7 @@ class modNotification extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 48c31b15d24..394d1e00655 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -71,7 +71,7 @@ class modOauth extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("oauth"); diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 623c6d7c43e..ee4a1faf0cd 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -76,7 +76,7 @@ class modOpenSurvey extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 4, 0); // Minimum version of Dolibarr required by module // Constants diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index a5cda052656..1dfe76f471a 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -73,7 +73,7 @@ class modPayBox extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 6); // Minimum version of Dolibarr required by module $this->langfiles = array("paybox"); diff --git a/htdocs/core/modules/modPaymentByBankTransfer.class.php b/htdocs/core/modules/modPaymentByBankTransfer.class.php index 0eab52fcdec..5704badf854 100644 --- a/htdocs/core/modules/modPaymentByBankTransfer.class.php +++ b/htdocs/core/modules/modPaymentByBankTransfer.class.php @@ -68,7 +68,7 @@ class modPaymentByBankTransfer extends DolibarrModules $this->depends = array("modFournisseur", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("paymentbybanktransfer.php"); diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 15a92020062..cdf25d24359 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -74,7 +74,7 @@ class modPaypal extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array('modPaypalPlus'); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("paypal"); diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 4ffa8358a06..4bee933376f 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -67,7 +67,7 @@ class modPrelevement extends DolibarrModules $this->depends = array("modFacture", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("prelevement.php"); diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index b918a8b1158..373ca131d2b 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -70,7 +70,7 @@ class modPrinting extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("printing"); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index f92d9b30890..27d44160949 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -70,7 +70,7 @@ class modProduct extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modStock", "modBarcode", "modProductBatch", "modVariants"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 92bfb9b66a5..e82bdbbd638 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -72,7 +72,7 @@ class modProductBatch extends DolibarrModules $this->depends = array("modProduct", "modStock", "modExpedition", "modFournisseur"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("productbatch"); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ff2edd3c787..7f2e695b8a4 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -68,7 +68,7 @@ class modProjet extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array('projects'); // Constants diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index c0ffa6f0811..bb4ba6c1744 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -69,7 +69,7 @@ class modPropale extends DolibarrModules $this->depends = array("modSociete"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->config_page_url = array("propal.php"); $this->langfiles = array("propal", "bills", "companies", "deliveries", "products"); diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 7143dd0d614..fe95a89d9ce 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -71,7 +71,7 @@ class modReceiptPrinter extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("receiptprinter"); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..7b6aee4ffd6 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -95,7 +95,7 @@ class modResource extends DolibarrModules // List of modules id to disable if this one is disabled $this->requiredby = array('modPlace'); // Minimum version of PHP required by module - $this->phpmin = array(5, 4); + $this->phpmin = array(5, 6); $this->langfiles = array("resource"); // langfiles@resource // Constants diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 23c892333d8..131b0f2945f 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -75,7 +75,7 @@ class modSalaries extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("salaries", "bills"); // Constants diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index b4dd93ff3e0..66a8dc76691 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -68,7 +68,7 @@ class modService extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index bf7573a912b..368634083ee 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -69,7 +69,7 @@ class modSocialNetworks extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array(); // Constants diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index e5a3c584adb..2d32ae3f0c4 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -70,7 +70,7 @@ class modSociete extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modExpedition", "modFacture", "modFournisseur", "modFicheinter", "modPropale", "modContrat", "modCommande"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("companies", 'bills', "compta", "admin", "banks"); // Constants diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 5ae6688a31f..0b390b55dc2 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -69,7 +69,7 @@ class modStock extends DolibarrModules $this->depends = array("modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modProductBatch"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("stocks"); // Constants diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 4d95a6329ba..652db701110 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -72,7 +72,7 @@ class modStripe extends DolibarrModules $this->hidden = false; // A condition to hide module $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(5, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("stripe"); diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 6074966b4b1..9fe6df1ae1f 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -70,7 +70,7 @@ class modSupplierProposal extends DolibarrModules $this->depends = array('modFournisseur'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("supplier_proposal"); // Constants diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 01079310e4b..d003108726e 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -71,7 +71,7 @@ class modSyslog extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index e8162ebf570..8a3d4a73776 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -102,7 +102,7 @@ class modTakePos extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("cashdesk"); - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index 3e2a62e099a..bf064d743f8 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -71,7 +71,7 @@ class modTax extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("compta", "bills"); // Constants diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 7746bf9ca52..bad4457466f 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -96,7 +96,7 @@ class modTicket extends DolibarrModules $this->depends = array('modAgenda'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index dba5f864e8f..df376a6ee61 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -68,7 +68,7 @@ class modUser extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("main", "users", "companies", "members", "salaries", "hrm"); $this->always_enabled = true; // Can't be disabled diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index 72b29230def..b40bd60f786 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -83,7 +83,7 @@ class modVariants extends DolibarrModules $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("products"); diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index e61ed5dc689..a6362a175cc 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -63,7 +63,7 @@ class modWebServices extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index 52a8889fbbb..b59e6cb9e13 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -63,7 +63,7 @@ class modWebServicesClient extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index c452ed9ded2..295e7ccefa4 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -68,7 +68,7 @@ class modWebsite extends DolibarrModules $this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("website"); // Constants diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index c7bd464b9d1..ec1c458ce00 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -72,7 +72,7 @@ class modWorkflow extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 8); // Minimum version of Dolibarr required by module $this->langfiles = array("@workflow"); From 4249abb2dea347386921fc97e4ff43a53931f83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 13:57:11 +0100 Subject: [PATCH 52/86] phpcs --- htdocs/blockedlog/class/blockedlog.class.php | 87 ++++++++++++++------ 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 1a2868a6a58..7844432f3f8 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -133,19 +133,33 @@ class BlockedLog * * @return int Always 1 */ - public function loadTrackedEvents() { + public function loadTrackedEvents() + { global $conf; $this->trackedevents = array(); - if ($conf->facture->enabled) $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; - if ($conf->facture->enabled) $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; - if ($conf->facture->enabled) $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; - if ($conf->facture->enabled) $this->trackedevents['DOC_DOWNLOAD'] = 'BlockedLogBillDownload'; - if ($conf->facture->enabled) $this->trackedevents['DOC_PREVIEW'] = 'BlockedLogBillPreview'; - - if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_CREATE'] = 'logPAYMENT_CUSTOMER_CREATE'; - if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_DELETE'] = 'logPAYMENT_CUSTOMER_DELETE'; + if ($conf->facture->enabled) { + $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; + } + if ($conf->facture->enabled) { + $this->trackedevents['DOC_DOWNLOAD'] = 'BlockedLogBillDownload'; + } + if ($conf->facture->enabled) { + $this->trackedevents['DOC_PREVIEW'] = 'BlockedLogBillPreview'; + } + if ($conf->facture->enabled) { + $this->trackedevents['PAYMENT_CUSTOMER_CREATE'] = 'logPAYMENT_CUSTOMER_CREATE'; + } + if ($conf->facture->enabled) { + $this->trackedevents['PAYMENT_CUSTOMER_DELETE'] = 'logPAYMENT_CUSTOMER_DELETE'; + } /* Supplier if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; @@ -158,12 +172,20 @@ class BlockedLog if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; */ - if ($conf->don->enabled) $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; - if ($conf->don->enabled) $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; + if ($conf->don->enabled) { + $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; + } + if ($conf->don->enabled) { + $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; + } //if ($conf->don->enabled) $this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL'; - if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_CREATE'] = 'logDONATION_PAYMENT_CREATE'; - if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_DELETE'] = 'logDONATION_PAYMENT_DELETE'; + if ($conf->don->enabled) { + $this->trackedevents['DONATION_PAYMENT_CREATE'] = 'logDONATION_PAYMENT_CREATE'; + } + if ($conf->don->enabled) { + $this->trackedevents['DONATION_PAYMENT_DELETE'] = 'logDONATION_PAYMENT_DELETE'; + } /* if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; @@ -171,18 +193,29 @@ class BlockedLog if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; */ - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; - if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; - - - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; - if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; - + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; + } + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; + } + if ($conf->adherent->enabled) { + $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; + } + if ($conf->banque->enabled) { + $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; + } // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); - if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + if ($moduleposenabled) { + $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + } // Add more action to track from a conf variable if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) { @@ -968,16 +1001,16 @@ class BlockedLog if ($element == 'all') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity; + WHERE entity=".$conf->entity; } elseif ($element == 'not_certified') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND certified = 0"; + WHERE entity=".$conf->entity." AND certified = 0"; } elseif ($element == 'just_certified') { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND certified = 1"; + WHERE entity=".$conf->entity." AND certified = 1"; } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog - WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."'"; + WHERE entity=".$conf->entity." AND element='".$this->db->escape($element)."'"; } if ($fk_object) $sql .= natural_search("rowid", $fk_object, 1); From eaaefe1382f4ff7b9dad33357aaf19236a8e3f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 14:12:22 +0100 Subject: [PATCH 53/86] 5.5 to 5.6 --- htdocs/core/modules/modMrp.class.php | 2 +- htdocs/core/modules/modRecruitment.class.php | 2 +- htdocs/core/modules/modWorkstation.class.php | 2 +- htdocs/core/modules/modZapier.class.php | 2 +- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- .../doc/doc_generic_recruitmentjobposition_odt.modules.php | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 012bb2d576a..46090c4c5d5 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -122,7 +122,7 @@ class modMrp extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(8, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 8e282a9513d..c85b61c179c 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -122,7 +122,7 @@ class modRecruitment extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("recruitment"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 5f55e2b2207..797f7c8c5e0 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -124,7 +124,7 @@ class modWorkstation extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index ee7589c6537..09abd0e9dc7 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -123,7 +123,7 @@ class modZapier extends DolibarrModules $this->conflictwith = array(); $this->langfiles = array("zapier"); // Minimum version of PHP required by module - //$this->phpmin = array(5, 5); + //$this->phpmin = array(5, 6); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(10, 0); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 9d47069d7da..e4f662c9e99 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -144,7 +144,7 @@ class modMyModule extends DolibarrModules $this->langfiles = array("mymodule@mymodule"); // Prerequisites - $this->phpmin = array(5, 5); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 59ea51466b6..0a8fb1bab0f 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.5 = array(5, 5) + * e.g.: PHP ≥ 5.6 = array(5, 6) */ - public $phpmin = array(5, 5); + public $phpmin = array(5, 6); /** * @var string Dolibarr version of the loaded document From 3bcf795d5576df7140632a2dcce223d9d1bb3fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 14:44:08 +0100 Subject: [PATCH 54/86] add more picto for module --- htdocs/core/modules/modRecruitment.class.php | 1 + htdocs/core/modules/modStripe.class.php | 1 + htdocs/core/modules/modTicket.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 8e282a9513d..02db6a8e075 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -270,6 +270,7 @@ class modRecruitment extends DolibarrModules 'fk_menu'=>'fk_mainmenu=hrm', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Top menu entry 'titre'=>'Recruitment', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'hrm', 'leftmenu'=>'recruitmentjobposition', 'url'=>'/recruitment/recruitmentindex.php', diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 4d95a6329ba..c05323aa34b 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -112,6 +112,7 @@ class modStripe extends DolibarrModules 'fk_menu'=>'fk_mainmenu=bank', 'type'=>'left', 'titre'=>'StripeAccount', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'bank', 'leftmenu'=>'stripe', 'url' => '', diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 7746bf9ca52..2d7a6c7c4e6 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -96,7 +96,7 @@ class modTicket extends DolibarrModules $this->depends = array('modAgenda'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 4); // Minimum version of PHP required by module + $this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants @@ -208,6 +208,7 @@ class modTicket extends DolibarrModules $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket', 'type' => 'left', 'titre' => 'Ticket', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu' => 'ticket', 'leftmenu' => 'ticket', 'url' => '/ticket/index.php', From 0be168561f8c0badd0482ee6eb1d962a75b50590 Mon Sep 17 00:00:00 2001 From: Raphael Schweizer Date: Sat, 6 Feb 2021 16:10:05 +0100 Subject: [PATCH 55/86] prevent browsers from storing / suggesting old captchas --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7934bb58009..8d9c79f807d 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -177,7 +177,7 @@ if ($captcha) { - " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" /> + " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 44d3c0199ac..2fb21094b4d 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -126,7 +126,7 @@ if (!empty($captcha)) { - " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" /> + " class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" /> From b96e405717c84e2ebbee059611b84cfe4ed13f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 17:18:00 +0100 Subject: [PATCH 56/86] add picto member --- htdocs/core/menus/standard/eldy.lib.php | 3 +-- htdocs/core/modules/modAgenda.class.php | 1 + htdocs/core/modules/modOpenSurvey.class.php | 1 + htdocs/core/modules/modResource.class.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f1141140973..43d6c79ced6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1838,7 +1838,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Load translation files required by the page $langs->loadLangs(array("members", "compta")); - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members'); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"')); $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); @@ -1888,7 +1888,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM //print $paramkey; if (!empty($conf->global->$paramkey)) { $link = "/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - $newmenu->add($link, dol_trunc($conf->global->$paramkey, 24)); } $i++; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 559260a77c2..8cb246d2a2c 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -221,6 +221,7 @@ class modAgenda extends DolibarrModules 'fk_menu'=>'r=0', 'type'=>'left', 'titre'=>'Actions', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 623c6d7c43e..f67b93fbc28 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -126,6 +126,7 @@ class modOpenSurvey extends DolibarrModules 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'Survey', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'tools', 'leftmenu'=>'opensurvey', 'url'=>'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey', diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..c679407c0cc 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -188,6 +188,7 @@ class modResource extends DolibarrModules 'fk_menu'=>'fk_mainmenu=tools', 'type'=>'left', 'titre'=> 'MenuResourceIndex', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'tools', 'leftmenu'=> 'resource', 'url'=> '/resource/list.php', From 0bfe55c3d2f944d1d1305a4a22b44b5b83bd179b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Feb 2021 17:26:16 +0100 Subject: [PATCH 57/86] add picto mail --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 43d6c79ced6..3048dc7837b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1807,11 +1807,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if ($mainmenu == 'tools') { if (empty($user->socid)) { // limit to internal users $langs->load("mails"); - $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates'); + $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); } if (!empty($conf->mailing->enabled)) { - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing'); + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); } From d4df62f1da865c83dc57c3c79de77af4973b5b7d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:25:41 +0100 Subject: [PATCH 58/86] Look and feel v14 --- htdocs/core/class/html.form.class.php | 16 +++++----------- htdocs/societe/notify/card.php | 10 +++++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 30a730495e4..0cd09c52dbd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -668,7 +668,7 @@ class Form $ret .= ''; - if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.'.$name.'select'); + if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.'.$name.'select'); // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button $ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER. @@ -6447,7 +6447,7 @@ class Form * @return string HTML select string. * @see multiselectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 0, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) + public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 1, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) { global $conf, $langs; @@ -6461,11 +6461,7 @@ class Form $out = ''; // Add code for jquery to use multiselect - if ($addjscombo && $jsbeautify) - { - $minLengthToAutocomplete = 0; - $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? (constant('REQUIRE_JQUERY_MULTISELECT') ?constant('REQUIRE_JQUERY_MULTISELECT') : 'select2') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; - + if ($addjscombo && $jsbeautify) { // Enhance with select2 include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); @@ -6475,16 +6471,14 @@ class Form $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); $out .= '>'; - if ($show_empty) - { + if ($show_empty) { $textforempty = ' '; if (!empty($conf->use_javascript_ajax)) $textforempty = ' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. if (!is_numeric($show_empty)) $textforempty = $show_empty; $out .= ''."\n"; } - if (is_array($array)) - { + if (is_array($array)) { // Translate if ($translate) { diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 5730d8f1ff4..7a6e0aaf92e 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -139,6 +139,7 @@ $result = $object->fetch($socid); $title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.' - '.$langs->trans("Notification"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + llxHeader('', $title, $help_url); @@ -323,7 +324,9 @@ if ($result > 0) $contactstatic->id = $obj->contact_id; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; - print '
'.$contactstatic->getNomUrl(1); + + print '
'.$contactstatic->getNomUrl(1); if ($obj->type == 'email') { if (isValidEmail($obj->email)) @@ -331,7 +334,7 @@ if ($result > 0) print ' <'.$obj->email.'>'; } else { $langs->load("errors"); - print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); + print ' '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email).''; } } print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -297,14 +297,14 @@ if ($result > 0) } // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From f62b4c15e8abcf63a0887e6235b498b898c3e7ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:31:40 +0100 Subject: [PATCH 60/86] Fix bad html --- htdocs/societe/notify/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 5730d8f1ff4..bf9ec2e6fa7 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -230,9 +230,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -296,14 +296,14 @@ if ($result > 0) } // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From 36fbba2ac24790128dee75e55d3e9dbe72898c78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:40:14 +0100 Subject: [PATCH 61/86] Make page to setup notification simpler --- htdocs/societe/notify/card.php | 110 +++++++++++++-------------------- 1 file changed, 44 insertions(+), 66 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 7f813bba72d..c5d06f1e756 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; -$langs->loadLangs(array("companies", "mails", "admin", "other")); +$langs->loadLangs(array("companies", "mails", "admin", "other", "errors")); $socid = GETPOST("socid", 'int'); $action = GETPOST('action', 'aZ09'); @@ -219,64 +219,6 @@ if ($result > 0) print '

'."\n"; - // Add notification form - print load_fiche_titre($langs->trans("AddNewNotification"), '', ''); - - print '
'; - print ''; - print ''; - - $param = "&socid=".$socid; - - // Line with titles - print '
'; - print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); - print_liste_field_titre(''); - print "\n"; - - $var = false; - $listofemails = $object->thirdparty_and_contact_email_array(); - if (count($listofemails) > 0) - { - $actions = array(); - - // Load array of available notifications - $notificationtrigger = new InterfaceNotification($db); - $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); - - foreach ($listofmanagedeventfornotification as $managedeventfornotification) - { - $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); - $actions[$managedeventfornotification['rowid']] = $label; - } - print ''; - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - } - - print '
'; - print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 0, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); - print ''; - $type = array('email'=>$langs->trans("EMail")); - print $form->selectarray("typeid", $type); - print '
'; - print $langs->trans("YouMustCreateContactFirst"); - print '
'; - - - print ''; - print '
'; - - // List of notifications enabled for contacts $sql = "SELECT n.rowid, n.type,"; $sql .= " a.code, a.label,"; @@ -296,20 +238,58 @@ if ($result > 0) dol_print_error($db); } - // List of active notifications + + // Add notification form print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); + print '
'; + print ''; + print ''; + + $param = "&socid=".$socid; + // Line with titles print ''; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); - print_liste_field_titre('', '', ''); - print ''; + print_liste_field_titre(''); + print "\n"; + + // Line to add a new subscription + $listofemails = $object->thirdparty_and_contact_email_array(); + if (count($listofemails) > 0) + { + $actions = array(); + + // Load array of available notifications + $notificationtrigger = new InterfaceNotification($db); + $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents(); + + foreach ($listofmanagedeventfornotification as $managedeventfornotification) + { + $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); + $actions[$managedeventfornotification['rowid']] = $label; + } + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } - $langs->load("errors"); - $langs->load("other"); if ($num) { @@ -358,7 +338,6 @@ if ($result > 0) foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; From 03124870cd99bd7188e1268c05958618d086d0b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:52:35 +0100 Subject: [PATCH 62/86] Responsive --- htdocs/societe/notify/card.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index c5d06f1e756..10f01e65ea8 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -209,14 +209,15 @@ if ($result > 0) print "\n"; // Help - print '
'; + print '
'; print $langs->trans("NotificationsDesc"); print '
'.$langs->trans("NotificationsDescUser"); print '
'.$langs->trans("NotificationsDescContact"); print '
'.$langs->trans("NotificationsDescGlobal"); + print '
'; print '
'; - print '

'."\n"; + print '
'."\n"; // List of notifications enabled for contacts @@ -249,7 +250,8 @@ if ($result > 0) $param = "&socid=".$socid; // Line with titles - print '
'; + print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + $type = array('email'=>$langs->trans("EMail")); + print $form->selectarray("typeid", $type); + print '
'; + print $langs->trans("YouMustCreateContactFirst"); + print '
'; $listtmp=explode(',',$val); $first=1; @@ -399,7 +378,6 @@ if ($result > 0) /*if ($user->admin) { - $var = ! $var; print '
'; print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; print '
'; + print '
'; + print '
'; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); @@ -272,15 +274,16 @@ if ($result > 0) $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']); $actions[$managedeventfornotification['rowid']] = $label; } - print ''; + print ''; - print ''; print ''; print ''; print ''; @@ -318,7 +321,7 @@ if ($result > 0) } } print ''; - print ''; @@ -384,7 +387,8 @@ if ($result > 0) }*/ print '
'; - print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print '
'; + print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); print ''; - print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); + print ''; + print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); print ''; $type = array('email'=>$langs->trans("EMail")); - print $form->selectarray("typeid", $type); + print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); print '
'; + print ''; $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label); print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label; print '
'; - + print ''; + print '
'; print '

'."\n"; @@ -440,7 +444,8 @@ if ($result > 0) print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); // Line with titles - print ''; + print '
'; + print '
'; print ''; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder); @@ -499,6 +504,7 @@ if ($result > 0) } print '
'; + print ''; print ''; } else dol_print_error('', 'RecordNotFound'); From a31c930522f9ed0dbfc84a102c720e044edae6e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:53:42 +0100 Subject: [PATCH 63/86] Fix look and feel v13 --- htdocs/societe/notify/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 10f01e65ea8..b911bfb034e 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -158,7 +158,7 @@ if ($result > 0) print '
'; print '
'; - print ''; + print '
'; // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field From 536ddd483211e0439b0f6c200dc7b9953940cae5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 17:53:42 +0100 Subject: [PATCH 64/86] Fix look and feel v13 --- htdocs/societe/notify/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index bf9ec2e6fa7..665039c6bc0 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -157,7 +157,7 @@ if ($result > 0) print '
'; print '
'; - print '
'; + print '
'; // Prefix if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field From b74ea17dd2c49ff062ed2151c2f406dae8324d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:14:50 +0100 Subject: [PATCH 65/86] fix html --- htdocs/user/notify/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 3c7395fe1e8..e7fc1cf81ab 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -195,9 +195,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -271,9 +271,9 @@ if ($result > 0) // Line with titles print '
'; print ''; - print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '"width="45%"', $sortfield, $sortorder); - print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '"width="35%"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '"width="10%"', $sortfield, $sortorder); + print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder); + print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder); print_liste_field_titre('', '', ''); print ''; From 51da7273a4c2ee03936731ea3b7cdc04cf853728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:18:45 +0100 Subject: [PATCH 66/86] Update payment.php --- htdocs/admin/payment.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 925c8fd6ff4..d27096df8f9 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -157,9 +157,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) - { - $var = !$var; + if ($module->isEnabled()) { print ''; print "\n"; foreach ($list as $key) { - $var = !$var; - - print ''; + print ''; // Param $label = $langs->trans($key); From 4b6d3d00206c0c998791477f7afe7190f8134695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:25:48 +0100 Subject: [PATCH 71/86] Update dynamic_prices.php --- htdocs/product/admin/dynamic_prices.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index bae21309022..4d2307d17ac 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -170,10 +170,8 @@ if ($action != 'create_updater' && $action != 'edit_updater') print ''; $arrayglobalvars = $price_globals->listGlobalVariables(); - if (!empty($arrayglobalvars)) - { + if (!empty($arrayglobalvars)) { foreach ($arrayglobalvars as $i=>$entry) { - $var = !$var; print ''; print ''; print ''; From b3dc87f3b75687f2335bd9bad449b4f3a90e76d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:31:31 +0100 Subject: [PATCH 72/86] fix phpcs --- htdocs/core/class/html.form.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0cd09c52dbd..3b0432e0f57 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2014-2020 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador @@ -1800,10 +1800,9 @@ class Form } $out .= ' data-html="'; $outhtml = ''; -// if (!empty($obj->photo)) -// { - $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; -// } + // if (!empty($obj->photo)) { + $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; + // } if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; $outhtml .= $labeltoshow; if ($showstatus >= 0 && $obj->status == 0) $outhtml .= ''; From b4e6a49930efc501eff5f350adbe863475038e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:35:03 +0100 Subject: [PATCH 73/86] Update card.php --- htdocs/user/notify/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index e7fc1cf81ab..d09ee52077f 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -322,10 +322,8 @@ if ($result > 0) // List of notifications enabled for fixed email /* - foreach($conf->global as $key => $val) - { + foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; - $var = ! $var; print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -435,7 +435,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } // Label of permission From 8d49ca9f0d90e92de77711e93b40400ccad28171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:49:46 +0100 Subject: [PATCH 75/86] fix html --- htdocs/admin/commande.php | 6 +++--- htdocs/admin/propal.php | 2 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/supplier_proposal.php | 2 +- htdocs/expedition/card.php | 4 ++-- htdocs/expedition/shipment.php | 4 ++-- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/societe/admin/societe.php | 10 +++++----- htdocs/user/group/perms.php | 4 ++-- htdocs/user/perms.php | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 5e5655f918f..c971cf42091 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -668,7 +668,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_... print ''; print ''; -print ''; +print ''; print ' + (".$value['nb'].")"; } } @@ -1412,7 +1412,7 @@ if ($action == 'create') print ' + (".$value['nb'].")"; print ""; } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 39772360227..1c4e5bf5c25 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -813,8 +813,8 @@ if ($id > 0 || !empty($ref)) } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''."\n"; } } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4175e5064c6..c9150c69792 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -925,7 +925,7 @@ if ($id > 0 || !empty($ref)) { print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, ''); print ''; } - print ''; // Supplier ref + Qty ordered + qty already dispatched + print ''; // Supplier ref + Qty ordered + qty already dispatched } else { $type = 'dispatch'; $colspan = 7; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index aa738f0845b..daaf9fbd623 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -784,7 +784,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; -print ''; +print ''; print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -351,7 +351,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } $permlabel = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 68238b63c29..a05fd76df7b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -424,7 +424,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } } else { // Do not own permission @@ -435,7 +435,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print ''; } - print ''; + print ''; } // Label of permission From e0b2e26da6c698d8fc990e53239029908a53dfcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:05:10 +0100 Subject: [PATCH 76/86] fix html --- htdocs/comm/mailing/cibles.php | 6 +++--- htdocs/comm/propal/list.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/projet/list.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index bcf1e9c1e3b..a2a06c2a038 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -575,17 +575,17 @@ if ($object->fetch($id) >= 0) print ''; // Source print ''; // Date last update print ''; // Date sending print ''; //Statut diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9b585bc54a9..a4aad3afab5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1386,7 +1386,7 @@ if ($resql) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 95c2e721b09..85ee1512924 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -746,7 +746,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 76697359299..b8ab088cf85 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -809,7 +809,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } else { - print ' '; + print ' '; } print ''; if (!$i) $totalarray['nbfield']++; From c3d1f3de3c1a9426c7562e084c6460f6197007cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:12:26 +0100 Subject: [PATCH 77/86] fix html --- htdocs/user/clicktodial.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index fff39a3d45f..cb113166cad 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -185,7 +185,7 @@ if ($id > 0) { print '
'; print '
'; - print '     '; + print '     '; print ''; print '
'; } From 0e1353733da063f776ae0e07b8b0029aab49fc8e Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 7 Feb 2021 19:21:52 +0100 Subject: [PATCH 78/86] Fix #15940 mixing different joins --- htdocs/fourn/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0ebfd024658..1f2b55d0628 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -319,6 +319,7 @@ if (!$search_all) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefou if ($search_all || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; // We'll need this table joined to the select in order to filter by sale if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_user > 0) @@ -326,7 +327,6 @@ if ($search_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; From ebe7e1464adfc3112d880afab4835bb046581bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:38:46 +0100 Subject: [PATCH 79/86] fix html --- htdocs/core/boxes/box_dolibarr_state_board.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 833f1c4478f..72693860fae 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -291,9 +291,6 @@ class box_dolibarr_state_board extends ModeleBoxes $boxstat .= '
'; $boxstat .= '
'; - $boxstat .= '
'; - $boxstat .= '
'; echo preg_replace('/\-.*$/', '', preg_replace('/mod_payment_/', '', preg_replace('/\.php$/', '', $file))); print "\n"; From 8d90063e8ffbf576019b66e8183d8e3a4732ea73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:19:57 +0100 Subject: [PATCH 67/86] Update paymentbybanktransfer.php --- htdocs/admin/paymentbybanktransfer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 113c4e18510..cea40f9f840 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -281,9 +281,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name)?$name:$module->name); print "\n"; From e37ca613d267a2cca2f60981534585728f8bd48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:20:46 +0100 Subject: [PATCH 68/86] Update prelevement.php --- htdocs/admin/prelevement.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index a51fc8b39f4..0e6f926cb10 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -287,9 +287,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name)?$name:$module->name); print "\n"; From 9aca5f0535c92b335cc1ec554cd59e716ac2a6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:21:39 +0100 Subject: [PATCH 69/86] Update propal.php --- htdocs/admin/propal.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 6d80aa78211..7a27530320a 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -383,9 +383,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; - if ($modulequalified) - { - $var = !$var; + if ($modulequalified) { print '
'; print (empty($module->name) ? $name : $module->name); print "\n"; From d5ffbae3b360c7a5795585ea44cb021870f30e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:24:30 +0100 Subject: [PATCH 70/86] Update admin_hrm.php --- htdocs/hrm/admin/admin_hrm.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 4648c2d690a..c4081e1d454 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -88,9 +88,7 @@ print ''.$langs->trans('Parameters').'
'.$entry->code.''.$entry->description.'
'; $listtmp=explode(',',$val); $first=1; From 05c7bcf70fae48c9ad6a51beb561d0e3f70dbb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 18:45:34 +0100 Subject: [PATCH 74/86] Update perms.php --- htdocs/user/perms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 68238b63c29..a05fd76df7b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -424,7 +424,7 @@ if ($result) print img_picto($langs->trans("Add"), 'switch_off'); print '    
'.$langs->trans("ShippableOrderIconInList").'  '; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; @@ -687,7 +687,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); @@ -717,7 +717,7 @@ if ($conf->stock->enabled) { print '
'; - print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; + print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 6d80aa78211..6b0f6f3fabe 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -654,7 +654,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f255a77348a..543a6196469 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -485,7 +485,7 @@ if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER'); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index dac0a733782..9910f08b064 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -511,7 +511,7 @@ print ''; if ($conf->banque->enabled) { print '
'; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c4d646160e5..9e08673f4a7 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1259,7 +1259,7 @@ if ($action == 'create') } print "
      -> ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   ".$value['nb_total']."   ".$value['stock']." ".$img."
'; print "      -> ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   ".$value['nb_total']."   ".$value['stock']." ".$img."
      -> '.$value['fullpath'].' ('.$value['nb'].') '.$value['nb_total'].'    '.$value['stock'].' '.$img.'
  
'.$langs->trans("AddRefInList").'  '; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { @@ -799,7 +799,7 @@ print '
'.$langs->trans("AddAdressInList").'  '; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { @@ -814,7 +814,7 @@ print '
'.$langs->trans("AddEmailPhoneTownInContactList").'  '; if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { print ''; @@ -830,7 +830,7 @@ if (!empty($conf->expedition->enabled)) { if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print '
'.$langs->trans("AskForPreferredShippingMethod").'  '; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { @@ -848,7 +848,7 @@ if (!empty($conf->expedition->enabled)) { // Disable Prospect/Customer thirdparty type print '
'.$langs->trans("DisableProspectCustomerType").'  '; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index badf3840582..ee60b90b994 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -340,7 +340,7 @@ if ($object->id > 0) print img_picto($langs->trans("Add"), 'switch_off'); print '        '; - print ' '; + print ' '; print ''; - print ' '; + print ' '; print ''; - print ' '; + print ' '; print '
'; - $this->info_box_contents[0][0] = array( 'td' => '', 'textnoformat' => $boxstat From 58a39a263bed3ce449bebb31318a392be0a7514f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:44:09 +0100 Subject: [PATCH 80/86] Update box_produits.php --- htdocs/core/boxes/box_produits.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index f36b0500655..44333683000 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2021 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -196,7 +196,7 @@ class box_produits extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', 'asis' => 1 ); From 8c71c8335e037c14a703daae0de9cabc9df230bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 19:44:22 +0100 Subject: [PATCH 81/86] Fix TZ problems --- htdocs/comm/action/index.php | 56 +++++++++++++-------------- htdocs/comm/action/list.php | 10 ++--- htdocs/comm/action/pertype.php | 38 +++++++++--------- htdocs/comm/action/peruser.php | 56 ++++++++++++++------------- htdocs/core/class/html.form.class.php | 10 +++-- htdocs/core/lib/company.lib.php | 36 ++++++++--------- htdocs/theme/eldy/global.inc.php | 8 ++++ 7 files changed, 112 insertions(+), 102 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e969351c41e..d5f5edbb143 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -280,10 +280,10 @@ if (empty($action) || $action == 'show_month') $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'tzuserrel'); $next_day = 7 - ($max_day_in_month + 1 - $tmpday) % 7; if ($next_day < 6) $next_day += 7; - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } if ($action == 'show_week') { @@ -304,10 +304,10 @@ if ($action == 'show_week') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); - $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); + $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year, 'gmt')); $tmpday = $first_day; } @@ -323,8 +323,8 @@ if ($action == 'show_day') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'gmt'); - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; @@ -607,17 +607,18 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND (a.fk_soc IS if ($socid > 0) $sql .= ' AND a.fk_soc = '.$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; +//var_dump($day.' '.$month.' '.$year); if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -723,9 +724,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); //var_dump($annee.'-'.$mois.'-'.$jour); @@ -1539,9 +1540,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa foreach ($eventarray as $daykey => $notused) { - $annee = date('Y', $daykey); - $mois = date('m', $daykey); - $jour = date('d', $daykey); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { @@ -1703,20 +1704,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (empty($event->fulldayevent)) { // Show hours (start ... end) - $tmpyearstart = date('Y', $event->date_start_in_calendar); - $tmpmonthstart = date('m', $event->date_start_in_calendar); - $tmpdaystart = date('d', $event->date_start_in_calendar); - $tmpyearend = date('Y', $event->date_end_in_calendar); - $tmpmonthend = date('m', $event->date_end_in_calendar); - $tmpdayend = date('d', $event->date_end_in_calendar); - /*var_dump($tmpyearstart.' '.$tmpmonthstart.' '.$tmpdaystart); - var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend); - var_dump($annee.' '.$mois.' '.$jour);*/ + $tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel'); + $tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel'); + $tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel'); + $tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel'); // Hour start if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) { - $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) @@ -1736,7 +1734,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); } } else { if ($showinfo) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ed7caa173b1..b1d864589e8 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,9 +67,9 @@ $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); -$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); -$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); +$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'), 'tzuserrel'); +$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); @@ -566,12 +566,12 @@ if ($resql) if (!empty($arrayfields['a.note']['checked'])) print ''; if (!empty($arrayfields['a.datep']['checked'])) { print ''; - print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); + print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['a.datep2']['checked'])) { print ''; - print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0); + print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['s.nom']['checked'])) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f956b5ae5f7..a399ee3d580 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -265,7 +265,7 @@ $next_month = $month; $next_day = $day; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) -$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); +$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); //print $firstday.'-'.$first_month.'-'.$first_year; //print dol_print_date($firstdaytoshow,'dayhour'); @@ -482,14 +482,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -599,9 +599,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -858,9 +858,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { @@ -931,9 +931,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -944,13 +944,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -990,13 +990,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 2dc62a52e91..6b54a327705 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -404,7 +404,11 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); + if ($begin_h !== '') $newparam .= '&begin_h='.urlencode($begin_h); + if ($end_h !== '') $newparam .= '&end_h='.urlencode($end_h); + if ($begin_d !== '') $newparam .= '&begin_d='.urlencode($begin_d); + if ($end_d !== '') $newparam .= '&end_d='.urlencode($end_d); //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; @@ -487,14 +491,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -605,9 +609,10 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); + //print $daycursor.' '.dol_print_date($daycursor, 'dayhour', 'gmt').' '.$event->id.' -> '.$annee.'-'.$mois.'-'.$jour.'
'; // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -920,7 +925,7 @@ jQuery(document).ready(function() { if (ids == \'none\') /* No event */ { /* alert(\'no event\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'" + url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day.($begin_h !== '' ? '&begin_h='.$begin_h : '').($end_h !== '' ? '&end_h='.$end_h : '').($begin_d !== '' ? '&begin_d='.$begin_d : '').($end_d !== '' ? '&end_d='.$end_d : '')).'" window.location.href = url; } else if (ids.indexOf(",") > -1) /* There is several events */ @@ -979,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2 = array(); // Color second half hour $i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array(); - $ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $nextindextouse = count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... @@ -988,16 +993,16 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { // Scan all event for this date foreach ($eventarray[$daykey] as $index => $event) { - //print $daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; + //print $daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; //var_dump($event); $keysofuserassigned = array_keys($event->userassigned); @@ -1078,7 +1083,6 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // Define color $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } - //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Define all rects with event (cases1 is first half hour, cases2 is second half hour) for ($h = $begin_h; $h < $end_h; $h++) @@ -1087,9 +1091,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -1100,13 +1104,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -1146,13 +1150,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0cd09c52dbd..2b08d83d683 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5586,9 +5586,11 @@ class Form */ public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = 're', $empty = 0) { - $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty); - $ret .= '
'; - $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty); + global $langs; + + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); + $ret .= '
'; + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); return $ret; } @@ -5703,7 +5705,7 @@ class Form if (strval($set_time) != '' && $set_time != -1) { //$formated_date=dol_print_date($set_time,$conf->format_date_short); - $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput"), $gm); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript } // Calendrier popup version eldy diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 133a8fb86cd..a424657e206 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1206,27 +1206,23 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin global $form; global $param, $massactionbutton; - $start_year = GETPOST('dateevent_startyear'); - $start_month = GETPOST('dateevent_startmonth'); - $start_day = GETPOST('dateevent_startday'); - $end_year = GETPOST('dateevent_endyear'); - $end_month = GETPOST('dateevent_endmonth'); - $end_day = GETPOST('dateevent_endday'); + $start_year = GETPOST('dateevent_startyear', 'int'); + $start_month = GETPOST('dateevent_startmonth', 'int'); + $start_day = GETPOST('dateevent_startday', 'int'); + $end_year = GETPOST('dateevent_endyear', 'int'); + $end_month = GETPOST('dateevent_endmonth', 'int'); + $end_day = GETPOST('dateevent_endday', 'int'); $tms_start = ''; $tms_end = ''; if (!empty($start_year) && !empty($start_month) && !empty($start_day)) { - $search_start = $start_year.'-'.$start_month.'-'.$start_day; - $tms_start = strtotime($search_start); + $tms_start = dol_mktime(0, 0, 0, $start_month, $start_day, $start_year, 'tzuserrel'); } if (!empty($end_year) && !empty($end_month) && !empty($end_day)) { - $search_end = $end_year.'-'.$end_month.'-'.$end_day.' 23:59:59'; - $tms_end = strtotime($search_end); + $tms_end = dol_mktime(23, 59, 59, $end_month, $end_day, $end_year, 'tzuserrel'); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers - $search_start = ''; $tms_start = ''; - $search_end = ''; $tms_end = ''; } dol_include_once('/comm/action/class/actioncomm.class.php'); @@ -1328,14 +1324,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep BETWEEN '$search_start' AND '$search_end') OR (a.datep2 BETWEEN '$search_start' AND '$search_end'))"; + if (!empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))"; } - elseif (empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep <= '$search_end') OR (a.datep2 <= '$search_end'))"; + elseif (empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))"; } - elseif (!empty($search_start) && empty($search_end)) { - $sql .= " AND ((a.datep >= '$search_start') OR (a.datep2 >= '$search_start'))"; + elseif (!empty($tms_start) && empty($tms_end)) { + $sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))"; } if (is_array($actioncode) && !empty($actioncode)) { @@ -1491,7 +1487,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1); $out .= ''; $out .= ''; - $out .= ''.$form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1).''; + $out .= ''; + $out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1); + $out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 1d155bf0cc9..d39e7a3e1b5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -816,7 +816,15 @@ span.fa.fa-plus-circle.paddingleft { } #formuserfile input[type='file'] { font-size: 1em; + /* opacity: 0.5em; */ } +/*#formuserfile input[type='file']:valid { + color: #a00; +} +#formuserfile input[type='file']:empty { + color: #0a0; +}*/ + #formuserfile_link { margin-left: 1px; } From dbe5c23ed5547ee38df63a4634503b3cf2379d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Feb 2021 19:45:18 +0100 Subject: [PATCH 82/86] Update box_produits_alerte_stock.php --- htdocs/core/boxes/box_produits_alerte_stock.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 5d1e944d805..0c6752ec764 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005-2012 Maxime Kohlhaas - * Copyright (C) 2015-2019 Frédéric France + * Copyright (C) 2015-2021 Frédéric France * Copyright (C) 2015 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -206,23 +206,24 @@ class box_produits_alerte_stock extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tosell, 3, 0).'', 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => ''.$productstatic->LibStatut($objp->tobuy, 3, 0).'', + 'text' => ''.$productstatic->LibStatut($objp->tobuy, 3, 0).'', 'asis' => 1 ); $line++; } - if ($num == 0) + if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', 'text'=>$langs->trans("NoTooLowStockProducts"), ); + } $this->db->free($result); } else { From 45789ec21ca07bd17a0c62d410532935d6dce3fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 19:44:22 +0100 Subject: [PATCH 83/86] Fix TZ problems Conflicts: htdocs/core/lib/company.lib.php --- htdocs/comm/action/index.php | 56 +++++++++++++-------------- htdocs/comm/action/list.php | 10 ++--- htdocs/comm/action/pertype.php | 38 +++++++++--------- htdocs/comm/action/peruser.php | 56 ++++++++++++++------------- htdocs/core/class/html.form.class.php | 10 +++-- htdocs/core/lib/company.lib.php | 39 ++++++++++--------- htdocs/theme/eldy/global.inc.php | 8 ++++ 7 files changed, 115 insertions(+), 102 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5396454667b..99287ec82d7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -280,10 +280,10 @@ if (empty($action) || $action == 'show_month') $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1); if ($tmpday >= 1) $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week. // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $max_day_in_prev_month + $tmpday, $prev_year, 'tzuserrel'); $next_day = 7 - ($max_day_in_month + 1 - $tmpday) % 7; if ($next_day < 6) $next_day += 7; - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } if ($action == 'show_week') { @@ -304,10 +304,10 @@ if ($action == 'show_week') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); - $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); + $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year, 'gmt')); $tmpday = $first_day; } @@ -323,8 +323,8 @@ if ($action == 'show_day') $next_day = $next['day']; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) - $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'gmt'); - $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'gmt'); + $firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel'); + $lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel'); } //print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day; //print 'xx'.$next_year.'-'.$next_month.'-'.$next_day; @@ -607,17 +607,18 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND (a.fk_soc IS if ($socid > 0) $sql .= ' AND a.fk_soc = '.$socid; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; +//var_dump($day.' '.$month.' '.$year); if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -723,9 +724,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); //var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); //var_dump($annee.'-'.$mois.'-'.$jour); @@ -1539,9 +1540,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa foreach ($eventarray as $daykey => $notused) { - $annee = date('Y', $daykey); - $mois = date('m', $daykey); - $jour = date('d', $daykey); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { @@ -1703,20 +1704,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (empty($event->fulldayevent)) { // Show hours (start ... end) - $tmpyearstart = date('Y', $event->date_start_in_calendar); - $tmpmonthstart = date('m', $event->date_start_in_calendar); - $tmpdaystart = date('d', $event->date_start_in_calendar); - $tmpyearend = date('Y', $event->date_end_in_calendar); - $tmpmonthend = date('m', $event->date_end_in_calendar); - $tmpdayend = date('d', $event->date_end_in_calendar); - /*var_dump($tmpyearstart.' '.$tmpmonthstart.' '.$tmpdaystart); - var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend); - var_dump($annee.' '.$mois.' '.$jour);*/ + $tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel'); + $tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel'); + $tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel'); + $tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel'); + $tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel'); // Hour start if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) { - $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) @@ -1736,7 +1734,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) { if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) - $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuser'); + $daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); } } else { if ($showinfo) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 991e945b16d..2db2d988add 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,9 +67,9 @@ $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); -$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); -$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); +$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'), 'tzuserrel'); +$dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); @@ -563,12 +563,12 @@ if ($resql) if (!empty($arrayfields['a.note']['checked'])) print ''; if (!empty($arrayfields['a.datep']['checked'])) { print ''; - print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); + print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['a.datep2']['checked'])) { print ''; - print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0); + print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzuserrel'); print ''; } if (!empty($arrayfields['s.nom']['checked'])) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f956b5ae5f7..a399ee3d580 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -265,7 +265,7 @@ $next_month = $month; $next_day = $day; // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) -$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'gmt'); +$firstdaytoshow = dol_mktime(0, 0, 0, $first_month, $first_day, $first_year, 'tzuserrel'); $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd'); //print $firstday.'-'.$first_month.'-'.$first_year; //print dol_print_date($firstdaytoshow,'dayhour'); @@ -482,14 +482,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -599,9 +599,9 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -858,9 +858,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { @@ -931,9 +931,9 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -944,13 +944,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -990,13 +990,13 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 2dc62a52e91..6b54a327705 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -404,7 +404,11 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction { $tmpforcreatebutton = dol_getdate(dol_now(), true); - $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; + $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); + if ($begin_h !== '') $newparam .= '&begin_h='.urlencode($begin_h); + if ($end_h !== '') $newparam .= '&end_h='.urlencode($end_h); + if ($begin_d !== '') $newparam .= '&begin_d='.urlencode($begin_d); + if ($end_d !== '') $newparam .= '&end_d='.urlencode($end_d); //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; @@ -487,14 +491,14 @@ if ($filtert > 0 || $usergroup > 0) $sql .= " AND ar.fk_actioncomm = a.id AND ar if ($action == 'show_day') { $sql .= " AND ("; - $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= " OR "; - $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'"; - $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')"; + $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; + $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; $sql .= ')'; } else { // To limit array @@ -605,9 +609,10 @@ if ($resql) // Add an entry in actionarray for each day $daycursor = $event->date_start_in_calendar; - $annee = dol_print_date($daycursor, '%Y'); - $mois = dol_print_date($daycursor, '%m'); - $jour = dol_print_date($daycursor, '%d'); + $annee = dol_print_date($daycursor, '%Y', 'tzuserrel'); + $mois = dol_print_date($daycursor, '%m', 'tzuserrel'); + $jour = dol_print_date($daycursor, '%d', 'tzuserrel'); + //print $daycursor.' '.dol_print_date($daycursor, 'dayhour', 'gmt').' '.$event->id.' -> '.$annee.'-'.$mois.'-'.$jour.'
'; // Loop on each day covered by action to prepare an index to show on calendar $loop = true; $j = 0; @@ -920,7 +925,7 @@ jQuery(document).ready(function() { if (ids == \'none\') /* No event */ { /* alert(\'no event\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day).'" + url = "'.DOL_URL_ROOT.'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER["PHP_SELF"].'?year='.$year.'&month='.$month.'&day='.$day.($begin_h !== '' ? '&begin_h='.$begin_h : '').($end_h !== '' ? '&end_h='.$end_h : '').($begin_d !== '' ? '&begin_d='.$begin_d : '').($end_d !== '' ? '&end_d='.$end_d : '')).'" window.location.href = url; } else if (ids.indexOf(",") > -1) /* There is several events */ @@ -979,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $cases2 = array(); // Color second half hour $i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array(); - $ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); + //$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day); $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0 $nextindextouse = count($colorindexused); // At first run this is 0, so first user has 0, next 1, ... @@ -988,16 +993,16 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { - $annee = dol_print_date($daykey, '%Y', 'gmt'); - $mois = dol_print_date($daykey, '%m', 'gmt'); - $jour = dol_print_date($daykey, '%d', 'gmt'); + $annee = dol_print_date($daykey, '%Y'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) // Is it the day we are looking for when calling function ? { // Scan all event for this date foreach ($eventarray[$daykey] as $index => $event) { - //print $daykey.' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; + //print $daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$year.'-'.$month.'-'.$day.' -> '.$event->id.' '.$index.' '.$annee.'-'.$mois.'-'.$jour."
\n"; //var_dump($event); $keysofuserassigned = array_keys($event->userassigned); @@ -1078,7 +1083,6 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & // Define color $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } - //$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Define all rects with event (cases1 is first half hour, cases2 is second half hour) for ($h = $begin_h; $h < $end_h; $h++) @@ -1087,9 +1091,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $newcolor = ''; //init if (empty($event->fulldayevent)) { - $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'auto', 0); - $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'auto', 0); - $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'auto', 0); + $a = dol_mktime((int) $h, 0, 0, $month, $day, $year, 'tzuserrel', 0); + $b = dol_mktime((int) $h, 30, 0, $month, $day, $year, 'tzuserrel', 0); + $c = dol_mktime((int) $h + 1, 0, 0, $month, $day, $year, 'tzuserrel', 0); $dateendtouse = $event->date_end_in_calendar; if ($dateendtouse == $event->date_start_in_calendar) $dateendtouse++; @@ -1100,13 +1104,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases1[$h][$event->id]['busy'] = $busy; - $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases1[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases1[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases1[$h][$event->id]['string'] .= ' - '.$event->label; $cases1[$h][$event->id]['typecode'] = $event->type_code; @@ -1146,13 +1150,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & { $busy = $event->transparency; $cases2[$h][$event->id]['busy'] = $busy; - $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour'); + $cases2[$h][$event->id]['string'] = dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel'); if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) { $tmpa = dol_getdate($event->date_start_in_calendar, true); $tmpb = dol_getdate($event->date_end_in_calendar, true); - if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour'); - else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour'); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel'); + else $cases2[$h][$event->id]['string'] .= '-'.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel'); } if ($event->label) $cases2[$h][$event->id]['string'] .= ' - '.$event->label; $cases2[$h][$event->id]['typecode'] = $event->type_code; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0348a01de3f..e75e1eeed44 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5511,9 +5511,11 @@ class Form */ public function selectDateToDate($set_time = '', $set_time_end = '', $prefix = 're', $empty = 0) { - $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty); - $ret .= '
'; - $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty); + global $langs; + + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); + $ret .= '
'; + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); return $ret; } @@ -5628,7 +5630,7 @@ class Form if (strval($set_time) != '' && $set_time != -1) { //$formated_date=dol_print_date($set_time,$conf->format_date_short); - $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $formated_date = dol_print_date($set_time, $langs->trans("FormatDateShortInput"), $gm); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript } // Calendrier popup version eldy diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1e2be9e856d..10cec80edda 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1206,24 +1206,23 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin global $form; global $param, $massactionbutton; - $start_year = GETPOST('dateevent_startyear'); - $start_month = GETPOST('dateevent_startmonth'); - $start_day = GETPOST('dateevent_startday'); - $end_year = GETPOST('dateevent_endyear'); - $end_month = GETPOST('dateevent_endmonth'); - $end_day = GETPOST('dateevent_endday'); + $start_year = GETPOST('dateevent_startyear', 'int'); + $start_month = GETPOST('dateevent_startmonth', 'int'); + $start_day = GETPOST('dateevent_startday', 'int'); + $end_year = GETPOST('dateevent_endyear', 'int'); + $end_month = GETPOST('dateevent_endmonth', 'int'); + $end_day = GETPOST('dateevent_endday', 'int'); + $tms_start = ''; + $tms_end = ''; + if (!empty($start_year) && !empty($start_month) && !empty($start_day)) { - $search_start = $start_year.'-'.$start_month.'-'.$start_day; - $tms_start = strtotime($search_start); + $tms_start = dol_mktime(0, 0, 0, $start_month, $start_day, $start_year, 'tzuserrel'); } if (!empty($end_year) && !empty($end_month) && !empty($end_day)) { - $search_end = $end_year.'-'.$end_month.'-'.$end_day.' 23:59:59'; - $tms_end = strtotime($search_end); + $tms_end = dol_mktime(23, 59, 59, $end_month, $end_day, $end_year, 'tzuserrel'); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers - $search_start = ''; $tms_start = ''; - $search_end = ''; $tms_end = ''; } dol_include_once('/comm/action/class/actioncomm.class.php'); @@ -1325,14 +1324,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep BETWEEN '$search_start' AND '$search_end') OR (a.datep2 BETWEEN '$search_start' AND '$search_end'))"; + if (!empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."') OR (a.datep2 BETWEEN '".$db->idate($tms_start)."' AND '".$db->idate($tms_end)."'))"; } - elseif (empty($search_start) && !empty($search_end)) { - $sql .= " AND ((a.datep <= '$search_end') OR (a.datep2 <= '$search_end'))"; + elseif (empty($tms_start) && !empty($tms_end)) { + $sql .= " AND ((a.datep <= '".$db->idate($tms_end)."') OR (a.datep2 <= '".$db->idate($tms_end)."'))"; } - elseif (!empty($search_start) && empty($search_end)) { - $sql .= " AND ((a.datep >= '$search_start') OR (a.datep2 >= '$search_start'))"; + elseif (!empty($tms_start) && empty($tms_end)) { + $sql .= " AND ((a.datep >= '".$db->idate($tms_start)."') OR (a.datep2 >= '".$db->idate($tms_start)."'))"; } if (is_array($actioncode) && !empty($actioncode)) { @@ -1488,7 +1487,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1); $out .= ''; $out .= ''; - $out .= ''.$form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1).''; + $out .= ''; + $out .= $form->selectDateToDate($tms_start, $tms_end, 'dateevent', 1); + $out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d9e2a70eab2..bc6bf8327e9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -801,7 +801,15 @@ span.fa.fa-plus-circle.paddingleft { } #formuserfile input[type='file'] { font-size: 1em; + /* opacity: 0.5em; */ } +/*#formuserfile input[type='file']:valid { + color: #a00; +} +#formuserfile input[type='file']:empty { + color: #0a0; +}*/ + #formuserfile_link { margin-left: 1px; } From 1f32d4a815ff033eea843ccb552677fee6e2d652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:21:21 +0100 Subject: [PATCH 84/86] Avoid warning --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4aead28ffda..a8e08ef1440 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4107,21 +4107,21 @@ function dol_print_error($db = '', $error = '', $errors = null) $out .= "".$langs->trans("Date").": ".dol_print_date(time(), 'dayhourlog')."
\n"; $out .= "".$langs->trans("Dolibarr").": ".DOL_VERSION." - https://www.dolibarr.org
\n"; - if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".$conf->global->MAIN_FEATURES_LEVEL."
\n"; + if (isset($conf->global->MAIN_FEATURES_LEVEL)) $out .= "".$langs->trans("LevelOfFeature").": ".dol_htmlentities($conf->global->MAIN_FEATURES_LEVEL, ENT_COMPAT)."
\n"; if (function_exists("phpversion")) { $out .= "".$langs->trans("PHP").": ".phpversion()."
\n"; } - $out .= "".$langs->trans("Server").": ".dol_htmlentities($_SERVER["SERVER_SOFTWARE"])."
\n"; + $out .= "".$langs->trans("Server").": ".(isset($_SERVER["SERVER_SOFTWARE"]) ? dol_htmlentities($_SERVER["SERVER_SOFTWARE"], ENT_COMPAT) : '')."
\n"; if (function_exists("php_uname")) { $out .= "".$langs->trans("OS").": ".php_uname()."
\n"; } - $out .= "".$langs->trans("UserAgent").": ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8')."
\n"; + $out .= "".$langs->trans("UserAgent").": ".(isset($_SERVER["HTTP_USER_AGENT"]) ? dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT) : '')."
\n"; $out .= "
\n"; - $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."
\n"; - $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."
\n"; - $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu) : '')."
\n"; + $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT)."
\n"; + $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n"; + $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu, ENT_COMPAT) : '')."
\n"; $out .= "
\n"; $syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]); $syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]); From e474ee4d16ca5d5e40a799da48698f0524a0e08e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:30:46 +0100 Subject: [PATCH 85/86] Fix add missing field --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_expensereport.sql | 1 + htdocs/install/mysql/tables/llx_projet.sql | 9 +++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index f12cd42e028..e58a197b58b 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -124,3 +124,7 @@ ALTER TABLE llx_socpeople MODIFY poste varchar(255); ALTER TABLE llx_menu ADD COLUMN prefix varchar(255) NULL AFTER titre; ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL; + + +ALTER TABLE llx_fichinter ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; +ALTER TABLE llx_projet ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql index d591de78436..36bd5efb50c 100644 --- a/htdocs/install/mysql/tables/llx_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.sql @@ -53,6 +53,7 @@ CREATE TABLE llx_expensereport ( integration_compta integer DEFAULT NULL, -- not used fk_bank_account integer DEFAULT NULL, model_pdf varchar(50) DEFAULT NULL, + last_main_doc varchar(255), -- relative filepath+filename of last main generated document fk_multicurrency integer, multicurrency_code varchar(255), diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 1b95444b3a1..76d254aafd3 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -44,10 +44,11 @@ create table llx_projet --budget_days real, -- budget in days is sum of field planned_workload of tasks opp_amount double(24,8), budget_amount double(24,8), - usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity - usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet - usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices - usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event, receive attendees subscription + usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity + usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet + usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices + usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event, receive attendees subscription model_pdf varchar(255), + last_main_doc varchar(255), -- relative filepath+filename of last main generated document import_key varchar(14) -- Import key )ENGINE=innodb; From fc30b9196097d025266e23b067596e5d2366aa90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 21:56:57 +0100 Subject: [PATCH 86/86] Fix warning --- htdocs/core/modules/DolibarrModules.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index a5b58e17dcb..485b079d1cd 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1867,9 +1867,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->mainmenu = isset($this->menu[$key]['mainmenu']) ? $this->menu[$key]['mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu : ''); $menu->leftmenu = isset($this->menu[$key]['leftmenu']) ? $this->menu[$key]['leftmenu'] : ''; $menu->title = $this->menu[$key]['titre']; - $menu->prefix = $this->menu[$key]['prefix']; + $menu->prefix = isset($this->menu[$key]['prefix']) ? $this->menu[$key]['prefix'] : ''; $menu->url = $this->menu[$key]['url']; - $menu->langs = $this->menu[$key]['langs']; + $menu->langs = isset($this->menu[$key]['langs']) ? $this->menu[$key]['langs'] : ''; $menu->position = $this->menu[$key]['position']; $menu->perms = $this->menu[$key]['perms']; $menu->target = isset($this->menu[$key]['target']) ? $this->menu[$key]['target'] : '';