From 0374cb103e7be0e73744990b4993403e7817e72f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:49:12 +0200 Subject: [PATCH 01/61] Update evaluation_note.php --- htdocs/hrm/evaluation_note.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 1b6b5a35564..5c02b533bb7 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -20,25 +20,27 @@ */ /** - * \file evaluation_note.php - * \ingroup hrm - * \brief Tab for notes on Evaluation + * \file htdocs/hrm/evaluation_note.php + * \ingroup hrm + * \brief Tab for notes on Evaluation */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; + // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -47,6 +49,7 @@ $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -56,8 +59,9 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php -$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php +// Permissions +$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php +$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); From a083de68f805e2036c3f65a0e31b954ee411f0db Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:52:00 +0200 Subject: [PATCH 02/61] Update index.php --- htdocs/hrm/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index e8554c9da3d..05967606a8e 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/hrm/index.php - * \ingroup hrm - * \brief Home page for HRM area. + * \file htdocs/hrm/index.php + * \ingroup hrm + * \brief Home page for HRM area. */ @@ -32,10 +32,10 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; From 6430310d74139e034b07d08e186a35b6a69a44d2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:57:59 +0200 Subject: [PATCH 03/61] Update job_card.php --- htdocs/hrm/job_card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index a9ec4f77121..d8be48bce69 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -20,7 +20,7 @@ */ /** - * \file job_card.php + * \file htdocs/hrm/job_card.php * \ingroup hrm * \brief Page to create/edit/view job */ @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other", 'products')); +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? // Get parameters $id = GETPOST('id', 'int'); @@ -76,9 +76,9 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->hrm->all->delete; $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job'; From b084da450226b1dc638c9fcb9b2eb7492993ca73 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:59:44 +0200 Subject: [PATCH 04/61] Update job_contact.php --- htdocs/hrm/job_contact.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 4a6c9995127..dc25ad6eae2 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -20,22 +20,23 @@ */ /** - * \file job_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Job + * \file htdocs/hrm/job_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Job */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -53,6 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->job->write; // Security check (enable the most restrictive one) From cbe98f44cdfb829d3f7530a85b50f8672b2d6635 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:01:36 +0200 Subject: [PATCH 05/61] Update job_document.php --- htdocs/hrm/job_document.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index 0e4d34e0412..eda504b07cd 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -20,9 +20,9 @@ */ /** - * \file job_document.php - * \ingroup hrm - * \brief Tab for documents linked to Job + * \file htdocs/hrm/job_document.php + * \ingroup hrm + * \brief Tab for documents linked to Job */ // Load Dolibarr environment @@ -36,15 +36,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); - +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); -// Get parameters + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -68,6 +68,7 @@ $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -78,6 +79,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php From c1dbb9559f915123f582863579738ef7d240a09f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:03:44 +0200 Subject: [PATCH 06/61] Update job_list.php --- htdocs/hrm/job_list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 53cb43ad080..ed0fb480a3a 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -20,9 +20,9 @@ */ /** - * \file job_list.php - * \ingroup hrm - * \brief List page for job + * \file htdocs/hrm/job_list.php + * \ingroup hrm + * \brief List page of jobs */ @@ -40,8 +40,9 @@ require_once __DIR__.'/class/job.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; +$permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; // Security check From 6e701e4bc2b867526078ea332a71746df3a23b3f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:05:59 +0200 Subject: [PATCH 07/61] Update job_note.php --- htdocs/hrm/job_note.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php index 7205afec247..9e64e27d6ae 100644 --- a/htdocs/hrm/job_note.php +++ b/htdocs/hrm/job_note.php @@ -20,9 +20,9 @@ */ /** - * \file job_note.php - * \ingroup hrm - * \brief Tab for notes on Job + * \file htdocs/hrm/job_note.php + * \ingroup hrm + * \brief Tab for notes on Job */ @@ -33,12 +33,13 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -47,6 +48,7 @@ $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -56,6 +58,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php From 6dcddafaa7439222f0be2c2d37164d1a534db3d7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:14:22 +0200 Subject: [PATCH 08/61] Update position_agenda.php --- htdocs/hrm/position_agenda.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index fc90a24dec6..fa0e6ab3aed 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -20,9 +20,9 @@ */ /** - * \file position_agenda.php - * \ingroup hrm - * \brief Tab of events on Position + * \file htdocs/hrm/position_agenda.php + * \ingroup hrm + * \brief Tab of events on Position */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -79,6 +79,7 @@ $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -88,6 +89,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php From f9248ab4b83ee7c374b0a662816fc1e99fbfa309 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:16:31 +0200 Subject: [PATCH 09/61] Update position_card.php --- htdocs/hrm/position_card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 746e1265a0b..00d8f96236d 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -20,9 +20,9 @@ */ /** - * \file position_card.php - * \ingroup hrm - * \brief Page to create/edit/view position + * \file htdocs/hrm/position_card.php + * \ingroup hrm + * \brief Page to create/edit/view job position */ @@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; //dol_include_once('/hrm/position.php'); +// Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); @@ -50,6 +51,7 @@ if ($res < 0) { dol_print_error($db, $object->error); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->hrm->all->delete; From 3cd4a74beaac13ee88d108baac44ceab35d9c63f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:19:09 +0200 Subject: [PATCH 10/61] Update position_contact.php --- htdocs/hrm/position_contact.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index f443099a9e4..4d85987f4d6 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -20,22 +20,23 @@ */ /** - * \file position_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Position + * \file htdocs/hrm/position_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Job Position */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; // Load translation files required by the page $langs->loadLangs(array("hrm", "companies", "other", "mails")); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -47,12 +48,14 @@ $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->position->write; // Security check (enable the most restrictive one) From 36653325464af5593610209758360de38f994eb1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:23:15 +0200 Subject: [PATCH 11/61] Update position_list.php --- htdocs/hrm/position_list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index e9eb83e12e4..e79af867a74 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -20,9 +20,9 @@ */ /** - * \file position_list.php - * \ingroup hrm - * \brief List page for position + * \file htdocs/hrm/position_list.php + * \ingroup hrm + * \brief List page for job positions */ @@ -40,8 +40,9 @@ require_once __DIR__.'/class/position.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; +// Permissions +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; // Security check From 2f07d48894934c79bdf1ae7984082ef616411782 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:25:22 +0200 Subject: [PATCH 12/61] Update position_note.php --- htdocs/hrm/position_note.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 99d6581247f..1ecd77b4bdc 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -20,26 +20,27 @@ */ /** - * \file position_note.php - * \ingroup hrm - * \ingroup hrm - * \brief Tab for notes on Position + * \file htdocs/hrm/position_note.php + * \ingroup hrm + * \brief Tab for notes on Position */ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; + // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); + // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -58,7 +59,8 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = $user->rights->hrm->all->write; +// Permissions +$permissionnote = $user->rights->hrm->all->write; $permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) From 4e1380f4ebd96d1bf18e86dc2ddba469e2f2c1fa Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:19:25 +0200 Subject: [PATCH 13/61] scrutinizer on imports/import.php: action builddoc never existed on import --- htdocs/imports/import.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 2c85007c086..4b08662d886 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield') } } */ -if ($action == 'builddoc') { - // Build import file - $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); - if ($result < 0) { - setEventMessages($objimport->error, $objimport->errors, 'errors'); - } else { - setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); - } -} +// if ($action == 'builddoc') { +// // Build import file +// $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); +// if ($result < 0) { +// setEventMessages($objimport->error, $objimport->errors, 'errors'); +// } else { +// setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); +// } +// } if ($action == 'deleteprof') { if (GETPOST("id", 'int')) { From 09eede8cde5dd513b42d1c22ecd88559e7fedcbc Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:42:47 +0200 Subject: [PATCH 14/61] scrutinizer on expensereport/class/expensereport_ik.class.php: method fetchLine was not defined --- .../expensereport/class/expensereport_ik.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 0d374f1c722..14f6908377e 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -126,6 +126,19 @@ class ExpenseReportIk extends CommonObject return $result; } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database From 54a211509be0423132d460120379671351dde3d8 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:51:25 +0200 Subject: [PATCH 15/61] scrutinizer on delivery/class/delivery.class.php: attribute $linked_object does not exist but $linked_objects does --- htdocs/delivery/class/delivery.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 55f6293a9d2..ad1a3b9934a 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -973,7 +973,7 @@ class Delivery extends CommonObject $sqlSourceLine .= ", p.ref, p.label"; $sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st"; $sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid"; - $sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $resultSourceLine = $this->db->query($sqlSourceLine); if ($resultSourceLine) { @@ -986,12 +986,12 @@ class Delivery extends CommonObject // Get lines of sources alread delivered $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; - $sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c"; - $sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; + $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c"; + $sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd"; $sql .= " WHERE ld.fk_delivery = l.rowid"; $sql .= " AND ld.fk_origin_line = cd.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid"; + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid); $sql .= " GROUP BY ld.fk_origin_line"; From 22ab13975f186a35387f2f3c953a94147d2f6813 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:57:23 +0200 Subject: [PATCH 16/61] scrutinizer on expensereport/class/expensereport_rule.class.php: method fetchLine wasn't defined --- .../class/expensereport_rule.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 02bf8b8ce5c..d695359229d 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database * From a2c62d39b4eece149f1fce631d9a855c818c9b3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Sep 2022 15:42:26 +0200 Subject: [PATCH 17/61] FIX some upgrade sql errors --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +++ htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_element_categorie.key.sql | 2 +- htdocs/install/mysql/tables/llx_user.sql | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 6d9aebf934f..f7e7a7a1ba5 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -689,3 +689,6 @@ ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity); ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); + +-- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2() +ALTER TABLE llx_user CHANGE COLUMN note note_private text; diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 4d7bca3f7c9..d0e9cdc7b95 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -175,5 +175,5 @@ create table llx_element_categorie ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); -ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); +ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); diff --git a/htdocs/install/mysql/tables/llx_element_categorie.key.sql b/htdocs/install/mysql/tables/llx_element_categorie.key.sql index 5ad41616d38..9bc70cf0863 100644 --- a/htdocs/install/mysql/tables/llx_element_categorie.key.sql +++ b/htdocs/install/mysql/tables/llx_element_categorie.key.sql @@ -19,4 +19,4 @@ ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); -ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); +ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 7b86b5c3396..e70716d90c4 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -75,8 +75,8 @@ create table llx_user idpers2 varchar(128), idpers3 varchar(128), - note_public text, - note_private text DEFAULT NULL, + note_public text, + note_private text DEFAULT NULL, model_pdf varchar(255) DEFAULT NULL, datelastlogin datetime, datepreviouslogin datetime, From d3dce0526870079b6e422539174bc2b77592bc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 13 Sep 2022 15:44:54 +0200 Subject: [PATCH 18/61] add debug in thirdparty merge --- htdocs/societe/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4b612df0c00..90aafe95f5d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2022 Frédéric 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 @@ -342,6 +342,7 @@ if (empty($reshook)) { if (!$error) { //We finally remove the old thirdparty if ($soc_origin->delete($soc_origin->id, $user) < 1) { + setEventMessages($soc_origin->error, $soc_origin->errors, 'errors'); $error++; } } From 0d20f332d00783e8c49d7e6306431d7af7d36742 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:59:07 +0200 Subject: [PATCH 19/61] Update emailcollector.class.php --- .../class/emailcollector.class.php | 161 +++++++++--------- 1 file changed, 83 insertions(+), 78 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 47d62197a70..b37d791a64a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -16,37 +16,38 @@ */ /** - * \file emailcollector/class/emailcollector.class.php - * \ingroup emailcollector - * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete) + * \file htdocs/emailcollector/class/emailcollector.class.php + * \ingroup emailcollector + * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete) */ // Put here all includes required by your class file -require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; -require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; +include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // customer proposal -require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // customer order -require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipment -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // supplier invoice -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // supplier order -require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // supplier proposal -require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // reception -include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; -//require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; // Holidays (leave request) -//require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // expernse repor +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; + +require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal +require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order +require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice +require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address +require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice +require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project +require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception +require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting +require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party +require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal +require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket +//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report +//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request) // use Webklex\PHPIMAP; -require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php'; -use Webklex\PHPIMAP\ClientManager; +require DOL_DOCUMENT_ROOT .'/includes/webklex/php-imap/vendor/autoload.php'; +use Webklex\PHPIMAP\ClientManager; use Webklex\PHPIMAP\Exceptions\ConnectionFailedException; use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException; use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException; @@ -64,14 +65,17 @@ class EmailCollector extends CommonObject * @var string ID to identify managed object */ public $element = 'emailcollector'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'emailcollector_emailcollector'; + /** * @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; + /** * @var int Does emailcollector support extrafields ? 0=No, 1=Yes */ @@ -91,6 +95,7 @@ class EmailCollector extends CommonObject * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); + /** * @var array List of child tables. To know object to delete on cascade. */ @@ -206,7 +211,6 @@ class EmailCollector extends CommonObject */ public $import_key; - public $host; public $port; public $hostcharset; @@ -1738,61 +1742,61 @@ class EmailCollector extends CommonObject $objectid = $reg[2]; // See also list into interface_50_modAgenda_ActionsAuto - if ($reg[1] == 'thi') { + if ($reg[1] == 'thi') { // Third-party $objectemail = new Societe($this->db); } - if ($reg[1] == 'ctc') { + if ($reg[1] == 'ctc') { // Contact $objectemail = new Contact($this->db); } - if ($reg[1] == 'inv') { // customer invoices + if ($reg[1] == 'inv') { // Customer Invoice $objectemail = new Facture($this->db); } - if ($reg[1] == 'sinv') { // supplier invoices + if ($reg[1] == 'sinv') { // Supplier Invoice $objectemail = new FactureFournisseur($this->db); } - if ($reg[1] == 'pro') { // customer proposals + if ($reg[1] == 'pro') { // Customer Proposal $objectemail = new Propal($this->db); } - if ($reg[1] == 'ord') { // customer orders + if ($reg[1] == 'ord') { // Customer Order $objectemail = new Commande($this->db); } - if ($reg[1] == 'shi') { // shipments + if ($reg[1] == 'shi') { // Shipment $objectemail = new Expedition($this->db); } - if ($reg[1] == 'spro') { // supplier proposal + if ($reg[1] == 'spro') { // Supplier Proposal $objectemail = new SupplierProposal($this->db); } - if ($reg[1] == 'sord') { // supplier order + if ($reg[1] == 'sord') { // Supplier Order $objectemail = new CommandeFournisseur($this->db); } - if ($reg[1] == 'rec') { // Reception + if ($reg[1] == 'rec') { // Reception $objectemail = new Reception($this->db); } - if ($reg[1] == 'proj') { + if ($reg[1] == 'proj') { // Project $objectemail = new Project($this->db); } - if ($reg[1] == 'tas') { + if ($reg[1] == 'tas') { // Task $objectemail = new Task($this->db); } - if ($reg[1] == 'con') { + if ($reg[1] == 'con') { // Contact $objectemail = new Contact($this->db); } - if ($reg[1] == 'use') { + if ($reg[1] == 'use') { // User $objectemail = new User($this->db); } - if ($reg[1] == 'tic') { + if ($reg[1] == 'tic') { // Ticket $objectemail = new Ticket($this->db); } - if ($reg[1] == 'recruitmentcandidature') { + if ($reg[1] == 'recruitmentcandidature') { // Recruiting Candidate $objectemail = new RecruitmentCandidature($this->db); } - if ($reg[1] == 'mem') { + if ($reg[1] == 'mem') { // Member $objectemail = new Adherent($this->db); } - /*if ($reg[1] == 'leav') { + /*if ($reg[1] == 'leav') { // Leave / Holiday $objectemail = new Holiday($db); } - if ($reg[1] == 'exp') { + if ($reg[1] == 'exp') { // ExpenseReport $objectemail = new ExpenseReport($db); }*/ } elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) { @@ -2213,42 +2217,42 @@ class EmailCollector extends CommonObject } $arrayobject = array( 'propale' => array('table' => 'propal', - 'fields' => array('ref'), - 'class' => 'comm/propal/class/propal.class.php', - 'object' => 'Propal'), + 'fields' => array('ref'), + 'class' => 'comm/propal/class/propal.class.php', + 'object' => 'Propal'), 'holiday' => array('table' => 'holiday', - 'fields' => array('ref'), - 'class' => 'holiday/class/holiday.class.php', - 'object' => 'Holiday'), + 'fields' => array('ref'), + 'class' => 'holiday/class/holiday.class.php', + 'object' => 'Holiday'), 'expensereport' => array('table' => 'expensereport', - 'fields' => array('ref'), - 'class' => 'expensereport/class/expensereport.class.php', - 'object' => 'ExpenseReport'), + 'fields' => array('ref'), + 'class' => 'expensereport/class/expensereport.class.php', + 'object' => 'ExpenseReport'), 'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentjobposition', - 'fields' => array('ref'), - 'class' => 'recruitment/class/recruitmentjobposition.class.php', - 'object' => 'RecruitmentJobPosition'), + 'fields' => array('ref'), + 'class' => 'recruitment/class/recruitmentjobposition.class.php', + 'object' => 'RecruitmentJobPosition'), 'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentcandidature', - 'fields' => array('ref'), - 'class' => 'recruitment/class/recruitmentcandidature.class.php', - 'object' => ' RecruitmentCandidature'), + 'fields' => array('ref'), + 'class' => 'recruitment/class/recruitmentcandidature.class.php', + 'object' => ' RecruitmentCandidature'), 'societe' => array('table' => 'societe', 'fields' => array('code_client', 'code_fournisseur'), 'class' => 'societe/class/societe.class.php', 'object' => 'Societe'), - 'commande' => array('table' => 'commande', + 'commande' => array('table' => 'commande', 'fields' => array('ref'), 'class' => 'commande/class/commande.class.php', 'object' => 'Commande'), - 'expedition' => array('table' => 'expedition', + 'expedition' => array('table' => 'expedition', 'fields' => array('ref'), 'class' => 'expedition/class/expedition.class.php', 'object' => 'Expedition'), - 'contract' => array('table' => 'contrat', + 'contract' => array('table' => 'contrat', 'fields' => array('ref'), 'class' => 'contrat/class/contrat.class.php', 'object' => 'Contrat'), - 'fichinter' => array('table' => 'fichinter', + 'fichinter' => array('table' => 'fichinter', 'fields' => array('ref'), 'class' => 'fichinter/class/fichinter.class.php', 'object' => 'Fichinter'), @@ -2256,51 +2260,51 @@ class EmailCollector extends CommonObject 'fields' => array('ref'), 'class' => 'ticket/class/ticket.class.php', 'object' => ' Ticket'), - 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord', + 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord', 'fields' => array('ref'), 'class' => 'knowledgemanagement/class/knowledgemanagement.class.php', 'object' => 'KnowledgeRecord'), - 'supplier_proposal' => array('table' => 'supplier_proposal', + 'supplier_proposal' => array('table' => 'supplier_proposal', 'fields' => array('ref'), 'class' => 'supplier_proposal/class/supplier_proposal.class.php', 'object' => 'SupplierProposal'), - 'fournisseur/commande' => array('table' => 'commande_fournisseur', + 'fournisseur/commande' => array('table' => 'commande_fournisseur', 'fields' => array('ref', 'ref_supplier'), 'class' => 'fourn/class/fournisseur.commande.class.php', 'object' => 'SupplierProposal'), - 'facture' => array('table' => 'facture', + 'facture' => array('table' => 'facture', 'fields' => array('ref'), 'class' => 'compta/facture/class/facture.class.php', 'object' => 'Facture'), - 'fournisseur/facture' => array('table' => 'facture_fourn', + 'fournisseur/facture' => array('table' => 'facture_fourn', 'fields' => array('ref', ref_client), 'class' => 'fourn/class/fournisseur.facture.class.php', 'object' => 'FactureFournisseur'), - 'produit' => array('table' => 'product', + 'produit' => array('table' => 'product', 'fields' => array('ref'), 'class' => 'product/class/product.class.php', 'object' => 'Product'), - 'productlot' => array('table' => 'product_lot', + 'productlot' => array('table' => 'product_lot', 'fields' => array('batch'), 'class' => 'product/stock/class/productlot.class.php', 'object' => 'Productlot'), - 'projet' => array('table' => 'projet', + 'projet' => array('table' => 'projet', 'fields' => array('ref'), 'class' => 'projet/class/projet.class.php', 'object' => 'Project'), - 'projet_task' => array('table' => 'projet_task', + 'projet_task' => array('table' => 'projet_task', 'fields' => array('ref'), 'class' => 'projet/class/task.class.php', 'object' => 'Task'), - 'ressource' => array('table' => 'resource', + 'ressource' => array('table' => 'resource', 'fields' => array('ref'), 'class' => 'ressource/class/dolressource.class.php', 'object' => 'Dolresource'), - 'bom' => array('table' => 'bom_bom', + 'bom' => array('table' => 'bom_bom', 'fields' => array('ref'), 'class' => 'bom/class/bom.class.php', 'object' => 'BOM'), - 'mrp' => array('table' => 'mrp_mo', + 'mrp' => array('table' => 'mrp_mo', 'fields' => array('ref'), 'class' => 'mrp/class/mo.class.php', 'object' => 'Mo'), @@ -2875,6 +2879,7 @@ class EmailCollector extends CommonObject 2.2.1 text/plain 2.2.2 text/html */ + /** * Sub function for getpart(). Only called by createPartArray() and itself. * @@ -2993,10 +2998,10 @@ class EmailCollector extends CommonObject /** * Converts a string from one encoding to another. * - * @param string $string String to convert - * @param string $fromEncoding String encoding - * @param string $toEncoding String return encoding - * @return string Converted string if conversion was successful, or the original string if not + * @param string $string String to convert + * @param string $fromEncoding String encoding + * @param string $toEncoding String return encoding + * @return string Converted string if conversion was successful, or the original string if not * @throws Exception */ protected function convertStringEncoding($string, $fromEncoding, $toEncoding = 'UTF-8') From 7ff31889cdbbe94416c04643a2ed0e288f9d3c06 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:14:51 +0200 Subject: [PATCH 20/61] Update eldy.lib.php edit: loadLangs --- htdocs/core/menus/standard/eldy.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index afaad336f9e..130eb6192e5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -114,7 +114,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1), - 'loadLangs' => array(), + 'loadLangs' => array("members"), 'submenus' => array(), ); @@ -170,7 +170,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1), - 'loadLangs' => array("products"), + 'loadLangs' => array("products", "stocks"), 'submenus' => array(), ); @@ -379,7 +379,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1), - 'loadLangs' => array("holiday"), + 'loadLangs' => array("hrm", "holiday"), 'submenus' => array(), ); @@ -410,7 +410,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1), - 'loadLangs' => array("other"), + 'loadLangs' => array("ticket", "knowledgemanagement"), 'submenus' => array(), ); From 2cf793d0fe0c191dee07a10044b9aea9931794c8 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 13 Sep 2022 18:29:46 +0000 Subject: [PATCH 21/61] Fixing style errors. --- htdocs/emailcollector/class/emailcollector.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b37d791a64a..e46bfbe9355 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception -require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting +require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket @@ -65,17 +65,17 @@ class EmailCollector extends CommonObject * @var string ID to identify managed object */ public $element = 'emailcollector'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'emailcollector_emailcollector'; - + /** * @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var int Does emailcollector support extrafields ? 0=No, 1=Yes */ @@ -95,7 +95,7 @@ class EmailCollector extends CommonObject * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); - + /** * @var array List of child tables. To know object to delete on cascade. */ @@ -2879,7 +2879,7 @@ class EmailCollector extends CommonObject 2.2.1 text/plain 2.2.2 text/html */ - + /** * Sub function for getpart(). Only called by createPartArray() and itself. * From cea9a4c4cc51a4deb8877776b1384bb1d4eb0d34 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 13 Sep 2022 20:34:40 +0200 Subject: [PATCH 22/61] cocorrection on expensereport/class/expensereport_ik.class.php: table_element_line doest not exist on class, so removed the call of fetchLine --- .../class/expensereport_ik.class.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 14f6908377e..503fa92b108 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -120,24 +120,10 @@ class ExpenseReportIk extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } + return $result; } - /** - * Load object lines in memory from the database - * - * @return int <0 if KO, 0 if not found, >0 if OK - */ - public function fetchLines() - { - $this->lines = array(); - - $result = $this->fetchLinesCommon(); - return $result; - } /** From ba2aafaf6f7495a457a94e7e9f162cb05d1d273c Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 14 Sep 2022 14:29:50 +0200 Subject: [PATCH 23/61] Update ActionComm type_code on email message ticket --- htdocs/ticket/class/ticket.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index df581d96fdc..1d7360b44a7 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1732,6 +1732,7 @@ class Ticket extends CommonObject $error = 0; $now = dol_now(); + $send_email = GETPOST('send_email','int'); // Clean parameters if (isset($this->fk_track_id)) { @@ -1752,6 +1753,9 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } + if ($send_email > 0){ + $actioncomm->type_code = 'AC_EMAIL'; + } $actioncomm->socid = $this->socid; $actioncomm->label = $this->subject; $actioncomm->note_private = $this->message; From b7db0af78b5b707b0fe478c5baf8259a061af72c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Sep 2022 12:48:21 +0000 Subject: [PATCH 24/61] Fixing style errors. --- htdocs/ticket/class/ticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1d7360b44a7..2ee10b855a8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1732,7 +1732,7 @@ class Ticket extends CommonObject $error = 0; $now = dol_now(); - $send_email = GETPOST('send_email','int'); + $send_email = GETPOST('send_email', 'int'); // Clean parameters if (isset($this->fk_track_id)) { @@ -1753,7 +1753,7 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } - if ($send_email > 0){ + if ($send_email > 0) { $actioncomm->type_code = 'AC_EMAIL'; } $actioncomm->socid = $this->socid; From 85525f9ea935149310d9a32a8245e244629126dc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:13:18 +0200 Subject: [PATCH 25/61] update code toward php8 compliance --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b1476b393d0..cc523be2eda 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 5492643514d121700eaa7fd242174403f73d637e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:16:08 +0200 Subject: [PATCH 26/61] update code toward php8 compliance --- htdocs/admin/pdf.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index b5a823edfb4..57ac961095d 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_TOP").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; -print ''; +print ''; print ''; print ''; From c56e8b08d64853d9e210384b954aaa9010741bef Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:17:50 +0200 Subject: [PATCH 27/61] update code toward php8 compliance --- htdocs/core/modules/action/rapport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php index 61579399247..fabb43fbdda 100644 --- a/htdocs/core/modules/action/rapport.class.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -98,10 +98,10 @@ class CommActionRapport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; From 67cabdfa9e5f7f55b19af7291295737bc845019c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:19:17 +0200 Subject: [PATCH 28/61] update code toward php8 compliance --- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index e313c612eb0..f47373f2e51 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; // Get source company $this->emetteur = $mysoc; From 732f2159158f673a0426a780fedd1f59997e1960 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:22:11 +0200 Subject: [PATCH 29/61] update code toward php8 compliance --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 3ab1cdcc193..b30806a4690 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 314a1fa7853..10659e18e66 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From a54be07c074a91361fc2c69b9774e88706971d7f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:23:27 +0200 Subject: [PATCH 30/61] update code toward php8 compliance --- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 21c131ad2a6..1fcad3a1b72 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; // Retrieves transmitter $this->emetteur = $mysoc; From 5891cfe8d50c8a526f8e9cf1bdb979adbf998206 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:24:36 +0200 Subject: [PATCH 31/61] update code toward php8 compliance --- .../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 34cdb41e6b8..f2f3e79ba19 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 7a0cc9c9163eff6da8f76edf55e196933ec9645a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:25:38 +0200 Subject: [PATCH 32/61] update code toward php8 compliance --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 1875cfb833c..560896ea559 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION From 5cd89aff35ed999f5148462cf12613220963a0eb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:26:57 +0200 Subject: [PATCH 33/61] update code toward php8 compliance --- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 7d880328663..e4114670eec 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 69a5d6ceac41ad50fbeb15e80fdf5564d3716078 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:28:09 +0200 Subject: [PATCH 34/61] update code toward php8 compliance --- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 2e0c3f2d05c..0c0cfae1750 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 944ad3087c384f0591a14d91ace59a1eb02b79a4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:29:23 +0200 Subject: [PATCH 35/61] update code toward php8 compliance --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 9e2e5286874..922d4acf418 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts From 17fa3b327e9ac864bb08f54302189b1367b39449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 14 Sep 2022 21:33:43 +0200 Subject: [PATCH 36/61] fix usage of getDolGlobalInt --- htdocs/admin/pdf.php | 8 ++++---- htdocs/core/modules/action/rapport.class.php | 8 ++++---- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 8 ++++---- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 8 ++++---- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 8 ++++---- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 8 ++++---- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 ++++---- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 8 ++++---- .../modules/expensereport/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 8 ++++---- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 8 ++++---- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 8 ++++---- htdocs/core/modules/product/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_timespent.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- htdocs/core/modules/rapport/pdf_paiement.class.php | 8 ++++---- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 8 ++++---- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 8 ++++---- .../core/modules/stocktransfer/doc/pdf_eagle.modules.php | 8 ++++---- .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 8 ++++---- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 8 ++++---- .../modules/supplier_order/doc/pdf_cornas.modules.php | 8 ++++---- .../modules/supplier_order/doc/pdf_muscadet.modules.php | 8 ++++---- .../modules/supplier_payment/doc/pdf_standard.modules.php | 8 ++++---- .../mymodule/doc/pdf_standard_myobject.modules.php | 8 ++++---- .../doc/pdf_standard_recruitmentjobposition.modules.php | 8 ++++---- 37 files changed, 148 insertions(+), 148 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 57ac961095d..686d13e7e39 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_TOP").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php index fabb43fbdda..4835c39c194 100644 --- a/htdocs/core/modules/action/rapport.class.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -98,10 +98,10 @@ class CommActionRapport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index f47373f2e51..14815f169f2 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Get source company $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index b30806a4690..bbbd82ec1c7 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 10659e18e66..e09fef45bf0 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 1fcad3a1b72..f32b2306624 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Retrieves transmitter $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cc523be2eda..2b89f229730 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f2f3e79ba19..df28616276d 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 560896ea559..5b45d0014be 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index e4114670eec..550957511ba 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 0c0cfae1750..ad8e0bd71a5 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 922d4acf418..485ff20951f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index e37977144d2..781d581aaf7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = round($formatarray['height'] / 2); $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 0237c294a0d..3872ad3d4a2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f6536cbb1df..fae58f49419 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2a94a94103e..76dc8950670 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index cb1c2fb64e0..9264da3f680 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index bb4a6826278..2d3e89a6316 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 6f2a6fcf694..d93a7d99076 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_codestockservice = 0; // Display stock-service code diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index ed10b5ee2bf..1a61a588ae3 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; //Available in several languages diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index e4bcc0e4f04..92cf586f848 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index df013a2fad0..3bae695f511 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 1dc5b7bf3f9..c3ce64e3df7 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects $this->page_hauteur = $formatarray['height']; } $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 9d118b2a555..02f3f0c8cfb 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c2971c9344e..ea95036b280 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9d52132db56..cdac495c393 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index e4991a5830d..8cb10e0a0f8 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -54,10 +54,10 @@ class pdf_paiement $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->tab_top = 30; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 050459d91d2..1b4588e57bb 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 3fd3917da2d..d3fa898d0a1 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_codestockservice = 0; // Display product-service code diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 87a6bcf0e38..2971741f078 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index fa49b0b6d44..493dd0f2f6f 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 39a9aab7e78..6e340a39981 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 00d1e2e28e7..a11983991cc 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 410a631fa62..5b9a572736b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 676c5768ea3..a6a272d6274 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages 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 3990d49fa6d..382b5a0f0ab 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 @@ -121,10 +121,10 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Get source company $this->emetteur = $mysoc; 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 2e85bfab121..bf267a475c6 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 @@ -121,10 +121,10 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 16ee0a5c966dc6be89bf9b29b7f615e6e67d7c2b Mon Sep 17 00:00:00 2001 From: GregM Date: Thu, 15 Sep 2022 09:56:50 +0200 Subject: [PATCH 37/61] Update function createTicketMessage --- htdocs/ticket/class/ticket.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1d7360b44a7..f7cd47ead07 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1724,15 +1724,15 @@ class Ticket extends CommonObject * @param array $filename_list List of files to attach (full path of filename on file system) * @param array $mimetype_list List of MIME type of attached files * @param array $mimefilename_list List of attached file name in message + * @param boolean $send_email Whether the message is sent by email * @return int <0 if KO, >0 if OK */ - public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array()) + public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = FALSE) { global $conf, $langs; $error = 0; $now = dol_now(); - $send_email = GETPOST('send_email','int'); // Clean parameters if (isset($this->fk_track_id)) { @@ -1753,7 +1753,7 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } - if ($send_email > 0){ + if ($send_email){ $actioncomm->type_code = 'AC_EMAIL'; } $actioncomm->socid = $this->socid; @@ -2540,7 +2540,7 @@ class Ticket extends CommonObject $listofnames = $resarray['listofnames']; $listofmimes = $resarray['listofmimes']; - $id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames); + $id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames, $send_email); if ($id <= 0) { $error++; $this->error = $object->error; From d4e57f34d948e41dd868f6f4d51da16f29d447ba Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 15 Sep 2022 08:05:40 +0000 Subject: [PATCH 38/61] Fixing style errors. --- htdocs/ticket/class/ticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index f7cd47ead07..4994faf5230 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1727,7 +1727,7 @@ class Ticket extends CommonObject * @param boolean $send_email Whether the message is sent by email * @return int <0 if KO, >0 if OK */ - public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = FALSE) + public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = false) { global $conf, $langs; $error = 0; @@ -1753,7 +1753,7 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } - if ($send_email){ + if ($send_email) { $actioncomm->type_code = 'AC_EMAIL'; } $actioncomm->socid = $this->socid; From a1d8879f34da8be01c882d571e9f8ef35a76a3e6 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Thu, 15 Sep 2022 14:30:37 +0200 Subject: [PATCH 39/61] Update create.php There is a previous line $format = GETPOST('format', 'aZ09'); --- htdocs/compta/prelevement/create.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index afcf2d4f086..5d6a58b9215 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -286,8 +286,8 @@ if ($nb) { if ($type != 'bank-transfer') { print ''; } print ''; From 603f6ed0361578b783dd546fbe5507d64e2345fa Mon Sep 17 00:00:00 2001 From: GregM Date: Thu, 15 Sep 2022 14:45:52 +0200 Subject: [PATCH 40/61] FIX error send token data on newonlinesign --- htdocs/public/onlinesign/newonlinesign.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 19fd85ace7e..76b26b09a3b 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -426,6 +426,7 @@ if ($action == "dosign" && empty($cancel)) { dataType: "text", data: { "action" : "importSignature", + "token" : \''.newToken().'\', "signaturebase64" : signature, "ref" : \''.dol_escape_js($REF).'\', "securekey" : \''.dol_escape_js($SECUREKEY).'\', From 9646c9c8a3fe715cdca8608198ae6ae7c931f604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 15 Sep 2022 15:11:19 +0200 Subject: [PATCH 41/61] add debug to product massaction --- htdocs/product/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d24b4e0d12b..5382f231322 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -371,7 +371,9 @@ if (empty($reshook)) { foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); if ($result > 0 && $product->id > 0) { - $product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell'); + if ($product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell') < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } } } } @@ -380,7 +382,9 @@ if (empty($reshook)) { foreach ($toselect as $toselectid) { $result = $product->fetch($toselectid); if ($result > 0 && $product->id > 0) { - $product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy'); + if ($product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy') < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } } } } From 3132f205cb0478b3f4acd55bbe4cf2997efed056 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Thu, 15 Sep 2022 16:47:39 +0200 Subject: [PATCH 42/61] Update extrafields.class.php The content of the field is never displayed translated. When fixing it, 18 is too short --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a3925c9160a..78763856089 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1688,8 +1688,8 @@ class ExtraFields if (!empty($obj->$field_toshow)) { $translabel = $langs->trans($obj->$field_toshow); } - if ($translabel != $field_toshow) { - $value .= dol_trunc($translabel, 18).' '; + if ($translabel != $obj->$field_toshow) { + $value .= dol_trunc($translabel, 24).' '; } else { $value .= $obj->$field_toshow.' '; } From 3bedbec81bd20ae079d80f2966fcab9c6decc14e Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Thu, 15 Sep 2022 18:02:24 +0200 Subject: [PATCH 43/61] Update date.lib.php If $duration_unit = 's', it shows a 500 error --- htdocs/core/lib/date.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index d2383a14dfc..ac93441d69e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -121,7 +121,9 @@ function getServerTimeZoneInt($refgmtdate = 'now') function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) { global $conf; - + if ($duration_unit == 's') { + return $time + ($duration_value); + } if ($duration_value == 0) { return $time; } From 9ed4131d20d5ff049bb51fdd831b6fa0dd69a93b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 15 Sep 2022 16:10:13 +0000 Subject: [PATCH 44/61] Fixing style errors. --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ac93441d69e..9aaf0771d44 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -122,7 +122,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend { global $conf; if ($duration_unit == 's') { - return $time + ($duration_value); + return $time + ($duration_value); } if ($duration_value == 0) { return $time; From 16d2f066844c24b0ee962f5865768ee1e49e7290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 15 Sep 2022 20:15:40 +0200 Subject: [PATCH 45/61] add badges --- htdocs/core/lib/agenda.lib.php | 11 +++++- htdocs/hrm/lib/hrm.lib.php | 70 ++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index cb5a7f41f8f..818cbca264d 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2022 Frédéric 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 @@ -362,7 +363,11 @@ function show_array_last_actions_done($max = 5) */ function agenda_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('actioncomm'); + $h = 0; $head = array(); @@ -395,6 +400,10 @@ function agenda_prepare_head() $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['actioncomm']['label']) ? count($extrafields->attributes['actioncomm']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index 508cbef22fd..a571231c143 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2022 Frédéric 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 @@ -21,7 +22,7 @@ /** * \file hrm/lib/hrm.lib.php - * \ingroup hr + * \ingroup hrm * \brief Library files with common functions for Workstation */ @@ -32,10 +33,15 @@ */ function hrmAdminPrepareHead() { - global $langs, $conf; + global $langs, $conf, $db; $langs->load("hrm"); + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('hrm_evaluation'); + $extrafields->fetch_name_optionals_label('hrm_job'); + $extrafields->fetch_name_optionals_label('hrm_skill'); + $h = 0; $head = array(); $head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php"; @@ -43,37 +49,37 @@ function hrmAdminPrepareHead() $head[$h][2] = 'settings'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; - $head[$h][1] = $langs->trans("Establishments"); - $head[$h][2] = 'establishments'; - $h++; - - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; - $head[$h][1] = $langs->trans("EvaluationsExtraFields"); - $head[$h][2] = 'evaluationsAttributes'; - $h++; - - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; - $head[$h][1] = $langs->trans("JobsExtraFields"); - $head[$h][2] = 'jobsAttributes'; - $h++; - - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; - $head[$h][1] = $langs->trans("SkillsExtraFields"); - $head[$h][2] = 'skillsAttributes'; - $h++; - - /* - $head[$h][0] = dol_buildpath("/workstation/admin/myobject_extrafields.php", 1); - $head[$h][1] = $langs->trans("ExtraFields"); - $head[$h][2] = 'myobject_extrafields'; + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; + $head[$h][1] = $langs->trans("Establishments"); + $head[$h][2] = 'establishments'; $h++; - */ - /*$head[$h][0] = require_once "/admin/about.php"; - $head[$h][1] = $langs->trans("About"); - $head[$h][2] = 'about'; - $h++;*/ + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; + $head[$h][1] = $langs->trans("EvaluationsExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['hrm_evaluation']['label']) ? count($extrafields->attributes['hrm_evaluation']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } + $head[$h][2] = 'evaluationsAttributes'; + $h++; + + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; + $head[$h][1] = $langs->trans("JobsExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['hrm_job']['label']) ? count($extrafields->attributes['hrm_job']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } + $head[$h][2] = 'jobsAttributes'; + $h++; + + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; + $head[$h][1] = $langs->trans("SkillsExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['hrm_skill']['label']) ? count($extrafields->attributes['hrm_skill']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } + $head[$h][2] = 'skillsAttributes'; + $h++; // Show more tabs from modules // Entries must be declared in modules descriptor with line @@ -85,7 +91,7 @@ function hrmAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin'); - complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove'); return $head; } From 567c646989c99ecf64c3a3e29032333f875ad17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 15 Sep 2022 20:23:37 +0200 Subject: [PATCH 46/61] add badges --- htdocs/core/lib/agenda.lib.php | 6 +++--- htdocs/core/lib/asset.lib.php | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 818cbca264d..d8f3bfbf102 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -20,8 +20,8 @@ */ /** - * \file htdocs/core/lib/agenda.lib.php - * \brief Set of function for the agenda module + * \file htdocs/core/lib/agenda.lib.php + * \brief Set of function for the agenda module */ @@ -314,7 +314,7 @@ function show_array_last_actions_done($max = 5) print ''; $staticaction->type_code = $obj->code; - $staticaction->libelle = $obj->label; + $staticaction->label = $obj->label; $staticaction->id = $obj->id; print ''.$staticaction->getNomUrl(1, 34).''; diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 9d71e2b38f1..719091973e3 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Frédéric 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 @@ -28,7 +29,11 @@ */ function assetAdminPrepareHead() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('asset'); + $extrafields->fetch_name_optionals_label('assetmodel'); $langs->load("assets"); @@ -52,11 +57,19 @@ function assetAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['asset']['label']) ? count($extrafields->attributes['asset']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'asset_extrafields'; $h++; $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsAssetModel"); + $nbExtrafields = is_countable($extrafields->attributes['assetmodel']['label']) ? count($extrafields->attributes['assetmodel']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'assetmodel_extrafields'; $h++; From 79c66ac19e3e73a03d400ef8ec831e3a2711b3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 15 Sep 2022 20:42:26 +0200 Subject: [PATCH 47/61] add badges --- htdocs/core/lib/contract.lib.php | 14 +++++++++++++- htdocs/core/lib/donation.lib.php | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 2d627532010..52c4267e55d 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -108,7 +108,11 @@ function contract_prepare_head(Contrat $object) */ function contract_admin_prepare_head() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('contract'); + $extrafields->fetch_name_optionals_label('contractdet'); $h = 0; $head = array(); @@ -126,11 +130,19 @@ function contract_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['contract']['label']) ? count($extrafields->attributes['contract']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = is_countable($extrafields->attributes['contractdet']['label']) ? count($extrafields->attributes['contractdet']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index e60b7ee3bc6..698932bd469 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -28,7 +28,10 @@ */ function donation_admin_prepare_head() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('donation'); $h = 0; $head = array(); @@ -46,6 +49,10 @@ function donation_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['donation']['label']) ? count($extrafields->attributes['donation']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; From 196c1c2c4a0e4158caed7b683fd1e9334aabf3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 15 Sep 2022 21:43:57 +0200 Subject: [PATCH 48/61] add badges --- htdocs/core/lib/ecm.lib.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index 97eeffd4337..f10f2ba2917 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Frédéric 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 @@ -17,9 +18,9 @@ */ /** - * \file htdocs/core/lib/ecm.lib.php - * \brief Ensemble de fonctions de base pour le module ecm - * \ingroup ecm + * \file htdocs/core/lib/ecm.lib.php + * \brief Ensemble de fonctions de base pour le module ecm + * \ingroup ecm */ @@ -160,7 +161,12 @@ function ecm_prepare_head_fm($object) */ function ecm_admin_prepare_head() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('ecm_files'); + $extrafields->fetch_name_optionals_label('ecm_directories'); + $langs->load("ecm"); $h = 0; @@ -173,11 +179,19 @@ function ecm_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles"); + $nbExtrafields = is_countable($extrafields->attributes['ecm_files']['label']) ? count($extrafields->attributes['ecm_files']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_ecm_files'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories"); + $nbExtrafields = is_countable($extrafields->attributes['ecm_directories']['label']) ? count($extrafields->attributes['ecm_directories']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_ecm_directories'; $h++; From b7208e273dc4fa762ec6515146c4edb9043f59fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 09:13:36 +0200 Subject: [PATCH 49/61] add badges in user admin --- htdocs/core/lib/asset.lib.php | 4 ++-- htdocs/core/lib/contract.lib.php | 8 ++++---- htdocs/core/lib/donation.lib.php | 4 ++-- htdocs/core/lib/usergroups.lib.php | 14 +++++++++++++- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 719091973e3..4c6f2aea9f3 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -33,7 +33,7 @@ function assetAdminPrepareHead() $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label('asset'); - $extrafields->fetch_name_optionals_label('assetmodel'); + $extrafields->fetch_name_optionals_label('asset_model'); $langs->load("assets"); @@ -66,7 +66,7 @@ function assetAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsAssetModel"); - $nbExtrafields = is_countable($extrafields->attributes['assetmodel']['label']) ? count($extrafields->attributes['assetmodel']['label']) : 0; + $nbExtrafields = is_countable($extrafields->attributes['asset_model']['label']) ? count($extrafields->attributes['asset_model']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 52c4267e55d..41f65be3622 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -111,8 +111,8 @@ function contract_admin_prepare_head() global $langs, $conf, $db; $extrafields = new ExtraFields($db); - $extrafields->fetch_name_optionals_label('contract'); - $extrafields->fetch_name_optionals_label('contractdet'); + $extrafields->fetch_name_optionals_label('contrat'); + $extrafields->fetch_name_optionals_label('contratdet'); $h = 0; $head = array(); @@ -130,7 +130,7 @@ function contract_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['contract']['label']) ? count($extrafields->attributes['contract']['label']) : 0; + $nbExtrafields = is_countable($extrafields->attributes['contrat']['label']) ? count($extrafields->attributes['contrat']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -139,7 +139,7 @@ function contract_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $nbExtrafields = is_countable($extrafields->attributes['contractdet']['label']) ? count($extrafields->attributes['contractdet']['label']) : 0; + $nbExtrafields = is_countable($extrafields->attributes['contratdet']['label']) ? count($extrafields->attributes['contratdet']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 698932bd469..06a8fca02d1 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -31,7 +31,7 @@ function donation_admin_prepare_head() global $langs, $conf, $db; $extrafields = new ExtraFields($db); - $extrafields->fetch_name_optionals_label('donation'); + $extrafields->fetch_name_optionals_label('don'); $h = 0; $head = array(); @@ -49,7 +49,7 @@ function donation_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['donation']['label']) ? count($extrafields->attributes['donation']['label']) : 0; + $nbExtrafields = is_countable($extrafields->attributes['don']['label']) ? count($extrafields->attributes['don']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 4b524f66b3e..d252606571b 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -250,7 +250,11 @@ function group_prepare_head($object) */ function user_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('user'); + $extrafields->fetch_name_optionals_label('usergroup'); $langs->load("users"); $h = 0; @@ -268,11 +272,19 @@ function user_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")"; + $nbExtrafields = is_countable($extrafields->attributes['user']['label']) ? count($extrafields->attributes['user']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")"; + $nbExtrafields = is_countable($extrafields->attributes['usergroup']['label']) ? count($extrafields->attributes['usergroup']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_group'; $h++; From d91d02f44ce63b59103122e5365d3ffa0bbc98a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 09:31:02 +0200 Subject: [PATCH 50/61] add badges in user admin --- htdocs/core/class/extrafields.class.php | 3 +++ htdocs/core/lib/usergroups.lib.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a3925c9160a..8a1ea7222ce 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -851,6 +851,7 @@ class ExtraFields $resql = $this->db->query($sql); if ($resql) { + $count = 0; if ($this->db->num_rows($resql)) { while ($tab = $this->db->fetch_object($resql)) { if ($tab->entity != 0 && $tab->entity != $conf->entity) { @@ -890,10 +891,12 @@ class ExtraFields $this->attributes[$tab->elementtype]['csslist'][$tab->name] = $tab->csslist; $this->attributes[$tab->elementtype]['loaded'] = 1; + $count++; } } if ($elementtype) { $this->attributes[$elementtype]['loaded'] = 1; // If nothing found, we also save tag 'loaded' + $this->attributes[$elementtype]['count'] = $count; } } else { $this->error = $this->db->lasterror(); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index d252606571b..79648eddd87 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -272,7 +272,7 @@ function user_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")"; - $nbExtrafields = is_countable($extrafields->attributes['user']['label']) ? count($extrafields->attributes['user']['label']) : 0; + $nbExtrafields = $extrafields->attributes['user']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -281,7 +281,7 @@ function user_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")"; - $nbExtrafields = is_countable($extrafields->attributes['usergroup']['label']) ? count($extrafields->attributes['usergroup']['label']) : 0; + $nbExtrafields = $extrafields->attributes['usergroup']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } From 6c844a5bb4ae8294c62954f60e54fd7ec2f28371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 09:35:28 +0200 Subject: [PATCH 51/61] use count from class --- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/asset.lib.php | 4 ++-- htdocs/core/lib/ecm.lib.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index d8f3bfbf102..87755969897 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -400,7 +400,7 @@ function agenda_prepare_head() $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['actioncomm']['label']) ? count($extrafields->attributes['actioncomm']['label']) : 0; + $nbExtrafields = $extrafields->attributes['actioncomm']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 4c6f2aea9f3..369c351cbaf 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -57,7 +57,7 @@ function assetAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['asset']['label']) ? count($extrafields->attributes['asset']['label']) : 0; + $nbExtrafields = $extrafields->attributes['asset']['count']); if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -66,7 +66,7 @@ function assetAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsAssetModel"); - $nbExtrafields = is_countable($extrafields->attributes['asset_model']['label']) ? count($extrafields->attributes['asset_model']['label']) : 0; + $nbExtrafields = $extrafields->attributes['asset_model']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index f10f2ba2917..cfcd4972a79 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -179,7 +179,7 @@ function ecm_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles"); - $nbExtrafields = is_countable($extrafields->attributes['ecm_files']['label']) ? count($extrafields->attributes['ecm_files']['label']) : 0; + $nbExtrafields = $extrafields->attributes['ecm_files']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -188,7 +188,7 @@ function ecm_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories"); - $nbExtrafields = is_countable($extrafields->attributes['ecm_directories']['label']) ? count($extrafields->attributes['ecm_directories']['label']) : 0; + $nbExtrafields = $extrafields->attributes['ecm_directories']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } From 26720ca11662875a4fa025c57529b8bfa0c6d4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 09:38:24 +0200 Subject: [PATCH 52/61] use count from class --- htdocs/core/lib/asset.lib.php | 2 +- htdocs/core/lib/contract.lib.php | 4 ++-- htdocs/core/lib/donation.lib.php | 2 +- htdocs/hrm/lib/hrm.lib.php | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 369c351cbaf..117c564dc95 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -57,7 +57,7 @@ function assetAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = $extrafields->attributes['asset']['count']); + $nbExtrafields = $extrafields->attributes['asset']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 41f65be3622..9ccffab8b49 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -130,7 +130,7 @@ function contract_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['contrat']['label']) ? count($extrafields->attributes['contrat']['label']) : 0; + $nbExtrafields = $extrafields->attributes['contrat']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -139,7 +139,7 @@ function contract_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $nbExtrafields = is_countable($extrafields->attributes['contratdet']['label']) ? count($extrafields->attributes['contratdet']['label']) : 0; + $nbExtrafields = $extrafields->attributes['contratdet']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 06a8fca02d1..f951d9b522f 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -49,7 +49,7 @@ function donation_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['don']['label']) ? count($extrafields->attributes['don']['label']) : 0; + $nbExtrafields = $extrafields->attributes['don']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index a571231c143..d821c2f5216 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -56,7 +56,7 @@ function hrmAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; $head[$h][1] = $langs->trans("EvaluationsExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['hrm_evaluation']['label']) ? count($extrafields->attributes['hrm_evaluation']['label']) : 0; + $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -65,7 +65,7 @@ function hrmAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; $head[$h][1] = $langs->trans("JobsExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['hrm_job']['label']) ? count($extrafields->attributes['hrm_job']['label']) : 0; + $nbExtrafields = $extrafields->attributes['hrm_job']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } @@ -74,7 +74,7 @@ function hrmAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; $head[$h][1] = $langs->trans("SkillsExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['hrm_skill']['label']) ? count($extrafields->attributes['hrm_skill']['label']) : 0; + $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ' '.$nbExtrafields.''; } From 674d85df4fba8113c58dbf0bdb82c0408ab44ca6 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 16 Sep 2022 10:14:39 +0200 Subject: [PATCH 53/61] FIX : No splitAll for multiple batch --- htdocs/mrp/mo_production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index ff6b180b9d8..9fa25f3cf54 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1070,7 +1070,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"'); print ''; print ''; - if (($action == 'consumeorproduce' || $action == 'consumeandproduceall')) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"'); + if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"'); print ''; } print ''; From 5843cc8cb6741800461c1b5f5af9f06cf1d1e79b Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 16 Sep 2022 11:11:20 +0200 Subject: [PATCH 54/61] Bom services : fix calcul of cost for line without workstation --- htdocs/bom/class/bom.class.php | 14 ++++++-------- htdocs/langs/fr_FR/mrp.lang | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index ef99f9f7bb7..c271b7479be 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1369,16 +1369,14 @@ class BOM extends CommonObject $unit = measuringUnitString($line->fk_unit, '', '', 1); $qty = convertDurationtoHour($line->qty, $unit); - if ($conf->workstation->enabled) { - if ($tmpproduct->fk_default_workstation) { - $workstation = new Workstation($this->db); - $res = $workstation->fetch($tmpproduct->fk_default_workstation); + if ($conf->workstation->enabled && !empty($tmpproduct->fk_default_workstation)) { + $workstation = new Workstation($this->db); + $res = $workstation->fetch($tmpproduct->fk_default_workstation); - if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); - else { - $this->error = $workstation->error; + if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + else { + $this->error = $workstation->error; return -3; - } } } else { $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 2a905a76530..1d17bc750ea 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,7 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) -BOMTotalCostService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" +BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travil est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" BOMProductsList=Liste des composants BOMServicesList=Liste des services GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. From 3d1595e21b2dda82818d71635272afa3c20aee2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 16:07:07 +0200 Subject: [PATCH 55/61] cannot enter a quantity with a comma --- htdocs/expedition/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index dc9a5c04b6e..52f8b75d7bc 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2016 Yasser Carreón - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2020 Lenin Rivas * Copyright (C) 2022 Josep Lluís Amador * @@ -214,13 +214,13 @@ if (empty($reshook)) { $db->begin(); $object->note = GETPOST('note', 'alpha'); - $object->origin = $origin; + $object->origin = $origin; $object->origin_id = $origin_id; $object->fk_project = GETPOST('projectid', 'int'); - $object->weight = GETPOST('weight', 'int') == '' ? "NULL" : GETPOST('weight', 'int'); - $object->sizeH = GETPOST('sizeH', 'int') == '' ? "NULL" : GETPOST('sizeH', 'int'); - $object->sizeW = GETPOST('sizeW', 'int') == '' ? "NULL" : GETPOST('sizeW', 'int'); - $object->sizeS = GETPOST('sizeS', 'int') == '' ? "NULL" : GETPOST('sizeS', 'int'); + $object->weight = GETPOST('weight', 'int') == '' ? "NULL" : GETPOST('weight', 'int'); + $object->sizeH = GETPOST('sizeH', 'int') == '' ? "NULL" : GETPOST('sizeH', 'int'); + $object->sizeW = GETPOST('sizeW', 'int') == '' ? "NULL" : GETPOST('sizeW', 'int'); + $object->sizeS = GETPOST('sizeS', 'int') == '' ? "NULL" : GETPOST('sizeS', 'int'); $object->size_units = GETPOST('size_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int'); @@ -233,8 +233,8 @@ if (empty($reshook)) { $object->ref_customer = GETPOST('ref_customer', 'alpha'); $object->model_pdf = GETPOST('model'); $object->date_delivery = $date_delivery; // Date delivery planed - $object->fk_delivery_address = $objectsrc->fk_delivery_address; - $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); + $object->fk_delivery_address = $objectsrc->fk_delivery_address; + $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->tracking_number = GETPOST('tracking_number', 'alpha'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -265,7 +265,7 @@ if (empty($reshook)) { $qty .= '_'.$j; while (GETPOSTISSET($batch)) { // save line of detail into sub_qty - $sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record + $sub_qty[$j]['q'] = price2num(GETPOST($qty, 'alpha'), 'MS'); // the qty we want to move for this stock record $sub_qty[$j]['id_batch'] = GETPOST($batch, 'int'); // the id into llx_product_batch of stock record to move $subtotalqty += $sub_qty[$j]['q']; @@ -481,7 +481,7 @@ if (empty($reshook)) { // setEventMessages($object->error, $object->errors, 'errors'); // } //} - } elseif ($action == 'setdate_livraison' && $user->rights->expedition->creer) { + } elseif ($action == 'setdate_livraison' && !empty($user->rights->expedition->creer)) { $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); From 2509a3bf733ab9aef86e7fd3b67baac8474394db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 16 Sep 2022 16:36:19 +0200 Subject: [PATCH 56/61] Update modStockTransfer.class.php --- htdocs/core/modules/modStockTransfer.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index 376cf9409f2..4f99039f8f7 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -1,8 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France - * Copyright (C) 2021 SuperAdmin + * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -63,8 +62,6 @@ class modStockTransfer extends DolibarrModules $this->description = $langs->trans("ModuleStockTransferDesc"); // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "StockTransfer description (Long)"; - $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'development'; // Url to the file with your last numberversion of this module @@ -127,7 +124,7 @@ class modStockTransfer 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("stocktransfer@stocktransfer"); - $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'...) From bafadb799120e1b05cfd094e99fba45e882cd0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 17 Sep 2022 21:16:02 +0200 Subject: [PATCH 57/61] wip --- htdocs/core/lib/stock.lib.php | 23 ++++++++++++++++++++--- htdocs/core/lib/ticket.lib.php | 15 +++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index afad01ebcff..79844f5aed7 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/core/lib/stock.lib.php - * \brief Library file with function for stock module + * \file htdocs/core/lib/stock.lib.php + * \brief Library file with function for stock module */ /** @@ -88,7 +88,12 @@ function stock_prepare_head($object) */ function stock_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('entrepot'); + $extrafields->fetch_name_optionals_label('stock_mouvement'); + $extrafields->fetch_name_optionals_label('inventory'); $h = 0; $head = array(); @@ -106,16 +111,28 @@ function stock_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['entrepot']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_mouvement_extrafields.php'; $head[$h][1] = $langs->trans("StockMouvementExtraFields"); + $nbExtrafields = $extrafields->attributes['stock_mouvement']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'stockMouvementAttributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/product/admin/inventory_extrafields.php'; $head[$h][1] = $langs->trans("InventoryExtraFields"); + $nbExtrafields = $extrafields->attributes['inventory']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'inventoryAttributes'; $h++; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 5fd2682d175..eb814cb1295 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -18,9 +18,9 @@ */ /** - * \file core/lib/ticket.lib.php - * \ingroup ticket - * \brief This file is a library for Ticket module + * \file core/lib/ticket.lib.php + * \ingroup ticket + * \brief This file is a library for Ticket module */ /** @@ -30,7 +30,10 @@ */ function ticketAdminPrepareHead() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('ticket'); $langs->load("ticket"); @@ -44,6 +47,10 @@ function ticketAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsTicket"); + $nbExtrafields = $extrafields->attributes['ticket']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; From 345864b10db3b5659b7e38104ece62d7a022cf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 18 Sep 2022 20:38:14 +0200 Subject: [PATCH 58/61] add badge in propal admin --- htdocs/core/lib/propal.lib.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 71391f2e499..9a28f2e331f 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -122,7 +122,11 @@ function propal_prepare_head($object) */ function propal_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('propal'); + $extrafields->fetch_name_optionals_label('propaldet'); $h = 0; $head = array(); @@ -140,11 +144,19 @@ function propal_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['propal']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['propaldet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; From 29bb7505cc91c5ccc86155b36ac6a3a6c6c1050e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 18 Sep 2022 20:50:15 +0200 Subject: [PATCH 59/61] add badge in product admin --- htdocs/core/lib/product.lib.php | 32 +++++++++++++++++++++++--------- htdocs/core/lib/project.lib.php | 23 +++++++++++++++++------ htdocs/core/lib/propal.lib.php | 6 +++--- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index b5056c2cce3..393a2f618a0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/core/lib/product.lib.php - * \brief Ensemble de fonctions de base pour le module produit et service - * \ingroup product + * \file htdocs/core/lib/product.lib.php + * \brief Ensemble de fonctions de base pour le module produit et service + * \ingroup product */ /** @@ -279,7 +279,11 @@ function productlot_prepare_head($object) */ function product_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('product'); + $extrafields->fetch_name_optionals_label('product_fournisseur_price'); $h = 0; $head = array(); @@ -306,11 +310,19 @@ function product_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['product']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'; $head[$h][1] = $langs->trans("ProductSupplierExtraFields"); + $nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'supplierAttributes'; $h++; @@ -322,9 +334,9 @@ function product_admin_prepare_head() /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object informations. * - * @return array head array with tabs + * @return array head array with tabs */ function product_lot_admin_prepare_head() { @@ -556,11 +568,11 @@ function show_stats_for_company($product, $socid) } // MO - if (!empty($conf->mrp->enabled) && $user->rights->mrp->read) { + if (!empty($conf->mrp->enabled) && !empty($user->rights->mrp->read)) { $nblines++; $ret = $product->load_stats_mo($socid); if ($ret < 0) { - setEventMessage($product->error, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } $langs->load("mrp"); print ''; @@ -585,7 +597,9 @@ function show_stats_for_company($product, $socid) } $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } print $hookmanager->resPrint; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 47fb9b6f186..6c4dbeffd8a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/core/lib/project.lib.php - * \brief Functions used by project module - * \ingroup project + * \file htdocs/core/lib/project.lib.php + * \brief Functions used by project module + * \ingroup project */ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -487,11 +487,14 @@ function project_timesheet_prepare_head($mode, $fuser = null) */ function project_admin_prepare_head() { - global $langs, $conf, $user; - $h = 0; - $head = array(); + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('projet'); + $extrafields->fetch_name_optionals_label('projet_task'); $h = 0; + $head = array(); $head[$h][0] = DOL_URL_ROOT."/projet/admin/project.php"; $head[$h][1] = $langs->trans("Projects"); @@ -502,11 +505,19 @@ function project_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT."/projet/admin/project_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFieldsProject"); + $nbExtrafields = $extrafields->attributes['projet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); + $nbExtrafields = $extrafields->attributes['projet_task']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_task'; $h++; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 9a28f2e331f..06fae0dd81d 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/core/lib/propal.lib.php - * \brief Ensemble de fonctions de base pour le module propal - * \ingroup propal + * \file htdocs/core/lib/propal.lib.php + * \brief Ensemble de fonctions de base pour le module propal + * \ingroup propal */ /** From d103b592aa4229e6e8f98ae340182b22573dd37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Sep 2022 09:58:38 +0200 Subject: [PATCH 60/61] Update modWebhook.class.php --- htdocs/core/modules/modWebhook.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index fd7f658bd48..ef4bced304d 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -2,7 +2,6 @@ /* Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2018-2019 Nicolas ZABOURI * Copyright (C) 2019-2020 Frédéric France - * Copyright (C) 2022 SuperAdmin * * 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 @@ -67,10 +66,6 @@ class modWebhook extends DolibarrModules // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "WebhookDescription"; - // Author - $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; - // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'development'; // Url to the file with your last numberversion of this module From 8221e4c4bdd53a3c20e3a2d2656c1ba8e00b6abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Sep 2022 14:16:23 +0200 Subject: [PATCH 61/61] wip --- htdocs/modulebuilder/template/lib/mymodule.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index ab8a647efe4..0ebae6eb74f 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -30,6 +30,10 @@ function mymoduleAdminPrepareHead() { global $langs, $conf; + // global $db; + // $extrafields = new ExtraFields($db); + // $extrafields->fetch_name_optionals_label('myobject'); + $langs->load("mymodule@mymodule"); $h = 0; @@ -43,6 +47,10 @@ function mymoduleAdminPrepareHead() /* $head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' ' . $nbExtrafields . ''; + } $head[$h][2] = 'myobject_extrafields'; $h++; */