From 26154d3190e3c59cf9e436e85e96e79b78505bb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Aug 2019 12:54:18 +0200 Subject: [PATCH 01/11] Fix must use the new common code --- .../admin/supplier_proposal_extrafields.php | 38 +------------------ .../supplier_proposaldet_extrafields.php | 35 +---------------- 2 files changed, 2 insertions(+), 71 deletions(-) diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index c97ea508448..49b581617bc 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -66,43 +66,7 @@ $head = supplier_proposal_admin_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("CommRequests"), -1, 'supplier_proposal'); - -print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; -print '
'; - -// Load attribute_label -$extrafields->fetch_name_optionals_label($elementtype); - -print ""; - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -foreach($extrafields->attribute_type as $key => $value) -{ - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print '\n"; - print '\n"; - print '\n"; - print '\n"; - print ""; - // $i++; -} - -print "
'.$langs->trans("Position").''.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_pos[$key]."".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; - print "  ".img_delete()."
"; +require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; dol_fiche_end(); diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index c54e65ad825..81d1e39791c 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -71,40 +71,7 @@ $head = supplier_proposal_admin_prepare_head(); dol_fiche_head($head, 'attributeslines', $langs->trans("CommRequests"), -1, 'supplier_proposal'); - -print $langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; -print '
'; - -// Load attribute_label -$extrafields->fetch_name_optionals_label($elementtype); - -print ""; - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -foreach($extrafields->attribute_type as $key => $value) -{ - print ''; - print "\n"; - print "\n"; - print "\n"; - print '\n"; - print '\n"; - print '\n"; - print '\n"; - print ""; -} - -print "
'.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; - print "  ".img_delete()."
"; +require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; dol_fiche_end(); From c81c8543da035bb12ef2eab85c0b7bc60edccb29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Aug 2019 13:26:22 +0200 Subject: [PATCH 02/11] Fix bad param --- htdocs/bom/lib/bom.lib.php | 2 +- htdocs/modulebuilder/template/lib/mymodule.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index b54a2e21b57..290e29c3f2b 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -55,7 +55,7 @@ function bomAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'bom'); return $head; } diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index cec23bd3c11..362b505e070 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -52,7 +52,7 @@ function mymoduleAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule'); return $head; } From df6472254d75cf1e92e73de3a2e2ce08b653bab9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Aug 2019 13:31:08 +0200 Subject: [PATCH 03/11] Fix var not defined --- htdocs/admin/dict.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f68864fcc3d..ee90a0638fb 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions")); @@ -1782,7 +1782,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); - if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); + $formaccounting = new FormAccounting($db); $withentity=''; @@ -1890,6 +1890,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif (in_array($fieldlist[$field], array('libelle_facture'))) { print ''; $transfound=0; + $transkey=''; // Special case for labels if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { From 46affe90908144b01b54b8e551a09c80966517f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Sep 2019 21:14:56 +0200 Subject: [PATCH 04/11] Fix css on smartphone --- htdocs/theme/eldy/global.inc.php | 2 ++ htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 36c88d31bdb..bc76fd445c3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1069,6 +1069,8 @@ body.sidebar-collapse .login_block { } .menuhider { display: block !important; } +.dropdown-user-image { display: none; } +.user-header { height: auto !important; color: rgb(); } #id-container { width: 100%; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index bbf5e4e1b54..3b8e1fc7329 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -192,7 +192,7 @@ $colortext=join(',', colorStringToArray($colortext)); $colortextlink=join(',', colorStringToArray($colortextlink)); $nbtopmenuentries=$menumanager->showmenu('topnb'); -if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 7); +if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 10); $minwidthtmenu=66; /* minimum width for one top menu entry */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 154ff416110..983d0773f48 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -195,7 +195,7 @@ $colortext=join(',', colorStringToArray($colortext)); $colortextlink=join(',', colorStringToArray($colortextlink)); $nbtopmenuentries=$menumanager->showmenu('topnb'); -if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 7); +if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 10); print '/*'."\n"; print 'colorbackbody='.$colorbackbody."\n"; From 5f3c7cb8dc79b46e738a4be1cca6683a8110b024 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Sep 2019 21:45:09 +0200 Subject: [PATCH 05/11] Fix compatibility with hooks tha add , at begin of sql string --- htdocs/modulebuilder/template/myobject_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 555e01d7896..60f64834583 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -221,8 +221,8 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/', '', $sql); +$sql.=preg_replace('/^,/', '', $hookmanager->resPrint); +$sql =preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; From a4600c9efae32fbe8e59a388f86a27604a6c4b12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Sep 2019 23:24:02 +0200 Subject: [PATCH 06/11] Fix missing class reposition --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d271f90720c..9411e8bc824 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1381,7 +1381,7 @@ class FormFile if (! empty($conf->dol_use_jmobile)) $useajax=0; if (empty($conf->use_javascript_ajax)) $useajax=0; if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; - print ''.img_delete().''; + print ''.img_delete().''; } print ""; From 92799902b62c474f54720fb35135b3937b317358 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 03:44:34 +0200 Subject: [PATCH 07/11] Fix var null --- htdocs/adherents/type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4251ba45ab9..019388aeaab 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -822,7 +822,7 @@ if ($rowid > 0) $value = $_POST["options_" . $key]; } } else { - $value = $adht->array_options["options_" . $key]; + $value = $object->array_options["options_" . $key]; } print ''.$label.''; print $extrafields->showInputField($key, $value); From c589fdcb83bf1487a2b805349726e0a034b2b122 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 04:02:04 +0200 Subject: [PATCH 08/11] Code comment --- htdocs/categories/class/categorie.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index eb263bdffae..b9a92f85d5e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -188,10 +188,12 @@ class Categorie extends CommonObject * @var string Color */ public $color; + /** - * @var ??? + * @var int Id of thirdparty when CATEGORY_ASSIGNED_TO_A_CUSTOMER is set */ public $socid; + /** * @var string Category type * From 29d2e7edd04df8888489135cfc384a6adccfad14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 04:28:55 +0200 Subject: [PATCH 09/11] missing reposition --- htdocs/core/lib/ldap.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 02212952084..0babce52470 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -124,7 +124,7 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass) } else { - print ''.$butlabel.''; + print ''.$butlabel.''; } print '

'; } From 42defc31bdf6476f1aced7df6387377f5e94b68e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 04:38:01 +0200 Subject: [PATCH 10/11] FIX Look and feel v10 --- htdocs/adherents/ldap.php | 23 ++++++++--------------- htdocs/adherents/note.php | 2 +- htdocs/adherents/subscription.php | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 1d890ab580f..76d915aee32 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -83,10 +83,10 @@ if ($action == 'dolibarr2ldap') * View */ -llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); - $form = new Form($db); +llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); + $head = member_prepare_head($object); dol_fiche_head($head, 'ldap', $langs->trans("Member"), 0, 'user'); @@ -98,12 +98,12 @@ dol_banner_tab($object, 'rowid', $linkback); print '
'; print '
'; -print ''; +print '
'; // Login -print ''; +print ''; -// Password not crypted +// If there is a link to password not crypted, we show value in database here so we can compare because it is shown nowhere else if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) { print ''; @@ -111,18 +111,11 @@ if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) print "\n"; } -// Password crypted -if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) -{ - print ''; - print ''; - print "\n"; -} +$adht = new AdherentType($db); +$adht->fetch($object->typeid); // Type -print '\n"; - -$langs->load("admin"); +print '\n"; // LDAP DN print '\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index ce2918cb86a..5f5ab38da61 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -80,7 +80,7 @@ if ($id) print '
'; print '
'; - print '
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").'
'.$langs->trans("LDAPFieldPasswordCrypted").''.$object->pass_crypted.'
'.$langs->trans("Type").''.$object->type."
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
LDAP '.$langs->trans("LDAPMemberDn").''.$conf->global->LDAP_MEMBER_DN."
'; + print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index ab8206c66b8..7663fe6fba3 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -478,7 +478,7 @@ if ($rowid > 0) print '
'; print '
'; - print '
'; + print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) From a040d7eccc16b08776b6700a8b9f8eae4a2870e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 04:38:36 +0200 Subject: [PATCH 11/11] Fix bad link --- htdocs/contact/ldap.php | 4 ++-- htdocs/user/group/ldap.php | 5 ++--- htdocs/user/ldap.php | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 1514a2188ff..edcb08c515b 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -80,12 +80,12 @@ if ($action == 'dolibarr2ldap') * View */ +$form = new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -$form = new Form($db); - $head = contact_prepare_head($object); dol_fiche_head($head, 'ldap', $title, -1, 'contact'); diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index c5110c052ef..2fd4ef7e14c 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -95,10 +95,9 @@ if ($action == 'dolibarr2ldap') * View */ -llxHeader(); - $form = new Form($db); +llxHeader(); $head = group_prepare_head($object); @@ -106,7 +105,7 @@ dol_fiche_head($head, 'ldap', $langs->trans("Group"), -1, 'group'); $linkback = ''.$langs->trans("BackToList").''; -dol_banner_tab($object, 'id', $linback, $user->rights->user->user->lire || $user->admin); +dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); print '
'; print '
'; diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index decfbc1e0f7..7003a9429a1 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -86,10 +86,10 @@ if (empty($reshook)) * View */ -llxHeader(); - $form = new Form($db); +llxHeader(); + $head = user_prepare_head($object); $title = $langs->trans("User");