From 804480ca2d07f80025927c7a4c33124aba8def6e Mon Sep 17 00:00:00 2001 From: JC Prieto Date: Thu, 25 Aug 2022 12:51:18 +0200 Subject: [PATCH 001/507] Update card.php Same behavior as products with not lot. (See line 1338). --- htdocs/expedition/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4bec4220c6c..1bd4ca72dc2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1445,6 +1445,11 @@ if ($action == 'create') { } foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { + if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) { + // if a warehouse was selected by user, picking is limited to this warehouse and his children. + + continue; + } $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { From 215f89d5452abdde7282077a7d48ba49d25333a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Aug 2022 23:44:57 +0200 Subject: [PATCH 002/507] Fix phpcs --- htdocs/expedition/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 1bd4ca72dc2..e8bfb0249b1 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1446,8 +1446,7 @@ if ($action == 'create') { foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) { - // if a warehouse was selected by user, picking is limited to this warehouse and his children. - + // if a warehouse was selected by user, picking is limited to this warehouse and his children. continue; } $tmpwarehouseObject->fetch($warehouse_id); From 2b4391019b28b1680021833bec695ff355652030 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 26 Aug 2022 08:55:11 +0200 Subject: [PATCH 003/507] Add forcecombo parameter to select dol user function --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c2d2eeced9a..8c941c8f20b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1921,7 +1921,7 @@ class Form * @return string HTML select string * @see select_dolgroups() */ - public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) + public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false, $forcecombo = 0) { // phpcs:enable global $conf, $user, $langs, $hookmanager; @@ -2124,7 +2124,7 @@ class Form } $out .= ''; - if ($num) { + if ($num && !$forcecombo) { // Enhance with select2 include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); From 68994752cdacaeb01dc0febcc60d574b4cc8e5c9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 Aug 2022 11:08:39 +0200 Subject: [PATCH 004/507] FIX multiple php8 compatibility --- htdocs/comm/action/card.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/societe/index.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e543b7e6bd1..1f058b3c820 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1320,7 +1320,7 @@ if ($action == 'create') { // Description print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, isModEnabled('fckeditor'), ROWS_4, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c2d2eeced9a..e95eac4ac06 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6451,8 +6451,8 @@ class Form } elseif ($usecalendar == 'jquery') { if (!$disabled) { // Output javascript for datepicker - $minYear = $conf->global->MIN_YEAR_SELECT_DATE ? $conf->global->MIN_YEAR_SELECT_DATE : (date('Y') - 100); - $maxYear = $conf->global->MAX_YEAR_SELECT_DATE ? $conf->global->MAX_YEAR_SELECT_DATE : (date('Y') + 100); + $minYear = getDolGlobalString('MIN_YEAR_SELECT_DATE', date('Y') - 100); + $maxYear = getDolGlobalString('MAX_YEAR_SELECT_DATE', date('Y') + 100); $retstring .= "'."\n"; + } + if (!GETPOSTISSET("no_email") && !empty($object->email)) { + $result = $object->getNoEmail(); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + print ''; + print ''; + print ''; + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); + print ''; + print ''; + } + // Social networks if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1931,6 +1990,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); + $object->no_email = GETPOST("no_email", "int"); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'alphanohtml'); $object->idprof1 = GETPOST('idprof1', 'alphanohtml'); @@ -2272,10 +2332,58 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; // EMail / Web - print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''; - print ''.img_picto('', 'object_email', 'class="pictofixedwidth"').' '; print ''.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''; - print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' '; + print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' '; + + // EMail + print ''.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''; + print ''; + print img_picto('', 'object_email'); + print ''; + if (!empty($conf->mailing->enabled)) { + $langs->load("mails"); + print ''.$langs->trans("NbOfEMailingsSend").''; + print ''.$object->getNbOfEMailings().''; + } else { + print ''; + } + print ''; + + // Unsubscribe + if (!empty($conf->mailing->enabled)) { + if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { + print "\n".''."\n"; + } + if (!GETPOSTISSET("no_email") && !empty($object->email)) { + $result = $object->getNoEmail(); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + print ''; + print ''; + print ''; + $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty); + print ''; + print ''; + } // Social network if (!empty($conf->socialnetworks->enabled)) { @@ -2931,6 +3039,28 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; + // Email + if (!empty($conf->mailing->enabled)) { + $langs->load("mails"); + print ''.$langs->trans("NbOfEMailingsSend").''; + print ''.$object->getNbOfEMailings().''; + } + + // Unsubscribe opt-out + if (!empty($conf->mailing->enabled)) { + $result = $object->getNoEmail(); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + print ''.$langs->trans("No_Email").''; + if ($object->email) { + print yn($object->no_email); + } else { + print ''.$langs->trans("EMailNotDefined").''; + } + print ''; + } + // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index a7b78174cf1..123ad09560a 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -230,6 +230,9 @@ class Thirdparties extends DolibarrApi $obj = $this->db->fetch_object($result); $soc_static = new Societe($this->db); if ($soc_static->fetch($obj->rowid)) { + if (isModEnabled('mailing')) { + $soc_static->getNoEmail(); + } $obj_ret[] = $this->_cleanObjectDatas($soc_static); } $i++; @@ -263,6 +266,9 @@ class Thirdparties extends DolibarrApi if ($this->company->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, 'Error creating thirdparty', array_merge(array($this->company->error), $this->company->errors)); } + if (isModEnabled('mailing') && !empty($this->company->email) && isset($this->company->no_email)) { + $this->company->setNoEmail($this->company->no_email); + } return $this->company->id; } @@ -296,7 +302,11 @@ class Thirdparties extends DolibarrApi $this->company->$field = $value; } - if ($this->company->update($id, DolibarrApiAccess::$user, 1, '', '', 'update')) { + if (isModEnabled('mailing') && !empty($this->company->email) && isset($this->company->no_email)) { + $this->company->setNoEmail($this->company->no_email); + } + + if ($this->company->update($id, DolibarrApiAccess::$user, 1, '', '', 'update', 1)) { return $this->get($id); } @@ -1876,6 +1886,9 @@ class Thirdparties extends DolibarrApi if (!DolibarrApi::_checkAccessToResource('societe', $this->company->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login.' on this thirdparty'); } + if (isModEnabled('mailing')) { + $this->company->getNoEmail(); + } if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice From 747db835ae78d7755c82d7b095a29123b4785c26 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 29 Aug 2022 12:47:01 +0000 Subject: [PATCH 140/507] Fixing style errors. --- htdocs/societe/card.php | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 9c049148632..d56f9419989 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -770,7 +770,6 @@ if (empty($reshook)) { $result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0); if ($result > 0) { - // Update mass emailing flag into table mailing_unsubscribe if (GETPOSTISSET('no_email') && $object->email) { $no_email = GETPOST('no_email', 'int'); @@ -1621,10 +1620,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' '; // Unsubscribe - if (!empty($conf->mailing->enabled)) { - if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { - print "\n".''."\n"; - } - if (!GETPOSTISSET("no_email") && !empty($object->email)) { - $result = $object->getNoEmail(); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - print ''; - print ''; - print ''; - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); - print ''; - print ''; + print ''."\n"; } + if (!GETPOSTISSET("no_email") && !empty($object->email)) { + $result = $object->getNoEmail(); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + print ''; + print ''; + print ''; + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); + print ''; + print ''; + } // Social networks if (!empty($conf->socialnetworks->enabled)) { From 09f2140411b0c55417be6cdba9199da0793b1c3c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 29 Aug 2022 14:48:40 +0200 Subject: [PATCH 141/507] Update thirdparties.modules.php --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 0db503b620c..6f694cc0b74 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -81,7 +81,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; if (GETPOST('default_lang', 'alpha')) { - //$sql .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; + $sql .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; } } else { $addFilter = ""; From d41c6a93d31d93ba6a48edef13743e94eb847dec Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 29 Aug 2022 16:23:33 +0200 Subject: [PATCH 142/507] Fix : php 8.1 warn,ings --- htdocs/core/class/html.formticket.class.php | 8 ++++---- htdocs/core/lib/payments.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/public/members/new.php | 8 ++++---- htdocs/public/project/new.php | 2 +- htdocs/public/recruitment/index.php | 3 +++ htdocs/public/ticket/create_ticket.php | 2 ++ htdocs/public/ticket/index.php | 3 ++- 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 83071830ae7..2e4035e2131 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -416,7 +416,7 @@ class FormTicket $toolbarname = 'dolibarr_notes'; if ($this->ispublic) { $toolbarname = 'dolibarr_details'; - print '
'.($conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe')).'
'; + print '
'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'))).'
'; } include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $uselocalbrowser = true; @@ -752,7 +752,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -864,7 +864,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1199,7 +1199,7 @@ class FormTicket } } print ''; - if ($user->admin && !$noadmininfo) { + if (isset($user->admin) && $user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 5c9d9342b01..1ebca6ba65a 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -482,7 +482,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, } // Add other message if VAT exists - if ($object->total_vat != 0 || $object->total_tva != 0) { + if (!empty($object->total_vat) || $object->total_tva != 0) { $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; if (!empty($conf->global->$parammessageform)) { print $langs->transnoentities($conf->global->$parammessageform); diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 8ef509057c4..28a443f2034 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -206,7 +206,7 @@ function generate_random_id($car = 16) function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') { global $user, $conf, $langs, $mysoc; - + $urllogo = ""; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1); // Show html headers print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6a0fda06cb0..a45130010a3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1600,7 +1600,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&userid='.$user->id.'&entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&'.(!empty($user->id) ? ('userid='.$user->id.'&') : '').';entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..83941861474 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -475,7 +475,7 @@ print '
'; if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) { print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)."
\n"; } else { - print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; + print $langs->trans("NewSubscriptionDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."
\n"; } print '
'; @@ -568,7 +568,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW // Firstname print ''.$langs->trans("Firstname").' *'."\n"; // EMail - print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; + print ''.$langs->trans("Email").(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print ''."\n"; // Login @@ -623,7 +623,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } // Birthday print ''.$langs->trans("DateOfBirth").''; - print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); + print $form->selectDate(!empty($birthday) ? $birthday : "", 'birth', 0, 0, 1, "newmember", 1, 0); print ''."\n"; // Photo print ''.$langs->trans("URLPhoto").''."\n"; @@ -786,7 +786,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print max(1, intval($objp->duration)).' '.$units[$unit]; print ''; print ''; - $displayedamount = max(intval($objp->amount), intval($conf->global->MEMBER_MIN_AMOUNT)); + $displayedamount = max(intval($objp->amount), intval(getDolGlobalInt("MEMBER_MIN_AMOUNT"))); $caneditamount = !empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) || $objp->caneditamount; if ($objp->subscription) { if ($displayedamount > 0 || !$caneditamount) { diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 5b0c35c10f3..d984b3346d8 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -423,7 +423,7 @@ print '
'; if (!empty($conf->global->PROJECT_NEWFORM_TEXT)) { print $langs->trans($conf->global->PROJECT_NEWFORM_TEXT)."
\n"; } else { - print $langs->trans("FormForNewLeadDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; + print $langs->trans("FormForNewLeadDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."
\n"; } print '
'; diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 632a3f57da2..32585c94bb4 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -47,7 +47,10 @@ $langs->loadLangs(array("companies", "other", "recruitment")); // Get parameters $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); +$SECUREKEY = GETPOST("securekey"); +$entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; $backtopage = ''; +$suffix = ""; // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 33b3b8bdccd..4defe2be01f 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -71,6 +71,8 @@ $langs->loadLangs(array('companies', 'other', 'mails', 'ticket')); // Get parameters $id = GETPOST('id', 'int'); $msg_id = GETPOST('msg_id', 'int'); +$socid = GETPOST('socid', 'int'); +$suffix = ""; $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 4ea314c8149..bff53d91edb 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -59,6 +59,7 @@ $langs->loadLangs(array('companies', 'other', 'ticket', 'errors')); // Get parameters $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); +$suffix = ""; if (empty($conf->ticket->enabled)) { accessforbidden('', 0, 0, 1); @@ -82,7 +83,7 @@ $arrayofcss = array('/ticket/css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); print '
'; -print '

'.($conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans("TicketPublicDesc")).'

'; +print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", $langs->trans("TicketPublicDesc"))).'

'; print '
'; print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; print '

'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'
'; From 185f8896c596f624dba5702346262b62ccac5d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 29 Aug 2022 16:52:27 +0200 Subject: [PATCH 143/507] fix display date creation --- htdocs/reception/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 9a679c067f8..3ee755bef37 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1434,7 +1434,7 @@ if ($action == 'create') { // Date creation print ''.$langs->trans("DateCreation").''; - print ''.dol_print_date($object->date_creation, "dayhour")."\n"; + print ''.dol_print_date($object->date_creation, "dayhour", "tzuserrel")."\n"; print ''; // Delivery date planned From ec764595f8614e10c891b582297fecb7797bc545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 29 Aug 2022 16:59:23 +0200 Subject: [PATCH 144/507] enhance bank display for user --- htdocs/langs/en_US/holiday.lang | 5 +- htdocs/langs/fr_FR/holiday.lang | 1 + htdocs/user/bank.php | 90 ++++++++++++++++++++- htdocs/user/class/userbankaccount.class.php | 30 +++++-- 4 files changed, 115 insertions(+), 11 deletions(-) diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 0ab79985ea7..04f47c8428d 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - Source file is en_US - holiday HRM=HRM -Holidays=Leave +Holidays=Leaves +Holiday=Leave CPTitreMenu=Leave MenuReportMonth=Monthly statement MenuAddCP=New leave request @@ -147,4 +148,4 @@ XIsAUsualNonWorkingDay=%s is usualy a NON working day BlockHolidayIfNegative=Block if balance negative LeaveRequestCreationBlockedBecauseBalanceIsNegative=The creation of this leave request is blocked because your balance is negative ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted -HolidayQtyNotModified=Balance of remaining days for %s has not been changed \ No newline at end of file +HolidayQtyNotModified=Balance of remaining days for %s has not been changed diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index c6671f9f6a3..22720779eaf 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - Source file is en_US - holiday HRM=GRH Holidays=Congés +Holiday=Congé CPTitreMenu=Demande de congés MenuReportMonth=État mensuel MenuAddCP=Créer demande de congés diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 1b7ca92bbbb..81bf184d391 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; if (!empty($conf->holiday->enabled)) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } @@ -122,6 +124,10 @@ if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) { $account->proprio = GETPOST('proprio', 'alpha'); $account->owner_address = GETPOST('owner_address', 'alpha'); + $account->currency_code = trim(GETPOST("account_currency_code")); + $account->state_id = GETPOST("account_state_id", 'int'); + $account->country_id = GETPOST("account_country_id", 'int'); + $result = $account->create($user); if (!$result) { @@ -192,6 +198,10 @@ if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) { $account->proprio = GETPOST('proprio', 'alpha'); $account->owner_address = GETPOST('owner_address', 'alpha'); + $account->currency_code = trim(GETPOST("account_currency_code")); + $account->state_id = GETPOST("account_state_id", 'int'); + $account->country_id = GETPOST("account_country_id", 'int'); + $result = $account->update($user); if (!$result) { @@ -274,6 +284,7 @@ if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { */ $form = new Form($db); +$formcompany = new FormCompany($db); $childids = $user->getAllChildIds(1); @@ -285,14 +296,42 @@ llxHeader('', $title, $help_url); $head = user_prepare_head($object); if ($id && $bankid && $action == 'edit' && ($user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write)) { - print '
'; + if ($conf->use_javascript_ajax) { + print "\n\n"; + } + print ''; print ''; print ''; print ''; print ''; } if ($id && $action == 'create' && $user->rights->user->user->creer) { - print ''; + if ($conf->use_javascript_ajax) { + print "\n\n"; + } + print ''; print ''; print ''; print ''; @@ -772,6 +811,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print_liste_field_titre("RIB"); print_liste_field_titre("IBAN"); print_liste_field_titre("BIC"); + print_liste_field_titre("Currency"); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); print "\n"; @@ -806,7 +846,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print $string; print ''; // IBAN - print ''.$account->iban; + print ''.getIbanHumanReadable($account); if (!empty($account->iban)) { if (!checkIbanForAccount($account)) { print ' '.img_picto($langs->trans("IbanNotValid"), 'warning'); @@ -822,6 +862,9 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } print ''; + // Currency + print ''.$account->currency_code.''; + // Edit/Delete print ''; if ($permissiontoaddbankaccount) { @@ -864,6 +907,47 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->us print ''.$langs->trans("BankName").''; print ''; + // Currency + print ''.$langs->trans("Currency"); + print ''; + print ''; + print ''; + $selectedcode = $account->currency_code; + if (!$selectedcode) { + $selectedcode = $conf->currency; + } + print img_picto('', 'multicurrency', 'class="pictofixedwidth"'); + print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code'); + print ''; + + // Country + $account->country_id = $account->country_id ? $account->country_id : $mysoc->country_id; + $selectedcode = $account->country_code; + if (GETPOSTISSET("account_country_id")) { + $selectedcode = GETPOST("account_country_id"); + } elseif (empty($selectedcode)) { + $selectedcode = $mysoc->country_code; + } + $account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules + + print ''.$langs->trans("Country").''; + print ''; + print img_picto('', 'country', 'class="pictofixedwidth"').$form->select_country($selectedcode, 'account_country_id'); + if ($user->admin) { + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + } + print ''; + + // State + print ''.$langs->trans('State').''; + if ($selectedcode) { + print img_picto('', 'state', 'class="pictofixedwidth"'); + print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $account->state_id, $selectedcode, 'account_state_id'); + } else { + print $countrynotdefined; + } + print ''; + // Show fields of bank account foreach ($account->getFieldsToShow() as $val) { if ($val == 'BankCode') { diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 42164ce8b2c..d18f5feae16 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -134,6 +134,9 @@ class UserBankAccount extends Account $sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; + $sql .= ",currency_code = '".$this->db->escape($this->currency_code)."'"; + $sql .= ",state_id = ".($this->state_id > 0 ? ((int) $this->state_id) : "null"); + $sql .= ",fk_country = ".($this->country_id > 0 ? ((int) $this->country_id) : "null"); if (trim($this->label) != '') { $sql .= ",label = '".$this->db->escape($this->label)."'"; @@ -165,17 +168,23 @@ class UserBankAccount extends Account return -1; } - $sql = "SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; - $sql .= " owner_address, label, datec, tms as datem"; - $sql .= " FROM ".$this->db->prefix()."user_rib"; + $sql = "SELECT ur.rowid, ur.fk_user, ur.entity, ur.bank, ur.number, ur.code_banque, ur.code_guichet, ur.cle_rib, ur.bic, ur.iban_prefix as iban, ur.domiciliation, ur.proprio"; + $sql .= ", ur.owner_address, ur.label, ur.datec, ur.tms as datem"; + $sql .= ', ur.currency_code, ur.state_id, ur.fk_country as country_id'; + $sql .= ', c.code as country_code, c.label as country'; + $sql .= ', d.code_departement as state_code, d.nom as state'; + $sql .= " FROM ".$this->db->prefix()."user_rib as ur"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ur.fk_country=c.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ur.state_id=d.rowid'; + if ($id) { - $sql .= " WHERE rowid = ".((int) $id); + $sql .= " WHERE ur.rowid = ".((int) $id); } if ($ref) { - $sql .= " WHERE label = '".$this->db->escape($ref)."'"; + $sql .= " WHERE ur.label = '".$this->db->escape($ref)."'"; } if ($userid) { - $sql .= " WHERE fk_user = ".((int) $userid); + $sql .= " WHERE ur.fk_user = ".((int) $userid); } $resql = $this->db->query($sql); @@ -198,6 +207,15 @@ class UserBankAccount extends Account $this->label = $obj->label; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); + $this->currency_code = $obj->currency_code; + + $this->state_id = $obj->state_id; + $this->state_code = $obj->state_code; + $this->state = $obj->state; + + $this->country_id = $obj->country_id; + $this->country_code = $obj->country_code; + $this->country = $obj->country; } $this->db->free($resql); From 525b662b2411872b7ba1f4a1f7dc693b89958368 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:35:23 +0200 Subject: [PATCH 145/507] Update websiteaccount_card.php --- htdocs/website/websiteaccount_card.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 249398c322e..261839940e5 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -32,9 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; $langs->loadLangs(array("website", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -43,7 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $object = new SocieteAccount($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->website->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -68,9 +68,10 @@ if (empty($action) && empty($id) && empty($ref)) { //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'website', $id); -$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php -$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +// Permissions +$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php +$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. From b81ae9008804abe786c7c0388070fbdafe771c81 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:40:32 +0200 Subject: [PATCH 146/507] Update index.php --- htdocs/website/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0f9595f6206..0b599ba640b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -30,6 +30,7 @@ if (!defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1); //header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -45,8 +46,10 @@ require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +// Load translation files required by the page $langs->loadLangs(array("admin", "other", "website", "errors")); +// Security check if (!$user->rights->website->read) { accessforbidden(); } From 5de5c5c11ad10e64530d0add2db1440d3745dfd4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:51:52 +0200 Subject: [PATCH 147/507] Update agenda.php --- htdocs/ticket/agenda.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 2f919aa436d..17cb8ad785e 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -21,11 +21,12 @@ * \brief Page with events on ticket */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; -require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -40,12 +41,12 @@ $track_id = GETPOST('track_id', 'alpha', 3); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -$page = is_numeric($page) ? $page : 0; -$page = $page == -1 ? 0 : $page; +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = is_numeric($page) ? $page : 0; +$page = $page == -1 ? 0 : $page; if (!$sortfield) { $sortfield = "a.datep,a.id"; } @@ -64,6 +65,7 @@ if (GETPOST('actioncode', 'array')) { } else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } + $search_agenda_label = GETPOST('search_agenda_label'); $object = new Ticket($db); From 930929ebb6dce7bd8c89463cee6bf64d42b1f050 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:57:01 +0200 Subject: [PATCH 148/507] Update agenda.php --- htdocs/societe/agenda.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 89b69bda83c..c0525767527 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -27,12 +27,15 @@ * \brief Page of third party events */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->loadLangs(array("companies", "bills", "propal", "orders")); +// Load translation files required by the page +$langs->loadLangs(array('bills', 'companies', 'orders', 'propal')); + if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -42,6 +45,7 @@ if (GETPOST('actioncode', 'array')) { } else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } + $search_agenda_label = GETPOST('search_agenda_label'); // Security check From ad42d6b796a2e9043cddd4645221e1c696d809f6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:03:39 +0200 Subject: [PATCH 149/507] Update card.php --- htdocs/societe/card.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5d557d30a02..06fdbfba0a5 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -34,6 +34,8 @@ * \brief Third party card page */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -62,7 +64,10 @@ if (! empty($conf->eventorganization->enabled)) { } +// Load translation files required by the page + $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); + if (!empty($conf->adherent->enabled)) { $langs->load("members"); } @@ -81,13 +86,15 @@ if (!empty($conf->accounting->enabled)) { $error = 0; $errors = array(); + +// Get parameters $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); if ($user->socid) { @@ -96,6 +103,7 @@ if ($user->socid) { if (empty($socid) && $action == 'view') { $action = 'create'; } + $id = $socid; $object = new Societe($db); @@ -128,12 +136,13 @@ if (!empty($canvas)) { $objcanvas->getCanvas('thirdparty', 'card', $canvas); } -$permissiontoread = $user->rights->societe->lire; -$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +// Permissions +$permissiontoread = $user->rights->societe->lire; +$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0); -$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php -$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; +$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); From e586f8f3914eba42ecdf9079e18f6dd344709fd8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:06:28 +0200 Subject: [PATCH 150/507] Update consumption.php --- htdocs/societe/consumption.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 03c78a0c07b..53408fd00ff 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -26,12 +26,18 @@ * \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty */ +// Load Dolibarr environment require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.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.'/fourn/class/fournisseur.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); + + $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist'; // Security check @@ -46,11 +52,11 @@ if ($socid > 0) { } // Sort & Order fields -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -$optioncss = GETPOST('optioncss', 'alpha'); +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); if (empty($page) || $page == -1) { $page = 0; @@ -78,12 +84,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $year = ''; $month = ''; } + // Customer or supplier selected in drop box $thirdTypeSelect = GETPOST("third_select_id", 'az09'); $type_element = GETPOST('type_element') ? GETPOST('type_element') : ''; -// Load translation files required by the page -$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('consumptionthirdparty', 'globalcard')); From 6ba8ac8475c0159e57d937f86e36e2c3039f612b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:09:44 +0200 Subject: [PATCH 151/507] Update contact.php --- htdocs/societe/contact.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 4ecfc2a8cf4..1bc64658735 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -31,6 +31,7 @@ * \brief Page of contacts of thirdparties */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -46,7 +47,9 @@ if (!empty($conf->adherent->enabled)) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } +// Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); + if (!empty($conf->categorie->enabled)) { $langs->load("categories"); } @@ -59,18 +62,23 @@ if (!empty($conf->notification->enabled)) { $mesg = ''; $error = 0; $errors = array(); + +// Get parameters $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); -$cancel = GETPOST('cancel', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$confirm = GETPOST('confirm'); -$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); +$confirm = GETPOST('confirm'); +$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); + if ($user->socid) { $socid = $user->socid; } + if (empty($socid) && $action == 'view') { $action = 'create'; } +// Initialize objects $object = new Societe($db); $extrafields = new ExtraFields($db); From ffe1a7f8acd65193a776a8f5612efd3860253e9e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:12:47 +0200 Subject: [PATCH 152/507] Update document.php --- htdocs/societe/document.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 707c573f116..92c7efb63d9 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -26,30 +26,36 @@ * \ingroup societe */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + +// Load translation files required by the page $langs->loadLangs(array("companies", "other")); -$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'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; + +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield = $conf->global->MAIN_DOC_SORT_FIELD; @@ -65,6 +71,7 @@ if (!$sortfield) { $sortfield = "position_name"; } +// Initialize objects $object = new Societe($db); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); From 98b8d8db6b6c87efe11743767d4b58eecbde756a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:15:50 +0200 Subject: [PATCH 153/507] Update index.php --- htdocs/societe/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index a13d8a3de99..7ea3f591cb6 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -27,16 +27,21 @@ * \brief Home page for third parties area */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -$hookmanager = new HookManager($db); + +// Load translation files required by the page +$langs->load("companies"); + // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager = new HookManager($db); $hookmanager->initHooks(array('thirdpartiesindex')); -$langs->load("companies"); + $socid = GETPOST('socid', 'int'); if ($user->socid) { @@ -51,6 +56,7 @@ $thirdparty_static = new Societe($db); if (!isset($form) || !is_object($form)) { $form = new Form($db); } + // Load $resultboxes $resultboxes = FormOther::getBoxesArea($user, "3"); From 997c9e763a1e587b4cfbfe654f78ffcc256408a2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:18:55 +0200 Subject: [PATCH 154/507] Update list.php --- htdocs/societe/list.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index bf3ec6eb041..c8f0045d619 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -34,6 +34,8 @@ * \brief Page to show list of third parties */ + +// Load Dolibarr environment require_once '../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -42,20 +44,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; + +// Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "customers", "suppliers", "bills", "compta", "categories", "cashdesk")); -$action = GETPOST('action', 'aZ09'); + +// Get parameters +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist'; -$optioncss = GETPOST('optioncss', 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); + if ($contextpage == 'poslist') { $optioncss = 'print'; } + $mode = GETPOST("mode", 'alpha'); +// search fields $search_all = trim(GETPOST('search_all', 'alphanohtml') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars @@ -98,6 +107,7 @@ $search_stcomm = GETPOST('search_stcomm', 'int'); $search_import_key = trim(GETPOST("search_import_key", "alpha")); $search_parent_name = trim(GETPOST('search_parent_name', 'alpha')); + $type = GETPOST('type', 'alpha'); $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant From 28797930fc2ffaec6a804e8e60b0bf6f2ea317da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 18:21:35 +0200 Subject: [PATCH 155/507] Clean code --- htdocs/core/lib/functions.lib.php | 18 +++++++++++------- .../class/actions_datapolicy.class.php | 2 +- htdocs/societe/partnership.php | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3174fb132cd..c9b6d4a30c6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10418,8 +10418,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st /** * Function dolGetButtonAction * - * @param string $label label of button without HTML : use in alt attribute for accessibility $html is not empty - * @param string $html optional : content with html + * @param string $label label or tooltip of button. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. + * @param string $text optional : short label on button. Can be escaped HTML content or full simple text. * @param string $actionType default, delete, danger * @param string $url the url for link * @param string $id attribute id of button @@ -10444,7 +10444,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * // phpcs:enable * @return string html button */ -function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array()) +function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array()) { global $hookmanager, $action, $object, $langs; @@ -10464,8 +10464,8 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = 'title' => $label ); - if (empty($html)) { - $html = $label; + if (empty($text)) { + $text = $label; $attr['title'] = ''; // if html not set, leave label on title is redundant } else { $attr['aria-label'] = $label; @@ -10544,7 +10544,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = 'attr' => $attr, 'tag' => $tag, 'label' => $label, - 'html' => $html, + 'html' => $text, 'actionType' => $actionType, 'url' => $url, 'id' => $id, @@ -10556,7 +10556,11 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { - return '<' . $tag . ' ' . $compiledAttributes . '>' . $html . ''; + if (dol_textishtml($text)) { // If content already HTML encoded + return '<' . $tag . ' ' . $compiledAttributes . '>' . $text . ''; + } else { + return '<' . $tag . ' ' . $compiledAttributes . '>' . dol_escape_htmltag($text) . ''; + } } else { return $hookmanager->resPrint; } diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 6b7e27c67aa..ffd43bbf8ac 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -94,7 +94,7 @@ class ActionsDatapolicy $langs->load('datapolicy@datapolicy'); $error = 0; // Error counter - if (GETPOST('socid') && $parameters['currentcontext'] == 'thirdpartycard') { + if (GETPOST('socid') && $parameters['currentcontext'] == 'thirdpartycard' && !empty($object)) { $object->fetch(GETPOST('socid')); } diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index d9b3d3127f9..4e0552d3c15 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -121,7 +121,7 @@ $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid * Actions */ -$parameters = array(); +$parameters = array('socid' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 1b90446cc5d4c3d1150a754b3c75d37fc04da204 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:22:10 +0200 Subject: [PATCH 156/507] Update note.php --- htdocs/societe/note.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index b932fb11595..dabc5d7e39e 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -26,20 +26,28 @@ * \ingroup societe */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -$action = GETPOST('action', 'aZ09'); +// Load translation files required by the page $langs->load("companies"); -$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); +// Get parameters +$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + + +// Initialize objects $object = new Societe($db); if ($id > 0) { $object->fetch($id); } +// Permissions $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -50,6 +58,7 @@ if ($user->socid > 0) { unset($action); $socid = $user->socid; } + $result = restrictedArea($user, 'societe', $object->id, '&societe'); From 9cba037ea3adb90adc9a5db33fa45788598a863f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:24:16 +0200 Subject: [PATCH 157/507] Update paymentmodes.php --- htdocs/societe/paymentmodes.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 2c2c125530b..5b9bd1046ef 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -29,6 +29,8 @@ * \brief Tab of payment modes for the customer */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; @@ -40,8 +42,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; + +// Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "banks", "bills", 'paypal', 'stripe', 'withdrawals')); + // Security check $socid = GETPOST("socid", "int"); if ($user->socid) { @@ -49,12 +54,15 @@ if ($user->socid) { } $result = restrictedArea($user, 'societe', '', ''); + +// Get parameters $id = GETPOST("id", "int"); $source = GETPOST("source", "alpha"); // source can be a source or a paymentmode $ribid = GETPOST("ribid", "int"); $action = GETPOST("action", 'alpha', 3); $cancel = GETPOST('cancel', 'alpha'); +// Initialize objects $object = new Societe($db); $object->fetch($socid); @@ -70,6 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartybancard', 'globalcard')); +// Permissions $permissiontoread = $user->rights->societe->lire; $permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php From a3918e8d96318ad123336a983bb30dfc549b13ee Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:26:32 +0200 Subject: [PATCH 158/507] Update price.php --- htdocs/societe/price.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 314fb663631..a9f17f4b50a 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -26,6 +26,8 @@ * \brief Page to show product prices by customer */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -38,13 +40,17 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($db); } + +// Load translation files required by the page $langs->loadLangs(array("products", "companies", "bills")); -$action = GETPOST('action', 'aZ09'); -$search_prod = GETPOST('search_prod', 'alpha'); -$cancel = GETPOST('cancel', 'alpha'); -$search_label = GETPOST('search_label', 'alpha'); -$search_price = GETPOST('search_price'); + +// Get parameters +$action = GETPOST('action', 'aZ09'); +$search_prod = GETPOST('search_prod', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$search_label = GETPOST('search_label', 'alpha'); +$search_price = GETPOST('search_price'); $search_price_ttc = GETPOST('search_price_ttc'); // Security check @@ -54,6 +60,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'societe', $socid, '&societe'); +// Initialize objects $object = new Societe($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From c8aefcb7c509758fa94ab8b7659e58f19097845a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:28:08 +0200 Subject: [PATCH 159/507] Update project.php --- htdocs/societe/project.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index ef68a03ab78..f704273db60 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -28,11 +28,14 @@ * \brief Page of third party projects */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->loadLangs(array("companies", "projects")); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'projects')); // Security check $socid = GETPOST('socid', 'int'); From 7dd0535a5c5c7416df528a1903ca4f059436b7d0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:30:50 +0200 Subject: [PATCH 160/507] Update societecontact.php --- htdocs/societe/societecontact.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index b1e5174820c..a061933ba11 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -26,14 +26,18 @@ * \brief Onglet de gestion des contacts additionnel d'une société */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$langs->loadLangs(array("orders", "companies")); +// Load translation files required by the page +$langs->loadLangs(array('companies', 'orders')); +// Get parameters $id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -62,6 +66,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'societe', $id, ''); + +// Initialize objects $object = new Societe($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context From 43601b09f325bf5d076423b4a1ee16c426b451c6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:33:03 +0200 Subject: [PATCH 161/507] Update website.php --- htdocs/societe/website.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 2d346282c4c..424d18c2058 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -28,6 +28,8 @@ * \brief Page of web sites accounts */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; @@ -35,13 +37,17 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// Load translation files required by the page $langs->loadLangs(array("companies", "website")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$show_files = GETPOST('show_files', 'int'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +// Get parameters +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$show_files = GETPOST('show_files', 'int'); +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Security check $id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); From 7657bc35d7a21e262321d00944689f5130c827f8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:43:06 +0200 Subject: [PATCH 162/507] Update list.php --- htdocs/product/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index ebcfed98c80..38c3c0c80ea 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -33,6 +33,8 @@ * \brief Page to list products and services */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; @@ -51,12 +53,15 @@ if (!empty($conf->productbatch->enabled)) { $langs->load("productbatch"); } + +// Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +// Search Criterias $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_id = GETPOST("search_id", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); From 5b8f7cf00c8e2d2b2bbe15ac939691680d2ca5c6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:45:11 +0200 Subject: [PATCH 163/507] Update card.php --- htdocs/product/card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 761fe2a148f..5f0159ce567 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -41,6 +41,8 @@ * \brief Page to show product */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; @@ -88,6 +90,7 @@ $mesg = ''; $error = 0; $errors = array(); $refalreadyexists = 0; +// Get parameters $id = GETPOST('id', 'int'); $ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'alpha') : null); $type = (GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT); @@ -107,6 +110,7 @@ $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); $checkmandatory = GETPOST('accountancy_code_buy_export', 'alpha'); + // by default 'alphanohtml' (better security); hidden conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML allows basic html $label_security_check = empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML) ? 'alphanohtml' : 'restricthtml'; From eb83c818acce16e747dfb513a38306fcc24745f1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:47:35 +0200 Subject: [PATCH 164/507] Update index.php --- htdocs/product/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index f2b29926b21..e976e176224 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -28,6 +28,8 @@ * \brief Homepage products and services */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -47,6 +49,7 @@ $langs->loadLangs(array('products', 'stocks')); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('productindex')); +// Initialize objects $product_static = new Product($db); // Security check From c9826f975cf241eff7de98aa06e0b05da0f4e19c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:49:48 +0200 Subject: [PATCH 165/507] Update document.php --- htdocs/product/document.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index d83a684a308..2aaa2356879 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -28,6 +28,8 @@ * \brief Page des documents joints sur les produits */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -38,9 +40,12 @@ if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php'; } + // Load translation files required by the page $langs->loadLangs(array('other', 'products')); + +// Get parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -74,7 +79,7 @@ if (!$sortfield) { $sortfield = "position_name"; } - +// Initialize objects $object = new Product($db); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); @@ -93,6 +98,7 @@ if ($id > 0 || !empty($ref)) { } } } + $modulepart = 'produit'; From a8d480ee2d063524c035e43ccf51cfc709621ebd Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:55:02 +0200 Subject: [PATCH 166/507] Update index.php --- htdocs/compta/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 55ee99f4cb6..fefdff4aece 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -31,6 +31,8 @@ * \brief Main page of accountancy area */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -54,6 +56,7 @@ if (!empty($conf->commande->enabled)) { $langs->load("orders"); } +// Get parameters $action = GETPOST('action', 'aZ09'); $bid = GETPOST('bid', 'int'); From 2b59e9261b219036cc96f3237780f7bb6d5d49fa Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:58:51 +0200 Subject: [PATCH 167/507] Update index.php --- htdocs/commande/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 03644fe5690..57f61f3d9f7 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -25,6 +25,8 @@ * \brief Home page of customer order module */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; @@ -32,6 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array('orders', 'bills')); + + if (!$user->rights->commande->lire) { accessforbidden(); } @@ -41,8 +48,6 @@ $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('ordersindex')); -// Load translation files required by the page -$langs->loadLangs(array('orders', 'bills')); // Security check $socid = GETPOST('socid', 'int'); From 2f9bb23a120c980d1b1bf7da866b868c62d24b9d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:00:39 +0200 Subject: [PATCH 168/507] Update index.php --- htdocs/accountancy/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 911197994c1..2745ab4784a 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -23,6 +23,8 @@ * \brief Home accounting module */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; From 7e57ba7658d6282675692dccb4c7bf5cb35612d6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:02:52 +0200 Subject: [PATCH 169/507] Update index.php --- htdocs/adherents/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1ef98dddb6d..388d51be376 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -27,19 +27,24 @@ * \brief Home page of membership module */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("companies", "members")); + + $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('membersindex')); -// Load translation files required by the page -$langs->loadLangs(array("companies", "members")); // Security check $result = restrictedArea($user, 'adherent'); From 88dbf3aaff9ae0d28fc4855d7e1eb2f003185b9c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:05:31 +0200 Subject: [PATCH 170/507] Update card.php --- htdocs/adherents/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 63527452fe1..6816023f8de 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -29,6 +29,8 @@ * \brief Page of a member */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -44,9 +46,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + // Load translation files required by the page $langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal")); + +// Get parameters $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); From bcce09d7071cfa15cb48f7852f9c655a33cdde9a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:07:55 +0200 Subject: [PATCH 171/507] Update list.php --- htdocs/adherents/list.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index f9208daf70d..2c2efdd00a6 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -27,14 +27,20 @@ * \brief Page to list all members of foundation */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// Load translation files required by the page $langs->loadLangs(array("members", "companies")); + +// Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -42,6 +48,8 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search + +// Search fields $search = GETPOST("search", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); From 9dc61d32433dc5a5dbff22d50abe6a8cebc9cf7a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:10:12 +0200 Subject: [PATCH 172/507] Update note.php --- htdocs/adherents/note.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 2d98dfe5fbc..0d05bb85523 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -23,25 +23,34 @@ * \brief Tab for note of a member */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + // Load translation files required by the page $langs->loadLangs(array("companies", "members", "bills")); + +// Get parameters $action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alphanohtml'); + +// Initialize objects $object = new Adherent($db); + $result = $object->fetch($id); if ($result > 0) { $adht = new AdherentType($db); $result = $adht->fetch($object->typeid); } + $permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php // Fetch object From c4b8bac43fa2f5b2d42723533be80cc4bcfa8319 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 19:40:47 +0200 Subject: [PATCH 173/507] FIX email not visible into combo list --- htdocs/core/class/html.formmail.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 61f62f28a54..f12acbe1901 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1072,6 +1072,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach ($tmparray as $key => $val) { + $tmparray[$key] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]); $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } @@ -1080,6 +1081,7 @@ class FormMail extends Form if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { $withtoselected = array_keys($tmparray); } + $out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, ""); } } @@ -1107,6 +1109,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach ($tmparray as $key => $val) { + $tmparray[$key] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]); $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } $withtoccselected = GETPOST("receivercc", 'array'); // Array of selected value @@ -1510,7 +1513,7 @@ class FormMail extends Form /** - * Set substit array from object. This is call when suggesting the email template into forms before sending email. + * Set ->substit (and ->substit_line) array from object. This is call when suggesting the email template into forms before sending email. * * @param CommonObject $object Object to use * @param Translate $outputlangs Object lang From 35dbee5bbfaff7c7d5896da70d476eeea1c98818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 19:56:57 +0200 Subject: [PATCH 174/507] NEW On a form to send an email, we show all emails of contacts of object --- htdocs/core/tpl/card_presend.tpl.php | 44 ++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 5fbb227bc69..596feae69d1 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -156,7 +156,7 @@ if ($action == 'presend') { $formmail->inreplyto = empty($inreplyto) ? '' : $inreplyto; $formmail->withfrom = 1; - // Fill list of recipient with email inside <>. + // Define $liste, a list of recipients with email inside <>. $liste = array(); if ($object->element == 'expensereport') { $fuser = new User($db); @@ -202,16 +202,6 @@ if ($action == 'presend') { } } - $formmail->withto = $liste; - $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); - $formmail->withtocc = $liste; - $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); - $formmail->withtopic = $topicmail; - $formmail->withfile = 2; - $formmail->withbody = 1; - $formmail->withdeliveryreceipt = 1; - $formmail->withcancel = 1; - //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); if (!isset($arrayoffamiliestoexclude)) { $arrayoffamiliestoexclude = null; @@ -219,6 +209,7 @@ if ($action == 'presend') { // Make substitution in email content if ($object) { + // First we set ->substit (useless, it will be erased later) and ->substit_lines $formmail->setSubstitFromObject($object, $langs); } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); @@ -237,7 +228,7 @@ if ($action == 'presend') { ); complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters); - // Find the good contact address + // Find all external contact addresses $tmpobject = $object; if (($object->element == 'shipping' || $object->element == 'reception')) { $origin = $object->origin; @@ -289,17 +280,46 @@ if ($action == 'presend') { if (is_array($contactarr) && count($contactarr) > 0) { require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $contactstatic = new Contact($db); + $tmpcompany = new Societe($db); foreach ($contactarr as $contact) { $contactstatic->fetch($contact['id']); + // Complete substitution array $substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($outputlangs, 1); $substitutionarray['__CONTACT_LASTNAME_'.$contact['code'].'__'] = $contactstatic->lastname; $substitutionarray['__CONTACT_FIRSTNAME_'.$contact['code'].'__'] = $contactstatic->firstname; $substitutionarray['__CONTACT_TITLE_'.$contact['code'].'__'] = $contactstatic->getCivilityLabel(); + + // Complete $liste with the $contact + if (empty($liste[$contact['id']])) { // If this contact id not already into the $liste + $contacttoshow = ''; + if (isset($object->thirdparty) && is_object($object->thirdparty)) { + if ($contactstatic->fk_soc != $object->thirdparty->id) { + $tmpcompany->fetch($contactstatic->fk_soc); + if ($tmpcompany->id > 0) { + $contacttoshow .= $tmpcompany->name.': '; + } + } + } + $contacttoshow .= $contactstatic->getFullName($outputlangs, 1); + $contacttoshow .= " <".($contactstatic->email ? $contactstatic->email : $langs->transnoentitiesnoconv("NoEMail")) .">"; + $liste[$contact['id']] = $contacttoshow; + } } } + $formmail->withto = $liste; + $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); + $formmail->withtocc = $liste; + $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); + $formmail->withtopic = $topicmail; + $formmail->withfile = 2; + $formmail->withbody = 1; + $formmail->withdeliveryreceipt = 1; + $formmail->withcancel = 1; + // Array of substitutions $formmail->substit = $substitutionarray; From ab184bbfda838d09d1edd0b9e927074ff5b3c5bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Aug 2022 01:00:43 +0200 Subject: [PATCH 175/507] Update main.inc.php --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a45130010a3..56a85f5d03d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1600,7 +1600,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&'.(!empty($user->id) ? ('userid='.$user->id.'&') : '').';entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id) : '').'&entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { From 87df13507c7f9a709a83ed7e42c7d6298d6bb9cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Aug 2022 01:21:49 +0200 Subject: [PATCH 176/507] Update categories.php --- htdocs/accountancy/admin/categories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 68d4c03e0a6..e65572eafd3 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -125,7 +125,7 @@ if (!empty($cat_id)) { $arraykeyvalue = array(); foreach ($accountingcategory->lines_cptbk as $key => $val) { $doc_ref = !empty($val->doc_ref) ? $val->doc_ref : ''; - $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . $doc_ref; + $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : ''); } if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { From d70c70a5fe8bb71d2996fa2319a4745a7fdc3b80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 19:40:47 +0200 Subject: [PATCH 177/507] FIX email not visible into combo list --- htdocs/core/class/html.formmail.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index df7408200a9..281cfaca58d 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1066,6 +1066,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach ($tmparray as $key => $val) { + $tmparray[$key] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]); $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } @@ -1074,6 +1075,7 @@ class FormMail extends Form if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { $withtoselected = array_keys($tmparray); } + $out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, ""); } } @@ -1101,6 +1103,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach ($tmparray as $key => $val) { + $tmparray[$key] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]); $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } $withtoccselected = GETPOST("receivercc", 'array'); // Array of selected value @@ -1504,7 +1507,7 @@ class FormMail extends Form /** - * Set substit array from object. This is call when suggesting the email template into forms before sending email. + * Set ->substit (and ->substit_line) array from object. This is call when suggesting the email template into forms before sending email. * * @param CommonObject $object Object to use * @param Translate $outputlangs Object lang From 147207b4e17bfca0b3dcdb1badfd0dd1a619f544 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 19:56:57 +0200 Subject: [PATCH 178/507] NEW On a form to send an email, we show all emails of contacts of object --- ChangeLog | 3 +- htdocs/core/tpl/card_presend.tpl.php | 44 ++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41f765c8197..891e445ab39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ English Dolibarr ChangeLog For users: --------------- -NEW: PHP 8.1 compatibility. +NEW: PHP 8.1 compatibility: Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending on the PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. @@ -121,6 +121,7 @@ NEW: Ticket triggers: allow to automatically send messages on new tickets NEW: Accountancy - Add hidden feature for accounting reconciliation NEW: Can store the session into database (instead of beeing managed by PHP) NEW: Added MMK currency (Myanmar Kyat) +NEW: On a form to send an email, we show all emails of contacts of object Modules NEW: Module Partnership Management diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index ca524278398..2f6acb67ece 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -147,7 +147,7 @@ if ($action == 'presend') { $formmail->trackid = $trackid; $formmail->withfrom = 1; - // Fill list of recipient with email inside <>. + // Define $liste, a list of recipients with email inside <>. $liste = array(); if ($object->element == 'expensereport') { $fuser = new User($db); @@ -193,16 +193,6 @@ if ($action == 'presend') { } } - $formmail->withto = $liste; - $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); - $formmail->withtocc = $liste; - $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); - $formmail->withtopic = $topicmail; - $formmail->withfile = 2; - $formmail->withbody = 1; - $formmail->withdeliveryreceipt = 1; - $formmail->withcancel = 1; - //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); if (!isset($arrayoffamiliestoexclude)) { $arrayoffamiliestoexclude = null; @@ -210,6 +200,7 @@ if ($action == 'presend') { // Make substitution in email content if ($object) { + // First we set ->substit (useless, it will be erased later) and ->substit_lines $formmail->setSubstitFromObject($object, $langs); } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); @@ -228,7 +219,7 @@ if ($action == 'presend') { ); complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters); - // Find the good contact address + // Find all external contact addresses $tmpobject = $object; if (($object->element == 'shipping' || $object->element == 'reception')) { $origin = $object->origin; @@ -280,17 +271,46 @@ if ($action == 'presend') { if (is_array($contactarr) && count($contactarr) > 0) { require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $contactstatic = new Contact($db); + $tmpcompany = new Societe($db); foreach ($contactarr as $contact) { $contactstatic->fetch($contact['id']); + // Complete substitution array $substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($outputlangs, 1); $substitutionarray['__CONTACT_LASTNAME_'.$contact['code'].'__'] = $contactstatic->lastname; $substitutionarray['__CONTACT_FIRSTNAME_'.$contact['code'].'__'] = $contactstatic->firstname; $substitutionarray['__CONTACT_TITLE_'.$contact['code'].'__'] = $contactstatic->getCivilityLabel(); + + // Complete $liste with the $contact + if (empty($liste[$contact['id']])) { // If this contact id not already into the $liste + $contacttoshow = ''; + if (isset($object->thirdparty) && is_object($object->thirdparty)) { + if ($contactstatic->fk_soc != $object->thirdparty->id) { + $tmpcompany->fetch($contactstatic->fk_soc); + if ($tmpcompany->id > 0) { + $contacttoshow .= $tmpcompany->name.': '; + } + } + } + $contacttoshow .= $contactstatic->getFullName($outputlangs, 1); + $contacttoshow .= " <".($contactstatic->email ? $contactstatic->email : $langs->transnoentitiesnoconv("NoEMail")) .">"; + $liste[$contact['id']] = $contacttoshow; + } } } + $formmail->withto = $liste; + $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); + $formmail->withtocc = $liste; + $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); + $formmail->withtopic = $topicmail; + $formmail->withfile = 2; + $formmail->withbody = 1; + $formmail->withdeliveryreceipt = 1; + $formmail->withcancel = 1; + // Array of substitutions $formmail->substit = $substitutionarray; From 825fee4f79998d7dfd6bf4795b7acb5d29684ae1 Mon Sep 17 00:00:00 2001 From: bagtaib Date: Tue, 30 Aug 2022 00:36:29 +0100 Subject: [PATCH 179/507] update company fields if already exists --- htdocs/langs/en_US/companies.lang | 2 + htdocs/langs/en_US/partnership.lang | 1 + htdocs/public/partnership/new.php | 68 ++++++++++------------------- 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 996c98c203a..2ef90f89600 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -498,3 +498,5 @@ RestOfEurope=Rest of Europe (EEC) OutOfEurope=Out of Europe (EEC) CurrentOutstandingBillLate=Current outstanding bill late BecarefullChangeThirdpartyBeforeAddProductToInvoice=Be carefull, depending on your product price settings, you should change thirdparty before adding product to POS. +EmailAlreadyExistsPleaseRewriteYourCompanyName=email already exists please rewrite your company name +TwoRecordsOfCompanyName=more than one record exists for this company please contact us to complete your partnership request" \ No newline at end of file diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 5c85e4d7830..6490bf23d8b 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -28,6 +28,7 @@ PartnershipCheckBacklink=Partnership: Check referring backlink # Menu # NewPartnership=New Partnership +NewPartnershipbyWeb= Your partnership was added successfully. ListOfPartnerships=List of partnership # diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 4d30f42b0db..a50892c9e08 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -231,7 +231,7 @@ if (empty($reshook) && $action == 'add') { $result1 = $company->fetch(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETPOST('email')); if ($result1 > 0) { $error++; - $errmsg = $langs->trans("already exists please rewrite your company name"); + $errmsg = $langs->trans("EmailAlreadyExistsPleaseRewriteYourCompanyName"); } else { //create thirdparty $company = new Societe($db); @@ -255,53 +255,33 @@ if (empty($reshook) && $action == 'add') { } } elseif ($result == -2) { $error++; - $errmsg = $langs->trans('more than one entry exist for this company please contact us to complete your partnership request'); + $errmsg = $langs->trans("TwoRecordsOfCompanyName"); } else { $partnership->fk_soc = $company->id; - } - - /* - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE nom='".$db->escape(GETPOST('societe'))."'"; - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - } - if ($num = 0) { // si il ya pas d'entree sur le nom on teste l'email - $sql1 = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE email='".$db->escape(GETPOST('email'))."'"; - $result1 = $db->query($sql1); - if ($result1) { - $num1 = $db->num_rows($result1); + // update thirdparty fields + if (empty($company->address)) { + $company->address = GETPOST('address'); } - if ($num1 != 0) { - $error++; - $errmsg = "email already exists please rewrite your company name"; - } else { - //create thirdparty - $company = new Societe($db); - - $company->address = GETPOST('address'); - $company->zip = GETPOST('zipcode'); - $company->town = GETPOST('town'); - $company->email = GETPOST('email'); - $company->country_id = GETPOST('country_id', 'int'); - $company->state_id = GETPOST('state_id', 'int'); - $company->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); - - $resultat=$company->create($user); - if ($resultat < 0) { - $error++; - $errmsg .= join('
', $company->errors); - } - - $partnership->fk_soc = $company->id; + if (empty($company->zip)) { + $company->zip = GETPOST('zipcode'); } - } elseif ($num > 1) { - $error++; - $errmsg = 'more than one entry exist for this company please contact us to complete your partnership request'; - } else { - $company = $db->fetch_object($result); - $partnership->fk_soc = $company->rowid; - }*/ + if (empty($company->town)) { + $company->town = GETPOST('town'); + } + if (empty($company->country_id)) { + $company->country_id = GETPOST('country_id', 'int'); + } + if (empty($company->email)) { + $company->email = GETPOST('email'); + } + if (empty($company->state_id)) { + $company->state_id = GETPOST('state_id', 'int'); + } + if (empty($company->name_alias)) { + $company->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); + } + $company->update(0); + } // Fill array 'array_options' with data from add form $extrafields->fetch_name_optionals_label($partnership->table_element); From 627b894b71c2bc430f5e92736f4a60f02454d10a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 08:05:18 +0200 Subject: [PATCH 180/507] Update thirdparties.modules.php --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 6f694cc0b74..008888832cd 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = s.email) = 0"; + $sql .= " AND EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } From 7dcf8969b9608a789f6ea4b02365e641e7b0dc14 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 08:18:20 +0200 Subject: [PATCH 181/507] Revert "Update thirdparties.modules.php" This reverts commit 627b894b71c2bc430f5e92736f4a60f02454d10a. --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 008888832cd..6f694cc0b74 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; + $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = s.email) = 0"; // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } From b476efe55cf4578cc174e4cecaf1bbdd45928048 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 08:30:13 +0200 Subject: [PATCH 182/507] Revert "Revert "Update thirdparties.modules.php"" This reverts commit 7dcf8969b9608a789f6ea4b02365e641e7b0dc14. --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 6f694cc0b74..008888832cd 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = s.email) = 0"; + $sql .= " AND EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } From a486e2f91f4f11079b320e3634ef6f1d9bfd4490 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 08:32:12 +0200 Subject: [PATCH 183/507] Update thirdparties.modules.php --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 008888832cd..1d7acf02c09 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; + $sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } From dabb52d26f85ef2c9e0804b8896b312da879af6c Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Tue, 30 Aug 2022 09:10:03 +0200 Subject: [PATCH 184/507] require missing signture.lib.php --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3a1f8f12dd..b63bb68c4a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7631,6 +7631,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl; if (is_object($object) && $object->element == 'propal') { + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref); } if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'propal') { From 630c81772836c8771fa8b82780860e35436b894a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:47:56 +0200 Subject: [PATCH 185/507] Update agenda.php --- htdocs/contact/agenda.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 5f07922b2e4..29706f48b49 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -29,6 +29,8 @@ * \brief Card of a contact */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -49,12 +51,14 @@ $langs->loadLangs(array('companies', 'users', 'other', 'commercial')); $mesg = ''; $error = 0; $errors = array(); +// Get parameters $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); +// Initialize objects $object = new Contact($db); $extrafields = new ExtraFields($db); From 39ce121dd2a6b7e2f240e18cb7d94fd0fd328960 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:50:12 +0200 Subject: [PATCH 186/507] Update card.php --- htdocs/contact/card.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d486432f142..d7eb7f53d82 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -32,6 +32,8 @@ * \brief Card of a contact */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -52,14 +54,15 @@ $langs->loadLangs(array('companies', 'users', 'other', 'commercial')); $mesg = ''; $error = 0; $errors = array(); +// Get parameters $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); - $id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); +// Initialize technical object $object = new Contact($db); $extrafields = new ExtraFields($db); From 38dc398bda54bbc713a69c51d1087c333c06144a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:51:26 +0200 Subject: [PATCH 187/507] Update consumption.php --- htdocs/contact/consumption.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index c3cd54d890e..fff1ba17644 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -22,9 +22,11 @@ /** * \file htdocs/contact/consumption.php * \ingroup societe - * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + * \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty */ + +// Load Dolibarr environment require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; From 0af3a3cf8ebe41f680b6652e651e21317e763f43 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:52:29 +0200 Subject: [PATCH 188/507] Update document.php --- htdocs/contact/document.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 3fac8adea15..f62e82ee5a1 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -23,6 +23,8 @@ * \brief Page with attached files on contact */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -33,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page $langs->loadLangs(array('other', 'companies', 'contact')); +// Get parameters $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); From ae3a70a88686ee8fcdb2e32cdd20f604c8dcae0c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:54:09 +0200 Subject: [PATCH 189/507] Update info.php --- htdocs/contact/info.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index 4cea1cae85b..64688635179 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -23,6 +23,8 @@ * \brief Onglet info d'un contact */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; From 4cb4f5d411ed798c81cb2bd9b9b4b28ccc3635ce Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:56:31 +0200 Subject: [PATCH 190/507] Update list.php --- htdocs/contact/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f5810db2b13..d5c0d333d03 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -33,6 +33,8 @@ * \brief Page to list all contacts */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -44,6 +46,7 @@ $langs->loadLangs(array("companies", "suppliers", "categories")); $socialnetworks = getArrayOfSocialNetworks(); +// Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); From f4ad2d9aa5f7abb8eaebe0512824b352053877bd Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 30 Aug 2022 11:12:07 +0200 Subject: [PATCH 191/507] Fix : SQL error on 16-17 migration --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 1b0d8a33231..5db36ee955b 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 @@ -71,8 +71,8 @@ ALTER TABLE llx_adherent_type ADD COLUMN caneditamount integer DEFAULT 0 AFTER a ALTER TABLE llx_holiday CHANGE COLUMN date_approve date_approval datetime; -UPDATE llx_holiday SET date_approval = date_valid WHEN statut = 3 AND date_approval IS NULL; -UPDATE llx_holiday SET fk_user_approve = fk_user_valid WHEN statut = 3 AND fk_user_approve IS NULL; +UPDATE llx_holiday SET date_approval = date_valid WHERE statut = 3 AND date_approval IS NULL; +UPDATE llx_holiday SET fk_user_approve = fk_user_valid WHERE statut = 3 AND fk_user_approve IS NULL; ALTER TABLE llx_inventory ADD COLUMN categories_product VARCHAR(255) DEFAULT NULL AFTER fk_product; From 6e31609b14ec77cb98757bb3831c469bc3d5276c Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 30 Aug 2022 11:31:20 +0200 Subject: [PATCH 192/507] Fix #21810 : Broken statistics in project module --- htdocs/projet/class/projectstats.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 9b2314deacc..f1295c10424 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -528,4 +528,22 @@ class ProjectStats extends Stats // var_dump($res);print '
'; return $res; } + + /** + * Return average of entity by month + * @param int $year year number + * @return int value + */ + protected function getAverageByMonth($year) + { + $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; + $sql .= " FROM ".$this->from; + $sql .= $this->join; + $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + return $this->_getAverageByMonth($year, $sql); + } } From 2a8474003d23943da9cabc59816e5e7d0c3178dc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:34:28 +0200 Subject: [PATCH 193/507] update code --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 05f692be526..e2b8ace4783 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -526,7 +526,7 @@ $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENAB $tabcond[41] = !empty($conf->intracommreport->enabled); $tabcond[42] = isModEnabled("product"); $tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; -$tabcond[44] = !empty($conf->asset->enabled); +$tabcond[44] = isModEnabled('asset'); // List of help for fields (no more used, help is defined into tabcomplete) $tabhelp = array(); From c0e27f252c40229ec55321bb574a0cbf7bf6733e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:35:37 +0200 Subject: [PATCH 194/507] update code --- htdocs/asset/accountancy_codes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index 431b4ba7c68..824f1a75bbb 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); $result = $assetaccountancycodes->fetchAccountancyCodes($object->id); if ($result < 0) { From 8d08f302615afcc0e85849d30dc6e6843cca35da Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:36:05 +0200 Subject: [PATCH 195/507] update code --- htdocs/asset/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 3d40cf62328..437e51cf0b1 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -86,7 +86,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); /* From 7563ba8d6edc534c52f26ac8353fc5f485f3097c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:36:43 +0200 Subject: [PATCH 196/507] update code --- htdocs/asset/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index d94ba613d91..c2d768b5405 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); From f201e5994e289f3cb2e284bf425a0914d35ecc65 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:37:09 +0200 Subject: [PATCH 197/507] update code --- htdocs/asset/depreciation_options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php index ba5719705dc..23c66d8961b 100644 --- a/htdocs/asset/depreciation_options.php +++ b/htdocs/asset/depreciation_options.php @@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!empty($object->not_depreciated)) accessforbidden(); $object->asset_depreciation_options = &$assetdepreciationoptions; From e6e6a7000b1713cebccb4009c3f848d6ec269353 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:37:39 +0200 Subject: [PATCH 198/507] update code --- htdocs/asset/depreciation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php index 8f3547d81fb..679d750c668 100644 --- a/htdocs/asset/depreciation.php +++ b/htdocs/asset/depreciation.php @@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) { if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!empty($object->not_depreciated)) accessforbidden(); $object->asset_depreciation_options = &$assetdepreciationoptions; From 9414d5cfd5ba1b5ade4ee1f9664e1ce80fa767fb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:38:21 +0200 Subject: [PATCH 199/507] update code --- htdocs/asset/disposal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php index 7fddb92b05f..e06e86c78ac 100644 --- a/htdocs/asset/disposal.php +++ b/htdocs/asset/disposal.php @@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!isset($object->disposal_date) || $object->disposal_date === "") accessforbidden(); From 5811fc0cc52a4c04957b450b3cbe8e5574be198a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:38:48 +0200 Subject: [PATCH 200/507] update code --- htdocs/asset/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 96b222b26c1..9f4439f94d6 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -78,7 +78,7 @@ $permissiontoadd = $user->rights->asset->asset->write; // Used by the include of if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); /* From 34a2ffe33423044575aefa7239b7f02e6d16c232 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:39:24 +0200 Subject: [PATCH 201/507] update code --- htdocs/asset/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index c475e22fc83..45f90101adc 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -125,7 +125,7 @@ $permissiontoadd = $user->rights->asset->write; $permissiontodelete = $user->rights->asset->delete; // Security check -if (empty($conf->asset->enabled)) { +if (!isModEnabled('asset')) { accessforbidden('Module not enabled'); } @@ -134,7 +134,7 @@ if ($user->socid > 0) accessforbidden(); $socid = 0; if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); From 94a31d6d634262764e0d1371be2550acd70fcc0e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:39:52 +0200 Subject: [PATCH 202/507] update code --- htdocs/asset/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index 8de86d49bb7..810ab7f4462 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); /* From 67929038a9c6a2a6b3fe0e948e7a48773c58034a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:40:26 +0200 Subject: [PATCH 203/507] update code --- htdocs/asset/model/accountancy_codes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php index 7582b61177e..6eb6d70abaf 100644 --- a/htdocs/asset/model/accountancy_codes.php +++ b/htdocs/asset/model/accountancy_codes.php @@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); $result = $assetaccountancycodes->fetchAccountancyCodes(0, $object->id); From 6fd3a0d4cd5e2c0260cf63bc5db69fd553c7bfee Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:40:53 +0200 Subject: [PATCH 204/507] update code --- htdocs/asset/model/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index f1db3030dc2..51a7fb515bf 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -88,7 +88,7 @@ if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); From 52fad955c4faf5159a914ece8868514d2fc69474 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:41:23 +0200 Subject: [PATCH 205/507] update code --- htdocs/asset/model/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index 3d3ec2f67d2..756ac32e31f 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); From e4ff238afa983e952fa0c117083a279a5b90be58 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:41:54 +0200 Subject: [PATCH 206/507] update code --- htdocs/asset/model/depreciation_options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php index c34bd38dc46..f3f585f5397 100644 --- a/htdocs/asset/model/depreciation_options.php +++ b/htdocs/asset/model/depreciation_options.php @@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig if ($user->socid > 0) accessforbidden(); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); $object->asset_depreciation_options = &$assetdepreciationoptions; From b082443ad042c4be0cbfa654c48e66cc0ccd79f1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:42:36 +0200 Subject: [PATCH 207/507] update code --- htdocs/asset/model/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index a55d5f49f9a..1d85a982e5d 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -126,7 +126,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig $permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete))); // Security check -if (empty($conf->asset->enabled)) { +if (!isModEnabled('asset')) { accessforbidden('Module not enabled'); } @@ -140,7 +140,7 @@ if ($user->socid > 0) { } $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->asset->enabled)) accessforbidden(); +if (!isModEnabled('asset')) accessforbidden(); if (!$permissiontoread) accessforbidden(); /* From 6812d5d890816afd8ab117502f3594bd808c89ac Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:43:58 +0200 Subject: [PATCH 208/507] update code --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index cb38d7a3546..54e64ccc769 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -71,7 +71,7 @@ if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf- if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) { $colspan++; // With this, there is a column move button } -if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') { +if (isModEnabled('asset') && $object->element == 'invoice_supplier') { $colspan++; } From 16788846b93bdadd4b1c81e1d4bfaa9549561e4e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:44:26 +0200 Subject: [PATCH 209/507] update code --- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 761be27b512..b2974ffbbfc 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -73,7 +73,7 @@ if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', ' if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan += 2; } -if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') { +if (isModEnabled('asset') && $object->element == 'invoice_supplier') { $colspan++; } From 151ed11388e376a8b7d6535aef9308eebab8beed Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:44:50 +0200 Subject: [PATCH 210/507] update code --- htdocs/core/tpl/objectline_title.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 762e9b4eefa..79d4ebeae11 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -160,7 +160,7 @@ if ($outputalsopricetotalwithtax) { print ''.$langs->trans('TotalTTCShort').''; } -if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') { +if (isModEnabled('asset') && $object->element == 'invoice_supplier') { print ''; } From 6116478cca2c9e7316f92b24d4538edc83302edd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 30 Aug 2022 11:45:15 +0200 Subject: [PATCH 211/507] update code --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index c93e0d5c4cd..b660bd89d93 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -397,7 +397,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin } } - if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') { + if (isModEnabled('asset') && $object->element == 'invoice_supplier') { print ''; $coldisplay++; if (!empty($product_static->accountancy_code_buy) || From c666c2cb89d3ae77f335e9be999a3510840c99fb Mon Sep 17 00:00:00 2001 From: Julien Nicolas Date: Tue, 30 Aug 2022 12:02:53 +0200 Subject: [PATCH 212/507] Bugfix project stats when user has no project In case of no project assigned to user, stats were using all projects --- htdocs/projet/class/project.class.php | 42 ++++++++++++++------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index f395173b327..04e32a80c5d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2040,7 +2040,6 @@ class Project extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) @@ -2056,10 +2055,14 @@ class Project extends CommonObject // For external user, no check is done on company because readability is managed by public status of project and assignement. //$socid=$user->socid; - $projectsListId = null; - if (empty($user->rights->projet->all->lire)) { - $projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1); - } + $response = new WorkboardResponse(); + $response->warning_delay = $conf->project->warning_delay / 60 / 60 / 24; + $response->label = $langs->trans("OpenedProjects"); + $response->labelShort = $langs->trans("Opened"); + $response->url = DOL_URL_ROOT.'/projet/list.php?search_project_user=-1&search_status=1&mainmenu=project'; + $response->img = img_object('', "projectpub"); + $response->nbtodo = 0; + $response->nbtodolate = 0; $sql = "SELECT p.rowid, p.fk_statut as status, p.fk_opp_status, p.datee as datee"; $sql .= " FROM (".MAIN_DB_PREFIX."projet as p"; @@ -2069,9 +2072,19 @@ class Project extends CommonObject //if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; $sql .= " WHERE p.fk_statut = 1"; $sql .= " AND p.entity IN (".getEntity('project').')'; - if (!empty($projectsListId)) { + + + $projectsListId = null; + if (!$user->rights->projet->all->lire) { + $response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project'; + $projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1); + if (empty($projectsListId)) { + return $response; + } + $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; } + // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; // For external user, no check is done on company permission because readability is managed by public status of project and assignement. @@ -2082,16 +2095,6 @@ class Project extends CommonObject if ($resql) { $project_static = new Project($this->db); - $response = new WorkboardResponse(); - $response->warning_delay = $conf->project->warning_delay / 60 / 60 / 24; - $response->label = $langs->trans("OpenedProjects"); - $response->labelShort = $langs->trans("Opened"); - if ($user->rights->projet->all->lire) { - $response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project'; - } else { - $response->url = DOL_URL_ROOT.'/projet/list.php?search_project_user=-1&search_status=1&mainmenu=project'; - } - $response->img = img_object('', "projectpub"); // This assignment in condition is not a bug. It allows walking the results. while ($obj = $this->db->fetch_object($resql)) { @@ -2107,12 +2110,11 @@ class Project extends CommonObject } return $response; - } else { - $this->error = $this->db->error(); - return -1; } - } + $this->error = $this->db->error(); + return -1; + } /** * Function used to replace a thirdparty id with another one. From 96f16d05645f6533f4a3d4429d0a1c59c7b90c60 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 30 Aug 2022 13:53:19 +0200 Subject: [PATCH 213/507] Refresh button --- htdocs/admin/emailcollector_card.php | 182 +++++++++++++++++++++------ 1 file changed, 143 insertions(+), 39 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index e41777da9d9..919ae21f2d4 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -34,6 +34,16 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php'; include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; +// use Webklex\PHPIMAP; +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 OAuth\Common\Storage\DoliStorage; +use OAuth\Common\Consumer\Credentials; + if (!$user->admin) { accessforbidden(); } @@ -377,50 +387,144 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $connectstringserver = $object->getConnectStringIMAP($usessl); if ($action == 'scan') { - try { - if ($sourcedir) { - //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); - $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); + if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { + if ($object->acces_type == 1) { + // Mode OAUth2 with PHP-IMAP + require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // define $supportedoauth2array + $keyforsupportedoauth2array = $object->oauth_service; + if (preg_match('/^.*-/', $keyforsupportedoauth2array)) { + $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array); + } else { + $keyforprovider = ''; + } + $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); + $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; + + $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); + + require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; + //$debugtext = "Host: ".$this->host."
Port: ".$this->port."
Login: ".$this->login."
Password: ".$this->password."
access type: ".$this->acces_type."
oauth service: ".$this->oauth_service."
Max email per collect: ".$this->maxemailpercollect; + //dol_syslog($debugtext); + + $storage = new DoliStorage($db, $conf); + + try { + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + $expire = true; + // Is token expired or will token expire in the next 30 seconds + // if (is_object($tokenobj)) { + // $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30)); + // } + // Token expired so we refresh it + if (is_object($tokenobj) && $expire) { + $credentials = new Credentials( + getDolGlobalString('OAUTH_'.$object->oauth_service.'_ID'), + getDolGlobalString('OAUTH_'.$object->oauth_service.'_SECRET'), + getDolGlobalString('OAUTH_'.$object->oauth_service.'_URLAUTHORIZE') + ); + $serviceFactory = new \OAuth\ServiceFactory(); + $oauthname = explode('-', $OAUTH_SERVICENAME); + // ex service is Google-Emails we need only the first part Google + $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); + // We have to save the token because Google give it only once + $refreshtoken = $tokenobj->getRefreshToken(); + $tokenobj = $apiService->refreshAccessToken($tokenobj); + $tokenobj->setRefreshToken($refreshtoken); + $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); + } + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + if (is_object($tokenobj)) { + $token = $tokenobj->getAccessToken(); + } else { + $object->error = "Token not found"; + return -1; + } + } catch (Exception $e) { + print $e->getMessage(); + } + + $cm = new ClientManager(); + $client = $cm->make([ + 'host' => $object->host, + 'port' => $object->port, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'protocol' => 'imap', + 'username' => $object->login, + 'password' => $token, + 'authentication' => "oauth", + ]); + } else { + // Mode login/pass with PHP-IMAP + $cm = new ClientManager(); + $client = $cm->make([ + 'host' => $object->host, + 'port' => $object->port, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'protocol' => 'imap', + 'username' => $object->login, + 'password' => $object->password, + 'authentication' => "login", + ]); } - if ($targetdir) { - //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); - $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + try { + $client->connect(); + } catch (ConnectionFailedException $e) { + print $e->getMessage(); } - $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; - $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; - - dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); - - $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect - $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); - $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); - $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); - - dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); - - $connection = imap_open($connectstringsource, $object->login, $object->password); - - //dol_syslog("end imap_open connection=".var_export($connection, true)); - } catch (Exception $e) { - print $e->getMessage(); - } - - if (!$connection) { - $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; - if (function_exists('imap_last_error')) { - $morehtml .= '
'.imap_last_error(); - } - dol_syslog("Error ".$morehtml, LOG_WARNING); - //var_dump(imap_errors()) + $f = $client->getFolders(false, $object->source_directory); + $nbemail = $f[0]->examine()["exists"]; + print "mails:".$nbemail; + $morehtml .= $nbemail; + print "helo"; } else { - dol_syslog("Imap connected. Now we call imap_num_msg()"); - $morehtml .= imap_num_msg($connection); - } + try { + if ($sourcedir) { + //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); + $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); + } + if ($targetdir) { + //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); + $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + } - if ($connection) { - dol_syslog("Imap close"); - imap_close($connection); + $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; + $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; + + dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); + + $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect + $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); + $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); + $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); + + dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); + + $connection = imap_open($connectstringsource, $object->login, $object->password); + + //dol_syslog("end imap_open connection=".var_export($connection, true)); + } catch (Exception $e) { + print $e->getMessage(); + } + + if (!$connection) { + $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; + if (function_exists('imap_last_error')) { + $morehtml .= '
'.imap_last_error(); + } + dol_syslog("Error ".$morehtml, LOG_WARNING); + //var_dump(imap_errors()) + } else { + dol_syslog("Imap connected. Now we call imap_num_msg()"); + $morehtml .= imap_num_msg($connection); + } + + if ($connection) { + dol_syslog("Imap close"); + imap_close($connection); + } } } else { $morehtml .= ''.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").''; From b66ac591637780596be0e8cf4572a4fb6f776bc8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 30 Aug 2022 16:29:22 +0200 Subject: [PATCH 214/507] PHP8 Warnings --- htdocs/takepos/admin/terminal.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 122e8894095..4645f5d9cf2 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -239,11 +239,11 @@ if (isModEnabled('stock')) { } } -if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { // Select printer to use with terminal require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; $printer = new dolReceiptPrinter($db); - if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $printer->listprinters(); $printers = array(); foreach ($printer->listprinters as $key => $value) { @@ -251,20 +251,20 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA } print ''.$langs->trans("MainPrinterToUse").''; print ''; - print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1); + print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$terminal), 1); print ''; - if ($conf->global->TAKEPOS_ORDER_PRINTERS) { + if (getDolGlobalInt('TAKEPOS_ORDER_PRINTERS')) { print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1'; print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1); + print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal), 1); print ''; print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2'; print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1); + print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal), 1); print ''; print ''.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 3'; print ''; - print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal}), 1); + print $form->selectarray('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal), 1); print ''; } } @@ -275,12 +275,12 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA } print ''.$langs->trans("MainTemplateToUse").' ('.$langs->trans("SetupReceiptTemplate").')'; print ''; - print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal}), 1); + print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal), 1); print ''; - if ($conf->global->TAKEPOS_ORDER_PRINTERS) { + if (getDolGlobalInt('TAKEPOS_ORDER_PRINTERS')) { print ''.$langs->trans("OrderTemplateToUse").''; print ''; - print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, (empty($conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal}), 1); + print $form->selectarray('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal), 1); print ''; } } @@ -376,7 +376,7 @@ print $form->textwithpicto($langs->trans('Header'), $htmltext, 1, 'help', '', 0, print ''; print ''; $variablename = 'TAKEPOS_HEADER'.$terminaltouse; -if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { +if (!getDolGlobalInt('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -392,7 +392,7 @@ print $form->textwithpicto($langs->trans('Footer'), $htmltext, 1, 'help', '', 0, print ''; print ''; $variablename = 'TAKEPOS_FOOTER'.$terminaltouse; -if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { +if (!getDolGlobalInt('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; From 149fa48573b06f5fcbc69cba2e8029a8ccf7ac74 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 30 Aug 2022 16:29:27 +0200 Subject: [PATCH 215/507] PHP8 Warnings --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 16ac171b2ef..4ee3d1cbe2a 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -58,7 +58,7 @@ $setterminal = GETPOST('setterminal', 'int'); $setcurrency = GETPOST('setcurrency', 'aZ09'); if (empty($_SESSION["takeposterminal"])) { - if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") { + if (getDolGlobalInt('TAKEPOS_NUM_TERMINALS') == "1") { $_SESSION["takeposterminal"] = 1; // Use terminal 1 if there is only 1 terminal } elseif (!empty($_COOKIE["takeposterminal"])) { $_SESSION["takeposterminal"] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE["takeposterminal"]); // Restore takeposterminal from previous session From ebc9581ddefc8c67ae25209cd9b10a83b38e0069 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 30 Aug 2022 16:37:29 +0200 Subject: [PATCH 216/507] CSS --- htdocs/salaries/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 757027253d4..635ce443683 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -992,7 +992,7 @@ if ($id) { print $bankaccountstatic->getNomUrl(1, 'transactions'); print ''; } - print ''.price($objp->amount)."\n"; + print ''.price($objp->amount)."\n"; print ""; $totalpaid += $objp->amount; $i++; @@ -1003,14 +1003,14 @@ if ($id) { print ''; } - print ''.$langs->trans("AlreadyPaid")." :".price($totalpaid)."\n"; - print ''.$langs->trans("AmountExpected")." :".price($object->amount)."\n"; + print ''.$langs->trans("AlreadyPaid")." :".price($totalpaid)."\n"; + print ''.$langs->trans("AmountExpected")." :".price($object->amount)."\n"; $resteapayer = $object->amount - $totalpaid; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; print ''.$langs->trans("RemainderToPay")." :"; - print ''.price($resteapayer)."\n"; + print ''.price($resteapayer)."\n"; print ""; print '
'; From 7db656a9ba4cd685debdf3d3b534bb84d93590c4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 30 Aug 2022 17:01:31 +0200 Subject: [PATCH 217/507] PHP8 Warnings --- htdocs/product/fournisseurs.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 28e587b3576..9e872dcfb8a 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -521,7 +521,7 @@ if ($id > 0 || $ref) { print ''; // Availability - if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) { + if (getDolGlobalInt('FOURN_PRODUCT_AVAILABILITY')) { $langs->load("propal"); print ''.$langs->trans("Availability").''; $form->selectAvailabilityDelay($object->fk_availability, "oselDispo", 1); @@ -907,16 +907,16 @@ END; $arrayfields = array( 'pfp.datec'=>array('label'=>$langs->trans("AppliedPricesFrom"), 'checked'=>1, 'position'=>1), 's.nom'=>array('label'=>$langs->trans("Suppliers"), 'checked'=>1, 'position'=>2), - 'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4), + 'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => getDolGlobalInt('FOURN_PRODUCT_AVAILABILITY'), 'checked'=>0, 'position'=>4), 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), - 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10), + 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), - 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), - 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16), - 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17), - 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => $conf->barcode->enabled, 'checked'=>1, 'position'=>18), + 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15), + 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16), + 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked'=>0, 'position'=>17), + 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => isModEnabled('barcode'), 'checked'=>1, 'position'=>18), ); // fetch optionals attributes and labels From 425405a9b2f49915df7cf2cdb06fabcc23973c3c Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Tue, 30 Aug 2022 17:01:20 +0200 Subject: [PATCH 218/507] Product supplier price: autofill default supplier VAT --- htdocs/product/fournisseurs.php | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index c5b8004efa8..237c69ca377 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -506,6 +506,43 @@ if ($id > 0 || $ref) { print ''; } } + print ''; } print ''; From 0f4c59689d607d6b3d9b35ff33383b6afb4fbf16 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 17:26:18 +0200 Subject: [PATCH 219/507] Fix updating member need functions2.lib.php for clean_url() --- htdocs/adherents/class/adherent.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1f01f608fb0..0d7f6365fa4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -655,6 +655,8 @@ class Adherent extends CommonObject public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') { global $conf, $langs, $hookmanager; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $nbrowsaffected = 0; $error = 0; From a7529c171dd3083b45188f28cddc5763f8301fd4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 30 Aug 2022 15:33:18 +0000 Subject: [PATCH 220/507] Fixing style errors. --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0d7f6365fa4..f5784b43fb2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -655,7 +655,7 @@ class Adherent extends CommonObject public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') { global $conf, $langs, $hookmanager; - + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $nbrowsaffected = 0; From 52b912aa51d79270504c8510868c019e9a3a9b36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Aug 2022 19:56:57 +0200 Subject: [PATCH 221/507] Clean code --- htdocs/accountancy/bookkeeping/card.php | 6 ++-- htdocs/admin/menus/edit.php | 23 ------------- htdocs/core/class/utils.class.php | 2 +- htdocs/core/tpl/card_presend.tpl.php | 44 ++++++++++++++++++------- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index c2071e76cea..47c2746bf4f 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -332,7 +332,9 @@ if ($action == 'valid') { $html = new Form($db); $formaccounting = new FormAccounting($db); -llxHeader('', $langs->trans("CreateMvts")); +$title = $langs->trans("CreateMvts"); + +llxHeader('', $title); // Confirmation to delete the command if ($action == 'delete') { @@ -341,7 +343,7 @@ if ($action == 'delete') { } if ($action == 'create') { - print load_fiche_titre($langs->trans("CreateMvts")); + print load_fiche_titre($title); $object = new BookKeeping($db); $next_num_mvt = $object->getNextNumMvt('_tmp'); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 9378fc28bbe..471b34866a7 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -219,29 +219,6 @@ if ($action == 'add') { } } -// delete -if ($action == 'confirm_delete' && $confirm == 'yes') { - $db->begin(); - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu WHERE rowid = ".GETPOST('menuId', 'int'); - $result = $db->query($sql); - - if ($result == 0) { - $db->commit(); - - llxHeader(); - setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); - llxFooter(); - exit; - } else { - $db->rollback(); - - $reload = 0; - $_GET["action"] = ''; - $action = ''; - } -} - /* diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index a60c3fdd8f5..8805f7376c2 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -652,7 +652,7 @@ class Utils * @param string $outputfile A path for an output file (used only when method is 2). For example: $conf->admin->dir_temp.'/out.tmp'; * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @param string $redirectionfile If defined, a redirection of output to this file is added. - * @param int $noescapecommand 1=Do not escape command. Warning: Using this parameter need you alreay sanitized the command. if not, it will lead to security vulnerability. + * @param int $noescapecommand 1=Do not escape command. Warning: Using this parameter needs you alreay have sanitized the command. if not, it will lead to security vulnerability. * This parameter is provided for backward compatibility with external modules. Always use 0 in core. * @param string $redirectionfileerr If defined, a redirection of error is added to this file instead of to channel 1. * @return array array('result'=>...,'output'=>...,'error'=>...). result = 0 means OK. diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 5fbb227bc69..596feae69d1 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -156,7 +156,7 @@ if ($action == 'presend') { $formmail->inreplyto = empty($inreplyto) ? '' : $inreplyto; $formmail->withfrom = 1; - // Fill list of recipient with email inside <>. + // Define $liste, a list of recipients with email inside <>. $liste = array(); if ($object->element == 'expensereport') { $fuser = new User($db); @@ -202,16 +202,6 @@ if ($action == 'presend') { } } - $formmail->withto = $liste; - $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); - $formmail->withtocc = $liste; - $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); - $formmail->withtopic = $topicmail; - $formmail->withfile = 2; - $formmail->withbody = 1; - $formmail->withdeliveryreceipt = 1; - $formmail->withcancel = 1; - //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); if (!isset($arrayoffamiliestoexclude)) { $arrayoffamiliestoexclude = null; @@ -219,6 +209,7 @@ if ($action == 'presend') { // Make substitution in email content if ($object) { + // First we set ->substit (useless, it will be erased later) and ->substit_lines $formmail->setSubstitFromObject($object, $langs); } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); @@ -237,7 +228,7 @@ if ($action == 'presend') { ); complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters); - // Find the good contact address + // Find all external contact addresses $tmpobject = $object; if (($object->element == 'shipping' || $object->element == 'reception')) { $origin = $object->origin; @@ -289,17 +280,46 @@ if ($action == 'presend') { if (is_array($contactarr) && count($contactarr) > 0) { require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $contactstatic = new Contact($db); + $tmpcompany = new Societe($db); foreach ($contactarr as $contact) { $contactstatic->fetch($contact['id']); + // Complete substitution array $substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($outputlangs, 1); $substitutionarray['__CONTACT_LASTNAME_'.$contact['code'].'__'] = $contactstatic->lastname; $substitutionarray['__CONTACT_FIRSTNAME_'.$contact['code'].'__'] = $contactstatic->firstname; $substitutionarray['__CONTACT_TITLE_'.$contact['code'].'__'] = $contactstatic->getCivilityLabel(); + + // Complete $liste with the $contact + if (empty($liste[$contact['id']])) { // If this contact id not already into the $liste + $contacttoshow = ''; + if (isset($object->thirdparty) && is_object($object->thirdparty)) { + if ($contactstatic->fk_soc != $object->thirdparty->id) { + $tmpcompany->fetch($contactstatic->fk_soc); + if ($tmpcompany->id > 0) { + $contacttoshow .= $tmpcompany->name.': '; + } + } + } + $contacttoshow .= $contactstatic->getFullName($outputlangs, 1); + $contacttoshow .= " <".($contactstatic->email ? $contactstatic->email : $langs->transnoentitiesnoconv("NoEMail")) .">"; + $liste[$contact['id']] = $contacttoshow; + } } } + $formmail->withto = $liste; + $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1'); + $formmail->withtocc = $liste; + $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); + $formmail->withtopic = $topicmail; + $formmail->withfile = 2; + $formmail->withbody = 1; + $formmail->withdeliveryreceipt = 1; + $formmail->withcancel = 1; + // Array of substitutions $formmail->substit = $substitutionarray; From e0b1ad308b1d991364c1e86b17ffcf1792c8ade7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Aug 2022 19:38:35 +0200 Subject: [PATCH 222/507] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/admin/facture_situation.php | 7 +-- htdocs/admin/tools/export.php | 40 ++++++------- htdocs/admin/tools/export_files.php | 10 +++- htdocs/commande/list.php | 1 - htdocs/compta/bank/bankentries_list.php | 13 +++-- htdocs/compta/bank/releve.php | 19 +++--- .../compta/cashcontrol/cashcontrol_card.php | 8 +-- htdocs/compta/facture/document.php | 22 ++++--- htdocs/compta/facture/note.php | 17 ++++-- htdocs/core/lib/files.lib.php | 1 - htdocs/fourn/commande/list.php | 1 - htdocs/fourn/facture/list.php | 2 - htdocs/holiday/define_holiday.php | 29 ++++------ htdocs/holiday/list.php | 58 +++++++++---------- htdocs/holiday/view_log.php | 17 ++---- htdocs/imports/import.php | 4 +- htdocs/intracommreport/card.php | 7 +-- htdocs/takepos/phone.php | 3 +- htdocs/ticket/card.php | 4 +- htdocs/user/card.php | 16 ++--- htdocs/variants/combinations.php | 10 ++-- 21 files changed, 144 insertions(+), 145 deletions(-) diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 609a6605d1a..350055348f8 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -130,12 +130,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader( - "", - $langs->trans("BillsSetup"), - 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura' -); +$help_yrl = 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'; +llxHeader("", $langs->trans("BillsSetup"), $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index d21622d1f68..8b1e8ebf8c0 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -56,21 +56,23 @@ if (!$user->admin) { accessforbidden(); } -if ($file && !$what) { - //print DOL_URL_ROOT.'/dolibarr_export.php'; - header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); - exit; -} - $errormsg = ''; +$utils = new Utils($db); + /* * Actions */ +if ($file && !$what) { + //print DOL_URL_ROOT.'/dolibarr_export.php'; + header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); + exit; +} + if ($action == 'delete') { - $file = $conf->admin->dir_output.'/'.GETPOST('urlfile'); + $file = $conf->admin->dir_output.'/'.dol_sanitizeFileName(GETPOST('urlfile')); $ret = dol_delete_file($file, 1); if ($ret) { setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); @@ -80,11 +82,6 @@ if ($action == 'delete') { $action = ''; } - -/* - * View - */ - $_SESSION["commandbackuplastdone"] = ''; $_SESSION["commandbackuptorun"] = ''; $_SESSION["commandbackupresult"] = ''; @@ -103,13 +100,6 @@ if (!empty($MemoryLimit)) { @ini_set('memory_limit', $MemoryLimit); } - -//$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; -//llxHeader('','',$help_url); - -//print load_fiche_titre($langs->trans("Backup"),'','title_setup'); - - // Start with empty buffer $dump_buffer = ''; $dump_buffer_len = 0; @@ -122,9 +112,6 @@ $outputdir = $conf->admin->dir_output.'/backup'; $result = dol_mkdir($outputdir); -$utils = new Utils($db); - - // MYSQL if ($what == 'mysql') { $cmddump = GETPOST("mysqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg @@ -216,7 +203,16 @@ if ($errormsg) { }*/ } + + +/* + * View + */ + +top_httphead(); + $db->close(); // Redirect to backup page header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : '')); +exit(); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index bc627cc14f0..68cb81ccc24 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -205,7 +205,12 @@ if ($compression == 'zip') { print $errormsg; } + +// Output export + if ($export_type != 'externalmodule' || empty($what)) { + top_httphead(); + if ($errormsg) { setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); } else { @@ -218,12 +223,15 @@ if ($export_type != 'externalmodule' || empty($what)) { $returnto = 'dolibarr_export.php'; header("Location: ".$returnto); + exit(); } else { + top_httphead('application/zip'); + $zipname = $outputdir."/".$file; // Then download the zipped file. - header('Content-Type: application/zip'); + header('Content-disposition: attachment; filename='.basename($zipname)); header('Content-Length: '.filesize($zipname)); readfile($zipname); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b92140efa03..4ba2f410cc9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -779,7 +779,6 @@ $projectstatic = new Project($db); $title = $langs->trans("Orders"); $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; -// llxHeader('',$title,$help_url); $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index af833e7e257..3ec26a3a1ef 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -517,9 +517,15 @@ $morehtmlref = ''; if ($id > 0 || !empty($ref)) { $title = $object->ref.' - '.$langs->trans("Transactions"); - $helpurl = ""; - llxHeader('', $title, $helpurl); +} else { + $title = $langs->trans("BankTransactions"); +} +$help_url = ''; +llxHeader('', $title, $help_url, '', 0, 0, array(), array(), $param); + + +if ($id > 0 || !empty($ref)) { // Load bank groups require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; $bankcateg = new BankCateg($db); @@ -574,11 +580,8 @@ if ($id > 0 || !empty($ref)) { } } } -} else { - llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); } - $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,"; $sql .= " b.fk_account, b.fk_type, b.fk_bordereau,"; $sql .= " ba.rowid as bankid, ba.ref as bankref"; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index c08336841e2..ea80f1caab3 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -223,6 +223,17 @@ if ($id > 0) { $param .= '&id='.urlencode($id); } +if (empty($numref)) { + $title = $object->ref.' - '.$langs->trans("AccountStatements"); + $helpurl = ""; +} else { + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements"); + $helpurl = ""; +} + + +llxHeader('', $title, $helpurl); + if (empty($numref)) { $sortfield = 'numr'; @@ -248,10 +259,6 @@ if (empty($numref)) { $numrows = $db->num_rows($result); $i = 0; - $title = $object->ref.' - '.$langs->trans("AccountStatements"); - $helpurl = ""; - llxHeader('', $title, $helpurl); - // Onglets $head = bank_prepare_head($object); print dol_get_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), 0, 'account'); @@ -387,10 +394,6 @@ if (empty($numref)) { * Show list of record into a bank statement */ - $title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements"); - $helpurl = ""; - llxHeader('', $title, $helpurl); - // Onglets $head = account_statement_prepare_head($object, $numref); print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 0130cfe10f0..a8b5f3d56bd 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -265,6 +265,10 @@ $initialbalanceforterminal = array(); $theoricalamountforterminal = array(); $theoricalnbofinvoiceforterminal = array(); + +llxHeader('', $langs->trans("CashControl")); + + if ($action == "create" || $action == "start" || $action == 'close') { if ($action == 'close') { $posmodule = $object->posmodule; @@ -376,8 +380,6 @@ if ($action == "create" || $action == "start" || $action == 'close') { //var_dump($theoricalamountforterminal); var_dump($theoricalnbofinvoiceforterminal); if ($action != 'close') { - llxHeader('', $langs->trans("NewCashFence")); - print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; @@ -597,8 +599,6 @@ if ($action == "create" || $action == "start" || $action == 'close') { if (empty($action) || $action == "view" || $action == "close") { $result = $object->fetch($id); - llxHeader('', $langs->trans("CashControl")); - if ($result <= 0) { print $langs->trans("ErrorRecordNotFound"); } else { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 5c57f89f51b..98885369bef 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -92,20 +92,24 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; * View */ -if (empty($object->id)) { - llxHeader(); - $langs->load('errors'); - echo '
'.$langs->trans("ErrorRecordNotFound").'
'; - llxFooter(); - exit; -} +$form = new Form($db); -$title = $object->ref." - ".$langs->trans('Documents'); +if (empty($object->id)) { + $title = $langs->trans('Documents'); +} else { + $title = $object->ref." - ".$langs->trans('Documents'); +} $help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $help_url); -$form = new Form($db); +if (empty($object->id)) { + $langs->load('errors'); + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; + + llxFooter(); + exit; +} if ($id > 0 || !empty($ref)) { if ($object->fetch($id, $ref) > 0) { diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 711921ee08e..866163c223f 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -77,19 +77,24 @@ if (empty($reshook)) { * View */ +$form = new Form($db); + +if (empty($object->id)) { + $title = $object->ref." - ".$langs->trans('Notes'); +} else { + $title = $langs->trans('Notes'); +} +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $helpurl); + if (empty($object->id)) { - llxHeader(); $langs->load('errors'); echo '
'.$langs->trans("ErrorRecordNotFound").'
'; llxFooter(); exit; } -$title = $object->ref." - ".$langs->trans('Notes'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); - -$form = new Form($db); if ($id > 0 || !empty($ref)) { $object = new Facture($db); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 147938fb53a..32526574294 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1261,7 +1261,6 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $hookmanager->initHooks(array('fileslib')); $parameters = array( - 'GET' => $_GET, 'file' => $file, 'disableglob'=> $disableglob, 'nophperrors' => $nophperrors diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 354c92eb534..5676cd4aae3 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -741,7 +741,6 @@ if ($search_billed > 0) { //$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; $help_url = ''; -// llxHeader('',$title,$help_url); $sql = 'SELECT'; if ($sall || $search_product_category > 0) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index f9419653c2f..47e6786f2f0 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -404,8 +404,6 @@ $facturestatic = new FactureFournisseur($db); $formcompany = new FormCompany($db); $thirdparty = new Societe($db); -// llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); - $sql = "SELECT"; if ($search_all || $search_product_category > 0) { $sql = 'SELECT DISTINCT'; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 85de7b09f61..3ea0d87d3cd 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -60,6 +60,17 @@ if (!$sortorder) { } +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('defineholidaylist')); +$extrafields = new ExtraFields($db); + +$holiday = new Holiday($db); + + +if (empty($conf->holiday->enabled)) { + accessforbidden('Module not enabled'); +} + // Protection if external user if ($user->socid > 0) { accessforbidden(); @@ -71,23 +82,6 @@ if (empty($user->rights->holiday->read)) { } -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array -$hookmanager->initHooks(array('defineholidaylist')); -$extrafields = new ExtraFields($db); - -$holiday = new Holiday($db); - -if (empty($conf->holiday->enabled)) { - llxHeader('', $langs->trans('CPTitreMenu')); - print '
'; - print ''.$langs->trans('NotActiveModCP').''; - print '
'; - llxFooter(); - exit(); -} - - - /* * Actions */ @@ -212,7 +206,6 @@ $title = $langs->trans('CPTitreMenu'); llxHeader('', $title); - $typeleaves = $holiday->getTypes(1, 1); $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. if ($result < 0) { diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 5978b6a31be..d4d2c3fff36 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -59,29 +59,6 @@ $id = GETPOST('id', 'int'); $childids = $user->getAllChildIds(1); -// Security check -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -$result = restrictedArea($user, 'holiday', '', ''); -// If we are on the view of a specific user -if ($id > 0) { - $canread = 0; - if ($id == $user->id) { - $canread = 1; - } - if (!empty($user->rights->holiday->readall)) { - $canread = 1; - } - if (!empty($user->rights->holiday->read) && in_array($id, $childids)) { - $canread = 1; - } - if (!$canread) { - accessforbidden(); - } -} $diroutputmassaction = $conf->holiday->dir_output.'/temp/massgeneration/'.$user->id; @@ -156,15 +133,36 @@ $arrayfields = array( // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; -if (empty($conf->holiday->enabled)) { - llxHeader('', $langs->trans('CPTitreMenu')); - print '
'; - print ''.$langs->trans('NotActiveModCP').''; - print '
'; - llxFooter(); - exit(); + +// Security check +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); } +if (empty($conf->holiday->enabled)) accessforbidden('Module not enabled'); + +$result = restrictedArea($user, 'holiday', '', ''); +// If we are on the view of a specific user +if ($id > 0) { + $canread = 0; + if ($id == $user->id) { + $canread = 1; + } + if (!empty($user->rights->holiday->readall)) { + $canread = 1; + } + if (!empty($user->rights->holiday->read) && in_array($id, $childids)) { + $canread = 1; + } + if (!$canread) { + accessforbidden(); + } +} + + + /* * Actions diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index ea71deb4d26..1463b91939e 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -74,11 +74,6 @@ if (!$sortorder) { $sortorder = "DESC"; } -// Si l'utilisateur n'a pas le droit de lire cette page -if (!$user->rights->holiday->readall) { - accessforbidden(); -} - // Load translation files required by the page $langs->loadLangs(array('users', 'other', 'holiday')); @@ -92,12 +87,12 @@ $arrayfields = array(); $arrayofmassactions = array(); if (empty($conf->holiday->enabled)) { - llxHeader('', $langs->trans('CPTitreMenu')); - print '
'; - print ''.$langs->trans('NotActiveModCP').''; - print '
'; - llxFooter(); - exit(); + accessforbidden('Module not enabled'); +} + +// Si l'utilisateur n'a pas le droit de lire cette page +if (!$user->rights->holiday->readall) { + accessforbidden(); } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index f573d3c85f4..fe39f39757c 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1585,7 +1585,7 @@ if ($step == 5 && $datatoimport) { $param .= '&updatekeys[]='.implode('&updatekeys[]=', $updatekeys); } - llxHeader('', $langs->trans("NewImport"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones'); + llxHeader('', $langs->trans("NewImport"), $help_url); $head = import_prepare_head($param, 5); @@ -2051,7 +2051,7 @@ if ($step == 6 && $datatoimport) { $param .= '&enclosure='.urlencode($enclosure); } - llxHeader('', $langs->trans("NewImport"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones'); + llxHeader('', $langs->trans("NewImport"), $help_url); $head = import_prepare_head($param, 6); diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index 681320e0d75..a5acefca8d6 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -155,10 +155,11 @@ if ($action == 'add' && $permissiontoadd) { * View */ +$title = $langs->trans("IntracommReportTitle"); +llxHeader("", $title); + // Creation mode if ($action == 'create') { - $title = $langs->trans("IntracommReportTitle"); - llxHeader("", $title); print load_fiche_titre($langs->trans("IntracommReportTitle")); print ''; @@ -294,8 +295,6 @@ if ($id > 0 && $action != 'edit') { { global $langs, $formother, $year, $month, $type_declaration; - $title = $langs->trans("IntracommReportDESTitle"); - llxHeader("", $title); print load_fiche_titre($langs->trans("IntracommReportDESTitle")); print dol_get_fiche_head(); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 59ed75fb46e..fa12487763e 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -85,7 +85,8 @@ if (empty($action)) { '; $arrayofcss = array('/takepos/css/phone.css'); - top_htmlhead($head, $title, 0, 0, '', ''); + + top_htmlhead($head, $title, 0, 0, '', $arrayofcss); } else { top_httphead('text/html', 1); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 8b76f5968cb..c92ee6d50e8 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -716,9 +716,9 @@ if (!empty($conf->project->enabled)) { $help_url = 'EN:Module_Ticket|FR:DocumentationModuleTicket'; -$page_title = $actionobject->getTitle($action); +$title = $actionobject->getTitle($action); -llxHeader('', $page_title, $help_url); +llxHeader('', $title, $help_url); if ($action == 'create' || $action == 'presend') { $formticket = new FormTicket($db); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 853c4d91e2f..c4e2715f664 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -730,12 +730,18 @@ if (!empty($conf->stock->enabled)) { $formproduct = new FormProduct($db); } +if ($object->id > 0) { + $person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname; + $title = $person_name." - ".$langs->trans('Card'); +} else { + $title = $langs->trans("NewUser"); +} $help_url = ''; -if ($action == 'create' || $action == 'adduserldap') { - $title = $langs->trans("NewUser"); - llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url); + +if ($action == 'create' || $action == 'adduserldap') { print load_fiche_titre($langs->trans("NewUser"), '', 'user'); print ''.$langs->trans("CreateInternalUserDesc")."
\n"; @@ -1353,10 +1359,6 @@ if ($action == 'create' || $action == 'adduserldap') { } } - $person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname; - $title = $person_name." - ".$langs->trans('Card'); - llxHeader('', $title, $help_url); - // Show tabs if ($mode == 'employee') { // For HRM module development $title = $langs->trans("Employee"); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index fe058849899..7337bf57f94 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -370,9 +370,12 @@ if ($action === 'confirm_deletecombination') { $form = new Form($db); -if (!empty($id) || !empty($ref)) { - llxHeader("", "", $langs->trans("CardProduct".$object->type)); +$title = $langs->trans("Variant"); +llxHeader("", $title); + + +if (!empty($id) || !empty($ref)) { $showbarcode = empty($conf->barcode->enabled) ? 0 : 1; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) { $showbarcode = 0; @@ -932,9 +935,6 @@ if (!empty($id) || !empty($ref)) { print '
'; print ''; } -} else { - llxHeader(); - // not found } // End of page From 27ce241074d08986c552436fc369f9df15b04bbc Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:33:54 +0200 Subject: [PATCH 223/507] Update modules_takepos.php --- htdocs/core/modules/takepos/modules_takepos.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/takepos/modules_takepos.php b/htdocs/core/modules/takepos/modules_takepos.php index 24fa70b7f28..89b3dbde5bc 100644 --- a/htdocs/core/modules/takepos/modules_takepos.php +++ b/htdocs/core/modules/takepos/modules_takepos.php @@ -16,14 +16,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ + * along with this program. If not, see . + * or see https://www.gnu.org/ */ /** * \file htdocs/core/modules/takepos/modules_takepos.php * \ingroup takepos - * \brief Fichier contenant la classe mere de numerotation des tickets de caisse + * \brief File containing the parent class for the numbering of cash register receipts */ From ed4ed8705d742053575cd47783db5561a77d1cc5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:43:19 +0200 Subject: [PATCH 224/507] Update mod_takepos_ref_simple.php --- .../core/modules/takepos/mod_takepos_ref_simple.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index 41b7bb8c90e..31eb9345110 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -15,8 +15,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ + * along with this program. If not, see . + * or see https://www.gnu.org/ */ /** @@ -24,6 +24,7 @@ * \ingroup takepos * \brief File with Simple ref numbering module for takepos */ + dol_include_once('/core/modules/takepos/modules_takepos.php'); /** @@ -80,10 +81,10 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos } /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. + * Test if the numbers already in the database do not cause any conflicts that will prevent this + * of conflicts that will prevent this numbering from working. * - * @return boolean false si conflit, true si ok + * @return boolean false if KO (there is a conflict), true if OK */ public function canBeActivated() { From a97f606cd9baf1fa25f2dfbada2b3edc24ddd33d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:47:44 +0200 Subject: [PATCH 225/507] Update mod_takepos_ref_universal.php --- .../modules/takepos/mod_takepos_ref_universal.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 7e46c10a341..9a6e632b92c 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -17,8 +17,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ + * along with this program. If not, see . + * or see https://www.gnu.org/ */ /** @@ -26,6 +26,7 @@ * \ingroup takepos * \brief File with Universal ref numbering module for takepos */ + dol_include_once('/core/modules/takepos/modules_takepos.php'); /** @@ -51,7 +52,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos public $nom = 'Universal'; /** - * Renvoi la description du modele de numerotation + * return description of the numbering model * * @return string Texte descripif */ @@ -77,7 +78,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos $tooltip .= $langs->trans('GenericMaskCodes5'); $tooltip .= $langs->trans('CashDeskGenericMaskCodes6'); - // Parametrage du prefix + // Setting up the prefix $texte .= ''.$langs->trans("Mask").':'; $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -92,7 +93,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos } /** - * Renvoi un exemple de numerotation + * Return an example of numbering * * @return string Example */ @@ -125,7 +126,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - // On defini critere recherche compteur + // We define search criteria counter $mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK; if (!$mask) { From 60bfd55db1a4256c5785471902004b7cfc136566 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 30 Aug 2022 22:51:30 +0200 Subject: [PATCH 226/507] Update ecm.php --- htdocs/admin/ecm.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 44df7f74189..3e0c2378742 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -22,6 +22,8 @@ * \brief Page to setup ECM (GED) module */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -37,6 +39,8 @@ if (!$user->admin) { /* * Action */ + +// set if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { @@ -47,6 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { } } +// delete if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { From 017a2258ce5608102bf003c409d9058f0fb94ce2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 01:03:30 +0200 Subject: [PATCH 227/507] FIX bad sort order field on DMD in product lot page --- htdocs/product/reassortlot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 2bd62b2ce22..f432d97e403 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -369,10 +369,10 @@ if ($resql) { //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right ); print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center '); if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { - print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pl.sellby", $param, "", '', $sortfield, $sortorder, 'center '); } if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pl.eatby", $param, "", '', $sortfield, $sortorder, 'center '); } print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right '); // TODO Add info of running suppliers/customers orders From f6c6797dc4d077a3b721089ebf91913b7be978a7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:38:18 +0200 Subject: [PATCH 228/507] Update compare.php --- htdocs/hrm/compare.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index c8bb01d85e5..686d5820695 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -1,9 +1,9 @@ - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Greg Rastklan - * Copyright (C) 2021 Jean-Pascal BOUDET - * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND * * 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 @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * \file class/compare.php + * \file htdocs/hrm/compare.php * \ingroup hrm * \brief This file compares skills of user groups * @@ -33,23 +33,29 @@ * */ + +// Load Dolibarr environment require_once '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php'; -$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read; -$permissiontoadd = 0; -if (empty($conf->hrm->enabled)) accessforbidden(); -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); +// Load translation files required by the page $langs->load('hrm'); +// Permissions +$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read; +$permissiontoadd = 0; + +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + /* * View From 66cb51708cd1f2ef7ae08f5f7e1202c3bd6dfe76 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:49:27 +0200 Subject: [PATCH 229/507] Update index.php --- htdocs/hrm/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 1160ee0fc14..861bde0fb51 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -26,6 +26,8 @@ * \brief Home page for HRM area. */ + +// Load Dolibarr environment 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'; @@ -34,6 +36,7 @@ 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'; + if (!empty($conf->deplacement->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } @@ -48,12 +51,15 @@ if (!empty($conf->holiday->enabled)) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager = new HookManager($db); $hookmanager->initHooks('hrmindex'); // Load translation files required by the page $langs->loadLangs(array('users', 'holiday', 'trips', 'boxes')); +// Get Parameters $socid = GETPOST("socid", "int"); // Protection if external user From e390e6273b7e399a3ffb2b52a554bf38dc9a6257 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:56:16 +0200 Subject: [PATCH 230/507] Update position.php --- htdocs/hrm/position.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 78838136a1e..2659321e5fc 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -20,9 +20,9 @@ */ /** - * \file position.php - * \ingroup hrm - * \brief Page to create/edit/view position + * \file htdocs/hrm/position.php + * \ingroup hrm + * \brief Page to create/edit/view position */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -88,10 +88,6 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$backtopage = GETPOST('backtopage', 'alpha'); -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$fk_job = GETPOST('fk_job', 'int'); // Get parameters $id = GETPOST('fk_job', 'int'); @@ -105,12 +101,18 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'positioncard'; // To manage different context of search +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$fk_job = GETPOST('fk_job', 'int'); + // Initialize technical objects $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; + $hookmanager->initHooks(array('positiontab', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -130,6 +132,7 @@ foreach ($object->fields as $key => $val) { // 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 $permissiontodelete = $user->rights->hrm->all->delete; From 28c4dd88a26dadce160d1d19952298cd5a0c2a99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 14:02:09 +0200 Subject: [PATCH 231/507] FIX use correct smtp setup for the check_server_port() test --- htdocs/core/class/CMailFile.class.php | 38 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 42dcd1d493b..f9157a6a3c2 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -156,7 +156,7 @@ class CMailFile * @param string $errors_to Email for errors-to * @param string $css Css option * @param string $trackid Tracking string (contains type and id of related element) - * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment) + * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'mail' and 'smtps' for the moment) * @param string $sendcontext 'standard', 'emailing', ... (used to define which sending mode and parameters to use) * @param string $replyto Reply-to email (will be set to same value than From by default if not provided) */ @@ -173,12 +173,11 @@ class CMailFile $this->sendcontext = $sendcontext; - // Define this->sendmode + // Define this->sendmode ('mail', 'smtps', 'siwftmailer', ...) according to $sendcontext ('standard', 'emailing', 'ticket') $this->sendmode = ''; if (!empty($this->sendcontext)) { $smtpContextKey = strtoupper($this->sendcontext); - $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey; - $smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode}; + $smtpContextSendMode = getDolGlobalString('MAIN_MAIL_SENDMODE_'.$smtpContextKey); if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { $this->sendmode = $smtpContextSendMode; } @@ -329,8 +328,7 @@ class CMailFile $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'; if (!empty($this->sendcontext)) { $smtpContextKey = strtoupper($this->sendcontext); - $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey; - $smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode}; + $smtpContextSendMode = getDolGlobalString('MAIN_MAIL_SENDMODE_'.$smtpContextKey); if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_'.$smtpContextKey; } @@ -701,8 +699,7 @@ class CMailFile $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'; if (!empty($this->sendcontext)) { $smtpContextKey = strtoupper($this->sendcontext); - $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey; - $smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode}; + $smtpContextSendMode = getDolGlobalString('MAIN_MAIL_SENDMODE_'.$smtpContextKey); if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { $keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey; $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey; @@ -1537,15 +1534,26 @@ class CMailFile $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT'; $keyforsmtpid = 'MAIN_MAIL_SMTPS_ID'; $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW'; + $keyforsmtpauthtype = 'MAIN_MAIL_SMTPS_AUTH_TYPE'; + $keyforsmtpoauthservice = 'MAIN_MAIL_SMTPS_OAUTH_SERVICE'; $keyfortls = 'MAIN_MAIL_EMAIL_TLS'; $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS'; - if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { - $keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_EMAILING'; - $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_EMAILING'; - $keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_EMAILING'; - $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_EMAILING'; - $keyfortls = 'MAIN_MAIL_EMAIL_TLS_EMAILING'; - $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; + $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED'; + + if (!empty($this->sendcontext)) { + $smtpContextKey = strtoupper($this->sendcontext); + $smtpContextSendMode = getDolGlobalString('MAIN_MAIL_SENDMODE_'.$smtpContextKey); + if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { + $keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey; + $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey; + $keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_'.$smtpContextKey; + $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_'.$smtpContextKey; + $keyforsmtpauthtype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_'.$smtpContextKey; + $keyforsmtpoauthservice = 'MAIN_MAIL_SMTPS_OAUTH_SERVICE_'.$smtpContextKey; + $keyfortls = 'MAIN_MAIL_EMAIL_TLS_'.$smtpContextKey; + $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_'.$smtpContextKey; + $keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_'.$smtpContextKey; + } } // If we use SSL/TLS From 6a1b33b5ad91b5188dd79f290b37dbcebe547590 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 14:55:53 +0200 Subject: [PATCH 232/507] Update index.php --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4ee3d1cbe2a..004ce45c459 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -58,7 +58,7 @@ $setterminal = GETPOST('setterminal', 'int'); $setcurrency = GETPOST('setcurrency', 'aZ09'); if (empty($_SESSION["takeposterminal"])) { - if (getDolGlobalInt('TAKEPOS_NUM_TERMINALS') == "1") { + if (getDolGlobalInt('TAKEPOS_NUM_TERMINALS') == 1) { $_SESSION["takeposterminal"] = 1; // Use terminal 1 if there is only 1 terminal } elseif (!empty($_COOKIE["takeposterminal"])) { $_SESSION["takeposterminal"] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE["takeposterminal"]); // Restore takeposterminal from previous session From 204c223b8bd83df136def30b85f80533b558bee8 Mon Sep 17 00:00:00 2001 From: Adventurousdonut <110562645+Adventurousdonut@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:16:15 +0200 Subject: [PATCH 233/507] Update llx_accounting_account_at.sql --- .../mysql/data/llx_accounting_account_at.sql | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index 3e153dc88e7..a006d716432 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -344,3 +344,211 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 319, 'AT-BASE','GROUP6','60000','0','kalk. Löhne u Gehälter', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 320, 'AT-BASE','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 321, 'AT-BASE','GROUP6','66300','0','Leistungserfassung', 1); + +-- Different Base CoA for Austria + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 7, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 8, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 9, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 14, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 15, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 16, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 18, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 19, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 20, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 23, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 24, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 25, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 26, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 27, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 28, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 29, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 32, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 33, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 34, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 35, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 36, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 37, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 38, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 39, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 40, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 42, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 43, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 44, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 45, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 46, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 47, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 48, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 49, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 50, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 53, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 54, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 55, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 56, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 57, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 58, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 59, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 60, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 63, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 64, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 65, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 66, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 67, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 68, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 69, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 72, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 73, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 74, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 75, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 76, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 77, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 78, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 79, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 80, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 83, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 84, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 85, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 86, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 87, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 88, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 89, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 90, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 91, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 92, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 93, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); From db6d345e54a7727e89fdf9bf6f7b6ad15327429f Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 30 Aug 2022 11:31:20 +0200 Subject: [PATCH 234/507] Fix #21810 : Broken statistics in project module --- htdocs/projet/class/projectstats.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 9b2314deacc..f1295c10424 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -528,4 +528,22 @@ class ProjectStats extends Stats // var_dump($res);print '
'; return $res; } + + /** + * Return average of entity by month + * @param int $year year number + * @return int value + */ + protected function getAverageByMonth($year) + { + $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; + $sql .= " FROM ".$this->from; + $sql .= $this->join; + $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + return $this->_getAverageByMonth($year, $sql); + } } From 30475a8ce63a64d4f93251fe874706adf9b8ee03 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 17:26:18 +0200 Subject: [PATCH 235/507] Fix updating member need functions2.lib.php for clean_url() --- htdocs/adherents/class/adherent.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f5784b43fb2..b65946af622 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -655,6 +655,8 @@ class Adherent extends CommonObject public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') { global $conf, $langs, $hookmanager; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; From 5c135b59eba913a5351842c721c615a2e3926ab2 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Tue, 30 Aug 2022 09:10:03 +0200 Subject: [PATCH 236/507] require missing signture.lib.php --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 89cf3819d7e..f5206c700d0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7288,6 +7288,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl; if (is_object($object) && $object->element == 'propal') { + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref); } if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'propal') { From 596fcd89ae2d80537af1f05d2d9b53a091ea965f Mon Sep 17 00:00:00 2001 From: Adventurousdonut <110562645+Adventurousdonut@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:52:53 +0200 Subject: [PATCH 237/507] Update llx_accounting_account_at.sql --- .../mysql/data/llx_accounting_account_at.sql | 410 +++++++++--------- 1 file changed, 205 insertions(+), 205 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index a006d716432..08cf24ec51a 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -347,208 +347,208 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc -- Different Base CoA for Austria -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 7, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 8, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 9, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 14, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 15, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 16, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 18, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 19, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 20, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 23, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 24, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 25, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 26, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 27, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 28, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 29, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 32, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 33, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 34, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 35, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 36, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 37, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 38, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 39, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 40, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 42, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 43, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 44, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 45, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 46, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 47, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 48, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 49, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 50, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 53, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 54, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 55, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 56, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 57, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 58, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 59, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 60, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 63, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 64, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 65, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 66, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 67, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 68, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 69, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 72, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 73, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 74, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 75, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 76, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 77, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 78, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 79, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 80, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 83, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 84, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 85, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 86, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 87, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 88, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 89, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 90, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 91, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 92, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 93, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1001, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1002, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1003, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1004, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1005, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1006, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1007, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1008, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1009, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); From dc08b96444bd2c011dd4b4e376fa11b390692393 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 17:17:43 +0200 Subject: [PATCH 238/507] Fix phpcs --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b65946af622..7d3328cde34 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -655,7 +655,7 @@ class Adherent extends CommonObject public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') { global $conf, $langs, $hookmanager; - + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; From 55dcf19efd1fdc74fea391d76f60604bb696bc36 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 Aug 2022 17:22:06 +0200 Subject: [PATCH 239/507] FIX missing hook context and some parameters --- htdocs/accountancy/admin/account.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 48d8ab23d96..84eab31849d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -97,6 +97,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { $accounting = new AccountingAccount($db); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('accountancyadminaccount')); + /* * Actions @@ -109,8 +112,8 @@ if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; } -$parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been monowraponalldified by some hooks +$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $accounting, $action); // Note that $action and $object may have been monowraponalldified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } From 594bbcb1f194460dfa59543ed5a37c8cbb14ccd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 17:32:38 +0200 Subject: [PATCH 240/507] Fix regression --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 0db718f28b4..40449d5da1f 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -130,7 +130,7 @@ $error = 0; $listofchoices = array( 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)), + 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)), From 0bfa7a2a8f864cd079c63bb56bb39258b9e2e4bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 18:09:46 +0200 Subject: [PATCH 241/507] Fix delete dir --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 3024d3b1e61..abf16cee764 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -632,7 +632,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`; From 92f9f36dd68e7993728a51cabb1727de0e4efd5e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 Aug 2022 18:39:41 +0200 Subject: [PATCH 242/507] FIX add hook formobjectoptions --- htdocs/accountancy/admin/account.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 84eab31849d..15931b19c57 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -399,6 +399,11 @@ if ($resql) { print ''; print '
'; + + $parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; From 7374974880038016788d8933da92b168eb6c0efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 Aug 2022 18:40:28 +0200 Subject: [PATCH 243/507] add tables for bank lines extrafields --- .../install/mysql/migration/16.0.0-17.0.0.sql | 10 ++++++++ .../mysql/tables/llx_bank_extrafields.key.sql | 20 +++++++++++++++ .../mysql/tables/llx_bank_extrafields.sql | 25 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_bank_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_bank_extrafields.sql 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 5db36ee955b..187106f679c 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 @@ -129,3 +129,13 @@ ALTER TABLE llx_societe_rib ADD COLUMN currency_code varchar(3) AFTER fk_country ALTER TABLE llx_user_rib ADD COLUMN state_id integer AFTER owner_address; ALTER TABLE llx_user_rib ADD COLUMN fk_country integer AFTER state_id; ALTER TABLE llx_user_rib ADD COLUMN currency_code varchar(3) AFTER fk_country; + +CREATE TABLE llx_bank_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql b/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql new file mode 100644 index 00000000000..3d308e79684 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_bank_extrafields.sql b/htdocs/install/mysql/tables/llx_bank_extrafields.sql new file mode 100644 index 00000000000..3ca4f7a84d4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bank_extrafields.sql @@ -0,0 +1,25 @@ +-- =================================================================== +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +CREATE TABLE llx_bank_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; From 9d57680d8267f82f28c8ee3803128f93b8b55c60 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 31 Aug 2022 20:14:54 +0200 Subject: [PATCH 244/507] FIX double fix --- htdocs/adherents/class/adherent.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 7d3328cde34..f5784b43fb2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -658,8 +658,6 @@ class Adherent extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $nbrowsaffected = 0; $error = 0; From 194c76727e31f64a07106da4e2c6f1dd82b1a940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:37:10 +0200 Subject: [PATCH 245/507] fix php8 warnings --- htdocs/expedition/class/expedition.class.php | 8 ++++---- htdocs/expensereport/card.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5df7108e895..ec7d7ff3cab 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php'; @@ -625,7 +625,7 @@ class Expedition extends CommonObject $this->fetch_optionals(); // Fix Get multicurrency param for transmited - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { if (!empty($this->multicurrency_code)) { $this->multicurrency_code = $this->thirdparty->multicurrency_code; } @@ -1291,7 +1291,7 @@ class Expedition extends CommonObject } // delete batch expedition line - if (!$error && $conf->productbatch->enabled) { + if (!$error && isModEnabled('productbatch')) { $shipmentlinebatch = new ExpeditionLineBatch($this->db); if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); @@ -2901,7 +2901,7 @@ class ExpeditionLigne extends CommonObjectLine // update lot - if (!empty($batch) && $conf->productbatch->enabled) { + if (!empty($batch) && isModEnabled('productbatch')) { dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch"); if (empty($batch_id) || empty($this->fk_product)) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 05831c5dd97..9daa03a3ec8 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index cdcfe74cb73..f7b3ddd5ac6 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -161,7 +161,7 @@ if (empty($reshook)) { // Get the real quantity in stock now, but before the stock move for inventory. $realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->real; - if ($conf->productbatch->enabled && $product_static->hasbatch()) { + if (isModEnabled('productbatch') && $product_static->hasbatch()) { $realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->detail_batch[$line->batch]->qty; } From 9cf33bb932cc1235ea3b3da6e2223a24910447b8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:41:12 +0200 Subject: [PATCH 246/507] update code --- htdocs/fichinter/card-rec.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 3f644b074bd..8ffcafcccc1 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -244,7 +244,7 @@ $companystatic = new Societe($db); if (!empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $projectstatic = new Project($db); } @@ -272,7 +272,7 @@ if ($action == 'create') { print dol_get_fiche_head(); $rowspan = 4; - if (!empty($conf->project->enabled) && $object->fk_project > 0) { + if (isModEnabled('project') && $object->fk_project > 0) { $rowspan++; } if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { @@ -314,7 +314,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $formproject = new FormProjets($db); print "".$langs->trans("Project").""; $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; @@ -484,7 +484,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $formproject = new FormProjets($db); $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; @@ -803,7 +803,7 @@ if ($action == 'create') { if (!empty($conf->contrat->enabled)) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right '); @@ -842,7 +842,7 @@ if ($action == 'create') { } print ''; } - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { print ''; if ($objp->fk_project > 0) { $projectstatic->fetch($objp->fk_project); From e13a276a2e45ea9806ce6d0d021a53a150c3433b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:42:34 +0200 Subject: [PATCH 247/507] update code --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e2b8ace4783..efe7a9e7088 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -511,7 +511,7 @@ $tabcond[25] = !empty($conf->website->enabled); //$tabcond[26]= isModEnabled("product"); $tabcond[27] = isModEnabled("societe"); $tabcond[28] = !empty($conf->holiday->enabled); -$tabcond[29] = !empty($conf->project->enabled); +$tabcond[29] = isModEnabled('project'); $tabcond[30] = !empty($conf->label->enabled); //$tabcond[31]= !empty($conf->accounting->enabled); $tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); From 93a441197049cb6d1709304bbd0df5b364fd65e8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:46:25 +0200 Subject: [PATCH 248/507] update code --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7f60b2260d7..651118d8c6a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -188,7 +188,7 @@ if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->re if (isModEnabled("societe") && !empty($user->rights->societe->lire)) { $elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty')); } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject')); } if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { From 4dbb6cfa6e8aecb3ccd0c8cbc13380ccb4c82ef9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:47:03 +0200 Subject: [PATCH 249/507] update code --- htdocs/bom/bom_agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d2c64eea0b6..3c2f3e732ba 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; From 04679ac000ae72feffabbae8b919b4fb525e0da7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:47:33 +0200 Subject: [PATCH 250/507] update code --- htdocs/bom/bom_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f088ae34050..c39711ce296 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; From 6e6b0d16cc04dc88f40434807cce885c95fcc49f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:48:00 +0200 Subject: [PATCH 251/507] update code --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ec8ebdd67e6..7c1d9da7e29 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -78,7 +78,7 @@ if (isModEnabled("expedition")) { if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); } if (!empty($conf->ficheinter->enabled)) { From 1ab949b3c45b72c34713aef6ece166936092cfab Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:48:32 +0200 Subject: [PATCH 252/507] update code --- htdocs/comm/action/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6f6ddc5383e..380c5813155 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1411,7 +1411,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $projectid = GETPOST('projectid', 'int'); @@ -1914,7 +1914,7 @@ if ($id > 0) { } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); print ''.$langs->trans("Project").''; @@ -1939,7 +1939,7 @@ if ($id > 0) { print ''; print ''.$langs->trans("LinkedObject").''; - if ($object->elementtype == 'task' && !empty($conf->project->enabled)) { + if ($object->elementtype == 'task' && isModEnabled('project')) { print ''; $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility @@ -2132,7 +2132,7 @@ if ($id > 0) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').' '; From da5fb7047356c223fde7da9824082c3348b2d281 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:49:06 +0200 Subject: [PATCH 253/507] update code --- htdocs/comm/action/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 90ed4ea1944..ada742f9742 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -159,7 +159,7 @@ if ($object->id > 0) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; From ece2f5553ae85c9e421a0f7d36d6a64f978eaa2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:49:10 +0200 Subject: [PATCH 254/507] fix php8 warnings --- htdocs/admin/dict.php | 18 +++++++++--------- htdocs/comm/card.php | 2 +- htdocs/contact/card.php | 8 ++++---- htdocs/contact/list.php | 14 +++++++------- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 4 ++-- htdocs/core/modules/modCategorie.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 8 ++++---- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/fourn/facture/card.php | 4 ++-- htdocs/hrm/index.php | 10 +++++----- htdocs/societe/card.php | 10 +++++----- htdocs/societe/website.php | 2 +- htdocs/user/bank.php | 8 ++++---- htdocs/user/card.php | 20 ++++++++++---------- htdocs/user/list.php | 2 +- htdocs/user/param_ihm.php | 2 +- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e2b8ace4783..ca5757dc452 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -506,24 +506,24 @@ $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW $tabcond[21] = isModEnabled("propal"); $tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); $tabcond[23] = true; -$tabcond[24] = !empty($conf->resource->enabled); -$tabcond[25] = !empty($conf->website->enabled); +$tabcond[24] = isModEnabled('resource'); +$tabcond[25] = isModEnabled('website'); //$tabcond[26]= isModEnabled("product"); $tabcond[27] = isModEnabled("societe"); -$tabcond[28] = !empty($conf->holiday->enabled); +$tabcond[28] = isModEnabled('holiday'); $tabcond[29] = !empty($conf->project->enabled); -$tabcond[30] = !empty($conf->label->enabled); +$tabcond[30] = isModEnabled('label'); //$tabcond[31]= !empty($conf->accounting->enabled); -$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); -$tabcond[33] = !empty($conf->hrm->enabled); -$tabcond[34] = !empty($conf->hrm->enabled); +$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); +$tabcond[33] = isModEnabled('hrm'); +$tabcond[34] = isModEnabled('hrm'); $tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[37] = isModEnabled("product"); -$tabcond[38] = !empty($conf->socialnetworks->enabled); +$tabcond[38] = isModEnabled('socialnetworks'); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); -$tabcond[41] = !empty($conf->intracommreport->enabled); +$tabcond[41] = isModEnabled('intracommreport'); $tabcond[42] = isModEnabled("product"); $tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[44] = isModEnabled('asset'); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ec8ebdd67e6..3e388677605 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -584,7 +584,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { // Transport mode by default print ''; print ''; @@ -1146,7 +1146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d5c0d333d03..6d66f70ceeb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -83,7 +83,7 @@ if (!empty($conf->mailing->enabled)) { } else { $search_no_email = -1; } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $search_[$key] = GETPOST("search_".$key, 'alpha'); @@ -221,7 +221,7 @@ $arrayfields['unsubscribed'] = array( 'enabled'=>(!empty($conf->mailing->enabled)), 'position'=>111); -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $arrayfields['p.'.$key] = array( @@ -289,7 +289,7 @@ if (empty($reshook)) { $search_fax = ""; $search_email = ""; $search_no_email = -1; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $search_[$key] = ""; @@ -499,7 +499,7 @@ if (strlen($search_phone_mobile)) { if (strlen($search_fax)) { $sql .= natural_search('p.fax', $search_fax); } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && strlen($search_[$key])) { $sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'"; @@ -880,7 +880,7 @@ if (!empty($arrayfields['unsubscribed']['checked'])) { print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); print ''; } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { if (!empty($arrayfields['p.'.$key]['checked'])) { @@ -1004,7 +1004,7 @@ if (!empty($arrayfields['p.email']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) { print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center '); } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder); @@ -1219,7 +1219,7 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5b5de36406a..2c438fdd98c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -968,7 +968,7 @@ abstract class CommonObject $outdone++; } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $outsocialnetwork = ''; if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 17235576394..a1446bf6964 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -124,7 +124,7 @@ function product_prepare_head($object) } // Tab to link resources - if (!empty($conf->resource->enabled)) { + if (isModEnabled('resource')) { if ($object->isProduct() && !empty($conf->global->RESOURCE_ON_PRODUCTS)) { $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&ref='.$object->ref; $head[$h][1] = $langs->trans("Resources"); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 65b512ec18e..19578ec9fe3 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -142,9 +142,9 @@ function user_prepare_head(User $object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'user'); if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read)) + || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read)) || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) - || (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) + || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) ) { // Bank $head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index e70cdad999e..2e31bdef7db 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -160,7 +160,7 @@ class modCategorie extends DolibarrModules if (isModEnabled('agenda')) { $typeexample .= ($typeexample ? " / " : "")."10=Agenda event"; } - if (!empty($conf->website->enabled)) { + if (isModEnabled('website')) { $typeexample .= ($typeexample ? " / " : "")."11=Website page"; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c11c37d11ef..7e7d010ed5d 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -520,7 +520,7 @@ class modSociete extends DolibarrModules $this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); } // Add social networks fields - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -693,7 +693,7 @@ class modSociete extends DolibarrModules 's.code_compta' => 'CustomerAccountancyCode', 's.code_compta_fournisseur' => 'SupplierAccountancyCode' ); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -757,7 +757,7 @@ class modSociete extends DolibarrModules 's.note_public' => "NotePublic" ); // Add social networks fields - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -835,7 +835,7 @@ class modSociete extends DolibarrModules 's.rowid' => 'Id', 's.lastname' => "Lastname", ); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 49bd25d0b90..c37ce4690f4 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -359,7 +359,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 6bbca0026e1..7572dd3f3d8 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -152,7 +152,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->expensereport->enabled)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } if (isModEnabled("banque")) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ddf54ba0727..f5ed12fd984 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2465,7 +2465,7 @@ if ($action == 'create') { } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7eb7f53d82..ff7c0051a29 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -215,7 +215,7 @@ if (empty($reshook)) { //$object->facebook = GETPOST("facebook", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); @@ -427,7 +427,7 @@ if (empty($reshook)) { //$object->facebook = GETPOST("facebook", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); @@ -859,7 +859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print '
'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'
'.$langs->trans('IntracommReportTransportMode').''; $form->selectTransportMode(GETPOSTISSET('transport_mode_id') ? GETPOST('transport_mode_id') : $transport_mode_id, 'transport_mode_id'); @@ -3137,7 +3137,7 @@ if ($action == 'create') { } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
'; print ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -1929,7 +1929,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -2287,7 +2287,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Social network - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 424d18c2058..b8111274969 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -249,7 +249,7 @@ print ''; print dol_get_fiche_end(); $newcardbutton = ''; -if (!empty($conf->website->enabled)) { +if (isModEnabled('website')) { if (!empty($user->rights->societe->lire)) { $newcardbutton .= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id)); } else { diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index fed40e6a1bd..0dd8a7f9d08 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } if (!empty($conf->expensereport->enabled)) { @@ -377,7 +377,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -1242,7 +1242,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($id, $childids)) || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // THM @@ -1514,7 +1514,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print ''; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -2721,7 +2721,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // Salary diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e98922f7e01..e22f95d1055 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -941,7 +941,7 @@ while ($i < $imaxinloop) { $canreadhrmdata = 0; if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($obj->rowid, $childids)) || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $canreadhrmdata = 1; } $canreadsecretapi = 0; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 49dc7e7f7a3..6d5a27cd8ba 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -192,7 +192,7 @@ if (isModEnabled("societe")) { if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } -if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) { +if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) { $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus } if (isModEnabled("product") || isModEnabled("service")) { From 1f3c39090732e396d852f54ab11d39f3eb23a0b8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:49:38 +0200 Subject: [PATCH 255/507] update code --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7fb2f0f129e..278096b3b75 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } From 990ff193aa5981058c4cf5354ae7b146b6981b67 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:50:12 +0200 Subject: [PATCH 256/507] update code --- htdocs/comm/action/info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 0ea24279df4..73acc0e7c82 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -86,7 +86,7 @@ $morehtmlref = '
'; // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; From 37a2cc3052ea3ae02694774879ae5443eb067b66 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:50:58 +0200 Subject: [PATCH 257/507] update code --- htdocs/comm/propal/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e02ff5d8875..3c93332ab29 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2010-2021 Philippe Grand + * Copyright (C) 2010-2022 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Florian Henry @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1574,7 +1574,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -1835,7 +1835,7 @@ if ($action == 'create') { print '
'; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); print ''; print ''; print ''; print ''; print '\n"; print "\n"; /* Disabled. Would be better to be managed with a user cookie -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { print ''; print ''; print ''; print '
'; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 861bde0fb51..dfa47df91a3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -47,7 +47,7 @@ if (!empty($conf->recruitment->enabled)) { require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php'; } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } @@ -79,7 +79,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; */ // Update sold -if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { +if (isModEnabled('holiday') && !empty($setupcompanynotcomplete)) { $holidaystatic = new Holiday($db); $result = $holidaystatic->updateBalance(); } @@ -112,7 +112,7 @@ if (!empty($setupcompanynotcomplete)) { print '
'; if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { + if (isModEnabled('holiday') && $user->rights->holiday->read) { $langs->load("holiday"); $listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP'); } @@ -150,7 +150,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { $holidaystatic = new Holiday($db); $user_id = $user->id; @@ -187,7 +187,7 @@ print '
'; // Latest leave requests -if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { +if (isModEnabled('holiday') && $user->rights->holiday->read) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,"; $sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 06fdbfba0a5..d5ccb96eaf7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -463,7 +463,7 @@ if (empty($reshook)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -1083,7 +1083,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -1600,7 +1600,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -407,7 +407,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))) { $langs->load("salaries"); // Salary @@ -635,7 +635,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Latest leave requests - if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) { + if (isModEnabled('holiday') && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) { $holiday = new Holiday($db); $sql = "SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday"; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c4e2715f664..45d7c91a8bb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -262,7 +262,7 @@ if (empty($reshook)) { $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $object->socialnetworks = array(); foreach ($socialnetworks as $key => $value) { if (GETPOST($key, 'alphanohtml')) { @@ -432,7 +432,7 @@ if (empty($reshook)) { $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $object->socialnetworks = array(); foreach ($socialnetworks as $key => $value) { if (GETPOST($key, 'alphanohtml')) { @@ -962,7 +962,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1128,7 +1128,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$langs->trans($value['label']).'
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1544,7 +1544,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // Salary @@ -2258,7 +2258,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -2507,7 +2507,7 @@ if ($action == 'create' || $action == 'adduserldap') { } print '
'.$langs->trans($value['label']).'
'.$langs->trans("Project").''; @@ -2267,7 +2267,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').''; if ($usercancreate) { From 1acc9bb99c0192765153a4052d50b241b46211e4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:51:32 +0200 Subject: [PATCH 258/507] update code --- htdocs/comm/propal/contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 52318684f42..2497ba905a8 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Patrick Rouillon * Copyright (C) 2005-2016 Destailleur Laurent * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2022 Philippe Grand * * 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 @@ -138,7 +138,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { From fa34b7ac204f133dbc55a4ba2ef25a1ee9b7c24b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:52:00 +0200 Subject: [PATCH 259/507] update code --- htdocs/comm/propal/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 35ab2e28b49..6f17c655e82 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -136,7 +136,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { From 50728f4b22641bc2e9120fa40ad9a9a7b433f348 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:52:34 +0200 Subject: [PATCH 260/507] update code --- htdocs/comm/propal/info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 92285183cf2..c67ec346ecb 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { From 97013cc956465bbd399c6b5935c813e6f1e2e56d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:53:29 +0200 Subject: [PATCH 261/507] update code --- htdocs/comm/propal/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6b717d3ea6f..f7e54d18fc1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -204,8 +204,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'p.ref'=>array('label'=>"Ref", 'checked'=>1), 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1), - 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), - 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)), + 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1)), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), 's.town'=>array('label'=>"Town", 'checked'=>-1), From 8d73d2ecd595dd0c5ee7840e5a997c64e5a79091 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:54:11 +0200 Subject: [PATCH 262/507] update code --- htdocs/comm/propal/note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 28819123cb0..2b007ab3fa0 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -108,7 +108,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { From 50e96a635687359f4c169e162eb45cc77576f0e3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:55:01 +0200 Subject: [PATCH 263/507] update code --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index aa7753946a7..9e4001c3274 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1364,7 +1364,7 @@ class Propal extends CommonObject $object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); $object->fk_delivery_address = ''; - /*if (!empty($conf->project->enabled)) + /*if (isModEnabled('project')) { $project = new Project($db); if ($this->fk_project > 0 && $project->fetch($this->fk_project)) { From f26b1cccdcae025d86bb61c40f048c37780bd317 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:55:54 +0200 Subject: [PATCH 264/507] update code --- htdocs/commande/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b97bf147dbb..f07f6d0ec43 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2022 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2012 Cedric Salvador @@ -52,7 +52,7 @@ if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -1569,7 +1569,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $formmargin = new FormMargin($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -1854,7 +1854,7 @@ if ($action == 'create' && $usercancreate) { // TODO How record was recorded OrderMode (llx_c_input_method) // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); print '
'.$langs->trans("Project").''; @@ -2327,7 +2327,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { From fc01cc66cdb53f895b341f5c1fceb2040eef42c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:55:55 +0200 Subject: [PATCH 265/507] fix php8 warnings --- htdocs/admin/dict.php | 18 +++++++------- htdocs/admin/fckeditor.php | 4 ++-- htdocs/admin/mails_templates.php | 8 +++---- htdocs/admin/stock.php | 6 ++--- htdocs/admin/workflow.php | 12 +++++----- htdocs/blockedlog/class/blockedlog.class.php | 2 +- .../comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/card.php | 20 ++++++++-------- htdocs/comm/index.php | 6 ++--- htdocs/comm/propal/card.php | 6 ++--- htdocs/commande/card.php | 2 +- htdocs/commande/index.php | 6 ++--- htdocs/commande/list.php | 2 +- htdocs/compta/facture/card.php | 2 +- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 4 ++-- htdocs/contact/consumption.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/core/boxes/box_activity.php | 2 +- .../boxes/box_graph_product_distribution.php | 4 ++-- htdocs/core/boxes/box_members_by_type.php | 2 +- .../core/boxes/box_members_last_modified.php | 2 +- .../boxes/box_members_last_subscriptions.php | 2 +- .../box_members_subscriptions_by_year.php | 2 +- htdocs/core/class/html.formmail.class.php | 8 +++---- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++--- htdocs/core/lib/ldap.lib.php | 4 ++-- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/project.lib.php | 12 +++++----- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/modules/modCategorie.class.php | 6 ++--- htdocs/core/modules/modStock.class.php | 4 ++-- .../doc/doc_generic_project_odt.modules.php | 4 ++-- .../task/doc/doc_generic_task_odt.modules.php | 4 ++-- .../stocktransfer/doc/pdf_eagle.modules.php | 4 ++-- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 4 ++-- ...e_20_modWorkflow_WorkflowManager.class.php | 8 +++---- htdocs/datapolicy/admin/setup.php | 2 +- htdocs/delivery/card.php | 4 ++-- htdocs/delivery/class/delivery.class.php | 2 +- htdocs/ecm/index_auto.php | 6 ++--- htdocs/ecm/search.php | 6 ++--- htdocs/expedition/card.php | 24 +++++++++---------- htdocs/expedition/class/expedition.class.php | 4 ++-- htdocs/expedition/contact.php | 4 ++-- htdocs/expedition/note.php | 2 +- htdocs/fourn/card.php | 4 ++-- .../class/fournisseur.commande.class.php | 2 +- .../fourn/class/fournisseur.product.class.php | 2 +- htdocs/fourn/commande/dispatch.php | 14 +++++------ htdocs/hrm/index.php | 10 ++++---- htdocs/install/upgrade2.php | 2 +- htdocs/main.inc.php | 4 ++-- htdocs/mrp/mo_movements.php | 6 ++--- htdocs/mrp/mo_production.php | 2 +- htdocs/product/card.php | 10 ++++---- htdocs/product/class/product.class.php | 6 ++--- htdocs/product/inventory/inventory.php | 12 +++++----- htdocs/product/list.php | 4 ++-- .../stock/class/mouvementstock.class.php | 8 +++---- htdocs/product/stock/index.php | 4 ++-- htdocs/product/stock/movement_card.php | 10 ++++---- htdocs/product/stock/movement_list.php | 10 ++++---- htdocs/product/stock/product.php | 16 ++++++------- htdocs/product/stock/productlot_document.php | 2 +- htdocs/product/stock/replenish.php | 2 +- .../product/stock/tpl/stocktransfer.tpl.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/projet/element.php | 14 +++++------ htdocs/projet/info.php | 2 +- htdocs/reception/card.php | 20 ++++++++-------- htdocs/reception/class/reception.class.php | 4 ++-- htdocs/reception/note.php | 2 +- .../canvas/actions_card_common.class.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/card.php | 8 +++---- htdocs/societe/class/societe.class.php | 6 ++--- htdocs/societe/consumption.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/societecontact.php | 2 +- htdocs/user/bank.php | 6 ++--- htdocs/user/card.php | 12 +++++----- htdocs/user/param_ihm.php | 6 ++--- htdocs/webhook/target_agenda.php | 4 ++-- htdocs/webservices/admin/index.php | 4 ++-- 90 files changed, 243 insertions(+), 243 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ca5757dc452..1db1afd124c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -487,24 +487,24 @@ $tabcond[1] = (isModEnabled("societe")); $tabcond[2] = true; $tabcond[3] = true; $tabcond[4] = true; -$tabcond[5] = (isModEnabled("societe") || !empty($conf->adherent->enabled)); +$tabcond[5] = (isModEnabled("societe") || isModEnabled('adherent')); $tabcond[6] = isModEnabled('agenda'); -$tabcond[7] = !empty($conf->tax->enabled); +$tabcond[7] = isModEnabled('tax'); $tabcond[8] = isModEnabled("societe"); $tabcond[9] = true; $tabcond[10] = true; $tabcond[11] = (isModEnabled("societe")); -$tabcond[12] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); -$tabcond[13] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); +$tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); +$tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[15] = true; $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); -$tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled)); +$tabcond[17] = (isModEnabled('deplacement') || isModEnabled('expensereport')); $tabcond[18] = isModEnabled("expedition") || isModEnabled("reception"); $tabcond[19] = isModEnabled("societe"); $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order"); $tabcond[21] = isModEnabled("propal"); -$tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); +$tabcond[22] = (isModEnabled('commande') || isModEnabled("propal")); $tabcond[23] = true; $tabcond[24] = isModEnabled('resource'); $tabcond[25] = isModEnabled('website'); @@ -517,15 +517,15 @@ $tabcond[30] = isModEnabled('label'); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[33] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm'); -$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); -$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); +$tabcond[35] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK); +$tabcond[36] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[37] = isModEnabled("product"); $tabcond[38] = isModEnabled('socialnetworks'); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[41] = isModEnabled('intracommreport'); $tabcond[42] = isModEnabled("product"); -$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; +$tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[44] = isModEnabled('asset'); // List of help for fields (no more used, help is defined into tabcomplete) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 04048ac83db..3c15fc9f48f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -63,10 +63,10 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), - 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled)), + 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), 'TICKET' => !empty($conf->ticket->enabled), ); // Picto diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7f60b2260d7..a60f3f407d1 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langsArray=array("errors", "admin", "mails", "languages"); -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $langsArray[]='members'; } if (!empty($conf->eventorganization->enabled)) { @@ -179,7 +179,7 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); -if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) { +if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) { $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); } if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { @@ -194,7 +194,7 @@ if (!empty($conf->project->enabled)) { if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { $elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); } -if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { +if (isModEnabled('commande') && !empty($user->rights->commande->lire)) { $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); } if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { @@ -224,7 +224,7 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); } -if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { +if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) { $elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport')); } if (isModEnabled('agenda')) { diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index ade62c29081..4103c8cd354 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -180,7 +180,7 @@ $formproduct = new FormProduct($db); $disabled = ''; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); $disabled = ' disabled'; print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); @@ -226,7 +226,7 @@ $found++; print '
'.$langs->trans("DeStockOnValidateOrder").''; -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); } else { @@ -763,7 +763,7 @@ print "
' . $langs->trans("ShowAllBatchByDefault") . ''; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index e1899b35a56..c4a8790896e 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -62,13 +62,13 @@ $workflowcodes = array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'family'=>'create', 'position'=>10, - 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), + 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( @@ -84,7 +84,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>30, - 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), 'picto'=>'propal', 'warning'=>'' ), @@ -100,19 +100,19 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, - 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, - 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')), 'picto'=>'order', 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 3ab2b63ad3f..ea9e5efca76 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -179,7 +179,7 @@ class BlockedLog } */ - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index db9f28c7763..50aaca466e2 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -201,7 +201,7 @@ class CActionComm if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) { $qualified = 1; } - if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { + if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3e388677605..267b84285ee 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -47,7 +47,7 @@ if (isModEnabled('facture')) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("expedition")) { @@ -56,7 +56,7 @@ if (isModEnabled("expedition")) { if (!empty($conf->contrat->enabled)) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->ficheinter->enabled)) { @@ -69,7 +69,7 @@ $langs->loadLangs(array('companies', 'banks')); if (!empty($conf->contrat->enabled)) { $langs->load("contracts"); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $langs->load("orders"); } if (isModEnabled("expedition")) { @@ -510,7 +510,7 @@ if ($object->id > 0) { } if ($object->client) { - if (!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { + if (isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { print ''."\n"; print '
'; @@ -621,7 +621,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $langs->load("users"); @@ -718,7 +718,7 @@ if ($object->id > 0) { } } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { // Box commandes $tmp = $object->getOutstandingOrders(); $outstandingOpened = $tmp['opened']; @@ -913,7 +913,7 @@ if ($object->id > 0) { /* * Latest orders */ - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $param =""; $sql = "SELECT s.nom, s.rowid"; @@ -1553,7 +1553,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status == 1) { + if (isModEnabled('commande') && $user->rights->commande->creer && $object->status == 1) { $langs->load("orders"); print ''; } @@ -1570,7 +1570,7 @@ if ($object->id > 0) { // Add invoice if ($user->socid == 0) { - if (!empty($conf->deplacement->enabled) && $object->status == 1) { + if (isModEnabled('deplacement') && $object->status == 1) { $langs->load("trips"); print ''; } @@ -1581,7 +1581,7 @@ if ($object->id > 0) { } else { $langs->loadLangs(array("orders", "bills")); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if ($object->client != 0 && $object->client != 2) { if (!empty($orders2invoice) && $orders2invoice > 0) { print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 9eb37d80799..419f85cb28f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -96,7 +96,7 @@ if (isModEnabled("propal")) { if (!empty($conf->supplier_proposal->enabled)) { $supplierproposalstatic = new SupplierProposal($db); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $orderstatic = new Commande($db); } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { @@ -323,7 +323,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa * Draft customer orders */ -if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { +if (isModEnabled('commande') && $user->rights->commande->lire) { $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -1007,7 +1007,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) { /* * Opened (validated) order */ -if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { +if (isModEnabled('commande') && $user->rights->commande->lire) { $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e02ff5d8875..a0b181230fa 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1792,7 +1792,7 @@ if ($action == 'create') { // Delivery delay print '
'.$langs->trans('AvailabilityPeriod'); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print ' ('.$langs->trans('AfterOrder').')'; } print ''; @@ -2441,7 +2441,7 @@ if ($action == 'create') { // Delivery delay print '
'; print ''; @@ -1498,7 +1498,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->commande->enabled) || isModEnabled("expedition")) { + if (isModEnabled('commande') || isModEnabled("expedition")) { print ''; } // Customer orders - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $nblines++; $ret = $product->load_stats_commande($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 8e514a505bf..ba71d22b7f8 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -125,9 +125,9 @@ function project_prepare_head(Project $project, $moreparam = '') } if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) - || isModEnabled("propal") || !empty($conf->commande->enabled) + || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('facture') || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { + || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -141,7 +141,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("propal")) { $nbElements += $project->getElementCount('propal', 'propal'); } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $nbElements += $project->getElementCount('order', 'commande'); } if (isModEnabled('facture')) { @@ -171,10 +171,10 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->mrp->enabled)) { $nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project'); } - if (!empty($conf->deplacement->enabled)) { + if (isModEnabled('deplacement')) { $nbElements += $project->getElementCount('trip', 'deplacement'); } - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $nbElements += $project->getElementCount('expensereport', 'expensereport'); } if (!empty($conf->don->enabled)) { @@ -183,7 +183,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->loan->enabled)) { $nbElements += $project->getElementCount('loan', 'loan'); } - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $nbElements += $project->getElementCount('chargesociales', 'chargesociales'); } if (!empty($conf->project->enabled)) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 19578ec9fe3..aef55e09bd6 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -143,7 +143,7 @@ function user_prepare_head(User $object) if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read)) - || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) + || (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) ) { // Bank diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 2e31bdef7db..73606987d9d 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules if (isModEnabled("societe")) { $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; } - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $typeexample .= ($typeexample ? " / " : "")."3=Member"; } if (isModEnabled("societe")) { @@ -297,7 +297,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_label[$r] = 'CatMemberList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->adherent->enabled)'; + $this->export_enabled[$r] = 'isModEnabled('adherent')'; $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); @@ -527,7 +527,7 @@ class modCategorie extends DolibarrModules } // 3 Members - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $r++; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_label[$r] = "CatMembersLinks"; // Translation key diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 7aa9abb3bff..87ea6303742 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -266,7 +266,7 @@ class modStock extends DolibarrModules $this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')'; // Export stock including batch number - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch @@ -340,7 +340,7 @@ class modStock extends DolibarrModules 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product' ); // We define here only fields that use another icon that the one defined into export_icon - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $this->export_fields_array[$r]['sm.batch'] = 'Batch'; $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; $this->export_entities_array[$r]['sm.batch'] = 'movement'; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 420dfd61909..beec387020a 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -46,7 +46,7 @@ if (isModEnabled('facture')) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -61,7 +61,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->ficheinter->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } if (isModEnabled('agenda')) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 8433aaa6331..07bd3ee03ab 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -47,7 +47,7 @@ if (isModEnabled('facture')) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -62,7 +62,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->ficheinter->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } if (isModEnabled('agenda')) { diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 7722698593c..87a6bcf0e38 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -531,7 +531,7 @@ class pdf_eagle extends ModelePdfStockTransfer $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut // Lot / série - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $pdf->SetXY($this->posxlot, $curY); $pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C'); } @@ -813,7 +813,7 @@ class pdf_eagle extends ModelePdfStockTransfer $pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); } - if (!empty($conf->productbatch->enabled) && $this->atLeastOneBatch) { + if (isModEnabled('productbatch') && $this->atLeastOneBatch) { $pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxlot, $tab_top + 1); diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 657d32a0a36..1615dbe87ed 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -30,7 +30,7 @@ print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'free')."

\n"; -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'order')."
\n"; @@ -96,7 +96,7 @@ if (!empty($conf->contrat->enabled)) { } print '
'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'membersubscription')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 9a8414c7a69..49f2873f472 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -71,7 +71,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Proposals to order if ($action == 'PROPAL_CLOSE_SIGNED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { + if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { $object->fetchObjectLinked(); if (!empty($object->linkedObjectsIds['commande'])) { setEventMessages($langs->trans("OrderExists"), null, 'warnings'); @@ -142,7 +142,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (!empty($conf->commande->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { + if (isModEnabled('commande') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -272,7 +272,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_PAYED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { + if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -296,7 +296,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && isModEnabled("expedition") && !empty($conf->workflow->enabled) && + if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) && ( (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 8f25461eb64..26b71ce60e1 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -50,7 +50,7 @@ if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) { 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), ); } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $arrayofparameters['Member'] = array( 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), ); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 108f81751b3..40d73b0f298 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -308,7 +308,7 @@ if ($action == 'create') { // Create. Seems to no be used * Delivery */ - if ($typeobject == 'commande' && $expedition->origin_id > 0 && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($expedition->origin_id); } @@ -400,7 +400,7 @@ if ($action == 'create') { // Create. Seems to no be used */ // Document origine - if ($typeobject == 'commande' && $expedition->origin_id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) { print '
'; $order = new Commande($db); $order->fetch($expedition->origin_id); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 9af06f87541..55f6293a9d2 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index c37ce4690f4..c7a4a570a5c 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -322,7 +322,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } if (isModEnabled('facture')) { @@ -338,7 +338,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) { $rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT"))); @@ -355,7 +355,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 7572dd3f3d8..ac986ad00f4 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -125,7 +125,7 @@ if (isModEnabled("propal")) { if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } if (isModEnabled('facture')) { @@ -140,7 +140,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } -if (!empty($conf->tax->enabled)) { +if (isModEnabled('tax')) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); } if (!empty($conf->project->enabled)) { @@ -149,7 +149,7 @@ if (!empty($conf->project->enabled)) { if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } if (isModEnabled('holiday')) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3a0a9869571..333c93fdfd7 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -53,7 +53,7 @@ if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -67,7 +67,7 @@ $langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders' if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -258,7 +258,7 @@ if (empty($reshook)) { $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number + if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; @@ -875,7 +875,7 @@ if ($action == 'create') { // Ref print ''."\n"; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Customer Categories print '"; // Contract - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load('contracts'); print ''; print ''; print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } if (!empty($conf->project->enabled)) { @@ -834,7 +834,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; // Contract - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load('contracts'); print ''; print ''; print '
'; - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); } else { print $langs->trans('AvailabilityPeriod'); @@ -2826,7 +2826,7 @@ if ($action == 'create') { } // Create a sale order - if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateorder) { print ''.$langs->trans("AddOrder").''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b97bf147dbb..c5b00c3c41e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -71,7 +71,7 @@ if (!empty($conf->incoterm->enabled)) { if (!empty($conf->margin->enabled)) { $langs->load('margins'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 57f61f3d9f7..9ee103911f7 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -92,7 +92,7 @@ if ($tmp) { /* * Draft orders */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -244,7 +244,7 @@ $max = 10; /* * Orders to process */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled)) { /* * Orders that are in process */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ba2f410cc9..84dafaba2e8 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2389,7 +2389,7 @@ if ($resql) { $stock_order = 0; $stock_order_supplier = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 839a61b2413..f9c6f4edd3e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2321,7 +2321,7 @@ if (empty($reshook)) { if (!$error) { // Add batchinfo if the detail_batch array is defined - if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 2c7ac145b78..a0834139bd2 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -191,7 +191,7 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index ff7c0051a29..d3b050e5e0b 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1225,7 +1225,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->load_ref_elements(); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande ? $object->ref_commande : (''.$langs->trans("NoContactForAnyOrder").''); print '
'; if (isModEnabled("expedition")) { print $langs->trans("ContactForOrdersOrShipments"); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fff1ba17644..569a155cc99 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -159,7 +159,7 @@ if ($object->thirdparty->client) { if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 439f312bef6..564122f3137 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2116,7 +2116,7 @@ if ($action == 'create') { } } - if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { + if (isModEnabled('commande') && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("orders"); if ($user->rights->commande->creer) { print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 12656518efc..20c2e814d82 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic = new Commande($this->db); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 42a77f14b9c..92a8b471e5f 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -214,7 +214,7 @@ class box_graph_product_distribution extends ModeleBoxes } } - if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { + if (isModEnabled('commande') && !empty($user->rights->commande->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { $langs->load("orders"); @@ -369,7 +369,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } - if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { + if (isModEnabled('commande') || !empty($user->rights->commande->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 23542999b47..2e25da59564 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 91ce3c93c36..52bc75e1fd1 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 39ae0140ca4..b5472b979a2 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 479d2424f09..716b8ed0482 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index f12acbe1901..0c5aa54b5ca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1630,7 +1630,7 @@ class FormMail extends Form if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { $tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; } if (!empty($conf->don->enabled)) { @@ -1639,7 +1639,7 @@ class FormMail extends Form if (isModEnabled('facture')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } if (!empty($conf->contrat->enabled)) { @@ -1647,7 +1647,7 @@ class FormMail extends Form } //Online payement link - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; } if (!empty($conf->don->enabled)) { @@ -1656,7 +1656,7 @@ class FormMail extends Form if (isModEnabled('facture')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index ad9c47f4c48..ad5c07e9a7e 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 32526574294..42d0d96f7a9 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2933,7 +2933,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $original_file = $conf->productbatch->multidir_output[$entity].'/'.$original_file; } } elseif ($modulepart == 'movement' || $modulepart == 'mouvement') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53204c4cc41..a0e57c173c8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2976,7 +2976,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); } - if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $type = 'AC_EMAIL'; $link = ''; if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) { @@ -3082,7 +3082,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor $htmllink .= '?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">'; $htmllink .= ''; $htmllink .= ''; - if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $addlink = 'AC_SKYPE'; $link = ''; if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) { @@ -7371,7 +7371,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } - if (!empty($conf->adherent->enabled) && (!is_object($object) || $object->element == 'adherent')) { + if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent')) { $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 7e173bd269e..94e14a90267 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -64,14 +64,14 @@ function ldap_prepare_head() $h++; } - if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { + if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][2] = 'members'; $h++; } - if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { + if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][2] = 'memberstypes'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 9a5e9ae56a5..9128be56ea1 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object) $h = 0; $head = array(); - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][2] = 'order'; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a1446bf6964..710b2462afa 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -417,7 +417,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("RefOrder").'
'; - if ($origin == 'commande' && !empty($conf->commande->enabled)) { + if ($origin == 'commande' && isModEnabled('commande')) { print $langs->trans("RefOrder"); } if ($origin == 'propal' && isModEnabled("propal")) { @@ -1033,7 +1033,7 @@ if ($action == 'create') { $i = 0; while ($i < $numAsked) { print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; } $i++; @@ -1552,7 +1552,7 @@ if ($action == 'create') { if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $disabled = ''; - if (!empty($conf->productbatch->enabled) && $product->hasbatch()) { + if (isModEnabled('productbatch') && $product->hasbatch()) { $disabled = 'disabled="disabled"'; } if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. @@ -1714,7 +1714,7 @@ if ($action == 'create') { $totalVolume = $tmparray['volume']; - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1779,7 +1779,7 @@ if ($action == 'create') { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; print ''; @@ -2062,7 +2062,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; } } @@ -2358,7 +2358,7 @@ if ($action == 'create') { } // Batch number managment - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (isset($lines[$i]->detail_batch)) { print ''; print ''; } // Supplier proposals - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { + if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $nblines++; $ret = $product->load_stats_proposal_supplier($socid); if ($ret < 0) { @@ -513,7 +513,7 @@ function show_stats_for_company($product, $socid) } // Contracts - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $nblines++; $ret = $product->load_stats_contrat($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ba71d22b7f8..3d0ab7f083d 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) || isModEnabled("propal") || isModEnabled('commande') - || isModEnabled('facture') || !empty($conf->contrat->enabled) + || isModEnabled('facture') || isModEnabled('contrat') || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts @@ -150,7 +150,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $nbElements += $project->getElementCount('proposal_supplier', 'supplier_proposal'); } if (isModEnabled("supplier_order")) { @@ -159,7 +159,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("supplier_invoice")) { $nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn'); } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $nbElements += $project->getElementCount('contract', 'contrat'); } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index beec387020a..29050c6b780 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -55,7 +55,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 07bd3ee03ab..35f00912143 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -56,7 +56,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 86292ec0ff4..07595012466 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -254,7 +254,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) { print ''."\n"; } -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Customer Categories print '
'; print $langs->trans("RefOrder").''; @@ -2048,7 +2048,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print $langs->trans("WarehouseSource").' - '; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print $langs->trans("Batch"); } print ''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''; @@ -2437,7 +2437,7 @@ if ($action == 'create') { if ($origin && $origin_id > 0) { $colspan++; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $colspan++; } if (!empty($conf->stock->enabled)) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ec7d7ff3cab..b1a767e197d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -965,7 +965,7 @@ class Expedition extends CommonObject } // If product need a batch number, we should not have called this function but addline_batch instead. - if (!empty($conf->productbatch->enabled) && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { + if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH'; return -4; } @@ -1716,7 +1716,7 @@ class Expedition extends CommonObject } // Detail of batch - if (!empty($conf->productbatch->enabled) && $obj->line_id > 0 && $obj->product_tobatch > 0) { + if (isModEnabled('productbatch') && $obj->line_id > 0 && $obj->product_tobatch > 0) { $newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product); if (is_array($newdetailbatch)) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 112d35a63aa..cdf6a982054 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -53,7 +53,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c794a227afa..b90b03a06cb 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index cbf961b8ff9..25b26c75852 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1173,7 +1173,7 @@ class ProductFournisseur extends Product $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); $label .= "
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 2f0f7966679..c7baf022d8e 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -46,7 +46,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks", "receptions")); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -721,7 +721,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -820,7 +820,7 @@ if ($id > 0 || !empty($ref)) { $linktoprod = $tmpproduct->getNomUrl(1); $linktoprod .= ' - '.$objp->label."\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($objp->tobatch) { // Product print ''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { + if (isModEnabled('productbatch') && $objp->tobatch > 0) { $type = 'batch'; print ''; // Qty to dispatch @@ -981,7 +981,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -1227,7 +1227,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($objp->batch) { include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; $lot = new Productlot($db); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index dfa47df91a3..a86783db2d3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -37,10 +37,10 @@ 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'; -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (!empty($conf->recruitment->enabled)) { @@ -116,11 +116,11 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel $langs->load("holiday"); $listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP'); } - if (!empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { + if (isModEnabled('deplacement') && $user->rights->deplacement->lire) { $langs->load("trips"); $listofsearchfields['search_deplacement'] = array('text'=>'ExpenseReport'); } - if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { + if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { $langs->load("trips"); $listofsearchfields['search_expensereport'] = array('text'=>'ExpenseReport'); } @@ -270,7 +270,7 @@ if (isModEnabled('holiday') && $user->rights->holiday->read) { // Latest expense report -if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { +if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,"; $sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a7216b6ad72..02b3ce48ca4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2024,7 +2024,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6a0fda06cb0..989e856b690 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2432,7 +2432,7 @@ function printDropdownQuickadd() "title" => "MenuNewMember@members", "name" => "Adherent@members", "picto" => "object_member", - "activation" => !empty($conf->adherent->enabled) && $user->hasRight("adherent", "write"), // vs hooking + "activation" => isModEnabled('adherent') && $user->hasRight("adherent", "write"), // vs hooking "position" => 5, ), array( @@ -2465,7 +2465,7 @@ function printDropdownQuickadd() "title" => "NewOrder@orders", "name" => "Order@orders", "picto" => "object_order", - "activation" => !empty($conf->commande->enabled) && $user->hasRight("commande", "write"), // vs hooking + "activation" => isModEnabled('commande') && $user->hasRight("commande", "write"), // vs hooking "position" => 40, ), array( diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 1384852ace8..19533e05c06 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -119,9 +119,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0f734df6ae9..88788da8b43 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -278,7 +278,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); $error++; } - if (!empty($conf->productbatch->enabled) && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { + if (isModEnabled('productbatch') && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); $error++; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5f0159ce567..d9b943fb40f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -62,7 +62,7 @@ if (isModEnabled("propal")) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -82,7 +82,7 @@ if (!empty($conf->stock->enabled)) { if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -1353,7 +1353,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Batch number management - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; @@ -944,7 +944,7 @@ if ($object->id > 0) { print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; @@ -1022,7 +1022,7 @@ if ($object->id > 0) { print $product_static->getNomUrl(1).' - '.$product_static->label; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print '"; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; /*if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -204,7 +204,7 @@ if ($resql) { print '\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 32c95537947..c31bbbc3101 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -44,7 +44,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -106,9 +106,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1), 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), - 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), @@ -273,7 +273,7 @@ if ($action == "transfert_stock" && !$cancel) { $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $product = new Product($db); $result = $product->fetch($product_id); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 9f097e1c4e3..d2639000270 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -45,7 +45,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -125,9 +125,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), @@ -448,7 +448,7 @@ if ($action == "transfert_stock" && !$cancel) { $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $product = new Product($db); $result = $product->fetch($product_id); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 51b12d4a6b1..ca3624fe147 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class.php'; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -56,7 +56,7 @@ if (!empty($conf->variants->enabled)) { // Load translation files required by the page $langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -248,7 +248,7 @@ if ($action == "correct_stock" && !$cancel) { $action = 'correction'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $object = new Product($db); $result = $object->fetch($id); @@ -345,7 +345,7 @@ if ($action == "transfert_stock" && !$cancel) { $error++; $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $object = new Product($db); $result = $object->fetch($id); @@ -761,7 +761,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
'; // Number of customer orders running - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if ($found) { $helpondiff .= '
'; } else { @@ -959,7 +959,7 @@ if (!$variants) { print ''; print ''; - if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { + if ((isModEnabled('productbatch')) && $object->hasbatch()) { $colspan = 3; print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -1216,7 +1216,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (!empty($product->status_batch)) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { @@ -1358,7 +1358,7 @@ if ($action == 'create') { $totalVolume = $tmparray['volume']; - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1427,7 +1427,7 @@ if ($action == 'create') { print '
'; $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index c8fc0ff35be..a6a6a1b0e3b 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 7234e54e8f1..9d5c5b70fe4 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->categorie->enabled)) { @@ -353,7 +353,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $langs->load("users"); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("Description").''.$langs->trans("batch_number").''.$langs->trans("SellByDate").''; @@ -869,7 +869,7 @@ if ($id > 0 || !empty($ref)) { // Already dispatched print ''.$products_dispatched[$objp->rowid].''; print ''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { + if (isModEnabled('productbatch') && $objp->tobatch > 0) { $type = 'batch'; print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); } else { @@ -1162,7 +1162,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("Product").''.$langs->trans("DateCreation").''.$langs->trans("DateDeliveryPlanned").''.$langs->trans("batch_number").''.$langs->trans("SellByDate").''.dol_print_date($db->jdate($objp->datec), 'day').''.dol_print_date($db->jdate($objp->date_delivery), 'day').'
'.$langs->trans("ManageLotSerial").''; $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); @@ -2368,7 +2368,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Batch number management (to batch) - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print '
'.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); @@ -2823,7 +2823,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == } // Commande - if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { + if (isModEnabled('commande') && $user->rights->commande->creer) { $commande = new Commande($db); $langs->load("orders"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1a157ed9171..360709dc5a0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4943,7 +4943,7 @@ class Product extends CommonObject $label .= '
'.$langs->trans('ProductLabel').': '.$this->label; } if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); $label .= "
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); } @@ -5141,7 +5141,7 @@ class Product extends CommonObject $labelStatus = $labelStatusShort = ''; $langs->load('products'); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -5456,7 +5456,7 @@ class Product extends CommonObject //dol_syslog("load_virtual_stock"); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $result = $this->load_stats_commande(0, '1,2', 1); if ($result < 0) { dol_print_error($this->db, $this->error); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index f7b3ddd5ac6..c1ef43c5c02 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -348,7 +348,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); } - if (!$error && !empty($conf->productbatch->enabled)) { + if (!$error && isModEnabled('productbatch')) { $tmpproduct = new Product($db); $result = $tmpproduct->fetch($fk_product); @@ -608,7 +608,7 @@ if ($object->id > 0) { if (!empty($conf->use_javascript_ajax)) { if ($permissiontoadd) { // Link to launch scan tool - if (isModEnabled('barcode') || !empty($conf->productbatch->enabled)) { + if (isModEnabled('barcode') || isModEnabled('productbatch')) { print ''.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").''; } @@ -906,7 +906,7 @@ if ($object->id > 0) { print '
'.$langs->trans("Warehouse").''.$langs->trans("Product").''; print $langs->trans("Batch"); print ''; print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOST('fk_product', 'int') : $object->fk_product), 'fk_product', '', 0, 0, -1, 2, '', 0, null, 0, '1', 0, 'maxwidth300'); print ''; print ''; print ''; $batch_static = new Productlot($db); $res = $batch_static->fetch(0, $product_static->id, $obj->batch); @@ -1039,7 +1039,7 @@ if ($object->id > 0) { $valuetoshow = $obj->qty_stock; // For inventory not yet close, we overwrite with the real value in stock now if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { - if (!empty($conf->productbatch->enabled) && $product_static->hasbatch()) { + if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 38c3c0c80ea..dcea4f4b8f7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -49,7 +49,7 @@ if (!empty($conf->categorie->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -238,7 +238,7 @@ $arrayfields = array( 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51), 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52), 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53), - 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60), + 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60), 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100), 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101), $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400), diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5653a564b9e..8edb3be32da 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -272,7 +272,7 @@ class MouvementStock extends CommonObject } // Test if product require batch data. If yes, and there is not or values are not correct, we throw an error. - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if (empty($batch)) { $langs->load("errors"); $this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref); @@ -384,7 +384,7 @@ class MouvementStock extends CommonObject // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { $foundforbatch = 0; $qtyisnotenough = 0; @@ -544,7 +544,7 @@ class MouvementStock extends CommonObject } // Update detail of stock for the lot. - if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if ($id_product_batch > 0) { $result = $this->createBatch($id_product_batch, $qty); } else { @@ -596,7 +596,7 @@ class MouvementStock extends CommonObject // End call triggers // Check unicity for serial numbered equipments once all movement were done. - if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty if ($this->getBatchCount($fk_product, $batch) > 1) { $error++; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 6efe9f0d9e8..0f9deb92772 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -164,7 +164,7 @@ if ($resql) { print "
'.$langs->trans("LastMovements", min($num, $max)).''.$langs->trans("Product").''.$langs->trans("Batch").''.$langs->trans("SellByDate").''; print $producttmp->getNomUrl(1); print "'; print $tmplotstatic->getNomUrl(0, 'nolink'); print '
'; if (!empty($conf->use_javascript_ajax)) { @@ -1029,7 +1029,7 @@ if (!$variants) { // Warehouse print ''; print $entrepotstatic->getNomUrl(1); - if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) { + if (!empty($conf->use_javascript_ajax) && isModEnabled('productbatch') && $object->hasbatch()) { print ''; print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); print ''; @@ -1096,7 +1096,7 @@ if (!$variants) { $totalvalue = $totalvalue + ($object->pmp * $obj->reel); $totalvaluesell = $totalvaluesell + ($object->price * $obj->reel); // Batch Detail - if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { + if ((isModEnabled('productbatch')) && $object->hasbatch()) { $details = Productbatch::findAll($db, $obj->product_stock_id, 0, $object->id); if ($details < 0) { dol_print_error($db); diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 89ba063e8d7..842aa83bd07 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -85,7 +85,7 @@ if ($id || $ref) { $object->fetch($id, $productid, $batch); $object->ref = $object->batch; // Old system for document management ( it uses $object->ref) - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart); $filearray = dol_dir_list($upload_dir, "files"); if (empty($filearray)) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index f2821eab8ce..1eb8a444d8a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -413,7 +413,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sql .= ', s.fk_product'; if ($usevirtualstock) { - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")"; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index f2ecfa1d73c..819fa404d52 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -93,7 +93,7 @@ print '
'.$langs->trans("NumberOfUnit").''; // Serial / Eat-by date -if (!empty($conf->productbatch->enabled) && +if (isModEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 246ae6b7ba8..bc182efa3f2 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1348,7 +1348,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("propal"); print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { + if (isModEnabled('commande') && $user->rights->commande->creer) { $langs->load("orders"); print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } @@ -1376,7 +1376,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("contracts"); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) { + if (isModEnabled('expensereport') && $user->rights->expensereport->creer) { $langs->load("trips"); print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a96ba8c2819..57583a538fb 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -46,7 +46,7 @@ if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (!empty($conf->supplier_proposal->enabled)) { @@ -67,10 +67,10 @@ if (!empty($conf->ficheinter->enabled)) { if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (isModEnabled('agenda')) { @@ -86,7 +86,7 @@ if (!empty($conf->loan->enabled)) { if (!empty($conf->stock->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; } -if (!empty($conf->tax->enabled)) { +if (isModEnabled('tax')) { require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; } if (isModEnabled("banque")) { @@ -107,7 +107,7 @@ $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $langs->load("orders"); } if (isModEnabled("propal")) { @@ -116,10 +116,10 @@ if (isModEnabled("propal")) { if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { $langs->load("trips"); } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { $langs->load("trips"); } if (!empty($conf->don->enabled)) { diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index e3532fb6471..8964cca8c19 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { } $object->info($object->id); } -$agenda = (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; +$agenda = (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; $title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 00f534a388c..6ca72ea2d97 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -54,7 +54,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -67,7 +67,7 @@ $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'order if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -626,7 +626,7 @@ if (empty($reshook)) { $line->qty = GETPOST($qty, 'int'); $line->comment = GETPOST($comment, 'alpha'); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $batch = "batch".$line_id; $dlc = "dlc".$line_id; $dluo = "dluo".$line_id; @@ -1041,7 +1041,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print ''.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'.$langs->trans("batch_number").''.$langs->trans("SellByDate").'
'; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; print ''; @@ -1721,7 +1721,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; } } @@ -1957,7 +1957,7 @@ if ($action == 'create') { } // Batch number managment - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (isset($lines[$i]->batch)) { print ''; print ' -adherent->enabled)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index bfbf6271711..98979c917d4 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -174,7 +174,7 @@ if ($this->control->tpl['action_delete']) { -adherent->enabled)) { ?> + diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d5ccb96eaf7..331fb58ae9c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -68,7 +68,7 @@ if (! empty($conf->eventorganization->enabled)) { $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $langs->load("members"); } if (!empty($conf->categorie->enabled)) { @@ -3035,7 +3035,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print ''; print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print ''; print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print ''; print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; // Tags-Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 267b84285ee..27391a4cd3d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -53,7 +53,7 @@ if (isModEnabled('commande')) { if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (isModEnabled('adherent')) { @@ -66,7 +66,7 @@ if (!empty($conf->ficheinter->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'banks')); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $langs->load("contracts"); } if (isModEnabled('commande')) { @@ -605,7 +605,7 @@ if ($object->id > 0) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load("categories"); print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $arrayselected = array(); print ''; print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; @@ -1471,7 +1471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print $langs->trans("RefOrder").''; @@ -1700,7 +1700,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print $langs->trans("WarehouseSource").' - '; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print $langs->trans("Batch"); } print ''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ceb71624292..85071a49b94 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } @@ -849,7 +849,7 @@ class Reception extends CommonObject // Check batch is set $product = new Product($this->db); $product->fetch($fk_product); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("errors"); if (!empty($product->status_batch) && empty($batch)) { $this->error = $langs->trans('ErrorProductNeedBatchNumber', $product->ref); diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index fadf222aa3e..cb2c84ebd76 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 5a26946913c..e71ee255981 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -342,7 +342,7 @@ abstract class ActionsCardCommon } // Linked member - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 0c6f2caf1e1..d1ba18f82fd 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -247,7 +247,7 @@ for ($i = 1; $i <= 4; $i++) { control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>
'.$langs->trans("LinkedToDolibarrMember").''; @@ -3108,7 +3108,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $adh = new Adherent($db); $result = $adh->fetch('', '', $object->id); if ($result == 0 && ($object->client == 1 || $object->client == 3) && !empty($conf->global->MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS)) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ee2d71f6d12..3f7bb239c51 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -214,8 +214,8 @@ class Societe extends CommonObject 'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305), 'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308), 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1), - 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), - 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), + 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), + 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330), 'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335), 'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340), @@ -1561,7 +1561,7 @@ class Societe extends CommonObject if (!$error && $nbrowsaffected) { // Update information on linked member if it is an update - if (!$nosyncmember && !empty($conf->adherent->enabled)) { + if (!$nosyncmember && isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; dol_syslog(get_class($this)."::update update linked member"); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 53408fd00ff..a8f250f29d5 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -170,7 +170,7 @@ if ($object->client) { if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 1bc64658735..14c1347c98c 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 5b9bd1046ef..f22a5fb440b 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -791,7 +791,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index a061933ba11..1767973a001 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { } // additionnal list with adherents of company - if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { + if (isModEnabled('adherent') && $user->rights->adherent->lire) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0dd8a7f9d08..2c6dd47b234 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (!empty($conf->salaries->enabled)) { @@ -361,7 +361,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -691,7 +691,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Latest expense report - if (!empty($conf->expensereport->enabled) && + if (isModEnabled('expensereport') && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { $exp = new ExpenseReport($db); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 45d7c91a8bb..7ae7bb70566 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (!empty($conf->ldap->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->categorie->enabled)) { @@ -950,7 +950,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1498,7 +1498,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1707,7 +1707,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; @@ -2239,7 +2239,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -2629,7 +2629,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 6d5a27cd8ba..1df44179461 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -192,19 +192,19 @@ if (isModEnabled("societe")) { if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } -if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) { +if (isModEnabled('holiday') || isModEnabled('expensereport')) { $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus } if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; } -if (isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { +if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) { $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea'; } if (isModEnabled('agenda')) { diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index ccc61d806af..a8d110eb081 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -227,7 +227,7 @@ if ($object->id > 0) { print '
'; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -237,7 +237,7 @@ if ($object->id > 0) { print '
'; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 97b8a4768a0..79d222f7e84 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -103,10 +103,10 @@ $webservices = array( 'thirdparty' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', - 'order' => '!empty($conf->commande->enabled)', + 'order' => 'isModEnabled('commande')', 'invoice' => 'isModEnabled("facture")', 'supplier_invoice' => 'isModEnabled("fournisseur")', - 'actioncomm' => '!empty($conf->agenda->enabled)', + 'actioncomm' => 'isModEnabled('agenda')', 'category' => '!empty($conf->categorie->enabled)', 'project' => '!empty($conf->project->enabled)', 'other' => '' From c86617c7b1d49e19eb780e7c35710647ae5ab1d2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:56:30 +0200 Subject: [PATCH 266/507] update code --- htdocs/commande/contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index c9ef518d1d0..1be1384df30 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Patrick Rouillon * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2022 Philippe Grand * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { From 18fba7a8e7114c8a7887cf8bbbff3c5470a4af8f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:56:58 +0200 Subject: [PATCH 267/507] update code --- htdocs/commande/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index af04389b8d9..501a803b697 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { From 6cf7a80ce3e887d05495af51f6a4006f16508e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:57:05 +0200 Subject: [PATCH 268/507] fix php8 warnings --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1db1afd124c..3503421d7fe 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2020-2022 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -496,7 +496,7 @@ $tabcond[10] = true; $tabcond[11] = (isModEnabled("societe")); $tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); -$tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); +$tabcond[14] = (isModEnabled("product") && (isModEnabled('ecotax') || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[15] = true; $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); $tabcond[17] = (isModEnabled('deplacement') || isModEnabled('expensereport')); From 1b7934062fb21c8f2bb1713c9843b2f2c65b154b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:57:27 +0200 Subject: [PATCH 269/507] update code --- htdocs/commande/info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 93b80b80f1c..396052082c5 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { From b04125f9f950b7a44dbdaef362015aaf8a9a1160 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:58:38 +0200 Subject: [PATCH 270/507] update code --- htdocs/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ba2f410cc9..03569128fe3 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -170,8 +170,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>20), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>25), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), From 52fed85676d5a9d945e2274ad95adb84bda7026d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 21:59:06 +0200 Subject: [PATCH 271/507] update code --- htdocs/commande/note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 934299377e5..2082e356797 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { From b5b9871c115461f293efec193e0aa5526aafa81c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:00:12 +0200 Subject: [PATCH 272/507] update code --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 688b0fd544b..4e7ab4802b7 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } From fd707eede1dc26203dd3b86b07930a3a32ca604a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:01:21 +0200 Subject: [PATCH 273/507] update code --- htdocs/compta/bank/various_payment/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 6644a81f62a..fe9bb032fa8 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -151,7 +151,7 @@ $arrayfields = array( 'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120), 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), - 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), + 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>isModEnabled('project')), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')), From e71692e7456bb82bf131c68b552ac81b5ef9f08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:02:31 +0200 Subject: [PATCH 274/507] fix php8 warnings --- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/mails_templates.php | 4 ++-- htdocs/admin/workflow.php | 2 +- htdocs/comm/action/card.php | 6 +++--- htdocs/comm/card.php | 8 ++++---- htdocs/comm/index.php | 6 +++--- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 4 ++-- htdocs/compta/facture/card.php | 2 +- .../stats/supplier_turnover_by_thirdparty.php | 2 +- .../canvas/actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 10 +++++----- htdocs/contact/consumption.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/core/class/html.formmail.class.php | 4 ++-- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/product.lib.php | 4 ++-- htdocs/core/lib/project.lib.php | 6 +++--- .../doc/doc_generic_project_odt.modules.php | 2 +- .../task/doc/doc_generic_task_odt.modules.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 6 +++--- htdocs/core/tpl/notes.tpl.php | 6 +++--- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 2 +- ...erface_20_modWorkflow_WorkflowManager.class.php | 2 +- htdocs/ecm/index_auto.php | 4 ++-- htdocs/ecm/search.php | 4 ++-- htdocs/expedition/list.php | 4 ++-- htdocs/fichinter/card-rec.php | 14 +++++++------- htdocs/fichinter/card.php | 4 ++-- htdocs/fichinter/list.php | 10 +++++----- htdocs/fourn/card.php | 8 ++++---- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/list.php | 4 ++-- .../knowledgemanagement/knowledgerecord_card.php | 4 ++-- .../knowledgemanagement/knowledgerecord_list.php | 4 ++-- htdocs/main.inc.php | 4 ++-- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 6 +++--- htdocs/product/index.php | 2 +- htdocs/product/inventory/list.php | 4 ++-- htdocs/product/list.php | 4 ++-- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/list.php | 10 +++++----- htdocs/projet/card.php | 6 +++--- htdocs/projet/element.php | 6 +++--- htdocs/projet/list.php | 10 +++++----- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/card.php | 12 ++++++------ htdocs/societe/consumption.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 4 ++-- htdocs/societe/paymentmodes.php | 2 +- htdocs/supplier_proposal/index.php | 4 ++-- htdocs/supplier_proposal/list.php | 2 +- htdocs/user/card.php | 8 ++++---- htdocs/user/list.php | 4 ++-- htdocs/user/param_ihm.php | 2 +- htdocs/webservices/admin/index.php | 2 +- htdocs/website/index.php | 8 ++++---- 77 files changed, 151 insertions(+), 151 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 3c15fc9f48f..3c3cd731a7d 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -63,7 +63,7 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index a60f3f407d1..f53e8c6b0d0 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -209,7 +209,7 @@ if (isModEnabled("reception")) { if (!empty($conf->ficheinter->enabled)) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); } if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) { @@ -218,7 +218,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande- if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } -if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { +if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index c4a8790896e..e29a351a705 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -123,7 +123,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array( 'family'=>'classify_supplier_proposal', 'position'=>60, - 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), + 'enabled'=>(isModEnabled('supplier_proposal') && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), 'picto'=>'supplier_proposal', 'warning'=>'' ), diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6f6ddc5383e..0d7953db900 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1362,7 +1362,7 @@ if ($action == 'create') { $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); @@ -1870,7 +1870,7 @@ if ($id > 0) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2285,7 +2285,7 @@ if ($id > 0) { } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1); print "
'.$langs->trans("CustomersCategoriesShort").''; @@ -1122,7 +1122,7 @@ if ($object->id > 0) { /* * Latest contracts */ - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,"; $sql .= " c.last_main_doc, c.model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 419f85cb28f..c2852cd45c9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -93,7 +93,7 @@ $companystatic = new Societe($db); if (isModEnabled("propal")) { $propalstatic = new Propal($db); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $supplierproposalstatic = new SupplierProposal($db); } if (isModEnabled('commande')) { @@ -226,7 +226,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) { * Draft supplier proposals */ -if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { +if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -810,7 +810,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM /* * Latest contracts */ -if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT $staticcontrat = new Contrat($db); $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index bd052f4161e..8f0a2b38c7d 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('mails', 'companies')); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index eb1b50cee1b..ed1fa3f523e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -980,7 +980,7 @@ if ($action == 'create') { } if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { - if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { + if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { print ''.$langs->trans("EditWithEditor").''; } else { print ''.$langs->trans("EditWithTextEditor").''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a0b181230fa..f0e1e57249e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2850,7 +2850,7 @@ if ($action == 'create') { } // Create contract - if (!empty($conf->contrat->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6b717d3ea6f..31c4489d47f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1057,7 +1057,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view products - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1065,7 +1065,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1); $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c5b00c3c41e..507a24fd758 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2836,7 +2836,7 @@ if ($action == 'create' && $usercancreate) { } // Create contract - if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { + if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); if ($user->hasRight('contrat', 'creer')) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 84dafaba2e8..7acd7c78261 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1343,7 +1343,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1351,7 +1351,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f9c6f4edd3e..04c6df7ff1e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5511,7 +5511,7 @@ if ($action == 'create') { // Create contract if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) { - if (!empty($conf->contrat->enabled) && $object->statut == Facture::STATUS_VALIDATED) { + if (isModEnabled('contrat') && $object->statut == Facture::STATUS_VALIDATED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 2a405ba870f..28e932dcb4a 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -587,7 +587,7 @@ if (count($amount)) { // Other stats print '
'; - if (!empty($conf->supplier_proposal->enabled) && $key > 0) { + if (isModEnabled('supplier_proposal') && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) { diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index a0834139bd2..c4bfc127262 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -201,7 +201,7 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $i++; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d3b050e5e0b..3028a3719f1 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -892,7 +892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); @@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; @@ -1237,7 +1237,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").''); print '
'; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''; print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 569a155cc99..e4cc743159e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -165,7 +165,7 @@ if ($object->thirdparty->client) { if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6d66f70ceeb..ec56b4f7c2a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -734,7 +734,7 @@ if ($search_firstlast_only) { } $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ContactCategoriesShort'); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 62b60d9a091..d537934a299 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -239,7 +239,7 @@ print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); @@ -1514,7 +1514,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print '

"; // Draft contracts -if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { +if (isModEnabled('contrat') && $user->rights->contrat->lire) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 5ceec0a4cb9..0630f664b8d 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -571,7 +571,7 @@ if ($user->rights->user->user->lire) { $moreforfilter .= ''; } // If the user can view categories of products -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2c438fdd98c..a16881cd61e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6902,7 +6902,7 @@ abstract class CommonObject } elseif (preg_match('/^html/', $type)) { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss); } else { $out = ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 2be0c36c56c..b529d23ebda 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -152,7 +152,7 @@ class DolEditor $out .= htmlspecialchars($this->content); $out .= ''; - if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) { + if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && isModEnabled('fckeditor')) { if (!defined('REQUIRE_CKEDITOR')) { define('REQUIRE_CKEDITOR', '1'); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..cea529726e5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1098,7 +1098,7 @@ class ExtraFields } elseif ($type == 'html') { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $out = $doleditor->Create(1); } else { $out = ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c2f17314c81..1ecd05cc3a5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -529,7 +529,7 @@ class Form $savemethod = $tmp[4]; } - if (!empty($conf->fckeditor->enabled)) { + if (isModEnabled('fckeditor')) { $out .= ''."\n"; } else { $inputType = 'textarea'; @@ -8721,7 +8721,7 @@ class Form 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array( - 'enabled'=>(!empty($conf->supplier_proposal->enabled) ? $conf->supplier_proposal->enabled : 0), + 'enabled'=>(isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0), 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0c5aa54b5ca..80e69a39532 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1642,7 +1642,7 @@ class FormMail extends Form if (isModEnabled('commande')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine'; } @@ -1659,7 +1659,7 @@ class FormMail extends Form if (isModEnabled('commande')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine'; } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6ba3ca18094..9b1c46d7c53 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -128,7 +128,7 @@ function societe_prepare_head(Societe $object) } } $supplier_module_enabled = 0; - if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $supplier_module_enabled = 1; } if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a0e57c173c8..dcecd69769b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7405,7 +7405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__'; $substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/ } - if (!empty($conf->contrat->enabled) && (!is_object($object) || $object->element == 'contract')) { + if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract')) { $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ca9bfcfe0e4..91e0b382b44 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1605,7 +1605,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; // Add an additional description for the category products - if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) { + if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && isModEnabled('categorie')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categstatic = new Categorie($db); // recovering the list of all the categories linked to product diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 710b2462afa..56cb195060b 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -398,7 +398,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("CustomersCategoryShort"); if (!empty($array_query['cust_categ'])) { @@ -451,7 +451,7 @@ print '
'; print '
'."\n"; print '
'.$langs->trans("ContactCategoriesShort"); if (!empty($array_query['contact_categ'])) { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index e0f0c5d9142..1110e91b019 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -94,17 +94,17 @@ if ($module == 'propal') { } //else dol_print_error('','Bad value '.$module.' for param module'); -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdata = 'textarea:12:95%'; } -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdatapub = 'textarea:12:95%'; } -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { $typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdatapriv = 'textarea:12:95%'; diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 1615dbe87ed..611c556d98c 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -74,7 +74,7 @@ if (isModEnabled('facture')) { } print '
'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'contractline')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 49f2873f472..73312ec52cf 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -222,7 +222,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } // Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set. - if (!empty($conf->supplier_proposal->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { + if (isModEnabled('supplier_proposal') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { $object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index c7a4a570a5c..70e22db92a2 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -319,7 +319,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } if (isModEnabled('commande')) { @@ -328,7 +328,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index ac986ad00f4..bb22566ef1e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -122,7 +122,7 @@ if (isModEnabled("societe")) { if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } if (isModEnabled('commande')) { @@ -131,7 +131,7 @@ if (isModEnabled('commande')) { if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index adc80e27b64..b693800e253 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -577,7 +577,7 @@ if ($user->rights->user->user->lire) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -588,7 +588,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use $moreforfilter .= '
'; } -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 3f644b074bd..3d10693d4e1 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -41,7 +41,7 @@ if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; } @@ -241,7 +241,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url); $form = new Form($db); $companystatic = new Societe($db); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $contratstatic = new Contrat($db); } if (!empty($conf->project->enabled)) { @@ -275,7 +275,7 @@ if ($action == 'create') { if (!empty($conf->project->enabled) && $object->fk_project > 0) { $rowspan++; } - if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { + if (isModEnabled('contrat') && $object->fk_contrat > 0) { $rowspan++; } @@ -328,7 +328,7 @@ if ($action == 'create') { } // Contrat - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $formcontract = new FormContract($db); print "
".$langs->trans("Contract").""; $contractid = GETPOST('contractid') ?GETPOST('contractid') : $object->fk_contract; @@ -539,7 +539,7 @@ if ($action == 'create') { print '
'.$langs->trans("Description").''.nl2br($object->description)."
'; @@ -800,7 +800,7 @@ if ($action == 'create') { print '
'.$langs->trans("None").''; if ($objp->fk_contrat > 0) { $contratstatic->fetch($objp->fk_contrat); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e2d03790f78..1c83726f7e6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -784,7 +784,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $formcontract = new FormContract($db); } if (!empty($conf->project->enabled)) { @@ -1233,7 +1233,7 @@ if ($action == 'create') { print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d8bb62f6b5d..52af477741d 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } @@ -46,7 +46,7 @@ $langs->loadLangs(array('companies', 'bills', 'interventions')); if (!empty($conf->project->enabled)) { $langs->load("projects"); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $langs->load("contracts"); } @@ -205,7 +205,7 @@ $companystatic = new Societe($db); if (!empty($conf->project->enabled)) { $projetstatic = new Project($db); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $contratstatic = new Contrat($db); } @@ -237,7 +237,7 @@ $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.s if (!empty($conf->project->enabled)) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier"; } // Add fields from extrafields @@ -254,7 +254,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9d5c5b70fe4..9a7a3d7dcc0 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -340,7 +340,7 @@ if ($object->id > 0) { } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); print '
'.$langs->trans("SuppliersCategoriesShort").''; @@ -387,7 +387,7 @@ if ($object->id > 0) { $boxstat .= ''; $boxstat .= '"; //} - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire)) - || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { + || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) { // Supplier print ''; print ''; print ''; print ''; print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load('categories'); if (!GETPOSTISSET('categories')) { @@ -4270,7 +4270,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print '
'; print '
'; print $langs->trans("Category"); @@ -4404,7 +4404,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = // Categories - Tags print '
"; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load('projects'); $formproject = new FormProjets($db); @@ -1368,7 +1368,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { From 4e390dd29c26b006d9d3bf587e0fd366ee520861 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:07:15 +0200 Subject: [PATCH 282/507] update code --- htdocs/contrat/contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 1bd9d3388f6..1866fb24c3e 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { From 0f080269f1b6b0c397cebea879990a29b28ac7b9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:07:45 +0200 Subject: [PATCH 283/507] update code --- htdocs/contrat/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index ce386fe21b9..7f38e9561a4 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -144,7 +144,7 @@ if ($object->id) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { From 42597a3ff3958e4fa102a30a6f5752ea9497bbac Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:08:12 +0200 Subject: [PATCH 284/507] update code --- htdocs/contrat/note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 540491698c1..547604d9f4d 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { From e6be63c50a327eca29f199c72547e342ddc1e7c3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:08:38 +0200 Subject: [PATCH 285/507] update code --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 088d8f9b6d5..9a6326db10c 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -233,7 +233,7 @@ class Contrat extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>75), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>isModEnabled('project'), 'visible'=>-1, 'position'=>75), 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), From 7a6e8d82d578d95d0b2dc93fd6e50bbf6b019e58 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:09:11 +0200 Subject: [PATCH 286/507] update code --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3f74ba7fdb2..2854a631e42 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -456,7 +456,7 @@ if (!$error && $massaction == 'confirm_presend') { //var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref); foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object // Make substitution in email content - if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { + if (isModEnabled('project') && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { $objecttmp->fetch_projet(); } $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp); From 2d2d2546de6546844b6be6a73cb44e3957c3eeff Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:10:05 +0200 Subject: [PATCH 287/507] update code --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 83071830ae7..fbf148c8d1b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -622,7 +622,7 @@ class FormTicket } if ($subelement != 'project') { - if (!empty($conf->project->enabled) && !$this->ispublic) { + if (isModEnabled('project') && !$this->ispublic) { $formproject = new FormProjets($this->db); print '
\n"; print ''; print ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 16500c62d59..dbcc9cfdade 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -137,7 +137,7 @@ foreach ($modulesdir as $dir) { } // We discard modules according to property disabled - //if (! empty($objMod->hidden)) $modulequalified=0; + //if (!empty($objMod->hidden)) $modulequalified=0; if ($modulequalified > 0) { $publisher = dol_escape_htmltag($objMod->getPublisher()); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 997c71bb335..eb918086720 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -378,7 +378,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index f534ff881da..3468c997a58 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -471,7 +471,7 @@ print '\n\n"; $found++; -//if (! empty($conf->expedition->enabled)) +//if (!empty($conf->expedition->enabled)) //{ print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 9482a06be41..0204f184de7 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -468,7 +468,7 @@ if (isModEnabled('banque')) { print '
'; - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { // Box proposals $tmp = $object->getOutstandingProposals('supplier'); $outstandingOpened = $tmp['opened']; @@ -842,7 +842,7 @@ if ($object->id > 0) { print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('ThirdPartyIsClosed'), 'default', $_SERVER['PHP_SELF'].'#', '', false); } - if (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->creer)) { + if (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->creer)) { $langs->load("supplier_proposal"); if ($object->status == 1) { print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, ''); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 67ec98e3c96..769d8c451da 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } if (isModEnabled("product")) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5676cd4aae3..c6401b0a70a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1227,7 +1227,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 47e6786f2f0..e7f1785cb95 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -900,7 +900,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -909,7 +909,7 @@ if ($resql) { $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('SuppliersCategoriesShort'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 66b7b0ca160..8da0dd34b92 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -189,7 +189,7 @@ if ($action == 'create') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -236,7 +236,7 @@ if (($id || $ref) && $action == 'edit') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 18ec0d67738..ff28b79a4ad 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; // for other modules -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -475,7 +475,7 @@ $moreforfilter.= '
';*/ // Filter on categories $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 1); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 989e856b690..a2098b11a8f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2481,7 +2481,7 @@ function printDropdownQuickadd() "title" => "NewContractSubscription@contracts", "name" => "Contract@contracts", "picto" => "object_contract", - "activation" => !empty($conf->contrat->enabled) && $user->hasRight("contrat", "write"), // vs hooking + "activation" => isModEnabled('contrat') && $user->hasRight("contrat", "write"), // vs hooking "position" => 60, ), array( @@ -2489,7 +2489,7 @@ function printDropdownQuickadd() "title" => "SupplierProposalNew@supplier_proposal", "name" => "SupplierProposal@supplier_proposal", "picto" => "supplier_proposal", - "activation" => !empty($conf->supplier_proposal->enabled) && $user->hasRight("supplier_invoice", "write"), // vs hooking + "activation" => isModEnabled('supplier_proposal') && $user->hasRight("supplier_invoice", "write"), // vs hooking "position" => 70, ), array( diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d9b943fb40f..fd107c06351 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1615,7 +1615,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index e6a3b3171bc..3018312cd0e 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -179,7 +179,7 @@ if ($action == 'search') { } $sql .= natural_search($params, $key); } - if (!empty($conf->categorie->enabled) && !empty($parent) && $parent != -1) { + if (isModEnabled('categorie') && !empty($parent) && $parent != -1) { $sql .= " AND cp.fk_categorie ='".$db->escape($parent)."'"; } $sql .= " ORDER BY p.ref ASC"; @@ -590,7 +590,7 @@ if ($id > 0 || !empty($ref)) { print '
'; $rowspan = 1; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $rowspan++; } @@ -603,7 +603,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans("KeywordFilter").': '; print '   '; print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'.$langs->trans("CategoryFilter").': '; print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent, 'parent').'  
'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index e976e176224..4e90371a3f4 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod } -if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { +if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'; print '
'; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 553f4ed8baa..00f440f1990 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -464,7 +464,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; $tmptitle = $langs->transnoentities('ProductsCategoriesShort'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dcea4f4b8f7..6028a0a871d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -820,7 +820,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 10e70545af6..5585b8221a2 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -328,7 +328,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index a39dc246772..14d9815361d 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -481,7 +481,7 @@ if ($search_categ > 0) { // Filter on categories $moreforfilter = ''; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b4730778d32..43fb04b1ad3 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -378,7 +378,7 @@ if ($action == 'create') { // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index cc94ae303ec..f182cf1847b 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -53,7 +53,7 @@ $search_ref = GETPOST("sref", "alpha") ?GETPOST("sref", "alpha") : GETPOST("sear $search_label = GETPOST("snom", "alpha") ?GETPOST("snom", "alpha") : GETPOST("search_label", "alpha"); $search_status = GETPOST("search_status", "int"); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_WAREHOUSE."_list", "array"); } @@ -226,7 +226,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_WAREHOUSE, "t.rowid"); } if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -242,7 +242,7 @@ if ($separatedPMP) { $sql .= " WHERE t.entity IN (".getEntity('stock').")"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_WAREHOUSE, "t.rowid", $search_category_list); } foreach ($search as $key => $val) { @@ -419,7 +419,7 @@ if ($search_all) { $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list); } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index bc182efa3f2..8008ed4780f 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -714,7 +714,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $doleditor->Create(); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1356,7 +1356,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("bills"); print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) { + if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->creer) { $langs->load("supplier_proposal"); print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } @@ -1372,7 +1372,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("interventions"); print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) { + if (isModEnabled('contrat') && $user->rights->contrat->creer) { $langs->load("contracts"); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 57583a538fb..cf5c8fbde86 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -49,7 +49,7 @@ if (isModEnabled('facture')) { if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { @@ -95,7 +95,7 @@ if (isModEnabled("banque")) { if (!empty($conf->salaries->enabled)) { require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->mrp->enabled)) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 7cfb66288e1..7deaf0a1870 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -148,7 +148,7 @@ if ($search_status == '') { $search_status = -1; // -1 or 1 } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } @@ -413,7 +413,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); } if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -436,7 +436,7 @@ if ($search_project_contact > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp_contact"; } $sql .= " WHERE p.entity IN (".getEntity('project').')'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_array); } if (empty($user->rights->projet->all->lire)) { @@ -859,7 +859,7 @@ if ($user->rights->user->user->lire) { } // Filter on categories -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array); } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 018cb5c3408..de9bdf7855c 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 5a91f47dbd9..a25b44082a0 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -671,7 +671,7 @@ if ($search_all) { $moreforfilter = ''; // Filter on categories -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d803162afc4..c1152510cca 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -542,7 +542,7 @@ if ($action == 'confirm_generateinvoice') { $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note if (!empty($withdetail)) { - if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { + if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { $arrayoftasks[$object->timespent_id]['note'] .= "
"; } else { $arrayoftasks[$object->timespent_id]['note'] .= "\n"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 331fb58ae9c..2467d9959bc 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -71,7 +71,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (isModEnabled('adherent')) { $langs->load("members"); } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } if (!empty($conf->incoterm->enabled)) { @@ -1477,7 +1477,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; @@ -1762,7 +1762,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load('categories'); // Customer @@ -2177,7 +2177,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Supplier if (((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) - || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { + || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; @@ -2463,7 +2463,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Customer print '
'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).''; @@ -2888,7 +2888,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Tags / categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Customer if ($object->prospect || $object->client || !empty($conf->global->THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT)) { print ''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index a8f250f29d5..58f568b6f6a 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -176,7 +176,7 @@ if ($object->client) { if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 14c1347c98c..313947cbb0e 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -50,7 +50,7 @@ if (isModEnabled('adherent')) { // Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } if (!empty($conf->incoterm->enabled)) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c90dc1537d1..1d0bdfe39a1 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -199,7 +199,7 @@ $thirdpartygraph .= '
'.$langs->trans("CustomersCategoriesShort").'
'; $thirdpartygraph .= ''; $thirdpartycateggraph = ''; -if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { +if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c8f0045d619..ff6de888284 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -979,7 +979,7 @@ if ($search_all) { // Filter on categories $moreforfilter = ''; if (empty($type) || $type == 'c' || $type == 'p') { - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); @@ -990,7 +990,7 @@ if (empty($type) || $type == 'c' || $type == 'p') { } if (empty($type) || $type == 'f') { - if (isModEnabled("fournisseur") && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index f22a5fb440b..02d58d0dfe3 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -797,7 +797,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index f151651d186..6fd6480105b 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -162,7 +162,7 @@ if ($resql) { /* * Draft askprice */ -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -297,7 +297,7 @@ if ($resql) { /* * Opened askprice */ -if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { +if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $langs->load("supplier_proposal"); $now = dol_now(); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 03de4f7ecca..6a8ad41dbd2 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -644,7 +644,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view products - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7ae7bb70566..3b8b401f372 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -54,7 +54,7 @@ if (!empty($conf->ldap->enabled)) { if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->stock->enabled)) { @@ -1171,7 +1171,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%'); @@ -1627,7 +1627,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); @@ -2575,7 +2575,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e22f95d1055..858a46887ba 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -658,7 +658,7 @@ $moreforfilter = ''; $moreforfilter.= '';*/ // Filter on categories -if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { +if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('Category'); $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 1df44179461..40c39ba3879 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -198,7 +198,7 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) { if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; } -if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { +if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || isModEnabled('contrat')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) { diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 79d222f7e84..9214b4ad392 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -107,7 +107,7 @@ $webservices = array( 'invoice' => 'isModEnabled("facture")', 'supplier_invoice' => 'isModEnabled("fournisseur")', 'actioncomm' => 'isModEnabled('agenda')', - 'category' => '!empty($conf->categorie->enabled)', + 'category' => 'isModEnabled('categorie')', 'project' => '!empty($conf->project->enabled)', 'other' => '' ); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0b599ba640b..e83ea15a34d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2767,7 +2767,7 @@ if (!GETPOST('hide_websitemenu')) { print dolButtonToOpenUrlInDialogPopup('file_manager', $langs->transnoentitiesnoconv("MediaFiles"), '', '/website/index.php?action=file_manager&website='.urlencode($website->ref).'§ion_dir='.urlencode('image/'.$website->ref.'/'), $disabled); - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { //print ''; print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), '', '/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.urlencode($website->ref), $disabled); } @@ -3948,7 +3948,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print '
'; - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Get current categories $existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object'); if (is_array($existing)) { From 628ed5495571e8463da5ac35b1b6af32b58c0ba8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:02:34 +0200 Subject: [PATCH 275/507] update code --- htdocs/comm/propal/class/propal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9e4001c3274..3bb8a5b44de 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2010-2017 Philippe Grand + * Copyright (C) 2010-2022 Philippe Grand * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry @@ -297,7 +297,7 @@ class Propal extends CommonObject 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>23), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>24), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>isModEnabled('project'), 'visible'=>-1, 'position'=>24), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60), From 81c13bcc4c84959ee05df21256b58a0687cce1b1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:03:33 +0200 Subject: [PATCH 276/507] update code --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index bf97deb3fd8..10cd8357e21 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -314,7 +314,7 @@ class Commande extends CommonOrder 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>isModEnabled('project'), 'visible'=>-1, 'position'=>25), 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65), From b0ec6adf6b30288019ea91ecaba89a6d1eb892d8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:04:45 +0200 Subject: [PATCH 277/507] update code --- htdocs/compta/sociales/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 520f074a0c1..f36694bb3b2 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -100,7 +100,7 @@ $arrayfields = array( 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled('project'))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), From d44a75d7c9f05a8edfc332dc6c19dcc77d20f78b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:05:18 +0200 Subject: [PATCH 278/507] update code --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f15f65954cf..2809b586ea1 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -181,7 +181,7 @@ class FactureRec extends CommonInvoice 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>isModEnabled('project'), 'visible'=>-1, 'position'=>85), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), From 8a73872130ac3d8a1130873119c80d2f8178843b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:05:44 +0200 Subject: [PATCH 279/507] update code --- htdocs/compta/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 51257583ef7..5e8507e7229 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -215,8 +215,8 @@ $arrayfields = array( 'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22), 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25), 'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>40), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>41), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>40), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), From 7929f752dcaff04eeb33baa129fb45cf6201baee Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:06:11 +0200 Subject: [PATCH 280/507] update code --- htdocs/contrat/agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index a8dc5e7ee3b..da28bdca8bf 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -110,7 +110,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -171,7 +171,7 @@ if ($id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { From d8a25f1b9dae8c14520d21021056aea120bf16bc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:06:49 +0200 Subject: [PATCH 281/507] update code --- htdocs/contrat/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 439f312bef6..2b724d006d7 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1045,7 +1045,7 @@ llxHeader('', $langs->trans("Contract"), $help_url); $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -1204,7 +1204,7 @@ if ($action == 'create') { print "
'; print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); From 033597082017a7f4e51f20b057ad8e8bf5f483a8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:10:38 +0200 Subject: [PATCH 288/507] update code --- htdocs/core/lib/company.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6ba3ca18094..b6900ae22b5 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -138,7 +138,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (!empty($conf->project->enabled) && (!empty($user->rights->projet->lire))) { + if (isModEnabled('project') && (!empty($user->rights->projet->lire))) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -781,11 +781,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $i = -1; - if (!empty($conf->project->enabled) && $user->rights->projet->lire) { + if (isModEnabled('project') && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (isModEnabled('project') && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } From 1530361963053dc0ec5bce6ad9a0bd51a1afee43 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:11:06 +0200 Subject: [PATCH 289/507] update code --- htdocs/core/lib/contact.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index ad9c47f4c48..322f1cdbb0e 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'perso'; $tab++; - if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) { + if (isModEnabled('project') && $user->hasRight('project', 'lire')) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -170,11 +170,11 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $i = -1; - if (!empty($conf->project->enabled) && $user->rights->projet->lire) { + if (isModEnabled('project') && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (isModEnabled('project') && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } From 6fc7c9bca8b7c05f33c422e8595d92c3107c2d84 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:11:46 +0200 Subject: [PATCH 290/507] update code --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53204c4cc41..c82e7deaa5d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7398,7 +7398,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; $substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__'; } - if (!empty($conf->project->enabled)) { // Most objects + if (isModEnabled('project')) { // Most objects $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__'; From 886cb4f0836f926457bdbbe5818e26c3067a9327 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:12:10 +0200 Subject: [PATCH 291/507] update code --- htdocs/core/lib/project.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 8e514a505bf..226a6a6d7cd 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->tax->enabled)) { $nbElements += $project->getElementCount('chargesociales', 'chargesociales'); } - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $nbElements += $project->getElementCount('project_task', 'projet_task'); } if (!empty($conf->stock->enabled)) { From 00da52ef8c7751cba212e62c8aa081ff2a3df094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:12:25 +0200 Subject: [PATCH 292/507] fix php8 warnings --- htdocs/adherents/class/adherent.class.php | 6 +++--- htdocs/admin/commande.php | 4 ++-- htdocs/admin/compta.php | 2 +- htdocs/modulebuilder/template/mymoduleindex.php | 4 ++-- htdocs/modulebuilder/template/myobject_document.php | 4 ++-- htdocs/website/websiteaccount_card.php | 4 ++-- test/phpunit/FactureTest.php | 2 +- test/phpunit/PricesTest.php | 2 +- test/phpunit/SocieteTest.php | 2 +- test/phpunit/UserTest.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1d2df6c04ab..786814d30fc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2061,7 +2061,7 @@ class Adherent extends CommonObject $err = 0; // mailman - if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_mailman($this); if ($result < 0) { @@ -2081,7 +2081,7 @@ class Adherent extends CommonObject } // spip - if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; @@ -2132,7 +2132,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) { + if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) { $result = $mailmanspip->del_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index eec8bb16417..4bffad16ee3 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -644,7 +644,7 @@ if ($conf->banque->enabled) { print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { @@ -664,7 +664,7 @@ if ($conf->banque->enabled) { if (isModEnabled('stock')) { print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); } else { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index d215125d51e..7bb291d521e 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -146,7 +146,7 @@ print "
'.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT -//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) +//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) //{ // // print "
\n"; // // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 15f3d83ac54..a5620a45966 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -100,7 +100,7 @@ print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $langs->load("orders"); @@ -181,7 +181,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s"; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 78d20a1863a..173bea760a0 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -190,7 +190,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -211,7 +211,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 261839940e5..39e6e10e3d7 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index e40ed6aa2e7..891eaf05b99 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -86,7 +86,7 @@ class FactureTest extends PHPUnit\Framework\TestCase if (!isModEnabled('facture')) { print __METHOD__." module customer invoice must be enabled.\n"; die(1); } - if (! empty($conf->ecotaxdeee->enabled)) { + if (!empty($conf->ecotaxdeee->enabled)) { print __METHOD__." ecotaxdeee module must not be enabled.\n"; die(1); } diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 1845bf05149..de847e68411 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -38,7 +38,7 @@ if (empty($user->id)) { } $conf->global->MAIN_DISABLE_ALL_MAILS=1; -if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { +if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { print "Parameter MAIN_ROUNDING_RULE_TOT must be set to 0 or not set.\n"; exit(1); } diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 73363140acd..1a93fb5d21f 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -87,7 +87,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1); } - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) { + if (!empty($conf->global->MAIN_DISABLEPROFIDRULES)) { print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(1); } diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index ea7090f2b54..d6bc1093258 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -82,7 +82,7 @@ class UserTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; - if (! empty($conf->global->MAIN_MODULE_LDAP)) { + if (!empty($conf->global->MAIN_MODULE_LDAP)) { print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1); } From 01f3d626f2faf3ca9004d2a0353810164aa5ba52 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:12:45 +0200 Subject: [PATCH 293/507] update code --- htdocs/core/lib/security.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 79b020b4883..d0067d7575b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -876,7 +876,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checkproject) && $objectid > 0) { - if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { + if (isModEnabled('project') && empty($user->rights->projet->all->lire)) { $projectid = $objectid; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -897,7 +897,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checktask) && $objectid > 0) { - if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { + if (isModEnabled('project') && empty($user->rights->projet->all->lire)) { $task = new Task($db); $task->fetch($objectid); $projectid = $task->fk_project; From 8e66b7207ec587edb1b74489bcc6865495f3e881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:14:20 +0200 Subject: [PATCH 294/507] replace ! empty by !empty --- build/generate_filelist_xml.php | 2 +- dev/initdata/generate-proposal.php | 2 +- dev/initdata/purge-data.php | 2 +- dev/tools/dolibarr-postgres2mysql.php | 6 +- dev/translation/autotranslator.class.php | 6 +- dev/translation/sanity_check_en_langfiles.php | 4 +- dev/translation/strip_language_file.php | 4 +- .../class/accountancyexport.class.php | 4 +- .../actions_adherentcard_common.class.php | 2 +- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/delais.php | 4 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 4 +- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/paymentbybanktransfer.php | 2 +- htdocs/admin/pdf.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/admin/propal.php | 2 +- htdocs/admin/stock.php | 4 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/tools/export.php | 2 +- htdocs/admin/tools/export_files.php | 2 +- htdocs/api/class/api_login.class.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 6 +- htdocs/bom/bom_card.php | 10 +-- htdocs/bom/bom_list.php | 2 +- htdocs/bom/bom_net_needs.php | 20 ++--- htdocs/bom/class/bom.class.php | 26 +++--- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/index.php | 2 +- htdocs/comm/propal/card.php | 12 +-- htdocs/comm/propal/class/propal.class.php | 4 +- htdocs/comm/propal/index.php | 4 +- htdocs/commande/card.php | 14 +-- htdocs/commande/class/commande.class.php | 6 +- .../compta/cashcontrol/cashcontrol_list.php | 2 +- .../cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/compta/facture/card-rec.php | 4 +- htdocs/compta/facture/card.php | 10 +-- htdocs/compta/facture/class/facture.class.php | 14 +-- htdocs/compta/localtax/index.php | 2 +- htdocs/compta/localtax/quadri_detail.php | 2 +- htdocs/compta/paiement.php | 4 +- htdocs/compta/paiement/card.php | 4 +- htdocs/compta/payment_sc/card.php | 2 +- htdocs/compta/payment_vat/card.php | 4 +- htdocs/compta/resultat/result.php | 10 +-- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 2 +- htdocs/contact/consumption.php | 4 +- htdocs/contact/list.php | 12 +-- htdocs/contact/project.php | 4 +- htdocs/contrat/agenda.php | 4 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/actions_dellink.inc.php | 2 +- htdocs/core/ajax/saveinplace.php | 4 +- htdocs/core/boxes/box_contracts.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/core/boxes/modules_boxes.php | 2 +- htdocs/core/class/CMailFile.class.php | 6 +- htdocs/core/class/antivir.class.php | 2 +- htdocs/core/class/commonobject.class.php | 10 +-- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 28 +++--- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/class/html.formprojet.class.php | 4 +- htdocs/core/class/utils.class.php | 2 +- htdocs/core/customreports.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 +- htdocs/core/lib/pdf.lib.php | 44 ++++----- htdocs/core/lib/project.lib.php | 46 +++++----- htdocs/core/lib/security2.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 4 +- htdocs/core/lib/stock.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 14 +-- htdocs/core/lib/website2.lib.php | 4 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 6 +- .../commande/doc/pdf_einstein.modules.php | 10 +-- .../commande/doc/pdf_eratosthene.modules.php | 10 +-- .../doc/pdf_standard.modules.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 12 +-- .../facture/doc/pdf_sponge.modules.php | 12 +-- htdocs/core/modules/modBlockedLog.class.php | 2 +- htdocs/core/modules/modECM.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- .../movement/doc/pdf_standard.modules.php | 2 +- .../modules/mrp/doc/pdf_vinci.modules.php | 6 +- .../product/doc/pdf_standard.modules.php | 10 +-- .../modules/propale/doc/pdf_azur.modules.php | 10 +-- .../modules/propale/doc/pdf_cyan.modules.php | 10 +-- .../societe/mod_codecompta_aquarium.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 2 +- .../doc/pdf_canelle.modules.php | 6 +- .../supplier_order/doc/pdf_cornas.modules.php | 6 +- .../doc/pdf_muscadet.modules.php | 6 +- .../doc/pdf_standard.modules.php | 6 +- .../doc/pdf_aurore.modules.php | 8 +- htdocs/core/tpl/login.tpl.php | 2 +- .../interface_80_modStripe_Stripe.class.php | 2 +- htdocs/don/card.php | 4 +- htdocs/don/class/don.class.php | 4 +- htdocs/ecm/file_card.php | 4 +- .../class/emailcollector.class.php | 2 +- .../class/conferenceorbooth.class.php | 12 +-- .../class/conferenceorboothattendee.class.php | 16 ++-- .../conferenceorbooth_contact.php | 4 +- .../conferenceorboothattendee_note.php | 4 +- .../eventorganizationindex.php | 4 +- htdocs/expedition/card.php | 8 +- htdocs/expensereport/card.php | 10 +-- htdocs/fichinter/class/fichinter.class.php | 4 +- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- .../class/fournisseur.commande.class.php | 2 +- .../class/fournisseur.facture-rec.class.php | 10 +-- .../fourn/class/fournisseur.facture.class.php | 14 +-- htdocs/fourn/commande/card.php | 4 +- htdocs/fourn/facture/card-rec.php | 90 +++++++++---------- htdocs/fourn/facture/card.php | 8 +- htdocs/fourn/facture/list.php | 2 +- htdocs/ftp/index.php | 2 +- htdocs/holiday/document.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 16 ++-- htdocs/hrm/class/job.class.php | 16 ++-- htdocs/hrm/class/position.class.php | 16 ++-- htdocs/hrm/class/skill.class.php | 16 ++-- htdocs/hrm/class/skilldet.class.php | 16 ++-- htdocs/hrm/class/skillrank.class.php | 16 ++-- htdocs/hrm/establishment/info.php | 6 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_contact.php | 4 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/job_contact.php | 4 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_contact.php | 4 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/hrm/skill_contact.php | 4 +- .../PrintConnectors/ApiPrintConnector.php | 2 +- .../nusoap/lib/class.soap_transport_http.php | 6 +- .../includes/nusoap/lib/class.soapclient.php | 2 +- htdocs/includes/nusoap/lib/nusoap.php | 8 +- htdocs/includes/odtphp/Segment.php | 2 +- htdocs/includes/odtphp/odf.php | 4 +- .../vendor/illuminate/collections/Arr.php | 2 +- .../illuminate/collections/Collection.php | 2 +- .../illuminate/support/ServiceProvider.php | 2 +- .../vendor/illuminate/support/Stringable.php | 2 +- .../support/Testing/Fakes/BusFake.php | 6 +- .../support/Testing/Fakes/EventFake.php | 2 +- .../Testing/Fakes/NotificationFake.php | 2 +- .../support/Testing/Fakes/QueueFake.php | 2 +- htdocs/index.php | 4 +- htdocs/install/upgrade2.php | 4 +- htdocs/intracommreport/list.php | 6 +- .../class/knowledgerecord.class.php | 16 ++-- .../knowledgemanagementindex.php | 4 +- .../knowledgerecord_agenda.php | 6 +- .../knowledgerecord_card.php | 8 +- .../knowledgerecord_contact.php | 4 +- .../knowledgerecord_document.php | 4 +- .../knowledgerecord_list.php | 2 +- .../knowledgerecord_note.php | 4 +- .../template/class/myobject.class.php | 16 ++-- .../template/css/mymodule.css.php | 2 +- .../template/myobject_agenda.php | 6 +- .../modulebuilder/template/myobject_card.php | 6 +- .../template/myobject_contact.php | 4 +- .../modulebuilder/template/myobject_note.php | 4 +- htdocs/mrp/class/mo.class.php | 22 ++--- htdocs/mrp/mo_agenda.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/mrp/mo_production.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 4 +- .../partnership/class/partnership.class.php | 20 ++--- .../class/partnership_type.class.php | 12 +-- htdocs/partnership/partnership_agenda.php | 6 +- htdocs/partnership/partnership_card.php | 4 +- htdocs/partnership/partnership_contact.php | 4 +- htdocs/partnership/partnership_document.php | 4 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/partnership/partnership_note.php | 4 +- htdocs/partnership/partnershipindex.php | 4 +- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 2 +- htdocs/product/inventory/card.php | 4 +- .../inventory/class/inventory.class.php | 4 +- htdocs/product/inventory/inventory.php | 16 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 4 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../class/stocktransfer.class.php | 16 ++-- .../class/stocktransferline.class.php | 16 ++-- .../stocktransfer/stocktransfer_agenda.php | 6 +- .../stocktransfer/stocktransfer_card.php | 4 +- .../stocktransfer/stocktransfer_document.php | 6 +- .../stocktransfer/stocktransfer_list.php | 2 +- .../stocktransfer/stocktransfer_note.php | 4 +- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 4 +- htdocs/projet/card.php | 2 +- htdocs/projet/class/task.class.php | 6 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 6 +- htdocs/public/opensurvey/studs.php | 2 +- htdocs/public/payment/newpayment.php | 6 +- htdocs/reception/card.php | 4 +- .../class/recruitmentcandidature.class.php | 16 ++-- .../class/recruitmentjobposition.class.php | 16 ++-- htdocs/recruitment/index.php | 2 +- .../recruitmentcandidature_agenda.php | 6 +- .../recruitmentcandidature_card.php | 4 +- .../recruitmentcandidature_document.php | 4 +- .../recruitmentcandidature_list.php | 2 +- .../recruitmentcandidature_note.php | 4 +- .../recruitmentjobposition_agenda.php | 2 +- htdocs/societe/ajax/ajaxcompanies.php | 2 +- htdocs/societe/card.php | 14 +-- .../class/companypaymentmode.class.php | 2 +- htdocs/societe/consumption.php | 4 +- htdocs/societe/notify/card.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/stripe/charge.php | 2 +- htdocs/stripe/payout.php | 4 +- htdocs/stripe/transaction.php | 4 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/user/card.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/user/param_ihm.php | 2 +- htdocs/user/perms.php | 2 +- htdocs/webhook/class/target.class.php | 16 ++-- htdocs/webhook/target_agenda.php | 6 +- htdocs/webhook/target_card.php | 6 +- htdocs/webhook/target_contact.php | 4 +- htdocs/webhook/target_note.php | 4 +- htdocs/webhook/webhookindex.php | 4 +- htdocs/website/index.php | 6 +- test/phpunit/AdherentTest.php | 6 +- test/phpunit/AllTests.php | 4 +- test/phpunit/WebservicesInvoicesTest.php | 6 +- test/phpunit/WebservicesOrdersTest.php | 2 +- test/phpunit/WebservicesOtherTest.php | 4 +- test/phpunit/WebservicesProductsTest.php | 6 +- test/phpunit/WebservicesThirdpartyTest.php | 8 +- test/phpunit/WebservicesUserTest.php | 4 +- 265 files changed, 762 insertions(+), 762 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 7065e20f92b..3d72ebe6739 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -56,7 +56,7 @@ if (empty($argv[1])) { $i=0; while ($i < $argc) { - if (! empty($argv[$i])) { + if (!empty($argv[$i])) { parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ... } if (preg_match('/includeconstant=/', $argv[$i])) { diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 0b1c24dc139..8af71d441a1 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -152,7 +152,7 @@ $user->rights->propal->creer=1; $user->rights->propal->propal_advance->validate=1; -if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { +if (!empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"; } diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 9214f34d810..d75c9fae8b2 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -218,7 +218,7 @@ if ($date == 'all') { } // Replace database handler -if (! empty($argv[4])) { +if (!empty($argv[4])) { $db->close(); unset($db); $db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index 1a997ddc63c..76be3804f1a 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -487,7 +487,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $pkey = $line; $linenumber ++; - if (! empty($lines[$linenumber])) { + if (!empty($lines[$linenumber])) { $line = $lines[$linenumber]; } else { $line = ''; @@ -517,7 +517,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if (substr($line, 0, 12) == "CREATE INDEX") { $matches = array(); preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); - if (! empty($matches[3])) { + if (!empty($matches[3])) { $indexname = $matches[1]; $tablename = str_replace('public.', '', $matches[2]); $columns = $matches[3]; @@ -529,7 +529,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") { $matches = array(); preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); - if (! empty($matches[3])) { + if (!empty($matches[3])) { $indexname = $matches[1]; $tablename = str_replace('public.', '', $matches[2]); $columns = str_replace('"', '', $matches[3]); diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 956ad95b9b6..bf1b121b03f 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -309,11 +309,11 @@ class autoTranslator { // We want to be sure that src_lang and dest_lang are using 2 chars only $tmp=explode('_', $src_lang); - if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { + if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) { $src_lang=$tmp[0]; } $tmp=explode('_', $dest_lang); - if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { + if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) { $dest_lang=$tmp[0]; } @@ -349,7 +349,7 @@ class autoTranslator // now, process the JSON string $json = json_decode($body, true); - if ((! empty($json['responseStatus']) && $json['responseStatus'] != 200) + if ((!empty($json['responseStatus']) && $json['responseStatus'] != 200) || count($json['data']['translations']) == 0) { print "Error: ".$json['responseStatus']." ".$url."\n"; return false; diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 840f09a0adb..95ea90e3f34 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -221,7 +221,7 @@ foreach ($dups as $string => $pages) { // Loop on each line keword was found into file. $listoffilesforthisentry=array(); foreach ($lines as $line => $translatedvalue) { - if (! empty($listoffilesforthisentry[$file])) { + if (!empty($listoffilesforthisentry[$file])) { $duplicateinsamefile=1; } $listoffilesforthisentry[$file]=1; @@ -300,7 +300,7 @@ if ($web) { // STEP 2 - Search key not used -if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { +if ((!empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { print "***** Strings in en_US that are never used:\n"; $unused=array(); diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index f0a0397cd6e..b2427c9f57a 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -303,8 +303,8 @@ foreach ($filesToProcess as $fileToProcess) { // String exists in both files and value into alternative language differs from main language but also from english files // so we keep it. - if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] - && ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) + if ((!empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] + && !empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key) ) { //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n"; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c8c4099e67e..e4af034b1f4 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1347,7 +1347,7 @@ class AccountancyExport } print $nature_piece.$separator; // RACI - // if (! empty($line->subledger_account)) { + // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { // $racine_subledger_account = '40'; // } elseif ($line->doc_type == 'customer_invoice') { @@ -1610,7 +1610,7 @@ class AccountancyExport } print $nature_piece.$separator; // RACI - // if (! empty($line->subledger_account)) { + // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { // $racine_subledger_account = '40'; // } elseif ($line->doc_type == 'customer_invoice') { diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 502249907e8..45d9c4f8fce 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -65,7 +65,7 @@ abstract class ActionsAdherentCardCommon /*if (is_object($this->object) && method_exists($this->object,'fetch')) { - if (! empty($id)) $this->object->fetch($id); + if (!empty($id)) $this->object->fetch($id); } else {*/ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 786814d30fc..46420995312 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1108,7 +1108,7 @@ class Adherent extends CommonObject // Mise a jour $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."'"; - //if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) + //if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) if ($isencrypted) { $sql .= ", pass = null"; } else { diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 8f98b4d25e9..8b8f2c6c921 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -107,7 +107,7 @@ print '* https://myphoneserver/phoneurl?login=__LOGIN__&password=__PASS__&caller print '* sip:__PHONETO__@my.sip.server'; print ''; -//if (! empty($user->clicktodial_url)) +//if (!empty($user->clicktodial_url)) //{ print '
'; print info_admin($langs->trans("ValueOverwrittenByUserSetup")); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index af8fed1c197..e64d1bda876 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -317,8 +317,8 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE $offset = 0; $cursor = 10; // By default - //if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; - //if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; + //if (!empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; + //if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; $level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) { $level0 = $conf->global->MAIN_METEO_LEVEL0; } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index db92c33a7fb..3f72fc77c6c 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -285,7 +285,7 @@ foreach($object->fields as $key => $val) $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f53e8c6b0d0..e9b36be353a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -823,7 +823,7 @@ if ($action == 'add') { } elseif ($tmpfieldlist == 'joinfiles') { print ''; } else { - // print ''; + // print ''; $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $okforextended = false; @@ -1074,7 +1074,7 @@ if ($num) { $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); print $doleditor->Create(1); } print '
'.$langs->trans("Parameter").''.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").''; -//if (! empty($conf->global->MAIN_MULTILANGS)) +//if (!empty($conf->global->MAIN_MULTILANGS)) //{ $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 88a02e90457..c76cccdcc5c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -392,7 +392,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index eea567ea27c..408c42cc3a8 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -705,7 +705,7 @@ if (isModEnabled('facture')) print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; - if (! empty($conf->use_javascript_ajax)) + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); } diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 4103c8cd354..402119e6e51 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -186,7 +186,7 @@ if (isModEnabled('productbatch')) { print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); } -//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) +//if (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //{ print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); print '
'; @@ -239,7 +239,7 @@ if (isModEnabled('commande')) { print "
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER'); } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8b1e8ebf8c0..3f3316f6996 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -153,7 +153,7 @@ if ($what == 'postgresql') { $cmddump = dol_sanitizePathName($cmddump); /* Not required, the command is output on screen but not ran for pgsql - if (! empty($dolibarr_main_restrict_os_commands)) + if (!empty($dolibarr_main_restrict_os_commands)) { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 68cb81ccc24..84bbd197a64 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -127,7 +127,7 @@ $result = dol_mkdir($outputdir); $utils = new Utils($db); -if ($export_type == 'externalmodule' && ! empty($what)) { +if ($export_type == 'externalmodule' && !empty($what)) { $fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what); } else { $fulldirtocompress = DOL_DATA_ROOT; diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 5282a43dacc..d5362f4ac56 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -88,7 +88,7 @@ class Login global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; // Is the login API disabled ? The token must be generated from backoffice only. - if (! empty($conf->global->API_DISABLE_LOGIN_API)) { + if (!empty($conf->global->API_DISABLE_LOGIN_API)) { dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING); throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice."); } diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 437e51cf0b1..8d325954a76 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -123,7 +123,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 51a7fb515bf..fb2ff12aa88 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -125,7 +125,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d2c64eea0b6..623af8c79d8 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -126,7 +126,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -171,7 +171,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f088ae34050..25b7a8730dd 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -363,7 +363,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of closing if ($action == 'close') { $text = $langs->trans('ConfirmCloseBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -391,7 +391,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of reopen if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -477,7 +477,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=$proj->getNomUrl(); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 48798db9b8f..eb78228f068 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -366,7 +366,7 @@ foreach($object->fields as $key => $val) $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index baf4b096324..668ed29a62e 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -195,19 +195,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ $text_stock_options = $langs->trans("RealStockDesc").'
'; $text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'
'; - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'
' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'
' : ''); print ''; print "\n"; print ''; print ''; print ''; print ''; - if (! empty($TChildBom)) { + if (!empty($TChildBom)) { if ($action == 'treeview') { foreach ($TChildBom as $fk_bom => $TProduct) { $repeatChar = ' '; - if (! empty($TProduct['bom'])) { + if (!empty($TProduct['bom'])) { if ($TProduct['parentid'] != $object->id) print ''; else print ''; print ''; print ''; } - if (! empty($TProduct['product'])) { + if (!empty($TProduct['product'])) { foreach ($TProduct['product'] as $fk_product => $TInfos) { $prod = new Product($db); $prod->fetch($fk_product); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 576d8f5fb09..1bbd9babfba 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -821,8 +821,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->create)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->create)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -933,8 +933,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -957,8 +957,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -981,8 +981,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1338,9 +1338,9 @@ class BOM extends CommonObject */ public function getNetNeeds(&$TNetNeeds = array(), $qty = 0) { - if (! empty($this->lines)) { + if (!empty($this->lines)) { foreach ($this->lines as $line) { - if (! empty($line->childBom)) { + if (!empty($line->childBom)) { foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); } else { if (empty($TNetNeeds[$line->fk_product])) { @@ -1362,9 +1362,9 @@ class BOM extends CommonObject */ public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0) { - if (! empty($this->lines)) { + if (!empty($this->lines)) { foreach ($this->lines as $line) { - if (! empty($line->childBom)) { + if (!empty($line->childBom)) { foreach ($line->childBom as $childBom) { $TNetNeeds[$childBom->id]['bom'] = $childBom; $TNetNeeds[$childBom->id]['parentid'] = $this->id; @@ -1572,7 +1572,7 @@ class BOMLine extends CommonObjectLine public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9a7114a6113..571815fb615 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -457,11 +457,11 @@ class ActionComm extends CommonObject if (!empty($this->datep) && !empty($this->datef)) { $this->durationp = ($this->datef - $this->datep); // deprecated } - //if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); + //if (!empty($this->date) && !empty($this->dateend)) $this->durationa=($this->dateend - $this->date); if (!empty($this->datep) && !empty($this->datef) && $this->datep > $this->datef) { $this->datef = $this->datep; } - //if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; + //if (!empty($this->date) && !empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; if (!isset($this->fk_project) || $this->fk_project < 0) { $this->fk_project = 0; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7fb2f0f129e..4260cd0c583 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1911,7 +1911,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } //print 'background: #'.$colortouse.';'; //print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));'; - //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; + //if (!empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; //print ' -moz-border-radius:4px;"'; //print 'border: 1px solid #ccc" width="100%"'; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index dd877e903e4..b42bf003333 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -830,7 +830,7 @@ if (!empty($arrayfields['a.note']['checked'])) { print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } -//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) +//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (!empty($arrayfields['a.datep']['checked'])) { print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder); $totalarray['nbfield']++; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index c9b48665c95..764455e5f62 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -515,7 +515,7 @@ if ($object->fetch($id) >= 0) { $num = $db->num_rows($resql); $param = "&id=".$object->id; - //if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index bd1a83e9959..9ac09ac529b 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -58,7 +58,7 @@ print load_fiche_titre($title); print '
'; -//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo +//if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ // Search into emailings print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f0e1e57249e..fb75b3f0c6b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -693,7 +693,7 @@ if (empty($reshook)) { if ( !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' - && ! empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer) + && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1405,7 +1405,7 @@ if (empty($reshook)) { $pu = $pu_ht; $price_base_type = 'HT'; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -2057,7 +2057,7 @@ if ($action == 'create') { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && ! empty($user->rights->facture->creer)) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2106,7 +2106,7 @@ if ($action == 'create') { 'datenow' => true ); - if (! empty($conf->global->INVOICE_POINTOFTAX_DATE)) { + if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { $formquestion[] = array( 'type' => 'date', 'tdclass' => 'fieldrequired showonlyifgeneratedeposit', @@ -2799,7 +2799,7 @@ if ($action == 'create') { } } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print '' . $langs->trans("AddAction") . '
'; }*/ @@ -2809,7 +2809,7 @@ if ($action == 'create') { } // ReOpen - if ( (( ! empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { + if ( (( !empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { print 'global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; print '>'.$langs->trans('ReOpen').''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index aa7753946a7..51c07f15269 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1132,7 +1132,7 @@ class Propal extends CommonObject $sql .= ", '".$this->db->escape($this->model_pdf)."'"; $sql .= ", ".($this->fin_validite != '' ? "'".$this->db->idate($this->fin_validite)."'" : "NULL"); $sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : 'NULL'); - $sql .= ", ".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : 'NULL'); + $sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : 'NULL'); $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", '".$this->db->escape($this->ref_client)."'"; @@ -1738,7 +1738,7 @@ class Propal extends CommonObject $sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; - $sql .= " deposit_percent=".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").","; + $sql .= " deposit_percent=".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; $sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index c03cdf4fdcc..0e108b8ee9f 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -311,7 +311,7 @@ if (isModEnabled("propal") && $user->rights->propale->lire) { */ /* -if (! empty($conf->propal->enabled)) +if (!empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; @@ -386,7 +386,7 @@ if (! empty($conf->propal->enabled)) */ /* -if (! empty($conf->propal->enabled)) +if (!empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 507a24fd758..73bf27c0cfd 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -445,7 +445,7 @@ if (empty($reshook)) { // Now we create same links to contact than the ones found on origin object /* Useless, already into the create - if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + if (!empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; $originidforcontact = $object->origin_id; @@ -1170,7 +1170,7 @@ if (empty($reshook)) { $price_base_type = 'HT'; $pu = $pu_ht; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -1260,8 +1260,8 @@ if (empty($reshook)) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); if ( - GETPOST('generate_deposit', 'alpha') == 'on' && ! empty($deposit_percent_from_payment_terms) - && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer) + GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) + && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -2108,7 +2108,7 @@ if ($action == 'create' && $usercancreate) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)) { + if (!empty($deposit_percent_from_payment_terms) && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer)) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2157,7 +2157,7 @@ if ($action == 'create' && $usercancreate) { 'datenow' => true ); - if (! empty($conf->global->INVOICE_POINTOFTAX_DATE)) { + if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { $formquestion[] = array( 'type' => 'date', 'tdclass' => 'fieldrequired showonlyifgeneratedeposit', @@ -2805,7 +2805,7 @@ if ($action == 'create' && $usercancreate) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&token='.newToken().'&id='.$object->id, ''); } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) { // Add hidden condition because this is not a // "workflow" action so should appears somewhere else on diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index bf97deb3fd8..ca7d462a432 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -967,7 +967,7 @@ class Commande extends CommonOrder $sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null"); $sql .= ", '".$this->db->escape($this->model_pdf)."'"; $sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null"); - $sql .= ", ".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null"); + $sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null"); $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : "null"); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", ".($this->availability_id > 0 ? ((int) $this->availability_id) : "null"); @@ -1782,7 +1782,7 @@ class Commande extends CommonOrder $this->lines[] = $line; /** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE - if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) + if (!empty($conf->global->PRODUIT_SOUSPRODUITS)) { $prod = new Product($this->db); $prod->fetch($idproduct); @@ -3355,7 +3355,7 @@ class Commande extends CommonOrder $sql .= " fk_user_valid=".((isset($this->user_valid) && $this->user_valid > 0) ? $this->user_valid : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; - $sql .= " deposit_percent=".(! empty($this->deposit_percent) ? strval($this->deposit_percent) : "null").","; + $sql .= " deposit_percent=".(!empty($this->deposit_percent) ? strval($this->deposit_percent) : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; $sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').","; $sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").","; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 2315f12757a..4e86cb21141 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -269,7 +269,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index d7744f777fe..bc45f3b417d 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -258,7 +258,7 @@ class CashControl extends CommonObject /* $posmodule = $this->posmodule; - if (! empty($user->rights->$posmodule->use)) + if (!empty($user->rights->$posmodule->use)) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index bdb375c6b6b..031247951e9 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -652,7 +652,7 @@ if (empty($reshook)) { $newlang = ''; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -861,7 +861,7 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 04c6df7ff1e..589eb9dfcab 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1787,7 +1787,7 @@ if (empty($reshook)) { // Now we create same links to contact than the ones found on origin object /* Useless, already into the create - if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + if (!empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; $originidforcontact = $object->origin_id; @@ -2559,7 +2559,7 @@ if (empty($reshook)) { $price_base_type = 'HT'; $pu = $pu_ht; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -3367,13 +3367,13 @@ if ($action == 'create') { ); $typedeposit = GETPOST('typedeposit', 'aZ09'); $valuedeposit = GETPOST('valuedeposit', 'int'); - if (empty($typedeposit) && ! empty($objectsrc->deposit_percent)) { + if (empty($typedeposit) && !empty($objectsrc->deposit_percent)) { $origin_payment_conditions_deposit_percent = getDictionaryValue('c_payment_term', 'deposit_percent', $objectsrc->cond_reglement_id); - if (! empty($origin_payment_conditions_deposit_percent)) { + if (!empty($origin_payment_conditions_deposit_percent)) { $typedeposit = 'variable'; } } - if (empty($valuedeposit) && $typedeposit == 'variable' && ! empty($objectsrc->deposit_percent)) { + if (empty($valuedeposit) && $typedeposit == 'variable' && !empty($objectsrc->deposit_percent)) { $valuedeposit = $objectsrc->deposit_percent; } print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ab0fd8029d8..594ee548da7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1587,7 +1587,7 @@ class Facture extends CommonInvoice $amountdeposit = array(); $descriptions = array(); - if (! empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) { + if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) { $amount = $origin->total_ttc * ($origin->deposit_percent / 100); $TTotalByTva = array(); @@ -1596,8 +1596,8 @@ class Facture extends CommonInvoice continue; } $TTotalByTva[$line->tva_tx] += $line->total_ttc; - $descriptions[$line->tva_tx] .= '
  • ' . (! empty($line->product_ref) ? $line->product_ref . ' - ' : ''); - $descriptions[$line->tva_tx] .= (! empty($line->product_label) ? $line->product_label . ' - ' : ''); + $descriptions[$line->tva_tx] .= '
  • ' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); + $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); $descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty; $descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '
  • '; } @@ -1623,8 +1623,8 @@ class Facture extends CommonInvoice $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? $tva_tx = $lines[$i]->tva_tx; $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100; - $descriptions[$tva_tx] .= '
  • ' . (! empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); - $descriptions[$tva_tx] .= (! empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); + $descriptions[$tva_tx] .= '
  • ' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '
  • '; } @@ -1644,7 +1644,7 @@ class Facture extends CommonInvoice $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; // Hidden conf - if (! empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && ! empty($descriptions[$tva])) { + if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) { $descline .= '
      ' . $descriptions[$tva] . '
    '; } @@ -1739,7 +1739,7 @@ class Facture extends CommonInvoice return null; } - if (! empty($autoValidateDeposit)) { + if (!empty($autoValidateDeposit)) { $validateReturn = $deposit->validate($user, '', 0, $notrigger); if ($validateReturn < 0) { diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 28d095715c2..e9aab173337 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -244,7 +244,7 @@ $description .= $langs->trans($LT); $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' '; $calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')'; -//if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
    '.$langs->trans("ThisIsAnEstimatedValue"); +//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
    '.$langs->trans("ThisIsAnEstimatedValue"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 969376209eb..696e70ab40d 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -190,7 +190,7 @@ $builddate = dol_now(); if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='
    '.$langs->trans("RulesVATDueServices"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
    '.$langs->trans("RulesVATInServices"); -if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
    '.$langs->trans("DepositsAreNotIncluded"); } */ diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index a2b33f4fc7b..46a01e4ba70 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -858,10 +858,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
    '; print ' '.$checkboxlabel; - /*if (! empty($conf->prelevement->enabled)) + /*if (!empty($conf->prelevement->enabled)) { $langs->load("withdrawals"); - if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
    '.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); + if (!empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
    '.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); }*/ print '


    '; print '
    '; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index f163041a43a..1b2a8dcfc34 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -119,8 +119,8 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09')); } - $hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0; - $hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0; + $hidedetails = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0; + $hidedesc = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0; $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0; $sql = 'SELECT f.rowid as facid'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index f76cc6b27c1..1b2bbe63525 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -237,7 +237,7 @@ if ($resql) { print '
    '; /* -if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) +if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 401752af11b..ae3e1a201fa 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -95,7 +95,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char $fac->fetch($id); $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + if (!empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -292,7 +292,7 @@ if ($resql) { print '
    '; /* -if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) +if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 57157ec0140..bbe32d0cbc1 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -230,7 +230,7 @@ if ($modecompta == "CREANCES-DETTES") { $exportlink = ''; $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; - //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + //if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); } @@ -266,10 +266,10 @@ foreach ($months as $k => $v) { print ''; if ($modecompta == 'CREANCES-DETTES') { - //if (! empty($date_start) && ! empty($date_end)) + //if (!empty($date_start) && !empty($date_end)) // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "RECETTES-DEPENSES") { - //if (! empty($date_start) && ! empty($date_end)) + //if (!empty($date_start) && !empty($date_end)) // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active @@ -278,9 +278,9 @@ if ($modecompta == 'CREANCES-DETTES') { /* $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; $sql.= " WHERE t.numero_compte = aa.account_number AND aa.fk_accounting_category = 0"; - if (! empty($date_start) && ! empty($date_end)) + if (!empty($date_start) && !empty($date_end)) $sql.= " AND t.doc_date >= '".$db->idate($date_start)."' AND t.doc_date <= '".$db->idate($date_end)."'"; - if (! empty($month)) { + if (!empty($month)) { $sql .= " AND MONTH(t.doc_date) = " . ((int) $month); } $resql = $db->query($sql); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index c4bfc127262..d1cc70b4927 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -66,7 +66,7 @@ abstract class ActionsContactCardCommon if (is_object($this->object) && method_exists($this->object,'fetch')) { - if (! empty($id)) $this->object->fetch($id); + if (!empty($id)) $this->object->fetch($id); } else {*/ diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3028a3719f1..bd45ae69ada 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -532,7 +532,7 @@ if (empty($reshook)) { } // Update extrafields - if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) { + if ($action == 'update_extras' && !empty($user->rights->societe->contact->creer)) { $object->oldcopy = dol_clone($object); // Fill array 'array_options' with data from update form diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index e4cc743159e..729c99f1186 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -608,9 +608,9 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; + $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; } */ print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index ec56b4f7c2a..a247e9b1302 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -831,14 +831,14 @@ if (!empty($arrayfields['p.town']['checked'])) { print ''; } // State -/*if (! empty($arrayfields['state.nom']['checked'])) +/*if (!empty($arrayfields['state.nom']['checked'])) { print '
    '; } // Region - if (! empty($arrayfields['region.nom']['checked'])) + if (!empty($arrayfields['region.nom']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } // Region - if (! empty($arrayfields['region.nom']['checked'])) + if (!empty($arrayfields['region.nom']['checked'])) { print "\n"; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index e88c056af37..6680f7f7ee3 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -62,12 +62,12 @@ if ($id) { } $socid = $object->thirdparty->id; $title = $langs->trans("Projects"); - if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { + if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name." - ".$title; } llxHeader('', $title); - if (! empty($conf->notification->enabled)) { + if (!empty($conf->notification->enabled)) { $langs->load("mails"); } $head = contact_prepare_head($object); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index a8dc5e7ee3b..29288708664 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -227,11 +227,11 @@ if ($id > 0) { $out=''; $permok=$user->rights->agenda->myactions->create; - if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 088d8f9b6d5..bc43c54a8ec 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2650,7 +2650,7 @@ class Contrat extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($contractlineprocessed[$obj->lid]) || ! empty($contractignored[$obj->rowid]) || ! empty($contracterror[$obj->rowid])) { + if (!empty($contractlineprocessed[$obj->lid]) || !empty($contractignored[$obj->rowid]) || !empty($contracterror[$obj->rowid])) { continue; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 1bd9d3388f6..92a5a3f5999 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index ce386fe21b9..bf1c83dccb3 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -123,7 +123,7 @@ if ($object->id) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 540491698c1..044d6e4941e 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 2869c66cd9f..cfc888e229a 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -375,7 +375,7 @@ if (!$resql) { $num = $db->num_rows($resql); /* -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { $obj = $db->fetch_object($resql); $id = $obj->id; diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 9bf56b2f876..4db2c64206a 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -40,7 +40,7 @@ if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id > } // Link by reference -if ($action == 'addlinkbyref' && ! empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { +if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { $element_prop = getElementProperties($addlink); if (is_array($element_prop)) { dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php'); diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 05fad8148fa..a127fa08645 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -126,8 +126,8 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e $check_access = restrictedArea($user, $feature, $object_id, '', $feature2); //var_dump($user->rights); /* - if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write) - || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) + if (!empty($user->rights->$newelement->creer) || !empty($user->rights->$newelement->create) || !empty($user->rights->$newelement->write) + || (isset($subelement) && (!empty($user->rights->$newelement->$subelement->creer) || !empty($user->rights->$newelement->$subelement->write))) || ($element == 'payment' && $user->rights->facture->paiement) || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) */ diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 99ea5541c98..4251a4491f6 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -97,7 +97,7 @@ class box_contracts extends ModeleBoxes if ($user->socid) { $sql .= " AND s.rowid = ".((int) $user->socid); } - if (! empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { + if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC "; } else { $sql .= " ORDER BY c.tms DESC, c.ref DESC "; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9a212d0a10e..9ec279fe2d0 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -171,7 +171,7 @@ class box_services_contracts extends ModeleBoxes // Add description in form if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - //$text .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; + //$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; $description = ''; // Already added into main visible desc } diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 910e6d3ca77..5d423a9e202 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -259,7 +259,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $out .= img_picto($langs->trans("MoveBox", $this->box_id), 'grip_title', 'class="opacitymedium boxhandle hideonsmartphone cursormove marginleftonly"'); $out .= img_picto($langs->trans("CloseBox", $this->box_id), 'close_title', 'class="opacitymedium boxclose cursorpointer marginleftonly" rel="x:y" id="imgclose'.$this->box_id.'"'); $label = $head['text']; - //if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; + //if (!empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; if (!empty($head['graph'])) { $label .= ' '; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index f9157a6a3c2..ba657f58087 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -471,7 +471,7 @@ class CMailFile $msgid = $headers->get('Message-ID'); $msgid->setId($headerID); $headers->addIdHeader('References', $headerID); - // TODO if (! empty($moreinheader)) ... + // TODO if (!empty($moreinheader)) ... // Give the message a subject try { @@ -580,7 +580,7 @@ class CMailFile $this->errors[] = $e->getMessage(); } } - //if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); + //if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) { try { $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from)); @@ -1561,7 +1561,7 @@ class CMailFile $host = 'ssl://'.$host; } // tls smtp start with no encryption - //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; + //if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; dol_syslog("Try socket connection to host=".$host." port=".$port); //See if we can connect to the SMTP server diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index 7a60e7b6e03..dc38d38185e 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -116,7 +116,7 @@ class AntiVir fclose($handle); - if (! empty($conf->global->MAIN_UMASK)) + if (!empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } else diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a16881cd61e..7f99363794a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1085,8 +1085,8 @@ abstract class CommonObject $forcedownload = 0; $paramlink = ''; - //if (! empty($modulepart)) $paramlink.=($paramlink?'&':'').'modulepart='.$modulepart; // For sharing with hash (so public files), modulepart is not required. - //if (! empty($ecmfile->entity)) $paramlink.='&entity='.$ecmfile->entity; // For sharing with hash (so public files), entity is not required. + //if (!empty($modulepart)) $paramlink.=($paramlink?'&':'').'modulepart='.$modulepart; // For sharing with hash (so public files), modulepart is not required. + //if (!empty($ecmfile->entity)) $paramlink.='&entity='.$ecmfile->entity; // For sharing with hash (so public files), entity is not required. //$paramlink.=($paramlink?'&':'').'file='.urlencode($filepath); // No need of name of file for public link, we will use the hash if (!empty($ecmfile->share)) { $paramlink .= ($paramlink ? '&' : '').'hashp='.$ecmfile->share; // Hash for public share @@ -4917,7 +4917,7 @@ abstract class CommonObject //Line extrafield $line->fetch_optionals(); - //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) if (is_object($hookmanager)) { // Old code is commented on preceding line. if (empty($line->fk_parent_line)) { $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer, 'selected'=>$selected, 'table_element_line'=>$line->table_element); @@ -6159,7 +6159,7 @@ abstract class CommonObject // If we clone, we have to clean unique extrafields to prevent duplicates. // This behaviour can be prevented by external code by changing $this->context['createfromclone'] value in createFrom hook - if (! empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && ! empty($attributeUnique)) { + if (!empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && !empty($attributeUnique)) { $new_array_options[$key] = null; } @@ -8582,7 +8582,7 @@ abstract class CommonObject $filearray = dol_dir_list($dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); - /*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs + /*if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearray=array_merge($filearray, $filearrayold); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cea529726e5..8ddfb9290e7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1571,7 +1571,7 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - /*if (! empty($help) && $keyprefix != 'search_options_') { + /*if (!empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); }*/ return $out; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1ecd05cc3a5..838aea25f53 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -732,7 +732,7 @@ class Form } } // If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone) - //if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger)) + //if (!empty($conf->dol_no_mouse_hover) && !empty($tooltiptrigger)) //{ //if ($type == 'info' || $type == 'help') return ''.$text.'''; //} @@ -1433,7 +1433,7 @@ class Form $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); } else { @@ -2674,7 +2674,7 @@ class Form if (!empty($conf->global->MAIN_MULTILANGS)) { $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; } - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && ! empty($socid)) { + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; } if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { @@ -2733,7 +2733,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); @@ -2959,7 +2959,7 @@ class Form } $opt .= '>'; $opt .= $objp->ref; - if (! empty($objp->custref)) { + if (!empty($objp->custref)) { $opt.= ' (' . $objp->custref . ')'; } if ($outbarcode) { @@ -2971,7 +2971,7 @@ class Form } $objRef = $objp->ref; - if (! empty($objp->custref)) { + if (!empty($objp->custref)) { $objRef .= ' (' . $objp->custref . ')'; } if (!empty($filterkey) && $filterkey != '') { @@ -4086,7 +4086,7 @@ class Form $selectedDepositPercent = null; foreach ($this->cache_conditions_paiements as $id => $arrayconditions) { - if ($filtertype <= 0 && ! empty($arrayconditions['deposit_percent'])) { + if ($filtertype <= 0 && !empty($arrayconditions['deposit_percent'])) { continue; } @@ -4098,7 +4098,7 @@ class Form } $label = $arrayconditions['label']; - if (! empty($arrayconditions['deposit_percent'])) { + if (!empty($arrayconditions['deposit_percent'])) { $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'], $label); } @@ -5380,7 +5380,7 @@ class Form if (isset($this->cache_conditions_paiements[$selected])) { $label = $this->cache_conditions_paiements[$selected]['label']; - if (! empty($this->cache_conditions_paiements[$selected]['deposit_percent'])) { + if (!empty($this->cache_conditions_paiements[$selected]['deposit_percent'])) { $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label); } @@ -6231,7 +6231,7 @@ class Form } } $return .= '>'; - //if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES)) + //if (!empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES)) if ($mysoc->country_code == 'IN' || !empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES)) { $return .= $rate['labelpositiverates']; } else { @@ -7031,7 +7031,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7229,7 +7229,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7441,7 +7441,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7773,7 +7773,7 @@ class Form // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 $textifempty = ' '; - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->$confkeyforautocompletemode)) { if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 98b1fbd6593..612e555a6b0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1889,7 +1889,7 @@ class FormFile print img_picto($langs->trans("FileSharedViaALink"), 'globe').' '; print ''; } - //if (! empty($useinecm) && $useinecm != 6) print ''; //print img_view().'   '; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 47bbdec0fb2..4d34211ed17 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -381,9 +381,9 @@ class FormProjets if (!empty($show_empty)) { $out .= ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); - if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); $extrafieldsobjectkey='projet'; $extrafieldsobjectprefix='efp.'; @@ -1412,32 +1412,32 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) + if (!empty($arrayfields['p.fk_opp_status']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_amount']['checked'])) + if (!empty($arrayfields['p.opp_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_percent']['checked'])) + if (!empty($arrayfields['p.opp_percent']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.budget_amount']['checked'])) + if (!empty($arrayfields['p.budget_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.usage_bill_time']['checked'])) + if (!empty($arrayfields['p.usage_bill_time']['checked'])) { print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); - if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); $extrafieldsobjectkey='projet'; $extrafieldsobjectprefix='efp.'; @@ -1816,32 +1816,32 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) + if (!empty($arrayfields['p.fk_opp_status']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_amount']['checked'])) + if (!empty($arrayfields['p.opp_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_percent']['checked'])) + if (!empty($arrayfields['p.opp_percent']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.budget_amount']['checked'])) + if (!empty($arrayfields['p.budget_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.usage_bill_time']['checked'])) + if (!empty($arrayfields['p.usage_bill_time']['checked'])) { print ''; } /*TODO Add link to expeditiondet_batch - if (! empty($conf->productbatch->enabled)) + if (!empty($conf->productbatch->enabled)) { print ''; @@ -396,7 +396,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Batch number managment /*TODO Add link to expeditiondet_batch - if (! empty($conf->productbatch->enabled)) + if (!empty($conf->productbatch->enabled)) { //var_dump($objp->edrowid); $lines[$i]->detail_batch diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index c6b1bdefe6c..afad01ebcff 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -54,7 +54,7 @@ function stock_prepare_head($object) */ /* Disabled because will never be implemented. Table always empty. - if (! empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) + if (!empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) { // Should not be enabled by defaut because does not work yet correctly because // personnal stocks are not tagged into table llx_entrepot diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index aef55e09bd6..962ae897bca 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -483,7 +483,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print '
    '.$langs->trans('Product'); - if (! empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') { + if (!empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') { print '   '.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; } @@ -216,11 +216,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'
    '.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); @@ -233,7 +233,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
    '; print ''; print ''; print ''; @@ -981,8 +981,8 @@ if (!empty($arrayfields['p.zip']['checked'])) { if (!empty($arrayfields['p.town']['checked'])) { print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder); } -//if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); -//if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); +//if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); +//if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); if (!empty($arrayfields['country.code_iso']['checked'])) { print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); } @@ -1150,13 +1150,13 @@ while ($i < min($num, $limit)) { } } // State - /*if (! empty($arrayfields['state.nom']['checked'])) + /*if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."".$obj->region_name."
    '; $code = dol_getIdFromCode($db, $lines[$i]->fk_opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print "'; print price($lines[$i]->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); print "'; print price($lines[$i]->opp_percent, 0, $langs, 1, 0).' %'; print "'; print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print "'; print yn($lines[$i]->usage_bill_time); @@ -1718,7 +1718,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $restrictBefore = null; - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); } @@ -1802,11 +1802,11 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print '
    '; $code = dol_getIdFromCode($db, $lines[$i]->fk_opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print "'; print price($lines[$i]->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); print "'; print price($lines[$i]->opp_percent, 0, $langs, 1, 0).' %'; print "'; print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print "'; print yn($lines[$i]->usage_bill_time); @@ -2111,7 +2111,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $restrictBefore = null; - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 380282fc48b..287a151f41c 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -159,7 +159,7 @@ if (!function_exists('dol_loginfunction')) { /* $conf->css = "/theme/".(GETPOST('theme','aZ09')?GETPOST('theme','aZ09'):$conf->theme)."/style.css.php"; $themepath=dol_buildpath($conf->css,1); - if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application + if (!empty($conf->modules_parts['theme'])) // Using this feature slow down application { foreach($conf->modules_parts['theme'] as $reldir) { diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 4988be3cefd..df6e3231a0b 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -280,7 +280,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''.$langs->trans("Warehouse").''; print '
    '.$langs->trans("TopMenuDisableImages").''.($conf->global->THEME_TOPMENU_DISABLE_IMAGE?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -565,7 +565,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -608,7 +608,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -652,7 +652,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_VERMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -825,7 +825,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTLINK:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -968,7 +968,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_BTNACTION:$langs->trans("Default")).'conf->THEME_ELDY_BTNACTION)?" checked":""); + print 'conf->THEME_ELDY_BTNACTION)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -1014,7 +1014,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTBTNACTION:$langs->trans("Default")).'conf->THEME_ELDY_TEXTBTNACTION)?" checked":""); + print 'conf->THEME_ELDY_TEXTBTNACTION)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index e5042807b02..58a0c6a64dd 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -309,7 +309,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o $indexcontent .= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n"; $indexcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n"; $indexcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded\n"; - $indexcontent .= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n"; + $indexcontent .= 'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'."\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; @@ -341,7 +341,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o $indexcontent .= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n"; $indexcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n"; $indexcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once '".$relpath."/master.inc.php'; } // Load master if not already loaded\n"; - $indexcontent .= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n"; + $indexcontent .= 'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'."\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 71f399497c7..037d1fee8c2 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -148,7 +148,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout if (!empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); - /*} elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + /*} elseif (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4707657d3e3..35b233ba6e5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -208,7 +208,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'Projet', 'link' => '/projet/index.php?mainmenu=project&leftmenu=', - 'title' => (! empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"), + 'title' => (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"), 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, @@ -544,7 +544,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = if (!empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); - /*} elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + /*} elseif (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ @@ -1773,7 +1773,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - //if (isModEnabled('accounting') && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + //if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cb73b6fc282..d34c66c0def 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); @@ -954,7 +954,7 @@ class pdf_einstein extends ModelePDFCommandes // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -984,7 +984,7 @@ class pdf_einstein extends ModelePDFCommandes } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1044,7 +1044,7 @@ class pdf_einstein extends ModelePDFCommandes } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1075,7 +1075,7 @@ class pdf_einstein extends ModelePDFCommandes } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 8930481d219..28003fff639 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -992,7 +992,7 @@ class pdf_eratosthene extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); @@ -1168,7 +1168,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1197,7 +1197,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1257,7 +1257,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1288,7 +1288,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 365a2326281..380fb5b79a0 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -600,7 +600,7 @@ class pdf_standard extends ModeleExpenseReport //$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C'); // Project - //if (! empty($conf->project->enabled)) + //if (!empty($conf->project->enabled)) //{ // $pdf->SetFont('','', $default_font_size - 1); // $pdf->SetXY($this->posxprojet, $curY); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 14c13ceb57c..3b82e92f1ab 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -453,9 +453,9 @@ class pdf_crabe extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; $qrcodestring = ''; - if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { + if (!empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); - } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + } elseif (!empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { $qrcodestring = $object->buildSwitzerlandQRString(); } if ($qrcodestring) { @@ -1341,7 +1341,7 @@ class pdf_crabe extends ModelePDFFactures // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1373,7 +1373,7 @@ class pdf_crabe extends ModelePDFFactures } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1435,7 +1435,7 @@ class pdf_crabe extends ModelePDFFactures } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1465,7 +1465,7 @@ class pdf_crabe extends ModelePDFFactures } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 5555589b910..a537e35223f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -462,9 +462,9 @@ class pdf_sponge extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; $qrcodestring = ''; - if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { + if (!empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); - } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + } elseif (!empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { $qrcodestring = $object->buildSwitzerlandQRString(); } if ($qrcodestring) { @@ -1613,7 +1613,7 @@ class pdf_sponge extends ModelePDFFactures // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1645,7 +1645,7 @@ class pdf_sponge extends ModelePDFFactures } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1730,7 +1730,7 @@ class pdf_sponge extends ModelePDFFactures } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1761,7 +1761,7 @@ class pdf_sponge extends ModelePDFFactures } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 0c645099f56..0a07fff6aaf 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -79,7 +79,7 @@ class modBlockedLog extends DolibarrModules // Currently, activation is not automatic because only companies (in France) making invoices to non business customers must // enable this module. - /*if (! empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)) + /*if (!empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)) { $tmp=explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY); $this->automatic_activation = array(); diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 8b846089a03..e90b42a40aa 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -182,7 +182,7 @@ class modECM extends DolibarrModules 'langs'=>'ecm', 'position'=>103, 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', + 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && !empty($conf->global->ECM_AUTO_TREE_ENABLED)', 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 7e7d010ed5d..5f898584ba4 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -378,7 +378,7 @@ class modSociete extends DolibarrModules 't.libelle'=>"ThirdPartyType" ); // Add multicompany field - if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { + if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { if (isModEnabled('multicompany')) { $nbofallowedentities = count(explode(',', getEntity('contact'))); if ($nbofallowedentities > 1) { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index f83b6efa1ed..6f2a6fcf694 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -1119,7 +1119,7 @@ class pdf_standard extends ModelePDFMovement // Show sender $posy=42; $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; // Show sender frame diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index af37f6bbfcd..ba41c94ab4f 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -875,7 +875,7 @@ class pdf_vinci extends ModelePDFMo $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -905,7 +905,7 @@ class pdf_vinci extends ModelePDFMo } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1085,7 +1085,7 @@ class pdf_vinci extends ModelePDFMo //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index ea52b9c3c70..3f75a87fc73 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -351,7 +351,7 @@ class pdf_standard extends ModelePDFProduct if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page { $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (!empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposafter+1); } @@ -439,7 +439,7 @@ class pdf_standard extends ModelePDFProduct // Retrieve type from database for backward compatibility with old records if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined - && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax + && (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax { $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc); $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : ''; @@ -457,7 +457,7 @@ class pdf_standard extends ModelePDFProduct $this->tva[$vatrate] += $tvaligne; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) + if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); @@ -499,7 +499,7 @@ class pdf_standard extends ModelePDFProduct $this->_pagefoot($pdf,$object,$outputlangs,1); // New page $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (!empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } @@ -775,7 +775,7 @@ class pdf_standard extends ModelePDFProduct // Show sender $posy=42; $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; // Show sender frame diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index bb6389a2e67..3d209fce798 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1129,7 +1129,7 @@ class pdf_azur extends ModelePDFPropales // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1159,7 +1159,7 @@ class pdf_azur extends ModelePDFPropales } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1221,7 +1221,7 @@ class pdf_azur extends ModelePDFPropales } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1251,7 +1251,7 @@ class pdf_azur extends ModelePDFPropales } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1299,7 +1299,7 @@ class pdf_azur extends ModelePDFPropales /* $resteapayer = $object->total_ttc - $deja_regle; - if (! empty($object->paye)) $resteapayer=0; + if (!empty($object->paye)) $resteapayer=0; */ if ($deja_regle > 0) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7be7170edb2..224e3979f38 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1254,7 +1254,7 @@ class pdf_cyan extends ModelePDFPropales // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1285,7 +1285,7 @@ class pdf_cyan extends ModelePDFPropales } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1342,7 +1342,7 @@ class pdf_cyan extends ModelePDFPropales } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1373,7 +1373,7 @@ class pdf_cyan extends ModelePDFPropales } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1423,7 +1423,7 @@ class pdf_cyan extends ModelePDFPropales $resteapayer = 0; /* $resteapayer = $object->total_ttc - $deja_regle; - if (! empty($object->paye)) $resteapayer=0; + if (!empty($object->paye)) $resteapayer=0; */ if ($deja_regle > 0) { diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 4d1d01db682..257bdf55e52 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -98,7 +98,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if (!isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) { $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)."
    \n"; } - //if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."
    \n"; + //if (!empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."
    \n"; if (!empty($conf->global->COMPANY_AQUARIUM_CLEAN_REGEX)) { $texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX."
    \n"; } 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 5bff26a9d1d..9a6ee3c5f01 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -882,7 +882,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); 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 76c0ed56851..5cbdad90b03 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -167,7 +167,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->posxqty = 130; $this->posxunit = 147; } - //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + //if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) { // To work with US executive format $this->posxpicture -= 20; @@ -740,7 +740,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $tvakey => $tvaval) { @@ -765,7 +765,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } //} - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $tvakey => $tvaval) { 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 233d18ce229..a8f671fb528 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1031,7 +1031,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -1061,7 +1061,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1241,7 +1241,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ 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 5498800aefc..12b5b990648 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -912,7 +912,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -942,7 +942,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1150,7 +1150,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ 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 6919ffe69aa..676c5768ea3 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -131,7 +131,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->posxtva = 90; $this->posxtotalttc = 180; - //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + //if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if ($this->page_largeur < 210) { // To work with US executive format $this->posxreffacturefourn -= 20; $this->posxreffacture -= 20; @@ -676,10 +676,10 @@ class pdf_standard extends ModelePDFSuppliersPayments } } - if (! empty($conf->global->PDF_SHOW_PROJECT)) + if (!empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); - if (! empty($object->project->ref)) + if (!empty($object->project->ref)) { $outputlangs->load("projects"); $posy+=4; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 70ee5d75710..f5825957845 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -964,7 +964,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -994,7 +994,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1048,7 +1048,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1078,7 +1078,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 5965132d68c..b07bb66b46c 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -316,7 +316,7 @@ if ($forgetpasslink || $helpcenterlink) { if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) { $langs->load("users"); - //if (! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url= + //if (!empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url= echo '
    '; echo '
    '; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 54ee9929cb2..44cd1d1f660 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -141,7 +141,7 @@ class InterfaceStripe extends DolibarrTriggers } if ($changerequested) { - /*if (! empty($object->email)) $customer->email = $object->email; + /*if (!empty($object->email)) $customer->email = $object->email; $customer->description = $namecleaned; if (empty($taxinfo)) $customer->tax_info = array('type'=>'vat', 'tax_id'=>null); else $customer->tax_info = $taxinfo; */ diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bf9ba2e6388..f3bfca6ee95 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -351,9 +351,9 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang=''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) + if (!empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 4c0811e70c9..080ac3b9540 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -832,8 +832,8 @@ class Don extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 624f8d6ddf0..0a1114fb40c 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -371,8 +371,8 @@ if (!empty($object->share)) { } $fulllink = $urlwithroot.'/document.php'.($paramlink ? '?'.$paramlink : ''); - //if (! empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path - //elseif (! empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content + //if (!empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path + //elseif (!empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content print img_picto('', 'globe').' '; if ($action != 'edit') { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 50b7047b90d..006376cfd55 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -432,7 +432,7 @@ class EmailCollector extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; $this->password = dolDecrypt($this->password); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 2c22bfb77ab..faddee08d29 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -444,8 +444,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -468,8 +468,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -492,8 +492,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 158b29e4cf6..78fe18366b7 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -541,8 +541,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->conferenceorboothattendee->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->conferenceorboothattendee->conferenceorboothattendee_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->conferenceorboothattendee_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -684,8 +684,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -708,8 +708,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -732,8 +732,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 33b8f633b3a..499c6d7ac6d 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -396,7 +396,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -417,7 +417,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 4c5b2f394a9..b5e25872bf5 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -172,7 +172,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index 77c2ec512f4..d770d5e1900 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -71,7 +71,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) +if (!empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) { $langs->load("orders"); @@ -152,7 +152,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) +if (!empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."eventorganization_myobject as s"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 333c93fdfd7..f947e86a66a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -466,7 +466,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } // TODO add alternative status - //} elseif ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate))) + //} elseif ($action == 'reopen' && (!empty($user->rights->expedition->creer) || !empty($user->rights->expedition->shipping_advance->validate))) //{ // $result = $object->setStatut(0); // if ($result < 0) @@ -1218,7 +1218,7 @@ if ($action == 'create') { print ''; print ''; } else { - if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { + if (!empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { print ''; print ''; } @@ -1402,7 +1402,7 @@ if ($action == 'create') { print ''; print ''; } else { - if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { + if (!empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { print ''; } @@ -2515,7 +2515,7 @@ if ($action == 'create') { // Create bill if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->rights->facture->creer) { - // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) + // TODO show button only if (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // If we do that, we must also make this option official. print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 9daa03a3ec8..3c1656ebf84 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -68,7 +68,7 @@ $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('socid_id', $childids = $user->getAllChildIds(1); -if (! empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { +if (!empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { if (empty($date_start)) { $date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y')); } @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = isModEnabled('project') && !empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { @@ -1624,7 +1624,7 @@ if ($action == 'create') { print ''; } else { - $taxlessUnitPriceDisabled = ! empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : ''; + $taxlessUnitPriceDisabled = !empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : ''; print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); @@ -1697,7 +1697,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -1717,7 +1717,7 @@ if ($action == 'create') { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 61c127cab9b..18d051a0fa3 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1187,8 +1187,8 @@ class Fichinter extends CommonObject if ($objsoc->fetch($socid) > 0) { $this->socid = $objsoc->id; - //$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - //$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + //$this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + //$this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); $this->fk_project = ''; $this->fk_delivery_address = ''; } diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 6cfc4fbe7b9..6ebac09d8fb 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -114,7 +114,7 @@ if ($idprod > 0) { // Add price for costprice (at end) $price = $producttmp->cost_price; - if (empty($price) && ! empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { + if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { // get costprice for subproducts if any $producttmp->get_sousproduits_arbo(); $prods_arbo=$producttmp->get_arbo_each_prod(); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b90b03a06cb..8a1dcf682b2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2831,7 +2831,7 @@ class CommandeFournisseur extends CommonOrder if ($qty < $this->line->packaging) { $qty = $this->line->packaging; } else { - if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { + if (!empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 31bc37b6e1a..915ce532412 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -982,9 +982,9 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; $sql .= ') VALUES ('; $sql .= ' ' . (int) $facid; // source supplier invoie id - $sql .= ', ' . (! empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); - $sql .= ', ' . (! empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); - $sql .= ', ' . (! empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); + $sql .= ', ' . (!empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); + $sql .= ', ' . (!empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); + $sql .= ', ' . (!empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); $sql .= ", '" . $this->db->escape($desc) . "'"; $sql .= ', ' . price2num($pu_ht); $sql .= ', ' . price2num($pu_ttc); @@ -2154,8 +2154,8 @@ class FactureFournisseurLigneRec extends CommonObjectLine $sql .= ' fk_facture_fourn = ' . (int) $this->fk_facture_fourn; $sql .= ', fk_parent_line = ' . (int) $this->fk_parent; $sql .= ', fk_product = ' . (int) $this->fk_product; - $sql .= ', ref = ' . (! empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL'); - $sql .= ", label = " . (! empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL'); + $sql .= ', ref = ' . (!empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL'); + $sql .= ", label = " . (!empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL'); $sql .= ", description = '" . $this->db->escape($this->description) . "'"; $sql .= ', pu_ht = ' . price2num($this->pu_ht); $sql .= ', pu_ttc = ' . price2num($this->pu_ttc); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 830430f3730..2103b97d2e1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -433,7 +433,7 @@ class FactureFournisseur extends CommonInvoice $result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds // Define some dates - if (! empty($_facrec->frequency)) { + if (!empty($_facrec->frequency)) { $originaldatewhen = $_facrec->date_when; $nextdatewhen = dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency); $previousdaynextdatewhen = dol_time_plus_duree($nextdatewhen, -1, 'd'); @@ -464,7 +464,7 @@ class FactureFournisseur extends CommonInvoice if (! $this->type) { $this->type = self::TYPE_STANDARD; } - if (! empty(GETPOST('ref_supplier'))) { + if (!empty(GETPOST('ref_supplier'))) { $this->ref_supplier = trim($this->ref_supplier); } else { $this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1)); @@ -510,7 +510,7 @@ class FactureFournisseur extends CommonInvoice if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { $newlang = $this->default_lang; // for thirdparty } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -540,7 +540,7 @@ class FactureFournisseur extends CommonInvoice } // Define due date if not already defined - if (! empty($forceduedate)) { + if (!empty($forceduedate)) { $this->date_echeance = $forceduedate; } @@ -760,9 +760,9 @@ class FactureFournisseur extends CommonInvoice // If margin module defined on costprice, we try the costprice // If not defined or if module margin defined and pmp and stock module enabled, we try pmp price // else we get the best supplier price - if ($conf->global->MARGIN_TYPE == 'costprice' && ! empty($producttmp->cost_price)) { + if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { $buyprice = $producttmp->cost_price; - } elseif (! empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && ! empty($producttmp->pmp)) { + } elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { $buyprice = $producttmp->pmp; } else { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { @@ -3861,7 +3861,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").','; $sql .= " ".((int) $this->product_type).","; $sql .= " ".price2num($this->remise_percent).","; - $sql .= ' '.(! empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").','; + $sql .= ' '.(!empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").','; $sql .= " ".price2num($this->subprice).","; $sql .= " ".(!empty($this->qty) ?price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).","; $sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").","; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 769d8c451da..660d555676f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2357,7 +2357,7 @@ if ($action == 'create') { print '
    '; // Margin Infos - /*if (! empty($conf->margin->enabled)) { + /*if (!empty($conf->margin->enabled)) { $formmargin->displayMarginInfos($object); }*/ @@ -2462,7 +2462,7 @@ if ($action == 'create') { } } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print ''; }*/ diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index e996f29b3c8..8f8d9ec9e47 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -if (! empty($conf->project->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; @@ -112,10 +112,10 @@ $permissiontoedit = $user->rights->fournisseur->facture->creer || $user->rights- $usercanread = $user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire; $usercancreate = $user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer; $usercandelete = $user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer; -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($usercancreate)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))); +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send); -$usercanproductignorepricemin = ((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); +$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); $usercancreatemargin = $user->rights->margins->creer; $usercanreadallmargin = $user->rights->margins->liretous; $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; @@ -301,7 +301,7 @@ if (empty($reshook)) { } elseif ($action == 'setdate_when' && $usercancreate) { // Set next date of execution $date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')); - if (! empty($date)) { + if (!empty($date)) { $object->setNextDate($date); } } elseif ($action == 'setnb_gen_max' && $usercancreate) { @@ -484,7 +484,7 @@ if (empty($reshook)) { $res = $productsupplier->fetch($idprod); // Load product from its id // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price - if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) { + if (!empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) { $fksoctosearch = 0; $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist if ($productsupplier->fourn_socid != $socid) { // The price we found is for another supplier, so we clear supplier price @@ -502,7 +502,7 @@ if (empty($reshook)) { } } - if (! $error && ($qty >= 0) && (! empty($product_desc) || (! empty($idprod) && $idprod > 0))) { + if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $ret = $object->fetch($id); if ($ret < 0) { dol_print_error($db, $object->error); @@ -524,7 +524,7 @@ if (empty($reshook)) { // Ecrase $tva_tx par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (! empty($idprod) && $idprod > 0) { + if (!empty($idprod) && $idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -553,7 +553,7 @@ if (empty($reshook)) { $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); // if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ? - if (! empty($price_ht)) { + if (!empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } elseif ($tmpvat != $tmpprodvat) { @@ -569,7 +569,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -578,12 +578,12 @@ if (empty($reshook)) { if (empty($newlang)) { $newlang = $object->thirdparty->default_lang; } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - $desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; + $desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; } else { $desc = $prod->description; } @@ -591,10 +591,10 @@ if (empty($reshook)) { $desc = dol_concatdesc($desc, $product_desc); // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { + if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -603,28 +603,28 @@ if (empty($reshook)) { if (empty($newlang)) { $newlang = $object->thirdparty->default_lang; } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); $outputlangs->load('products'); } - if (! empty($prod->customcode)) { + if (!empty($prod->customcode)) { $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; } - if (! empty($prod->customcode) && ! empty($prod->country_code)) { + if (!empty($prod->customcode) && !empty($prod->country_code)) { $tmptxt .= ' - '; } - if (! empty($prod->country_code)) { + if (!empty($prod->country_code)) { $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); } } else { - if (! empty($prod->customcode)) { + if (!empty($prod->customcode)) { $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; } - if (! empty($prod->customcode) && ! empty($prod->country_code)) { + if (!empty($prod->customcode) && !empty($prod->country_code)) { $tmptxt .= ' - '; } - if (! empty($prod->country_code)) { + if (!empty($prod->country_code)) { $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); } } @@ -647,8 +647,8 @@ if (empty($reshook)) { $fk_unit = GETPOST('units', 'alpha'); } - $date_start_fill = ! empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : null; - $date_end_fill = ! empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; + $date_start_fill = !empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : null; + $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; // Margin $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); @@ -667,7 +667,7 @@ if (empty($reshook)) { $remise_percent = (float) price2num($remise_percent); $price_min = (float) price2num($price_min); - if ($usercanproductignorepricemin && (! empty($price_min) && ($pu_ht * (1 - $remise_percent / 100) < $price_min))) { + if ($usercanproductignorepricemin && (!empty($price_min) && ($pu_ht * (1 - $remise_percent / 100) < $price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -778,21 +778,21 @@ if (empty($reshook)) { // Check minimum price $productid = GETPOST('productid', 'int'); - if (! empty($productid)) { + if (!empty($productid)) { $product = new Product($db); $product->fetch($productid); $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { + if (!empty($conf->global->PRODUIT_MULTIPRICES) && !empty($object->thirdparty->price_level)) { $price_min = $product->multiprices_min[$object->thirdparty->price_level]; } $label = $product->label; // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)), null, 'errors'); $error++; } @@ -812,8 +812,8 @@ if (empty($reshook)) { $error++; } - $date_start_fill = ! empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : 'NULL'; - $date_end_fill = ! empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; + $date_start_fill = !empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : 'NULL'; + $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; // Update line if (! $error) { @@ -869,7 +869,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoice"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (! empty($conf->project->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -898,7 +898,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (! empty($conf->project->enabled)) $rowspan++; + if (!empty($conf->project->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print ''; @@ -986,12 +986,12 @@ if ($action == 'create') { print ""; // Project - if (! empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print ''; } @@ -1044,7 +1044,7 @@ if ($action == 'create') { print ""; // Auto generate document - if (! empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { + if (!empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { print "
    ' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); - print '   thirdparty->id . (! empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . ''; + print '   thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . ''; print '
    " . $langs->trans("StatusOfGeneratedDocuments") . ""; $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); @@ -1072,7 +1072,7 @@ if ($action == 'create') { print '
    '; print ''; // Show object lines - if (! empty($object->lines)) { + if (!empty($object->lines)) { $disableedit = 1; $disablemove = 1; $disableremove = 1; @@ -1119,7 +1119,7 @@ if ($action == 'create') { // Recurring invoice content - $linkback = '' . $langs->trans('BackToList') . ''; + $linkback = '' . $langs->trans('BackToList') . ''; $morehtmlref = ''; if ($action != 'edittitle') { @@ -1135,7 +1135,7 @@ if ($action == 'create') { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); $morehtmlref .= '
    ' . $langs->trans('Project') . ' '; if ($usercancreate) { @@ -1153,7 +1153,7 @@ if ($action == 'create') { $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $project = new Project($db); $project->fetch($object->fk_project); $morehtmlref .= ' : ' . $project->getNomUrl(1); @@ -1243,14 +1243,14 @@ if ($action == 'create') { print ''; // Multicurrency - if (! empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled)) { // Multicurrency code print ''; print ''; // Auto generate documents - if (! empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { + if (!empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { print ''; print '
    '; print ''; - if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) { + if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) { print ''; } print '
    '; print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print '' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; @@ -1266,7 +1266,7 @@ if ($action == 'create') { print ''; - if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { print ''; } print '
    '; print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print '' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; @@ -1290,7 +1290,7 @@ if ($action == 'create') { // Help of substitution key $dateexample = dol_now(); - if (! empty($object->frequency) && ! empty($object->date_when)) { + if (!empty($object->frequency) && !empty($object->date_when)) { $dateexample = $object->date_when; } @@ -1478,7 +1478,7 @@ if ($action == 'create') { } print '
    '; if ($action == 'generate_pdf' || $object->frequency > 0) { @@ -1544,7 +1544,7 @@ if ($action == 'create') { '; - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { + if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } @@ -1552,7 +1552,7 @@ if ($action == 'create') { print ''; $object->fetch_lines(); // Show object lines - if (! empty($object->lines)) { + if (!empty($object->lines)) { $canchangeproduct = 1; // To set ref for getNomURL function foreach ($object->lines as $line) { @@ -1598,7 +1598,7 @@ if ($action == 'create') { if (empty($object->suspended)) { if ($usercancreate) { - if (! empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { + if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { print ''; } else { if (empty($object->frequency) || $object->date_when <= $nowlasthour) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f5ed12fd984..f0640681e7f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -277,7 +277,7 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -2692,7 +2692,7 @@ if ($action == 'create') { $action = ''; } else { $text = $langs->trans('ConfirmValidateBill', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -3588,7 +3588,7 @@ if ($action == 'create') { global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; $forceall = 1; $dateSelector = 0; $inputalsopricewithtax = 1; $senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. - //if (! empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2; + //if (!empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2; if (!empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) { $senderissupplier = 1; } @@ -3741,7 +3741,7 @@ if ($action == 'create') { } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print ''; }*/ diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e7f1785cb95..0072349c06b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -963,7 +963,7 @@ if ($resql) { FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), ); /* - if (! empty($conf->global->INVOICE_USE_SITUATION)) + if (!empty($conf->global->INVOICE_USE_SITUATION)) { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index ea9cd9ec996..f798ff10973 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -647,7 +647,7 @@ if (!function_exists('ftp_connect')) { // Actions /* - if ($user->rights->ftp->write && ! empty($section)) + if ($user->rights->ftp->write && !empty($section)) { $formfile->form_attach_new_file(DOL_URL_ROOT.'/ftp/index.php','',0,$section,1); } diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index a4b9bcfcfdb..9d3e63bd09a 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -239,7 +239,7 @@ if ($object->id) { print '
    '."\n"; print ''; - if (! empty($object->fk_user_create)) { + if (!empty($object->fk_user_create)) { $userCreate=new User($db); $userCreate->fetch($object->fk_user_create); print ''; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 239e66ee48f..e8476d0449d 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -500,8 +500,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->evaluationdet->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->evaluationdet->evaluationdet_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->evaluationdet->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->evaluationdet->evaluationdet_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -618,8 +618,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -642,8 +642,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -666,8 +666,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index bc5af1f661d..117878c10c9 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -496,8 +496,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->job->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->job->job_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->job->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->job->job_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -652,8 +652,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -676,8 +676,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -700,8 +700,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 37a8300a1e2..19246dc2313 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -507,8 +507,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->position->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->position->position_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->position->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->position->position_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -626,8 +626,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -650,8 +650,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -674,8 +674,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 99dc0902f95..2c86c5dca56 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -564,8 +564,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skill->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skill->skill_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skill->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skill->skill_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -682,8 +682,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -706,8 +706,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -730,8 +730,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index d1ae24b7efe..4f6d43baa59 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -488,8 +488,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skilldet->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skilldet->skilldet_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skilldet->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skilldet->skilldet_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -606,8 +606,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -630,8 +630,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -654,8 +654,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index c5f5ccb8ff7..6db80642bab 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -527,8 +527,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skillrank->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skillrank->skillrank_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skillrank->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skillrank->skillrank_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -645,8 +645,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -669,8 +669,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -693,8 +693,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index afbd480e928..9d125f450e7 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -123,7 +123,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -147,7 +147,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -168,7 +168,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 8d2d234dd43..ed9e9ecc196 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -134,7 +134,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 0cc25901302..4b301720f07 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index b8008f009ea..b6ce99c9801 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -133,7 +133,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 76f6e73d690..9e0e5323053 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index ccbfabb985b..fc90a24dec6 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -134,7 +134,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index 56029f790a7..92eab8e63b2 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index e1947741bde..23f98d75f3f 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -133,7 +133,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index 5f284c4e72c..0e7f50c042d 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php b/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php index 893a4858c8e..0f75fe15089 100644 --- a/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php +++ b/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php @@ -49,7 +49,7 @@ class ApiPrintConnector implements PrintConnector */ public function __destruct() { - if (! empty($this->stream)) { + if (!empty($this->stream)) { trigger_error("Print connector was not finalized. Did you forget to close the printer?", E_USER_NOTICE); } } diff --git a/htdocs/includes/nusoap/lib/class.soap_transport_http.php b/htdocs/includes/nusoap/lib/class.soap_transport_http.php index 4ff49345083..1f3aa35a9a0 100644 --- a/htdocs/includes/nusoap/lib/class.soap_transport_http.php +++ b/htdocs/includes/nusoap/lib/class.soap_transport_http.php @@ -1270,20 +1270,20 @@ class soap_transport_http extends nusoap_base { continue; } $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) <= time()) { $this->debug('cookie has expired'); continue; } } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + if ((isset($cookie['domain'])) && (!empty($cookie['domain']))) { $domain = preg_quote($cookie['domain']); if (! preg_match("'.*$domain$'i", $this->host)) { $this->debug('cookie has different domain'); continue; } } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + if ((isset($cookie['path'])) && (!empty($cookie['path']))) { $path = preg_quote($cookie['path']); if (! preg_match("'^$path.*'i", $this->path)) { $this->debug('cookie is for a different path'); diff --git a/htdocs/includes/nusoap/lib/class.soapclient.php b/htdocs/includes/nusoap/lib/class.soapclient.php index de0ca3c9882..598ad62246a 100644 --- a/htdocs/includes/nusoap/lib/class.soapclient.php +++ b/htdocs/includes/nusoap/lib/class.soapclient.php @@ -900,7 +900,7 @@ class nusoap_client extends nusoap_base { $this->debug('Remove cookie that is not an array'); continue; } - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) > time()) { $this->cookies[] = $cookie; } else { diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 7e0ebd94da4..eda7ad20092 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -3421,20 +3421,20 @@ class soap_transport_http extends nusoap_base { continue; } $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) <= time()) { $this->debug('cookie has expired'); continue; } } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + if ((isset($cookie['domain'])) && (!empty($cookie['domain']))) { $domain = preg_quote($cookie['domain']); if (! preg_match("'.*$domain$'i", $this->host)) { $this->debug('cookie has different domain'); continue; } } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + if ((isset($cookie['path'])) && (!empty($cookie['path']))) { $path = preg_quote($cookie['path']); if (! preg_match("'^$path.*'i", $this->path)) { $this->debug('cookie is for a different path'); @@ -8057,7 +8057,7 @@ class nusoap_client extends nusoap_base { $this->debug('Remove cookie that is not an array'); continue; } - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) > time()) { $this->cookies[] = $cookie; } else { diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index b57983321a3..8d767de4620 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -101,7 +101,7 @@ class Segment implements IteratorAggregate, Countable preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); //var_dump($tmpvars);exit; foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it - if (! empty($match[1]) && ! isset($tmpvars[$match[1]])) { + if (!empty($match[1]) && ! isset($tmpvars[$match[1]])) { $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop } } diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 6c63da727b7..e993f85f7fd 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -530,7 +530,7 @@ IMG; //var_dump($this->vars);exit; foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it - if (! empty($match[1]) && ! isset($this->vars[$match[1]])) { + if (!empty($match[1]) && ! isset($this->vars[$match[1]])) { $this->vars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop } } @@ -877,7 +877,7 @@ IMG; pclose($handlein); fclose($handle); } - if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } if ($retval == 0) { diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php index fd7dca8a586..a5052f8f248 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php @@ -111,7 +111,7 @@ class Arr $results = []; foreach ($array as $key => $value) { - if (is_array($value) && ! empty($value)) { + if (is_array($value) && !empty($value)) { $results = array_merge($results, static::dot($value, $prepend.$key.'.')); } else { $results[$prepend.$key] = $value; diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php index 61a48841c11..5dfec085be4 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php @@ -482,7 +482,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl $result = new static($results); - if (! empty($nextGroups)) { + if (!empty($nextGroups)) { return $result->map->groupBy($nextGroups, $preserveKeys); } diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php index 6c530c121d3..d76ef31a081 100755 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php @@ -363,7 +363,7 @@ abstract class ServiceProvider */ protected static function pathsForProviderAndGroup($provider, $group) { - if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { + if (!empty(static::$publishes[$provider]) && !empty(static::$publishGroups[$group])) { return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); } diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php index 414be0c2735..63c4f9e1df1 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php @@ -223,7 +223,7 @@ class Stringable implements JsonSerializable $segments = preg_split($pattern, $this->value, $limit, $flags); - return ! empty($segments) ? collect($segments) : collect(); + return !empty($segments) ? collect($segments) : collect(); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php index 122252d8f00..1e4167247ef 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -517,7 +517,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatched($command) { - return isset($this->commands[$command]) && ! empty($this->commands[$command]); + return isset($this->commands[$command]) && !empty($this->commands[$command]); } /** @@ -528,7 +528,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatchedSync($command) { - return isset($this->commandsSync[$command]) && ! empty($this->commandsSync[$command]); + return isset($this->commandsSync[$command]) && !empty($this->commandsSync[$command]); } /** @@ -539,7 +539,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatchedAfterResponse($command) { - return isset($this->commandsAfterResponse[$command]) && ! empty($this->commandsAfterResponse[$command]); + return isset($this->commandsAfterResponse[$command]) && !empty($this->commandsAfterResponse[$command]); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php index 436173e9d3a..cdbf5b18a2c 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php @@ -189,7 +189,7 @@ class EventFake implements Dispatcher */ public function hasDispatched($event) { - return isset($this->events[$event]) && ! empty($this->events[$event]); + return isset($this->events[$event]) && !empty($this->events[$event]); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php index c7b12f42d47..40c694119e1 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -227,7 +227,7 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory */ public function hasSent($notifiable, $notification) { - return ! empty($this->notificationsFor($notifiable, $notification)); + return !empty($this->notificationsFor($notifiable, $notification)); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php index d37cd67237a..f49f4745b88 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -242,7 +242,7 @@ class QueueFake extends QueueManager implements Queue */ public function hasPushed($job) { - return isset($this->jobs[$job]) && ! empty($this->jobs[$job]); + return isset($this->jobs[$job]) && !empty($this->jobs[$job]); } /** diff --git a/htdocs/index.php b/htdocs/index.php index 553fee4855f..2a0a163f44e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -114,7 +114,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $lockfile = DOL_DATA_ROOT.'/install.lock'; if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { $langs->load("errors"); - //if (! empty($message)) $message.='
    '; + //if (!empty($message)) $message.='
    '; $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } @@ -122,7 +122,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { if (is_writable($conffile)) { $langs->load("errors"); //$langs->load("other"); - //if (! empty($message)) $message.='
    '; + //if (!empty($message)) $message.='
    '; $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 02b3ce48ca4..01e89bf51ff 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -574,7 +574,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ''; } } else { - //if (! empty($conf->modules)) + //if (!empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done print ''; } } else { - //if (! empty($conf->modules)) + //if (!empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done print '\n"; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 8b1ede66506..9e7cfdd5d03 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -611,8 +611,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->partnership_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -735,8 +735,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->partnership_advance->accept)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->partnership_advance->accept)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -853,8 +853,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -905,8 +905,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -929,8 +929,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 32162ae0b97..0074d2e80ee 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -270,8 +270,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -294,8 +294,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -318,8 +318,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index ab6d7ea083a..02580c1f73a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -125,7 +125,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -149,7 +149,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -169,7 +169,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index fb826efcd91..279b72593da 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -406,7 +406,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -424,7 +424,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 094380ab83b..75d315ae396 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -133,7 +133,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -154,7 +154,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index f9ea6559979..0b6d0e6bd07 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -151,7 +151,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 12c63b2f5bd..bc99655efa3 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -385,7 +385,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$db->escape($key).", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 3bd2b913163..a38fdc65ade 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -103,7 +103,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php index 0b8a6cd33c9..565a218d063 100644 --- a/htdocs/partnership/partnershipindex.php +++ b/htdocs/partnership/partnershipindex.php @@ -72,7 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { +if (!empty($conf->partnership->enabled) && $user->rights->partnership->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; @@ -141,7 +141,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { +if (!empty($conf->partnership->enabled) && $user->rights->partnership->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."partnership_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index fd107c06351..17387e3948d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1604,7 +1604,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Note (private, no output on invoices, propales...) - //if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode + //if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode //{ print '
    '; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 0580c6c8cc0..8a9186e49c0 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -119,7 +119,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4707657d3e3..49aca30d3e0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1998,7 +1998,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } if (isModEnabled('productbatch')) { $langs->load("stocks"); - $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } if (isModEnabled('variants')) { diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 47483bb8f3b..492cdd48864 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -24,6 +24,7 @@ StockAtDateInFuture=Date in the future StocksByLotSerial=Stocks by lot/serial LotSerial=Lots/Serials LotSerialList=List of lot/serials +SubjectToLotSerialOnly=Products subject to lot/serial only Movements=Movements ErrorWarehouseRefRequired=Warehouse reference name is required ListOfWarehouses=List of warehouses diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 10e70545af6..bec2b772d58 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -41,7 +41,7 @@ $snom = GETPOST("snom", 'alpha'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); -$toolowstock = GETPOST('toolowstock'); +$search_toolowstock = GETPOST('search_toolowstock'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); @@ -116,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $tobuy = ""; $search_sale = ""; $search_categ = ""; - $toolowstock = ''; + $search_toolowstock = ''; $fourn_id = ''; $sbarcode = ''; $search_stock_physique = ''; @@ -210,7 +210,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql_having = ''; -if ($toolowstock) { +if ($search_toolowstock) { $sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; } if ($search_stock_physique != '') { @@ -296,8 +296,8 @@ if ($resql) { if ($search_categ > 0) { $param .= "&search_categ=".urlencode($search_categ); } - if ($toolowstock) { - $param .= "&toolowstock=".urlencode($toolowstock); + if ($search_toolowstock) { + $param .= "&search_toolowstock=".urlencode($search_toolowstock); } if ($sbarcode) { $param .= "&sbarcode=".urlencode($sbarcode); @@ -336,7 +336,7 @@ if ($resql) { } $moreforfilter .= '
    '; - $moreforfilter .= $langs->trans("StockTooLow").' '; + $moreforfilter .= ''; $moreforfilter .= '
    '; if (!empty($moreforfilter)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index a39dc246772..87a49e1bce1 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -52,7 +52,8 @@ $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_batch = GETPOST('search_batch', 'alpha'); -$toolowstock = GETPOST('toolowstock'); +$search_toolowstock = GETPOST('search_toolowstock'); +$search_subjecttolotserial = GETPOST('search_subjecttolotserial'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); @@ -173,7 +174,8 @@ if (empty($reshook)) { $tobuy = ""; $search_sale = ""; $search_categ = ""; - $toolowstock = ''; + $search_toolowstock = ''; + $search_subjecttolotserial = ''; $search_batch = ''; $search_warehouse = ''; $fourn_id = ''; @@ -252,6 +254,9 @@ if (dol_strlen($type)) { $sql .= " AND p.fk_product_type <> '1'"; } } +if ($search_subjecttolotserial) { + $sql .= " AND p.tobatch > 0"; +} if ($sref) { $sql .= natural_search("p.ref", $sref); } @@ -318,7 +323,7 @@ $sql .= " e.ref, e.lieu, e.fk_parent,"; $sql .= " pb.batch, pb.eatby, pb.sellby,"; $sql .= " pl.rowid, pl.eatby, pl.sellby"; $sql_having = ''; -if ($toolowstock) { +if ($search_toolowstock) { $sql_having .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet } if ($search_stock_physique != '') { @@ -437,8 +442,11 @@ if ($sbarcode) { if ($search_warehouse) { $param .= "&search_warehouse=".urlencode($search_warehouse); } -if ($toolowstock) { - $param .= "&toolowstock=".urlencode($toolowstock); +if ($search_toolowstock) { + $param .= "&search_toolowstock=".urlencode($search_toolowstock); +} +if ($search_subjecttolotserial) { + $param .= "&search_subjecttolotserial=".urlencode($search_subjecttolotserial); } if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); @@ -487,7 +495,7 @@ if (!empty($conf->categorie->enabled)) { $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); $moreforfilter .= ''; } -//$moreforfilter.=$langs->trans("StockTooLow").' '; +$moreforfilter.=''; if (!empty($moreforfilter)) { print '
    '; From 03a39d33b904dcc64c3ee6d0653983e2f0c1545c Mon Sep 17 00:00:00 2001 From: Radarjr2002 <112626442+Radarjr2002@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:10:25 +0200 Subject: [PATCH 377/507] Warning in php 8 --- htdocs/core/lib/modulebuilder.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 9e17d925dbe..11cbcad7b85 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -123,7 +123,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = $i++; $texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."',"; $texttoinsert .= " 'label'=>'".$val['label']."',"; - if ($val['picto']) { + if (!empty($val['picto'])) { $texttoinsert .= " 'picto'=>'".$val['picto']."',"; } $texttoinsert .= " 'enabled'=>'".($val['enabled'] !== '' ? $val['enabled'] : 1)."',"; From e5e59e1de04038d05d7b6cf1fb9915cbad007d4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 13:11:11 +0200 Subject: [PATCH 378/507] Look and feel --- htdocs/adherents/admin/website.php | 45 ++++++++++++++---------------- htdocs/admin/ticket_public.php | 29 +++++++++++++++---- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 3c7775dc6b8..41ea43c4cec 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -167,10 +167,30 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $enabledisablehtml; print ''; +print '

    '; -print '
    '; if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { + print '
    '; + //print $langs->trans('FollowingLinksArePublic').'
    '; + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; + if (isModEnabled('multicompany')) { + $entity_qr = '?entity='.$conf->entity; + } else { + $entity_qr = ''; + } + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''; + print ajax_autoselect('publicurlmember'); + print '
    '; print '
    '; @@ -248,29 +268,6 @@ print dol_get_fiche_end(); print ''; - -if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { - print '
    '; - //print $langs->trans('FollowingLinksArePublic').'
    '; - print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; - if (isModEnabled('multicompany')) { - $entity_qr = '?entity='.$conf->entity; - } else { - $entity_qr = ''; - } - - // Define $urlwithroot - $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); - $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - - print ''; - print ajax_autoselect('publicurlmember'); -} - // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index a0df28a8f84..3e4c088620d 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -235,12 +235,10 @@ $head = ticketAdminPrepareHead(); print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); -print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).''; - -print dol_get_fiche_end(); - $param = ''; +print '
    '; + $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { // Button off, click to enable @@ -256,9 +254,30 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $enabledisablehtml; print ''; -print '

    '; +print dol_get_fiche_end(); + + if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { + print '
    '; + + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''.$langs->trans("TicketPublicAccess").' :
    '; + print ''; + print ajax_autoselect('publicurlmember'); + + + print '

    '; + + print '
    '; print ''; print ''; From a83b42ba8e480f93b5d8e276394e166782e5359a Mon Sep 17 00:00:00 2001 From: Radarjr2002 <112626442+Radarjr2002@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:21:15 +0200 Subject: [PATCH 379/507] fix php8 warnings --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7eb7f53d82..6ea90797d43 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1316,7 +1316,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $login = dol_buildlogin($object->lastname, $object->firstname); $generated_password = ''; - if (!$ldap_sid) { // TODO ldap_sid ? + if (empty($ldap_sid)) { // TODO ldap_sid ? require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password = getRandomPassword(false); } From 065c96e1bedfed765b42811ebb22ac8c1491c130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 13:57:15 +0200 Subject: [PATCH 380/507] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 24343c773d5..ced1f23ed39 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2223,7 +2223,7 @@ NoExternalModuleWithUpdate=No updates found for external modules SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. RandomlySelectedIfSeveral=Randomly selected if several pictures are available -SalesRepresentativeInfo=For Proposals, Orders, Invoces. +SalesRepresentativeInfo=For Proposals, Orders, Invoices. DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled From a10a428bc318ea1ec0a791db1c0f3190098c9ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 14:01:27 +0200 Subject: [PATCH 381/507] add doc --- htdocs/core/class/extrafields.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..d26a1dc8fc1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Charles-Fr BENKE * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2017 Nicolas ZABOURI - * 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 @@ -91,7 +91,9 @@ class ExtraFields */ public $errno; - + /** + * @var array array of type to label + */ public static $type2label = array( 'varchar'=>'String1Line', 'text'=>'TextLongNLines', From 06fafc9d7b7358684d13e0af768d5269220352ef Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 15:04:30 +0200 Subject: [PATCH 382/507] New : Add action to push banque account in Stripe account --- htdocs/societe/paymentmodes.php | 42 ++++++++- htdocs/stripe/class/stripe.class.php | 123 +++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 5b9bd1046ef..7d082440661 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -516,6 +516,40 @@ if (empty($reshook)) { } } } + if ($action == 'syncsepatostripe') { + $companybankaccount->fetch(GETPOST('bankid')); + // print "stripe account = " . json_encode($stripe->getStripeAccount($service)); + // print json_encode($companybankaccount); + // print "fetch id = " . json_encode($socid); + + $companypaymentmode = new CompanyPaymentMode($db); + $companypaymentmode->fetch(null, null, $socid); + // print json_encode($companypaymentmode); + + if ($companypaymentmode->type != 'ban') { + $error++; + setEventMessages('ThisPaymentModeIsNotSepa', null, 'errors'); + } else { + // Get the Stripe customer + $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); + // print json_encode($cu); + if (!$cu) { + $error++; + setEventMessages($stripe->error, $stripe->errors, 'errors'); + } + + if (!$error) { + // Creation of Stripe SEPA + update of societe_account + $card = $stripe->sepaStripe($cu, $companypaymentmode, $stripeacc, $servicestatus, 1); + if (!$card) { + $error++; + setEventMessages($stripe->error, $stripe->errors, 'errors'); + } else { + setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to customer account !")); + } + } + } + } if ($action == 'setkey_account') { $error = 0; @@ -632,7 +666,7 @@ if (empty($reshook)) { } elseif ($action == 'setassourcedefault') { // Set as default when payment mode defined remotely only try { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); - if (preg_match('/pm_/', $source)) { + if (preg_match('/pm_|src_/', $source)) { $cu->invoice_settings->default_payment_method = (string) $source; // New } else { $cu->default_source = (string) $source; // Old @@ -660,6 +694,10 @@ if (empty($reshook)) { // $card->detach(); Does not work with card_, only with src_ if (method_exists($card, 'detach')) { $card->detach(); + $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib as sr "; + $sql .= " SET stripe_card_ref = null"; + $sql .= " WHERE sr.stripe_card_ref = '".$db->escape($source)."'"; + $resql = $db->query($sql); } else { $card->delete(); } @@ -1465,7 +1503,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Edit/Delete print '
    '; foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0); print ''; @@ -260,7 +261,7 @@ if ($action == 'edit') { print ''; foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0); print ''; From 5a924d23e3e1d14212e28a61b80fce0bf7592458 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:30:48 +0200 Subject: [PATCH 390/507] fix CI errors --- htdocs/public/ticket/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 2f4bd720219..6332f063541 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -81,7 +81,7 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); print '
    '; -print '

    '.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", ''.$langs->trans("TicketPublicDesc")).'

    ')).'

    '; +print '

    '.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", ''.$langs->trans("TicketPublicDesc")).'

    ').'

    '; print '
    '; print '
    '; From 86b02bc17bc31faf4628f1328acca6d5dc0a0e98 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 18:03:34 +0200 Subject: [PATCH 391/507] Update new.php --- htdocs/public/members/new.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..6b8616ab777 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -62,6 +62,8 @@ if (is_numeric($entity)) { define("DOLENTITY", $entity); } + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; @@ -437,10 +439,11 @@ if (empty($reshook) && $action == 'add') { // Action called after a submitted was send and member created successfully // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. + if (empty($reshook) && $action == 'added') { llxHeaderVierge($langs->trans("NewMemberForm")); - // Si on a pas ete redirige + // If we have not been redirected print '

    '; print '
    '; print $langs->trans("NewMemberbyWeb"); @@ -556,42 +559,51 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''; } - // Company + // Company // TODO : optional hide print '
    '."\n"; + // Title print ''."\n"; + // Lastname print ''."\n"; + // Firstname print ''."\n"; + // EMail print ''."\n"; + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; print ''."\n"; print ''."\n"; } - // Gender + + // Gender // TODO: add diverse gender print ''; print ''; + // Address print ''."\n"; + // Zip / Town print ''; + // Country print ''; } + // Birthday print ''."\n"; + // Photo print ''."\n"; + // Public print ''."\n"; + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + // Comments print ''; print ''; @@ -733,7 +750,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print dol_get_fiche_end(); - // Save + // Save / Submit print '
    '; print ''; if (!empty($backtopage)) { @@ -746,6 +763,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
    "; print '
    '; } else { // Show the table of membership types + // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1)); From 3dc6283eb7216ade80bc5cdd74278545817db1c9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Sep 2022 16:09:05 +0000 Subject: [PATCH 392/507] Fixing style errors. --- htdocs/public/members/new.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 6b8616ab777..ccc229e33bf 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -563,47 +563,47 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''."\n"; - + // Title print ''."\n"; - + // Lastname print ''."\n"; - + // Firstname print ''."\n"; - + // EMail print ''."\n"; - + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; print ''."\n"; print ''."\n"; } - + // Gender // TODO: add diverse gender print ''; print ''; - + // Address print ''."\n"; - + // Zip / Town print ''; - + // Country print ''; } - + // Birthday print ''."\n"; - + // Photo print ''."\n"; - + // Public print ''."\n"; - + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - + // Comments print ''; print ''; @@ -763,7 +763,6 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
    "; print ''; } else { // Show the table of membership types - // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1)); From fce1c1a36aefd0445b2777ab0aea3ef53fb3c7d4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:13:25 +0200 Subject: [PATCH 393/507] Update about.php --- htdocs/zapier/admin/about.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/zapier/admin/about.php b/htdocs/zapier/admin/about.php index b7e2936fc41..71120a384a2 100644 --- a/htdocs/zapier/admin/about.php +++ b/htdocs/zapier/admin/about.php @@ -21,9 +21,9 @@ */ /** - * \file zapier/admin/about.php - * \ingroup zapier - * \brief About page of module Zapier. + * \file htdocs/zapier/admin/about.php + * \ingroup zapier + * \brief About page of module Zapier. */ // Load Dolibarr environment @@ -35,19 +35,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once '../lib/zapier.lib.php'; // Translations -$langs->loadLangs(array("errors", "admin", "zapier")); +$langs->loadLangs(array('admin', 'errors', 'zapier')); // Access control if (!$user->admin) { accessforbidden(); } +if (empty($conf->zapier->enabled)) accessforbidden(); +if (empty($user->admin)) accessforbidden(); + + // Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -if (empty($conf->zapier->enabled)) accessforbidden(); -if (empty($user->admin)) accessforbidden(); /* From c53658e24ade0b73f09090da7a64f55cbfe0ed48 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:16:36 +0200 Subject: [PATCH 394/507] Update webhookindex.php --- htdocs/webhook/webhookindex.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index e62c5e3ddae..50a7ec6d9c1 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -58,15 +58,16 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook")); +$langs->loadLangs(array('webhook')); -$action = GETPOST('action', 'aZ09'); // Security check // if (! $user->rights->webhook->myobject->read) { // accessforbidden(); // } + +$action = GETPOST('action', 'aZ09'); $socid = GETPOST('socid', 'int'); if (isset($user->socid) && $user->socid > 0) { $action = ''; From f4dda6c11c1002fd60a5e27b8f25cf93bd86e1ad Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:22:12 +0200 Subject: [PATCH 395/507] Update target_agenda.php --- htdocs/webhook/target_agenda.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index ccc61d806af..fd3464d3b67 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -16,11 +16,13 @@ */ /** - * \file target_agenda.php - * \ingroup webhook - * \brief Tab of events on Target + * \file htdocs/webhook/target_agenda.php + * \ingroup webhook + * \brief Tab of events on Target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -30,7 +32,7 @@ dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -47,6 +49,7 @@ if (GETPOST('actioncode', 'array')) { } else { $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } + $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -71,6 +74,7 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetagenda', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); From 78eab1a8e89778fea8413d6bf3b2e525603ea77f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:27:27 +0200 Subject: [PATCH 396/507] Update target_card.php --- htdocs/webhook/target_card.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 0777b984d9a..7e4ef4bb265 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -16,11 +16,13 @@ */ /** - * \file target_card.php - * \ingroup webhook - * \brief Page to create/edit/view target + * \file target_card.php + * \ingroup webhook + * \brief Page to create/edit/view target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -29,7 +31,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -69,6 +71,7 @@ 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 // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; From 1b78423ab3c0ad8feef69ff36cfd191fc98cfcb0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:30:26 +0200 Subject: [PATCH 397/507] Update target_contact.php --- htdocs/webhook/target_contact.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 76b1a92821f..9aa51b2c44e 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -16,11 +16,13 @@ */ /** - * \file target_contact.php - * \ingroup webhook - * \brief Tab for contacts linked to Target + * \file htdocs/webhook/target_contact.php + * \ingroup webhook + * \brief Tab for contacts linked to Target */ + +// 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'; @@ -28,7 +30,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "companies", "other", "mails")); +$langs->loadLangs(array('webhook', 'companies', 'other', 'mails')); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); @@ -41,12 +43,14 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetcontact', '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 // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; From d22120e5f4c581cdcf6b3b1e826f90a86e1f5f09 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:35:46 +0200 Subject: [PATCH 398/507] Update target_list.php --- htdocs/webhook/target_list.php | 36 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index e8a736f5e47..d80661906c0 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -17,11 +17,13 @@ */ /** - * \file target_list.php - * \ingroup webhook - * \brief List page for target + * \file htdocs/webhook/target_list.php + * \ingroup webhook + * \brief List page for target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -34,20 +36,21 @@ require_once __DIR__.'/class/target.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); -$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 ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ'); +// Get Parameters +$id = GETPOST('id', 'int'); +$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 ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); -$id = GETPOST('id', 'int'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -119,6 +122,7 @@ foreach ($object->fields as $key => $val) { ); } } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -126,6 +130,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; @@ -207,6 +212,7 @@ $now = dol_now(); //$help_url = "EN:Module_Target|FR:Module_Target_FR|ES:Módulo_Target"; $help_url = ''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Targets")); + $morejs = array(); $morecss = array(); From 77f352610a4c382e849b0b489120d076a06fc50e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:38:41 +0200 Subject: [PATCH 399/507] Update target_note.php --- htdocs/webhook/target_note.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index 8ba98fd622d..c9fe74c8758 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -17,22 +17,24 @@ */ /** - * \file target_note.php - * \ingroup webhook - * \brief Tab for notes on Target + * \file htdocs/webhook/target_note.php + * \ingroup webhook + * \brief Tab for notes on Target */ + +// Load Dolibarr environment require '../main.inc.php'; dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "companies")); +$langs->loadLangs(array('webhook', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -41,6 +43,7 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -50,7 +53,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } - +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; @@ -93,7 +96,7 @@ if (empty($reshook)) { $form = new Form($db); -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +//$help_url='EN:Webhooks|FR:Webhooks_FR|ES:Webhooks_ES'; $help_url = ''; $title = $langs->trans('Target').' - '.$langs->trans("Notes"); llxHeader('', $title, $help_url); From 401493a35931ac421ab5d6a8425322d3c683e1e5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:41:30 +0200 Subject: [PATCH 400/507] Update blockedlog.php --- htdocs/blockedlog/admin/blockedlog.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 8880e6c1e86..0f9034e374a 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -22,22 +22,25 @@ * \brief Page setup for blockedlog module */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "blockedlog")); +$langs->loadLangs(array('admin', 'blockedlog', 'other')); +// Access Control if (!$user->admin || empty($conf->blockedlog->enabled)) { accessforbidden(); } -$action = GETPOST('action', 'aZ09'); +// Get Parameters +$action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); - -$withtab = GETPOST('withtab', 'int'); +$withtab = GETPOST('withtab', 'int'); /* From ce986e4128859d5923e5de8a51795bfc3801c718 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:46:59 +0200 Subject: [PATCH 401/507] Update blockedlog_list.php --- htdocs/blockedlog/admin/blockedlog_list.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 4490b3897df..934ef9fba7b 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -18,11 +18,13 @@ */ /** - * \file htdocs/blockedlog/admin/blockedlog_list.php - * \ingroup blockedlog - * \brief Page setup for blockedlog module + * \file htdocs/blockedlog/admin/blockedlog_list.php + * \ingroup blockedlog + * \brief Page setup for blockedlog module */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; @@ -31,16 +33,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "blockedlog", "bills")); +$langs->loadLangs(array('admin', 'bills', 'blockedlog', 'other')); +// Access Control if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) { accessforbidden(); } -$action = GETPOST('action', 'aZ09'); +// Get Parameters +$action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'blockedloglist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); if ($search_showonlyerrors < 0) { @@ -95,7 +99,7 @@ $block_static->loadTrackedEvents(); $result = restrictedArea($user, 'blockedlog', 0, ''); - +// Execution Time $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined $max_time = @ini_get("max_execution_time"); if ($max_time && $max_time < $max_execution_time_for_importexport) { From e3b5b762032acef9a9c391f01d9e472d4059db3b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:54:11 +0200 Subject: [PATCH 402/507] Update blockedlog.class.php --- htdocs/blockedlog/class/blockedlog.class.php | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 3ab2b63ad3f..fa428e4f17e 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -140,6 +140,7 @@ class BlockedLog $this->trackedevents = array(); + // Customer Invoice/Facture / Payment if (isModEnabled('facture')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; @@ -151,18 +152,19 @@ class BlockedLog } /* Supplier + // Supplier Invoice / Payment if (isModEnabled("fournisseur")) { - $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; + $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; $this->trackedevents['BILL_SUPPLIER_DELETE']='BlockedLogSupplierBillDelete'; $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done - $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done - $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done - - $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; - $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; + $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done + $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done + $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; + $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; } */ + // Donation if (!empty($conf->don->enabled)) { $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; @@ -172,23 +174,29 @@ class BlockedLog } /* + // Salary if (!empty($conf->salary->enabled)) { - $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; - $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; - $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; } */ + // Members if (!empty($conf->adherent->enabled)) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; } + + // Bank if (isModEnabled("banque")) { $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; } + + // Cashdesk // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); if ($moduleposenabled) { From 111b5633370acb1ec58c56bbc3e7e282e5505cc3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:00:26 +0200 Subject: [PATCH 403/507] Update blockedlog.lib.php --- htdocs/blockedlog/lib/blockedlog.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index 44f7074d582..23a7ec1f62d 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/blockedlog/lib/blockedlog.lib.php - * \ingroup system - * \brief Library for common blockedlog functions + * \file htdocs/blockedlog/lib/blockedlog.lib.php + * \ingroup system + * \brief Library for common blockedlog functions */ /** From f17e0b6de5afdae943a1a974840280b3228b33c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 1 Sep 2022 20:09:54 +0200 Subject: [PATCH 404/507] use isModEnabled --- htdocs/webhook/README.md | 86 ----------------------- htdocs/webhook/lib/webhook_target.lib.php | 2 +- htdocs/webhook/target_agenda.php | 13 ++-- htdocs/webhook/target_card.php | 1 + htdocs/webhook/target_contact.php | 16 +++-- htdocs/webhook/target_list.php | 15 ++-- htdocs/webhook/target_note.php | 16 +++-- htdocs/webhook/webhookindex.php | 36 +--------- 8 files changed, 39 insertions(+), 146 deletions(-) delete mode 100644 htdocs/webhook/README.md diff --git a/htdocs/webhook/README.md b/htdocs/webhook/README.md deleted file mode 100644 index 74fe79e76fd..00000000000 --- a/htdocs/webhook/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# WEBHOOK FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) - -## Features - -Description of the module... - - - -Other external modules are available on [Dolistore.com](https://www.dolistore.com). - -## Translations - -Translations can be completed manually by editing files into directories *langs*. - - - - - -## Licenses - -### Main code - -GPLv3 or (at your option) any later version. See file COPYING for more information. - -### Documentation - -All texts and readmes are licensed under GFDL. diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index fb01a8f95aa..b15252794ea 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.php @@ -30,7 +30,7 @@ function targetPrepareHead($object) { global $db, $langs, $conf; - $langs->load("webhook@webhook"); + $langs->load("webhook"); $h = 0; $head = array(); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 5c039f4cc38..12b61187fbe 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -21,12 +21,13 @@ * \brief Tab of events on Target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page @@ -54,8 +55,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { + // If $page is not defined, or '' or -1 $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -96,8 +98,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 87c079b1b26..69338156da3 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -21,6 +21,7 @@ * \brief Page to create/edit/view target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 9b7f261cd59..d6523794444 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -21,19 +21,20 @@ * \brief Tab for contacts linked to Target */ +// 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'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "companies", "other", "mails")); -$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility -$ref = GETPOST('ref', 'alpha'); +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -63,8 +64,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index e8a736f5e47..5deee22691f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -22,13 +22,14 @@ * \brief List page for target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load webhook libraries -require_once __DIR__.'/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -36,16 +37,16 @@ require_once __DIR__.'/class/target.class.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "other")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$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 ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ'); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index ef3805d699d..0ae570b94e1 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -22,18 +22,19 @@ * \brief Tab for notes on Target */ +// Load Dolibarr environment require '../main.inc.php'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects @@ -69,8 +70,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index 3d050499a29..59973021ca2 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -25,40 +25,11 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook")); +$langs->loadLangs(array("webhook")); $action = GETPOST('action', 'aZ09'); @@ -100,8 +71,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (!empty($conf->webhook->enabled) && $user->rights->webhook->read) -{ +if (!empty($conf->webhook->enabled) && $user->rights->webhook->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; From 33e112eda7697766f7fecb81509dfa141f7dae92 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:06:30 +0200 Subject: [PATCH 405/507] Update list.php --- htdocs/commande/list.php | 78 ++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ba2f410cc9..1363d9bd953 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -33,6 +33,8 @@ * \brief Page to list orders */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -51,6 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products')); +// Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -58,6 +61,7 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist'; +// Search Parameters $search_datecloture_start = GETPOST('search_datecloture_start', 'int'); if (empty($search_datecloture_start)) { $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); @@ -86,7 +90,7 @@ $socid = GETPOST('socid', 'int'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); -$search_total_ht = GETPOST('search_total_ht', 'alpha'); +$search_total_ht = GETPOST('search_total_ht', 'alpha'); $search_total_vat = GETPOST('search_total_vat', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'int'); @@ -209,6 +213,7 @@ $arrayfields = array( 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -724,6 +729,7 @@ if ($action == 'shipped' && $permissiontoadd) { } } } + // Closed records if (!$error && $massaction === 'setbilled' && $permissiontoclose) { $db->begin(); @@ -760,10 +766,12 @@ if (!$error && $massaction === 'setbilled' && $permissiontoclose) { } } + /* * View */ + $now = dol_now(); $form = new Form($db); @@ -799,12 +807,14 @@ $sql .= ' c.fk_input_reason, c.import_key'; if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } + // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } + // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook @@ -1065,7 +1075,7 @@ if ($resql) { exit; } - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url); $param = ''; @@ -1327,7 +1337,7 @@ if ($resql) { $moreforfilter = ''; - // If the user can view prospects other than his' + // If the user can view prospects? sales other than his own if ($user->rights->user->user->lire) { $langs->load("commercial"); $moreforfilter .= '
    '; @@ -1342,7 +1352,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= '
    '; } - // If the user can view prospects other than his' + // If the user can view other products/services than his own if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1351,6 +1361,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
    '; } + // If Categories are enabled & user has rights to see if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1358,6 +1369,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= '
    '; } + // If Stock is enabled if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -1509,60 +1521,63 @@ if ($resql) { $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1); print ''; } + // Amount HT / net if (!empty($arrayfields['c.total_ht']['checked'])) { - // Amount print '
    '; } + // Amount of VAT if (!empty($arrayfields['c.total_vat']['checked'])) { - // Amount print ''; } + // Total Amount (TTC / gross) if (!empty($arrayfields['c.total_ttc']['checked'])) { - // Amount + print ''; } + // Currency if (!empty($arrayfields['c.multicurrency_code']['checked'])) { - // Currency print ''; } + // Currency rate if (!empty($arrayfields['c.multicurrency_tx']['checked'])) { - // Currency rate print ''; } + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { - // Amount + print ''; } + // VAT in foreign currency if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { - // Amount VAT print ''; } + // Amount/Total (TTC / gross) in foreign currency if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { - // Amount print ''; } + // Author if (!empty($arrayfields['u.login']['checked'])) { - // Author print ''; } + // Sales Representative if (!empty($arrayfields['sale_representative']['checked'])) { print ''; } @@ -1582,12 +1597,15 @@ if ($resql) { print ''; } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + // Fields from hook $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Date creation if (!empty($arrayfields['c.datec']['checked'])) { print '\n"; @@ -2010,6 +2034,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print '\n"; if (!$i) { @@ -2106,6 +2138,7 @@ if ($resql) { $totalarray['val']['c.total_ht'] = $obj->total_ht; } } + // Amount VAT if (!empty($arrayfields['c.total_vat']['checked'])) { print '\n"; @@ -2117,7 +2150,8 @@ if ($resql) { } $totalarray['val']['c.total_tva'] += $obj->total_tva; } - // Amount TTC + + // Amount TTC / gross if (!empty($arrayfields['c.total_ttc']['checked'])) { print '\n"; if (!$i) { @@ -2146,21 +2180,22 @@ if ($resql) { $totalarray['nbfield']++; } } - // Amount HT + + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; } } - // Amount VAT + // Amount VAT in foreign currency if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; } } - // Amount TTC + // Amount TTC / gross in foreign currency if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { print '\n"; if (!$i) { @@ -2196,8 +2231,8 @@ if ($resql) { } } + // Sales representatives if (!empty($arrayfields['sale_representative']['checked'])) { - // Sales representatives print ''; @@ -2261,6 +2297,7 @@ if ($resql) { } $totalarray['val']['total_margin'] += $marginInfo['total_margin']; } + // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { print ''; @@ -2268,6 +2305,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { print ''; @@ -2456,6 +2494,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Import key if (!empty($arrayfields['c.import_key']['checked'])) { print ''; @@ -2463,6 +2502,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { print ''; From 9a7ad0a7dca6737606ec2beda0d7f2a613017d4c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Sep 2022 19:17:42 +0000 Subject: [PATCH 406/507] Fixing style errors. --- htdocs/commande/list.php | 58 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1363d9bd953..22afe05725f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1075,7 +1075,7 @@ if ($resql) { exit; } - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url); $param = ''; @@ -1361,7 +1361,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= ''; } - // If Categories are enabled & user has rights to see + // If Categories are enabled & user has rights to see if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1533,9 +1533,8 @@ if ($resql) { print ''; print ''; } - // Total Amount (TTC / gross) + // Total Amount (TTC / gross) if (!empty($arrayfields['c.total_ttc']['checked'])) { - print '
    '; @@ -1554,7 +1553,6 @@ if ($resql) { } // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { - print ''; @@ -1597,15 +1595,15 @@ if ($resql) { print ''; } - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - + // Fields from hook $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + // Date creation if (!empty($arrayfields['c.datec']['checked'])) { print '\n"; @@ -2034,7 +2032,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print '\n"; @@ -2138,7 +2136,7 @@ if ($resql) { $totalarray['val']['c.total_ht'] = $obj->total_ht; } } - + // Amount VAT if (!empty($arrayfields['c.total_vat']['checked'])) { print '\n"; @@ -2150,7 +2148,7 @@ if ($resql) { } $totalarray['val']['c.total_tva'] += $obj->total_tva; } - + // Amount TTC / gross if (!empty($arrayfields['c.total_ttc']['checked'])) { print '\n"; @@ -2180,7 +2178,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { print '\n"; @@ -2285,7 +2283,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Total margin if (!empty($arrayfields['total_margin']['checked'])) { print ''; @@ -2297,7 +2295,7 @@ if ($resql) { } $totalarray['val']['total_margin'] += $marginInfo['total_margin']; } - + // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { print ''; @@ -2305,7 +2303,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { print ''; @@ -2494,7 +2492,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Import key if (!empty($arrayfields['c.import_key']['checked'])) { print ''; @@ -2502,7 +2500,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { print ''; From 3d9b57ac3f59be37ba5f9addb33a3d48fcd170b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 08:53:13 +0200 Subject: [PATCH 407/507] Clean code --- .../categories/class/api_categories.class.php | 3 - .../facture/class/facture-rec.class.php | 10 +- htdocs/core/class/extrafields.class.php | 111 ++++++------------ htdocs/cron/class/cronjob.class.php | 28 +++-- htdocs/fichinter/class/fichinter.class.php | 90 ++++++++------ htdocs/fichinter/class/fichinterrec.class.php | 26 ++-- .../install/mysql/migration/16.0.0-17.0.0.sql | 3 + .../mysql/tables/llx_fichinterdet_rec.sql | 2 - htdocs/website/index.php | 3 +- 9 files changed, 123 insertions(+), 153 deletions(-) diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 0a618974024..d5345106093 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -682,9 +682,6 @@ class Categories extends DolibarrApi unset($object->total_ttc); unset($object->total_tva); unset($object->lines); - unset($object->fk_incoterms); - unset($object->label_incoterms); - unset($object->location_incoterms); unset($object->civility_id); unset($object->name); unset($object->lastname); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f15f65954cf..3001baca506 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -25,7 +25,7 @@ /** * \file htdocs/compta/facture/class/facture-rec.class.php * \ingroup facture - * \brief Fichier de la classe des factures recurentes + * \brief File of class to manage recurring invoices */ require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; @@ -462,7 +462,7 @@ class FactureRec extends CommonInvoice /** - * Update a line to invoice_rec. + * Update a line invoice_rec. * * @param User $user User * @param int $notrigger No trigger @@ -470,8 +470,6 @@ class FactureRec extends CommonInvoice */ public function update(User $user, $notrigger = 0) { - global $conf; - $error = 0; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; @@ -480,8 +478,8 @@ class FactureRec extends CommonInvoice $sql .= " suspended = ".((int) $this->suspended).","; $sql .= " fk_soc = ".((int) $this->socid).","; $sql .= " total_tva = ".((float) $this->total_tva).","; - $sql .= " localtax1 = ".((float) $this->localtax1).","; - $sql .= " localtax2 = ".((float) $this->localtax2).","; + $sql .= " localtax1 = ".((float) $this->total_localtax1).","; + $sql .= " localtax2 = ".((float) $this->total_localtax2).","; $sql .= " total_ht = ".((float) $this->total_ht).","; $sql .= " total_ttc = ".((float) $this->total_ttc).","; $sql .= " remise_percent = ".((float) $this->remise_percent); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..5b6e00e91da 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -42,30 +42,6 @@ class ExtraFields */ public $db; - /** - * @var array Array with type of the extra field - * @deprecated - */ - public $attribute_type; - - /** - * @var array Array with label of extra field - * @deprecated - */ - public $attribute_label; - - /** - * @var array Array with list of possible values for some types of extra fields - * @deprecated - */ - public $attribute_choice; - - /** - * @var array array to store extrafields definition - * @deprecated - */ - public $attribute_list; - /** * @var array New array to store extrafields definition */ @@ -128,10 +104,6 @@ class ExtraFields $this->error = ''; $this->errors = array(); $this->attributes = array(); - - // For old usage - $this->attribute_type = array(); - $this->attribute_label = array(); } /** @@ -838,7 +810,7 @@ class ExtraFields // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load array this->attributes (and some old this->attribute_xxx like attribute_label, attribute_type, ... + * Load array this->attributes * * @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param boolean $forceload Force load of extra fields whatever is status of cache. @@ -892,11 +864,6 @@ class ExtraFields $array_name_label[$tab->name] = $tab->label; } - // Old usage - $this->attribute_type[$tab->name] = $tab->type; - $this->attribute_label[$tab->name] = $tab->label; - - // New usage $this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type; $this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label; $this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size; @@ -946,7 +913,7 @@ class ExtraFields * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) * @param int $objectid Current object id - * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data + * @param string $extrafieldsobjectkey The key to use to store retreived data (for example $object->table_element) * @param string $mode 1=Used for search filters * @return string */ @@ -965,29 +932,26 @@ class ExtraFields $keyprefix = $keyprefix.'options_'; } - if (!empty($extrafieldsobjectkey)) { - $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; - $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; - $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; - $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; - $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; - $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; - $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); - $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); - $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; - $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; - $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } else { - // Old usage - $label = $this->attribute_label[$key]; - $type = $this->attribute_type[$key]; - $list = $this->attribute_list[$key]; - $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if (empty($extrafieldsobjectkey)) { + dol_syslog(get_class($this).'::showInputField extrafieldsobjectkey required', LOG_ERR); + return 'BadValueForParamExtraFieldsObjectKey'; } + $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; + $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; + $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; + $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; + $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; + $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; + $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; + $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); + $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; + $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); + $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; + $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; + $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if ($computed) { if (!preg_match('/^search_/', $keyprefix)) { return ''.$langs->trans("AutomaticallyCalculated").''; @@ -1591,26 +1555,25 @@ class ExtraFields { global $conf, $langs; - if (!empty($extrafieldsobjectkey)) { - $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; - $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... - $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; - $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; - $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; - $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; - $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); - $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); - $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; - $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } else { - // Old usage not allowed anymore - dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_WARNING); - return ''; + if (empty($extrafieldsobjectkey)) { + dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_ERR); + return 'BadValueForParamExtraFieldsObjectKey'; } + $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; + $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... + $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; + $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; + $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; + $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; + $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; + $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); + $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; + $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); + $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; + $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if ($hidden) { return ''; // This is a protection. If field is hidden, we should just not call this method. } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 9bc8400188f..033e6512bd8 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -108,62 +108,62 @@ class Cronjob extends CommonObject public $datelastresult = ''; /** - * @var string Last result from end job execution + * @var string Last result from end job execution */ public $lastresult; /** - * @var string Last output from end job execution + * @var string Last output from end job execution */ public $lastoutput; /** - * @var string Unit frequency of job execution + * @var string Unit frequency of job execution */ public $unitfrequency; /** - * @var int Frequency of job execution + * @var int Frequency of job execution */ public $frequency; /** - * @var int Status + * @var int Status */ public $status; /** - * @var int Is job processing + * @var int Is job running ? */ public $processing; /** - * @var int The job current PID + * @var int The job current PID */ public $pid; /** - * @var int ID + * @var int User ID of creation */ public $fk_user_author; /** - * @var int ID + * @var int User ID of last modification */ public $fk_user_mod; /** - * @var int Number of run job execution + * @var int Number of run job execution */ public $nbrun; /** - * @var int Maximum run job execution + * @var int Maximum run job execution */ public $maxrun; /** - * @var string Libname + * @var string Libname */ public $libname; @@ -1513,10 +1513,12 @@ class Cronjobline public $datenextrun = ''; public $dateend = ''; public $datestart = ''; + public $datelastresult = ''; public $lastresult = ''; public $lastoutput; public $unitfrequency; public $frequency; + public $processing; /** * @var int Status @@ -1534,8 +1536,10 @@ class Cronjobline public $fk_user_mod; public $note; + public $note_private; public $nbrun; public $libname; + public $test; /** * Constructor diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 61c127cab9b..dbc14231b41 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -36,36 +36,36 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; */ class Fichinter extends CommonObject { - public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), - 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>36), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), - 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), + 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), + 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), + 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), + 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>36), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), + 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), ); + /** * @var string ID to identify managed object */ @@ -1267,7 +1267,8 @@ class Fichinter extends CommonObject $line->fk_fichinter = $fichinterid; $line->desc = $desc; - $line->datei = $date_intervention; + $line->date = $date_intervention; + $line->datei = $date_intervention; // For backward compatibility $line->duration = $duration; if (is_array($array_options) && count($array_options) > 0) { @@ -1316,7 +1317,8 @@ class Fichinter extends CommonObject while ($xnbp < $nbp) { $line = new FichinterLigne($this->db); $line->desc = $langs->trans("Description")." ".$xnbp; - $line->datei = ($now - 3600 * (1 + $xnbp)); + $line->date = ($now - 3600 * (1 + $xnbp)); + $line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility $line->duration = 600; $line->fk_fichinter = 0; $this->lines[$xnbp] = $line; @@ -1359,7 +1361,7 @@ class Fichinter extends CommonObject //For invoicing we calculing hours $line->qty = round($objp->duree / 3600, 2); $line->date = $this->db->jdate($objp->date); - $line->datei = $this->db->jdate($objp->date); + $line->datei = $this->db->jdate($objp->date); // For backward compatibility $line->rang = $objp->rang; $line->product_type = 1; $line->fetch_optionals(); @@ -1486,6 +1488,8 @@ class FichinterLigne extends CommonObjectLine public $duration; // Duration of intervention public $rang = 0; + public $tva_tx; + public $subprice; /** * @var string ID to identify managed object @@ -1522,8 +1526,7 @@ class FichinterLigne extends CommonObjectLine */ public function fetch($rowid) { - $sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang,'; - $sql .= ' ft.date as datei'; + $sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang, ft.date'; $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql .= ' WHERE ft.rowid = '.((int) $rowid); @@ -1534,7 +1537,8 @@ class FichinterLigne extends CommonObjectLine $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_fichinter = $objp->fk_fichinter; - $this->datei = $this->db->jdate($objp->datei); + $this->date = $this->db->jdate($objp->date); + $this->datei = $this->db->jdate($objp->date); // For backward compatibility $this->desc = $objp->description; $this->duration = $objp->duree; $this->rang = $objp->rang; @@ -1562,6 +1566,10 @@ class FichinterLigne extends CommonObjectLine dol_syslog("FichinterLigne::insert rang=".$this->rang); + if (empty($this->date) && !empty($this->datei)) { // For backward compatibility + $this->date = $this->datei; + } + $this->db->begin(); $rangToUse = $this->rang; @@ -1585,7 +1593,7 @@ class FichinterLigne extends CommonObjectLine $sql .= ' (fk_fichinter, description, date, duree, rang)'; $sql .= " VALUES (".((int) $this->fk_fichinter).","; $sql .= " '".$this->db->escape($this->desc)."',"; - $sql .= " '".$this->db->idate($this->datei)."',"; + $sql .= " '".$this->db->idate($this->date)."',"; $sql .= " ".((int) $this->duration).","; $sql .= ' '.((int) $rangToUse); $sql .= ')'; @@ -1647,14 +1655,18 @@ class FichinterLigne extends CommonObjectLine $error = 0; + if (empty($this->date) && !empty($this->datei)) { // For backward compatibility + $this->date = $this->datei; + } + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET"; - $sql .= " description='".$this->db->escape($this->desc)."'"; - $sql .= ",date='".$this->db->idate($this->datei)."'"; - $sql .= ",duree=".$this->duration; - $sql .= ",rang='".$this->db->escape($this->rang)."'"; + $sql .= " description = '".$this->db->escape($this->desc)."',"; + $sql .= " date = '".$this->db->idate($this->date)."',"; + $sql .= " duree = ".((int) $this->duration).","; + $sql .= " rang = ".((int) $this->rang); $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog("FichinterLigne::update", LOG_DEBUG); diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index b128bba60f8..bcf89704e55 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -64,7 +64,6 @@ class FichinterRec extends Fichinter public $number; public $date; public $amount; - public $remise; public $tva; public $total; @@ -222,7 +221,7 @@ class FichinterRec extends Fichinter $result_insert = $this->addline( $fichintsrc->lines[$i]->desc, $fichintsrc->lines[$i]->duration, - $fichintsrc->lines[$i]->datei, + $fichintsrc->lines[$i]->date, $fichintsrc->lines[$i]->rang, $fichintsrc->lines[$i]->subprice, $fichintsrc->lines[$i]->qty, @@ -350,8 +349,8 @@ class FichinterRec extends Fichinter // phpcs:enable $this->lines = array(); - $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description, '; - $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, '; + $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description,'; + $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, l.date,'; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.rang, l.special_code,'; $sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; @@ -381,19 +380,16 @@ class FichinterRec extends Fichinter $line->qty = $objp->qty; $line->duree = $objp->duree; $line->duration = $objp->duree; - $line->datei = $objp->date; + $line->date = $objp->date; $line->subprice = $objp->subprice; $line->tva_tx = $objp->tva_tx; $line->remise_percent = $objp->remise_percent; $line->fk_remise_except = $objp->fk_remise_except; $line->fk_product = $objp->fk_product; - $line->date_start = $objp->date_start; - $line->date_end = $objp->date_end; $line->info_bits = $objp->info_bits; $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; $line->total_ttc = $objp->total_ttc; - $line->code_ventilation = $objp->fk_code_ventilation; $line->rang = $objp->rang; $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; @@ -460,7 +456,7 @@ class FichinterRec extends Fichinter * * @param string $desc Description de la ligne * @param integer $duration Durée - * @param string $datei Date + * @param string $date Date * @param int $rang Position of line * @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $qty Quantity @@ -477,7 +473,7 @@ class FichinterRec extends Fichinter * @param string $fk_unit Unit * @return int <0 if KO, Id of line if OK */ - public function addline($desc, $duration, $datei, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) + public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) { global $mysoc; @@ -520,6 +516,8 @@ class FichinterRec extends Fichinter $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; + $pu_ht = $tabprice[3]; + $product_type = $type; if ($fk_product) { $product = new Product($this->db); @@ -539,8 +537,7 @@ class FichinterRec extends Fichinter $sql .= ", fk_product"; $sql .= ", product_type"; $sql .= ", remise_percent"; - //$sql.= ", subprice"; - $sql .= ", remise"; + $sql .= ", subprice"; $sql .= ", total_ht"; $sql .= ", total_tva"; $sql .= ", total_ttc"; @@ -551,7 +548,7 @@ class FichinterRec extends Fichinter $sql .= (int) $this->id; $sql .= ", ".(!empty($label) ? "'".$this->db->escape($label)."'" : "null"); $sql .= ", ".(!empty($desc) ? "'".$this->db->escape($desc)."'" : "null"); - $sql .= ", ".(!empty($datei) ? "'".$this->db->idate($datei)."'" : "null"); + $sql .= ", ".(!empty($date) ? "'".$this->db->idate($date)."'" : "null"); $sql .= ", ".$duration; //$sql.= ", ".price2num($pu_ht); //$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null")); @@ -559,8 +556,7 @@ class FichinterRec extends Fichinter $sql .= ", ".(!empty($fk_product) ? $fk_product : "null"); $sql .= ", ".$product_type; $sql .= ", ".(!empty($remise_percent) ? $remise_percent : "null"); - //$sql.= ", '".price2num($pu_ht)."'"; - $sql .= ", null"; + $sql.= ", '".price2num($pu_ht)."'"; $sql .= ", '".price2num($total_ht)."'"; $sql .= ", '".price2num($total_tva)."'"; $sql .= ", '".price2num($total_ttc)."'"; 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 5db36ee955b..c84a80aa72f 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 @@ -61,6 +61,9 @@ ALTER TABLE llx_user DROP COLUMN idpers3; ALTER TABLE llx_partnership ADD COLUMN ip varchar(250); ALTER TABLE llx_adherent ADD COLUMN ip varchar(250); +ALTER TABLE llx_fichinterdet_rec DROP COLUMN remise; +ALTER TABLE llx_fichinterdet_rec DROP COLUMN fk_export_commpta; + UPDATE llx_const set name = 'ADHERENT_MAILMAN_ADMIN_PASSWORD' WHERE name = 'ADHERENT_MAILMAN_ADMINPW'; ALTER TABLE llx_oauth_token ADD COLUMN state text after tokenstring; diff --git a/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql index ef799ea379a..bdef744df49 100644 --- a/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql +++ b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql @@ -41,7 +41,6 @@ create table llx_fichinterdet_rec localtax2_type VARCHAR(1) NULL DEFAULT NULL, qty double NULL DEFAULT NULL, remise_percent double NULL DEFAULT 0, - remise double NULL DEFAULT 0, fk_remise_except integer NULL DEFAULT NULL, price DOUBLE(24, 8) NULL DEFAULT NULL, total_tva DOUBLE(24, 8) NULL DEFAULT NULL, @@ -55,7 +54,6 @@ create table llx_fichinterdet_rec buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0, fk_product_fournisseur_price integer NULL DEFAULT NULL, fk_code_ventilation integer NOT NULL DEFAULT 0, - fk_export_commpta integer NOT NULL DEFAULT 0, special_code integer UNSIGNED NULL DEFAULT 0, fk_unit integer NULL DEFAULT NULL, import_key varchar(14) NULL DEFAULT NULL diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0b599ba640b..f8c6a94c09c 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -751,7 +751,6 @@ if ($action == 'addcontainer' && $usercanedit) { $objectpage->content = preg_replace('/^.*]*)*>/ims', '', $objectpage->content); $objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content); - $absoluteurlinaction = $urltograbdirwithoutslash; // TODO Replace 'action="$urltograbdirwithoutslash' into action="/" // TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..." // TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/" @@ -908,7 +907,7 @@ if ($action == 'addcontainer' && $usercanedit) { getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto); - // We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflicit with CSS of Dolibarr. + // We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflict with CSS of Dolibarr. include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php'; $lesscobj = new Lessc(); try { From 2d794473a5aefac46d8f2fd03344a75b9e7b5a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 09:45:40 +0200 Subject: [PATCH 408/507] Clean code --- htdocs/core/modules/modWebhook.class.php | 2 +- htdocs/webhook/class/target.class.php | 5 +---- htdocs/webhook/lib/webhook.lib.php | 4 +--- htdocs/webhook/lib/webhook_target.lib.php | 4 +--- htdocs/webhook/target_agenda.php | 2 +- htdocs/webhook/target_card.php | 2 +- htdocs/webhook/target_contact.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/webhook/target_note.php | 2 +- htdocs/webhook/webhookindex.php | 4 ---- 10 files changed, 9 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index fbcb5f81003..fd7f658bd48 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -141,7 +141,7 @@ class modWebhook extends DolibarrModules $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) // The language file dedicated to your module - $this->langfiles = array("webhook"); + $this->langfiles = array(); // Prerequisites $this->phpmin = array(5, 6); // Minimum version of PHP required by module diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 7eabbe397ab..991201a8d91 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -833,7 +833,7 @@ class Target extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("webhook@webhook"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); @@ -928,7 +928,6 @@ class Target extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("webhook@webhook"); if (empty($conf->global->WEBHOOK_TARGET_ADDON)) { $conf->global->WEBHOOK_TARGET_ADDON = 'mod_target_standard'; @@ -993,8 +992,6 @@ class Target extends CommonObject $result = 0; $includedocgeneration = 0; - $langs->load("webhook@webhook"); - if (!dol_strlen($modele)) { $modele = 'standard_target'; diff --git a/htdocs/webhook/lib/webhook.lib.php b/htdocs/webhook/lib/webhook.lib.php index 6c511180b6e..6c48eccfdf8 100644 --- a/htdocs/webhook/lib/webhook.lib.php +++ b/htdocs/webhook/lib/webhook.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Laurent Destailleur * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +30,6 @@ function webhookAdminPrepareHead() { global $langs, $conf; - $langs->load("webhook@webhook"); - $h = 0; $head = array(); $head[$h][0] = dol_buildpath("/admin/webhook.php", 1); diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index fb01a8f95aa..894e3134c0c 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.php @@ -1,5 +1,5 @@ * * 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 @@ -30,8 +30,6 @@ function targetPrepareHead($object) { global $db, $langs, $conf; - $langs->load("webhook@webhook"); - $h = 0; $head = array(); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index fd3464d3b67..bf4e883411b 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -32,7 +32,7 @@ dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 7e4ef4bb265..0b9ff450d44 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -31,7 +31,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 9aa51b2c44e..460cc7d8ea7 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -30,7 +30,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'companies', 'other', 'mails')); +$langs->loadLangs(array('companies', 'other', 'mails')); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index d80661906c0..2a4f2edfcf1 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -36,7 +36,7 @@ require_once __DIR__.'/class/target.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get Parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index c9fe74c8758..4b9be8aaea1 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -29,7 +29,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'companies')); +$langs->loadLangs(array('companies')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index 50a7ec6d9c1..77c717b628d 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -57,10 +57,6 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -// Load translation files required by the page -$langs->loadLangs(array('webhook')); - - // Security check // if (! $user->rights->webhook->myobject->read) { From 89da4e5bc3127151724fc82eac5dd66046cfd58d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:01:16 +0200 Subject: [PATCH 409/507] Update index.php --- htdocs/product/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index b76be278a44..2deef52946a 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -417,7 +417,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": // "commitment engagment" method and "cash accounting" method -if ( isModEnabled("invoice") && $user->hasRight('facture', 'lire') && getDolGlobalString('MAIN_SHOW_PRODUCT_ACTIVITY_TRIM')) { +if (isModEnabled("invoice") && $user->hasRight('facture', 'lire') && getDolGlobalString('MAIN_SHOW_PRODUCT_ACTIVITY_TRIM')) { if (isModEnabled("product")) { activitytrim(0); } From a380315056cb0e9372224811a7baa203c2e1fec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:05:25 +0200 Subject: [PATCH 410/507] Clean code --- htdocs/societe/paymentmodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 7d082440661..535c2978877 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -517,7 +517,7 @@ if (empty($reshook)) { } } if ($action == 'syncsepatostripe') { - $companybankaccount->fetch(GETPOST('bankid')); + $companybankaccount->fetch(GETPOST('bankid', 'int')); // print "stripe account = " . json_encode($stripe->getStripeAccount($service)); // print json_encode($companybankaccount); // print "fetch id = " . json_encode($socid); @@ -545,7 +545,7 @@ if (empty($reshook)) { $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); } else { - setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to customer account !")); + setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to the Stripe customer account !")); } } } From e450d464aa0eef77e41b865c77fb058dc9750144 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:26:30 +0200 Subject: [PATCH 411/507] Update bom_agenda.php --- htdocs/bom/bom_agenda.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d2c64eea0b6..2e4424bde47 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/modulebuilder/template/myobject_agenda.php - * \ingroup bom - * \brief Page of MyObject events + * \file htdocs/bom/bom_agenda.php + * \ingroup bom + * \brief Page of BOM events */ // Load Dolibarr environment From c9a2dea3d8b15ff84ef26c780d7ea186a359ddb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:34:25 +0200 Subject: [PATCH 412/507] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop From 831420b8e1bf7ab5445adf76837511110788c364 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Sep 2022 10:42:27 +0200 Subject: [PATCH 413/507] FIX: bad bookmark save --- htdocs/bookmarks/bookmarks.lib.php | 45 +++++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index f8daff1cd14..ca0f1486db1 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -36,28 +36,39 @@ function printDropdownBookmarksList() $langs->load("bookmarks"); + $authorized_var=array('page','limit','optioncss','contextpage'); $url = $_SERVER["PHP_SELF"]; - + $url_param=array(); if (!empty($_SERVER["QUERY_STRING"])) { - $url .= (dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''); - } else { - global $sortfield, $sortorder; - $tmpurl = ''; - // No urlencode, all param $url will be urlencoded later - if ($sortfield) { - $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.urlencode($sortfield); - } - if ($sortorder) { - $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder); - } - if (is_array($_POST)) { - foreach ($_POST as $key => $val) { - if (preg_match('/^search_/', $key) && $val != '') { - $tmpurl .= ($tmpurl ? '&' : '').http_build_query(array($key => $val)); + if (is_array($_GET)) { + foreach ($_GET as $key => $val) { + if ($val != '') { + $url_param[$key]=http_build_query(array($key => $val)); } } } - $url .= ($tmpurl ? '?'.$tmpurl : ''); + } + global $sortfield, $sortorder; + $tmpurl = ''; + // No urlencode, all param $url will be urlencoded later + if ($sortfield) { + $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.urlencode($sortfield); + } + if ($sortorder) { + $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder); + } + if (is_array($_POST)) { + foreach ($_POST as $key => $val) { + if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var)) + && $val != '' + && !array_key_exists($key, $url_param)) { + $url_param[$key]=http_build_query(array($key => $val)); + } + } + } + $url .= ($tmpurl ? '?'.$tmpurl : ''); + if (!empty($url_param)) { + $url .= '&'.implode('&', $url_param); } $searchForm = ''."\n"; From 8a44b1ab2bfd964e2e2e6b00558b4bc394d0ee05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:55:15 +0200 Subject: [PATCH 414/507] Update bookmarks.lib.php --- htdocs/bookmarks/bookmarks.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index ca0f1486db1..72fc0a9b51e 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -36,7 +36,7 @@ function printDropdownBookmarksList() $langs->load("bookmarks"); - $authorized_var=array('page','limit','optioncss','contextpage'); + $authorized_var=array('limit','optioncss','contextpage'); $url = $_SERVER["PHP_SELF"]; $url_param=array(); if (!empty($_SERVER["QUERY_STRING"])) { From 9d85eb1b7f828e682de7fe100ba7135d53a32500 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:57:47 +0200 Subject: [PATCH 415/507] Update bookmarks.lib.php --- htdocs/bookmarks/bookmarks.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 72fc0a9b51e..8eef3396eaa 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -43,7 +43,7 @@ function printDropdownBookmarksList() if (is_array($_GET)) { foreach ($_GET as $key => $val) { if ($val != '') { - $url_param[$key]=http_build_query(array($key => $val)); + $url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); } } } @@ -62,7 +62,7 @@ function printDropdownBookmarksList() if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var)) && $val != '' && !array_key_exists($key, $url_param)) { - $url_param[$key]=http_build_query(array($key => $val)); + $url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); } } } From cf8df1196583af3f86dc714ae99c6843fbb8a678 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Sep 2022 11:01:05 +0200 Subject: [PATCH 416/507] Update new.php add GenderOther --- htdocs/public/members/new.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index ccc229e33bf..d33d469b975 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -7,6 +7,7 @@ * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2022 Udo Tamm * * 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 @@ -586,11 +587,11 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''."\n"; } - // Gender // TODO: add diverse gender + // Gender print ''; print ''; // Address From d17f0c57e212083563ba81d99791e9a99dbf578f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 11:27:16 +0200 Subject: [PATCH 417/507] NEW Link "add to bookmark" always on top in the bookmark popup --- htdocs/bookmarks/bookmarks.lib.php | 33 +++++++++++++++++------------- htdocs/langs/en_US/bookmarks.lang | 1 + htdocs/theme/eldy/dropdown.inc.php | 2 +- htdocs/theme/md/dropdown.inc.php | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index e5781d98561..448a5f085f1 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -64,11 +64,6 @@ function printDropdownBookmarksList() $searchForm .= 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>'; $searchForm .= ''; - - // Url to list bookmark - $listbtn = ''; - $listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').''; - // Url to go on create new bookmark page $newbtn = ''; if (!empty($user->rights->bookmark->creer)) { @@ -80,6 +75,10 @@ function printDropdownBookmarksList() } } + // Url to list/edit bookmark + $listbtn = ''; + $listbtn .= img_picto('', 'edit', 'class="paddingright opacitymedium"').$langs->trans('EditBookmarks').''; + // Menu with list of bookmarks $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; @@ -171,27 +170,28 @@ function printDropdownBookmarksList() '; $html .= ' - - - '; - - $html .= ' - + '; + $html .= ' + + + '; + $html .= ' '; } diff --git a/htdocs/langs/en_US/bookmarks.lang b/htdocs/langs/en_US/bookmarks.lang index be0f2f7e25d..26551eee4f0 100644 --- a/htdocs/langs/en_US/bookmarks.lang +++ b/htdocs/langs/en_US/bookmarks.lang @@ -20,3 +20,4 @@ ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should BookmarksManagement=Bookmarks management BookmarksMenuShortCut=Ctrl + shift + m NoBookmarks=No bookmarks defined +NoBookmarkFound=No bookmark found \ No newline at end of file diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 0ca47fbd2bb..bfde88726e9 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -257,7 +257,7 @@ a.top-menu-dropdown-link { .dropdown-menu > .user-body, .dropdown-body { padding: 15px; border-bottom: 1px solid #f4f4f4; - border-top: 1px solid #dddddd; + border-top: 1px solid #f0f0f0; white-space: normal; } diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php index 1f60f0b7c2a..64bebc67f79 100644 --- a/htdocs/theme/md/dropdown.inc.php +++ b/htdocs/theme/md/dropdown.inc.php @@ -260,7 +260,7 @@ a.top-menu-dropdown-link { .dropdown-menu > .user-body, .dropdown-body{ padding: 15px; border-bottom: 1px solid #f4f4f4; - border-top: 1px solid #dddddd; + border-top: 1px solid #f0f0f0; white-space: normal; } From a28eb9296fdcb8d245df9e72d26ef18f2680b174 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 11:51:28 +0200 Subject: [PATCH 418/507] Update userbankaccount.class.php --- htdocs/user/class/userbankaccount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index d18f5feae16..271609139b1 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -174,8 +174,8 @@ class UserBankAccount extends Account $sql .= ', c.code as country_code, c.label as country'; $sql .= ', d.code_departement as state_code, d.nom as state'; $sql .= " FROM ".$this->db->prefix()."user_rib as ur"; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ur.fk_country=c.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ur.state_id=d.rowid'; + $sql .= ' LEFT JOIN '.$this->db->prefix().'c_country as c ON ur.fk_country=c.rowid'; + $sql .= ' LEFT JOIN '.$this->db->prefix().'c_departements as d ON ur.state_id=d.rowid'; if ($id) { $sql .= " WHERE ur.rowid = ".((int) $id); From 4b2eb7ed248bac961e0b9b4c4b8ef18bc7ea9755 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 12:34:34 +0200 Subject: [PATCH 419/507] css --- htdocs/adherents/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 8bf7f7af6a6..8362d311b0a 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1094,9 +1094,9 @@ while ($i < min($num, $limit)) { } // Country if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; From 84633177dae3d49ccfc6abe800280ab1b68bbad2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 14:44:55 +0200 Subject: [PATCH 420/507] Trans --- htdocs/admin/events.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index b98f3775aad..ceb3c286ac3 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -111,7 +111,7 @@ print '
    '; print '
    '; print ''.$langs->trans('UpgradeExternalModule').': '.$langs->trans("NodoUpgradeAfterDB"); @@ -646,7 +646,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print '
    '; print ''.$langs->trans('UpgradeExternalModule').': '.$langs->trans("NodoUpgradeAfterFiles"); diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 2c47ab3c7a2..244ebdd862f 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -129,7 +129,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array { foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (! empty($extrafields->attributes[$object->table_element]['list'][$key])) + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key])); } } @@ -206,7 +206,7 @@ $title = $langs->trans('IntracommReportList'.$type); $sql = 'SELECT DISTINCT i.rowid, i.type_declaration, i.type_export, i.periods, i.mode, i.entity'; /* // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } */ @@ -255,7 +255,7 @@ $sql .= " GROUP BY i.rowid, i.type_declaration, i.type_export, i.periods, i.mode /* // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } */ diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index f063db604e0..c20fa91c621 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -530,8 +530,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgerecord->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -648,8 +648,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -672,8 +672,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -696,8 +696,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/knowledgemanagement/knowledgemanagementindex.php b/htdocs/knowledgemanagement/knowledgemanagementindex.php index ccb3503eb2f..8f168e62598 100644 --- a/htdocs/knowledgemanagement/knowledgemanagementindex.php +++ b/htdocs/knowledgemanagement/knowledgemanagementindex.php @@ -72,7 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) +if (!empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { $langs->load("orders"); @@ -153,7 +153,7 @@ $max = $NBMAX; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { +if (!empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index cbf8ccf0895..a3cd190f196 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -126,7 +126,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -170,7 +170,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 8da0dd34b92..d62f9d7f98a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -294,7 +294,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'close') { $text = $langs->trans('ConfirmCloseKM', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -319,7 +319,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenKM', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -366,7 +366,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -384,7 +384,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index 2b2facafc18..820a596c6c2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -132,7 +132,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -153,7 +153,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index ce185c9b8cf..7f4da244271 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -151,7 +151,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index ff28b79a4ad..92b2b3f2adc 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -330,7 +330,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 0f56a6115a3..e61d2c1034c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -125,7 +125,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 94f57bdd776..1d6b6650d27 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -573,8 +573,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->myobject_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->myobject_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -691,8 +691,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -715,8 +715,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -739,8 +739,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index 985cbe6aa18..6d38c782184 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -80,7 +80,7 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS -/*if (empty($user->id) && ! empty($_SESSION['dol_login'])) { +/*if (empty($user->id) && !empty($_SESSION['dol_login'])) { $user->fetch('',$_SESSION['dol_login']); $user->getrights(); }*/ diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index b37da30f229..3e6213eaa26 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -186,7 +186,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); @@ -210,7 +210,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -230,7 +230,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 0e1815fade1..18328de1f9d 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -346,7 +346,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { $text = $langs->trans('ConfirmActionMyObject', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -393,7 +393,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index 01efbec8cdc..9a365dd88f2 100644 --- a/htdocs/modulebuilder/template/myobject_contact.php +++ b/htdocs/modulebuilder/template/myobject_contact.php @@ -173,7 +173,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -194,7 +194,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index fb5a773be81..f38e703fa69 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -189,7 +189,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 4a3a6bc8dd8..263ca494518 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -697,7 +697,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; @@ -770,13 +770,13 @@ class Mo extends CommonObject $fk_movement = GETPOST('fk_movement', 'int'); $arrayoflines = $this->fetchLinesLinked('consumed', $idline); - if (! empty($arrayoflines)) { + if (!empty($arrayoflines)) { $this->db->begin(); $stockmove = new MouvementStock($this->db); $stockmove->setOrigin($this->element, $this->id); - if (! empty($fk_movement)) { + if (!empty($fk_movement)) { $moline = new MoLine($this->db); $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); $moline = array_shift($TArrayMoLine); @@ -903,8 +903,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->create)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->mrp_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mrp->create)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mrp->mrp_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -1015,8 +1015,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1039,8 +1039,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1063,8 +1063,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 60ac81e20cd..491240cff55 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -130,7 +130,7 @@ $formproject = new FormProjets($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 032f9a7961c..5d06f8c0f52 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -424,7 +424,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 12d2320742d..9bcc446b7c8 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -292,7 +292,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.", " : ""); } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 88788da8b43..3dbfe40106d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -473,7 +473,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 7e0468119bd..bd4ecbc4cd4 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -28,7 +28,7 @@ if (!empty($form) && !is_object($form)) { $form = new Form($db); } -$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); +$qtytoconsumeforline = $this->tpl['qty'] / ( !empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 91dc0bce0ad..06fe91c120d 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -506,7 +506,7 @@ if ($resql) { } // code - if (! empty($arrayfields['m.code']['checked'])) { + if (!empty($arrayfields['m.code']['checked'])) { print '
    '; print $obj->code; print ' - '.$obj->name.''; @@ -516,7 +516,7 @@ if ($resql) { } // rate - if (! empty($arrayfields['cr.rate']['checked'])) { + if (!empty($arrayfields['cr.rate']['checked'])) { print ''; print $obj->rate; print "
    '.$langs->trans("NoteNotVisibleOnBill").''; diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 3018312cd0e..7f7b8ca01a8 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -293,7 +293,7 @@ if ($id > 0 || !empty($ref)) { $prods_arbo = $object->get_arbo_each_prod(); $tmpid = $id; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { $nboflines = $prods_arbo; $table_element_line='product_association'; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 47404ba4f04..796470c469c 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -313,7 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index f00f90e120b..281d58ea99e 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -488,7 +488,7 @@ class Inventory extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } @@ -815,7 +815,7 @@ class InventoryLine extends CommonObjectLine public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index c1ef43c5c02..be7512df6fc 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -494,7 +494,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -516,7 +516,7 @@ if ($object->id > 0) { } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=$proj->getNomUrl(); @@ -1058,9 +1058,9 @@ if ($object->id > 0) { $hasinput = true; } - if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print '
    '; @@ -1082,7 +1082,7 @@ if ($object->id > 0) { print ''; - if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (!empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $qty_view; print ''; @@ -1111,7 +1111,7 @@ if ($object->id > 0) { } else { if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print ''; @@ -1127,7 +1127,7 @@ if ($object->id > 0) { //PMP Real print ''; - if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (!empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $obj->qty_view; print price($pmp_real); @@ -1190,7 +1190,7 @@ if ($object->id > 0) { print ''; - if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { ?> '; } + } else { + dol_print_error($db); } } else { print ''; From 2c46410675cfa62b3e6516e1ab9c93e97a3c5255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 11:18:46 +0200 Subject: [PATCH 375/507] FIX list of email in public ticket interface --- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/public/ticket/list.php | 30 ++++++++++--------- htdocs/ticket/list.php | 11 ++++--- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 6f9b266a8c1..5d4ae896134 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -434,7 +434,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { + if (is_array($search[$key])) { foreach ($search[$key] as $skey) { if ($skey != '') { $param .= '&search_'.$key.'[]='.urlencode($skey); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 8a353eea881..c43ae59abb4 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -345,25 +345,25 @@ if ($action == "view_ticketlist") { } } $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as uc ON uc.rowid=t.fk_user_create"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON ua.rowid=t.fk_user_assign"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id=t.rowid"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON ec.fk_c_type_contact=tc.rowid"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople sp ON ec.fk_socpeople=sp.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as uc ON uc.rowid = t.fk_user_create"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON ua.rowid = t.fk_user_assign"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON ec.fk_c_type_contact = tc.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople sp ON ec.fk_socpeople = sp.rowid"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)"; } $sql .= " WHERE t.entity IN (".getEntity('ticket').")"; $sql .= " AND ((tc.source = 'external'"; - $sql .= " AND tc.element='".$db->escape($object->dao->element)."'"; - $sql .= " AND tc.active=1)"; - $sql .= " OR (sp.email='".$db->escape($_SESSION['email_customer'])."'"; - $sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'"; - $sql .= " OR t.origin_email='".$db->escape($_SESSION['email_customer'])."'))"; + $sql .= " AND tc.element='".$db->escape($object->element)."'"; + $sql .= " AND tc.active=1"; + $sql .= " AND sp.email='".$db->escape($_SESSION['email_customer'])."')"; // email found into an external contact + $sql .= " OR s.email='".$db->escape($_SESSION['email_customer'])."'"; // or email of the linked company + $sql .= " OR t.origin_email='".$db->escape($_SESSION['email_customer'])."')"; // or email of the requester // Manage filter if (!empty($filter)) { foreach ($filter as $key => $value) { @@ -696,6 +696,8 @@ if ($action == "view_ticketlist") { } '; } + } else { + dol_print_error($db); } } else { print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index f489c9218fc..d80d44813e0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -140,7 +140,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -621,8 +621,8 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } foreach ($search as $key => $val) { - if (is_array($val) && count($val)) { - foreach ($val as $skey) { + if (is_array($search[$key])) { + foreach ($search[$key] as $skey) { if ($skey != '') { $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : ""; } @@ -746,10 +746,13 @@ $trackid = 'tic'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { + $setupstring = ''; foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; } - print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; + print ''."\n"; + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '."\n"; } $moreforfilter = ''; From 6c45b13178555adf8f5b32c5e3ae4b8e81569572 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 12:32:27 +0200 Subject: [PATCH 376/507] NEW Add filter "Product subject to lot/Serial" in stock per lot/serial --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/stocks.lang | 1 + htdocs/product/reassort.php | 12 ++++++------ htdocs/product/reassortlot.php | 20 ++++++++++++++------ 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 83071830ae7..df24aa38327 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -190,7 +190,7 @@ class FormTicket // TITLE $email = GETPOSTISSET('email') ? GETPOST('email', 'alphanohtml') : ''; if ($this->withemail) { - print '
    '; + print '
    '; print ''; print '
    '; if ($permissiontoaddupdatepaymentinformation) { - print ''; + print ''; print img_picto($langs->trans("CreateBAN"), 'stripe'); print ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 5ec149ba07f..6814dc3757f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -588,7 +588,130 @@ class Stripe extends CommonObject return null; } } + /** + * Get the Stripe SEPA of a company payment mode + * + * @param \Stripe\StripeCustomer $cu Object stripe customer. + * @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity) + * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int $status Status (0=test, 1=live) + * @param int $createifnotlinkedtostripe 1=Create the stripe sepa and the link if the sepa is not yet linked to a stripe sepa. Deprecated with new Stripe API and SCA. + * @return \Stripe\PaymentMethod|null Stripe SEPA or null if not found + */ + public function sepaStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) + { + global $conf, $user, $langs; + $sepa = null; + $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa + $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; + $sql .= " WHERE sa.rowid = ".$object->id; // We get record from ID, no need for filter on entity + $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) + + $soc = new Societe($this->db); + $soc->fetch($object->fk_soc); + + dol_syslog(get_class($this)."::fetch search stripe sepa(card) id for paymentmode id=".$object->id.", stripeacc=".$stripeacc.", status=".$status.", createifnotlinkedtostripe=".$createifnotlinkedtostripe, LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num) { + $obj = $this->db->fetch_object($resql); + $cardref = $obj->stripe_card_ref; + dol_syslog(get_class($this)."::cardStripe cardref=".$cardref); + if ($cardref) { + try { + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + if (!preg_match('/^pm_/', $cardref) && !empty($cu->sources)) { + $sepa = $cu->sources->retrieve($cardref); + } else { + $sepa = \Stripe\PaymentMethod::retrieve($cardref); + } + } else { + if (!preg_match('/^pm_/', $cardref) && !empty($cu->sources)) { + //$sepa = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $sepa = $cu->sources->retrieve($cardref); + } else { + //$sepa = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works + $sepa = \Stripe\PaymentMethod::retrieve($cardref); + } + } + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + } + } elseif ($createifnotlinkedtostripe) { + $iban = $obj->iban_prefix; //prefix ? + $ipaddress = getUserRemoteIP(); + + $dataforcard = array( + 'type'=>'sepa_debit', + "sepa_debit" => array('iban' => $iban), + 'currency' => 'eur', + 'usage' => 'reusable', + 'owner' => array( + 'name' => $soc->name, + ), + "metadata" => array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress) + ); + + //$a = \Stripe\Stripe::getApiKey(); + //var_dump($a);var_dump($stripeacc);exit; + try { + dol_syslog("Try to create sepa_debit 0"); + + $service = 'StripeTest'; + $servicestatus = 0; + if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { + $service = 'StripeLive'; + $servicestatus = 1; + } + // Force to use the correct API key + global $stripearrayofkeysbyenv; + $stripeacc = $stripearrayofkeysbyenv[$servicestatus]['secret_key']; + + dol_syslog("Try to create sepa_debit with data = ".json_encode($dataforcard)); + $s = new \Stripe\StripeClient($stripeacc); + $sepa = $s->sources->create($dataforcard); + if (!$sepa) { + $this->error = 'Creation of sepa_debit on Stripe has failed'; + } else { + //association du client avec cette source de paimeent + $cs = $cu->createSource( + $cu->id, + [ + 'source' => $sepa->id, + ] + ); + if (!$cs) { + $this->error = 'Link SEPA <-> Customer failed'; + } else { + dol_syslog("Try to create sepa_debit 3"); + // print json_encode($sepa); + + $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib"; + $sql .= " SET stripe_card_ref = '".$this->db->escape($sepa->id)."', card_type = 'sepa_debit',"; + $sql .= " stripe_account= '" . $cu->id . '@' . $stripeacc . "'"; + $sql .= " WHERE rowid = ".$object->id; + $sql .= " AND type = 'ban'"; + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = $this->db->lasterror(); + } + } + } + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + } + } + } + } else { + dol_print_error($this->db); + } + + return $sepa; + } /** * Get the Stripe payment intent. Create it with confirmnow=false From 4ac4f78a997afc2de3ac5c6e5daa68c3c5a0fcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 15:25:19 +0200 Subject: [PATCH 383/507] add extrafield setup --- htdocs/admin/bankline_extrafields.php | 118 ++++++++++++++++++++++++++ htdocs/core/lib/bank.lib.php | 5 ++ htdocs/langs/en_US/banks.lang | 1 + 3 files changed, 124 insertions(+) create mode 100644 htdocs/admin/bankline_extrafields.php diff --git a/htdocs/admin/bankline_extrafields.php b/htdocs/admin/bankline_extrafields.php new file mode 100644 index 00000000000..d86733e4e24 --- /dev/null +++ b/htdocs/admin/bankline_extrafields.php @@ -0,0 +1,118 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2015 Jean-François Ferry + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file admin/bankline_extrafields.php + * \ingroup bank + * \brief Page to setup extra fields of bankline + */ + +// Load Dolibarr environment +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("admin", "companies", "bills", "other", "banks")); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label = ExtraFields::$type2label; +$type2label = []; +foreach ($tmptype2label as $key => $val) { + $type2label[$key] = $langs->transnoentitiesnoconv($val); +} + +$action = GETPOST('action', 'aZ09'); +$attrname = GETPOST('attrname', 'alpha'); +$elementtype = 'bank'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) { + accessforbidden(); +} + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + +/* + * View + */ + + +$help_url = ''; +$page_name = "BankSetupModule"; + +llxHeader('', $langs->trans("BankSetupModule"), $help_url); + + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); + + +$head = bank_admin_prepare_head(null); + +print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account'); + +require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; + +print dol_get_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') { + print '
    '; + print ''.$langs->trans("NewAttribute").''; + print "
    "; +} + + +/* + * Creation of an optional field + */ +if ($action == 'create') { + print '
    '; + print load_fiche_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* + * Edition of an optional field + */ +if ($action == 'edit' && !empty($attrname)) { + print "
    "; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 5dde1bc4360..1792de89a60 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -157,6 +157,11 @@ function bank_admin_prepare_head($object) $head[$h][2] = 'attributes'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; + $head[$h][1] = $langs->trans("BanklineExtraFields"); + $head[$h][2] = 'bankline_extrafields'; + $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove'); diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 10ba859e71f..71a80406ae4 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -185,3 +185,4 @@ AlreadyOneBankAccount=Already one bank account defined SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA transfer: 'Payment Type' at 'Credit Transfer' level SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=When generatin a SEPA XML file for Credit transfers, the section "PaymentTypeInformation" can now be placed inside the "CreditTransferTransactionInformation" section (instead of "Payment" section). We strongly recommend to keep this unchecked to place PaymentTypeInformation at Payment level, as all banks will not necessarily accept it at CreditTransferTransactionInformation level. Contact your bank before placing PaymentTypeInformation at CreditTransferTransactionInformation level. ToCreateRelatedRecordIntoBank=To create missing related bank record +BanklineExtraFields=Bank Line Extrafields From 6ce06658400c421e9d8ffbdc640b32b4204c8fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 15:32:48 +0200 Subject: [PATCH 384/507] fix agenda setup --- htdocs/admin/agenda.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 3221738bcd3..e9708d8c005 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -3,6 +3,7 @@ * Copyright (C) 2011 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * 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 @@ -184,7 +185,7 @@ if (!empty($triggers)) { } //print 'module='.$module.' code='.$trigger['code'].'
    '; - if (isModEnabled('module')) { + if (isModEnabled($module)) { // Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { continue; From a865388b9c471be122a813c838c000a53b0c2543 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 15:38:31 +0200 Subject: [PATCH 385/507] FIX fatal error abs on non int --- htdocs/public/recruitment/view.php | 6 ++++++ htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index b92dcbf9824..2eaa51ac2fe 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -217,7 +217,13 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb if ($urllogo) { print '
    '; print '
    '; + if (!empty($mysoc->url)) { + print ''; + } print ''; + if (!empty($mysoc->url)) { + print ''; + } print '
    '; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f8558e11a24..5a7a3bc030d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2827,7 +2827,7 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { $paddafterimage = ''; - if (abs($withpictoimg) == 1) { + if (abs((int) $withpictoimg) == 1) { $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; } // Only picto From 5ba052019596f38662c9d288cc10029dba120057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 15:38:31 +0200 Subject: [PATCH 386/507] FIX fatal error abs on non int --- htdocs/public/recruitment/view.php | 6 ++++++ htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index b92dcbf9824..2eaa51ac2fe 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -217,7 +217,13 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb if ($urllogo) { print '
    '; print '
    '; + if (!empty($mysoc->url)) { + print ''; + } print ''; + if (!empty($mysoc->url)) { + print ''; + } print '
    '; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 1fc536d10bd..3b71811e7b1 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2822,7 +2822,7 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { $paddafterimage = ''; - if (abs($withpictoimg) == 1) { + if (abs((int) $withpictoimg) == 1) { $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; } // Only picto From c8ddcf86b61d5618d0cfd6d09fdcb3dd0bb23097 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:06:03 +0200 Subject: [PATCH 387/507] fix Ci error --- htdocs/stripe/class/stripe.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6814dc3757f..6410050c642 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -588,6 +588,7 @@ class Stripe extends CommonObject return null; } } + /** * Get the Stripe SEPA of a company payment mode * @@ -605,7 +606,7 @@ class Stripe extends CommonObject $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; - $sql .= " WHERE sa.rowid = ".$object->id; // We get record from ID, no need for filter on entity + $sql .= " WHERE sa.rowid = '".$this->db->escape($object->id)."'"; // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) $soc = new Societe($this->db); @@ -691,8 +692,8 @@ class Stripe extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib"; $sql .= " SET stripe_card_ref = '".$this->db->escape($sepa->id)."', card_type = 'sepa_debit',"; - $sql .= " stripe_account= '" . $cu->id . '@' . $stripeacc . "'"; - $sql .= " WHERE rowid = ".$object->id; + $sql .= " stripe_account= '" . $this->db->escape($cu->id . "@" . $stripeacc) . "'"; + $sql .= " WHERE rowid = '".$this->db->escape($object->id)."'"; $sql .= " AND type = 'ban'"; $resql = $this->db->query($sql); if (!$resql) { From e589cc7d9b35a1f1135fdc2c2fe0bc01b641eda7 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:13:21 +0200 Subject: [PATCH 388/507] fix ci error --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ef64b2e5a74..46790b9cbc5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1605,7 +1605,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } - $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id) : '').'&entity='.$conf->entity; + $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id)).'&entity='.$conf->entity; $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (GETPOSTISSET('dol_hide_topmenu')) { From ffe0420523a39eea19e9b3ad22823271367025fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 16:15:36 +0200 Subject: [PATCH 389/507] fix delay setup --- htdocs/admin/delais.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index af8fed1c197..ec7874b7db8 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2016 Raphaël Doursenaud + * 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 @@ -172,7 +173,7 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) { if ($action == 'update') { foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { if (GETPOST($delay['code']) != '') { dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); @@ -226,7 +227,7 @@ if ($action == 'edit') { print '
    '.$langs->trans("LateWarningAfter").'
    '.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
    '.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print '
    '.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    '.$langs->trans("Login").' *
    '.$langs->trans("Password").' *
    '.$langs->trans("PasswordRetype").' *
    '.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
    '.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -621,17 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print '
    '.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print '
    '.$langs->trans("URLPhoto").'
    '.$langs->trans("Public").'
    '.$langs->trans("Comments").'
    '.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print '
    '.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    '.$langs->trans("Login").' *
    '.$langs->trans("Password").' *
    '.$langs->trans("PasswordRetype").' *
    '.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
    '.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -633,22 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print '
    '.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print '
    '.$langs->trans("URLPhoto").'
    '.$langs->trans("Public").'
    '.$langs->trans("Comments").''; print ''; print ''; print ''; print ''; print ''; print ''; print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; @@ -1775,8 +1793,10 @@ if ($resql) { ), 'pos' => array(), ); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields $parameters = array( 'arrayfields' => $arrayfields, @@ -1976,6 +1996,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; @@ -1985,6 +2006,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1994,6 +2016,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; @@ -2003,6 +2026,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // State if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."'; @@ -2020,6 +2045,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; @@ -2046,6 +2072,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Plannned date of delivery if (!empty($arrayfields['c.date_delivery']['checked'])) { print ''; @@ -2055,6 +2082,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Shipping Method if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { print ''; @@ -2064,6 +2092,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Payment terms if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; @@ -2073,6 +2102,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; @@ -2082,6 +2112,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Channel if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print ''; @@ -2091,7 +2122,8 @@ if ($resql) { $totalarray['nbfield']++; } } - // Amount HT + + // Amount HT/net if (!empty($arrayfields['c.total_ht']['checked'])) { print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'; if ($obj->socid > 0) { $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); @@ -2250,6 +2285,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Total margin if (!empty($arrayfields['total_margin']['checked'])) { print ''.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.$obj->import_key.''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).''; print ''; print ''; print ''; print ''; print ''; @@ -1793,10 +1791,10 @@ if ($resql) { ), 'pos' => array(), ); - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - + // Hook fields $parameters = array( 'arrayfields' => $arrayfields, @@ -1996,7 +1994,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; @@ -2006,7 +2004,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -2016,7 +2014,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; @@ -2026,7 +2024,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // State if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."'; @@ -2045,7 +2043,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; @@ -2072,7 +2070,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Plannned date of delivery if (!empty($arrayfields['c.date_delivery']['checked'])) { print ''; @@ -2082,7 +2080,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Shipping Method if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { print ''; @@ -2092,7 +2090,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Payment terms if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; @@ -2102,7 +2100,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; @@ -2112,7 +2110,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Channel if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print ''; @@ -2122,7 +2120,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Amount HT/net if (!empty($arrayfields['c.total_ht']['checked'])) { print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->multicurrency_total_ht)."'.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.$obj->import_key.''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'
    '.$langs->trans("PasswordRetype").' *
    '.$langs->trans("Gender").''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); + $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother")); + print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
    '; $tmparray = getCountry($obj->country, 'all'); - print $tmparray['label']; + print ''; + print dol_escape_htmltag($tmparray['label']); print '
    '; print ""; -print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; +print getTitleFieldOfList("TrackableSecurityEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print "\n"; // Loop on each event type diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ced1f23ed39..6fe10207247 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1238,6 +1238,7 @@ BrowserName=Browser name BrowserOS=Browser OS ListOfSecurityEvents=List of Dolibarr security events SecurityEventsPurged=Security events purged +TrackableSecurityEvents=Trackable security events LogEventDesc=Enable logging for specific security events. Administrators the log via menu %s - %s. Warning, this feature can generate a large amount of data in the database. AreaForAdminOnly=Setup parameters can be set by administrator users only. SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only. From 38352d0c28a9505aa5de6edd255171a29a9f45dc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 2 Sep 2022 16:22:54 +0200 Subject: [PATCH 421/507] NEW Manage VAT on all lines on purchases cycle --- htdocs/core/tpl/objectline_title.tpl.php | 2 +- htdocs/fourn/commande/card.php | 11 ++++++++++- htdocs/fourn/facture/card.php | 9 +++++++++ htdocs/supplier_proposal/card.php | 11 ++++++++++- .../class/supplier_proposal.class.php | 1 + 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 762e9b4eefa..6bb64075bd5 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -68,7 +68,7 @@ if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FA print $langs->trans('VAT'); } -if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { +if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_proposal', 'order_supplier', 'invoice_supplier')) && $object->status == $object::STATUS_DRAFT) { global $mysoc; if (empty($disableedit)) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 67ec98e3c96..b4c72197608 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -405,7 +405,16 @@ if (empty($reshook)) { } // Add a product line - if ($action == 'addline' && $usercancreate) { + if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + // Define vat_rate + $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); + foreach($object->lines as $line) { + $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->product_type, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + } + } elseif ($action == 'addline' && $usercancreate) { $db->begin(); $langs->load('errors'); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ddf54ba0727..adcdb892d5c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1383,6 +1383,15 @@ if (empty($reshook)) { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } + } elseif ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + // Define vat_rate + $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); + foreach($object->lines as $line) { + $result = $object->updateline($line->id, $line->desc, $line->subprice, $vat_rate, $localtax1_rate, $localtax2_rate, $line->qty, $line->fk_product, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice, $line->ref_supplier, $line->rang); + } } elseif ($action == 'addline' && $usercancreate) { // Add a product line $db->begin(); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e4c2efd2c72..7be61673260 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -546,7 +546,16 @@ if (empty($reshook)) { } // Add a product line - if ($action == 'addline' && $usercancreate) { + if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + // Define vat_rate + $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); + foreach($object->lines as $line) { + $result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + } + } elseif ($action == 'addline' && $usercancreate) { $langs->load('errors'); $error = 0; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 24b45c992eb..7e8c1d1c1b3 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1257,6 +1257,7 @@ class SupplierProposal extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->statut = (int) $obj->fk_statut; + $this->status = (int) $obj->fk_statut; $this->statut_libelle = $obj->statut_label; $this->datec = $this->db->jdate($obj->datec); // TODO deprecated $this->datev = $this->db->jdate($obj->datev); // TODO deprecated From 3883e66004eace7b024a6cb92364ff24938a2338 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 2 Sep 2022 14:25:03 +0000 Subject: [PATCH 422/507] Fixing style errors. --- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b4c72197608..f93373a64fa 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -411,7 +411,7 @@ if (empty($reshook)) { $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - foreach($object->lines as $line) { + foreach ($object->lines as $line) { $result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $line->info_bits, $line->product_type, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); } } elseif ($action == 'addline' && $usercancreate) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index adcdb892d5c..65ae4e81150 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1389,7 +1389,7 @@ if (empty($reshook)) { $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - foreach($object->lines as $line) { + foreach ($object->lines as $line) { $result = $object->updateline($line->id, $line->desc, $line->subprice, $vat_rate, $localtax1_rate, $localtax2_rate, $line->qty, $line->fk_product, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, 0, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice, $line->ref_supplier, $line->rang); } } elseif ($action == 'addline' && $usercancreate) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 7be61673260..9719928ab75 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -552,7 +552,7 @@ if (empty($reshook)) { $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - foreach($object->lines as $line) { + foreach ($object->lines as $line) { $result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); } } elseif ($action == 'addline' && $usercancreate) { From f52680a7e0d20ad6f528e6f84ad46f604ca78a0b Mon Sep 17 00:00:00 2001 From: Nicolas MANAUD Date: Fri, 2 Sep 2022 16:29:02 +0200 Subject: [PATCH 423/507] Force date of movement in MouvementStock propagated to subproducts (When using the class MouvementStock, it's possible to force a date of movement by specifying a date (parameter). If this MouvementStock is affected to a product containing sub-product.s, this date of movement forced will also be applied to the MouvementStock of the related sub-products.) --- .../stock/class/mouvementstock.class.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5653a564b9e..c762868aadb 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -586,7 +586,7 @@ class MouvementStock extends CommonObject // Add movement for sub products (recursive call) if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) { - $error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode); // we use 0 as price, because AWP must not change for subproduct + $error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode, $datem); // we use 0 as price, because AWP must not change for subproduct } if ($movestock && !$error) { @@ -705,17 +705,18 @@ class MouvementStock extends CommonObject /** * Create movement in database for all subproducts * - * @param User $user Object user - * @param int $idProduct Id product - * @param int $entrepot_id Warehouse id - * @param int $qty Quantity - * @param int $type Type - * @param int $price Price - * @param string $label Label of movement - * @param string $inventorycode Inventory code - * @return int <0 if KO, 0 if OK + * @param User $user Object user + * @param int $idProduct Id product + * @param int $entrepot_id Warehouse id + * @param int $qty Quantity + * @param int $type Type + * @param int $price Price + * @param string $label Label of movement + * @param string $inventorycode Inventory code + * @param integer|string $datem Force date of movement + * @return int <0 if KO, 0 if OK */ - private function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '') + private function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '') { global $langs; @@ -747,7 +748,7 @@ class MouvementStock extends CommonObject if (!$error) { $tmpmove = dol_clone($this, 1); - $result = $tmpmove->_create($user, $pids[$key], $entrepot_id, ($qty * $pqtys[$key]), $type, 0, $label, $inventorycode); // This will also call _createSubProduct making this recursive + $result = $tmpmove->_create($user, $pids[$key], $entrepot_id, ($qty * $pqtys[$key]), $type, 0, $label, $inventorycode, $datem); // This will also call _createSubProduct making this recursive if ($result < 0) { $this->error = $tmpmove->error; $this->errors = array_merge($this->errors, $tmpmove->errors); From 5bc926815074ecae99e6dcf11ce9c7516f38a75c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 17:33:24 +0200 Subject: [PATCH 424/507] FIX activate/desactivate entry in dictionary --- htdocs/admin/dict.php | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3503421d7fe..98502c31a25 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1028,10 +1028,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1048,10 +1051,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1068,10 +1074,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1088,10 +1097,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1108,10 +1120,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1128,10 +1143,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1140,6 +1158,8 @@ if (empty($reshook)) { } } } + + /* * View */ From e4dea1829e976f1d918d6cd6637f3c50931d0837 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 17:33:24 +0200 Subject: [PATCH 425/507] FIX activate/desactivate entry in dictionary --- htdocs/admin/dict.php | 44 +++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3cba1a333ca..3b1896e7ee7 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1028,10 +1028,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1048,10 +1051,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1068,10 +1074,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1088,10 +1097,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1108,10 +1120,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1128,10 +1143,13 @@ if (empty($reshook)) { $rowidcol = "rowid"; } + $tablename = $tabname[$id]; + $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); + if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } $result = $db->query($sql); @@ -1140,6 +1158,8 @@ if (empty($reshook)) { } } } + + /* * View */ From 6ff1d5574f07b83c0ff4bd1dbc6280afc0d317b4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Sep 2022 20:50:45 +0200 Subject: [PATCH 426/507] Update ChangeLog --- ChangeLog | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index caec167d380..9a127d4fcee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,7 @@ NEW: Accept 'auto' for ref of object on import of purchase order/proposal NEW: Accountancy - Add more filters and info on page to bind accounting accounts NEW: Accountancy - Add subledger account when generate a transaction with a deposit invoice NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list) +NEW: Accountancy - Add hidden feature for accounting reconciliation NEW: ACE Editor is restored at same cursor position after a save. NEW: Add "addMoreActionsButtons" hook to subscription form NEW: Add an option in GUI to show a Quick add button into top menu bar @@ -50,9 +51,6 @@ NEW: Add column date of Signature on proposal list NEW: Add column template invoice in invoice list NEW: Add column "Total HT" to products array on document creation card NEW: Add configuration for text color of button action -NEW: Add constant to hide categories in TakePos -NEW: Add constant to show category description in TakePos -NEW: Add constant to show only the products in stock in TakePos NEW: Add entity filter in exports NEW: Show the event block on recurring invoices #20870 NEW: Add filter "opportunity status" on statistics of projects. @@ -116,11 +114,11 @@ NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439) NEW: possibility to consume multiple batch NEW: Reverse movement product consumption NEW: Send email to the supplier order contact -NEW: New permission to report time on timesheet. +NEW: add permission to report time on timesheet NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: Show number of votes into the label of tab "Results" of a survey NEW: Some core tables are created only at module activation -NEW: split consumption line on MO +NEW: MRP - split consumption line on MO NEW: stock filter in reassort lists NEW: stock limit in stock export CSV NEW: Supplier order - Show ref supplier of reception in linked object block @@ -128,6 +126,9 @@ NEW: support user_modif in order NEW: TakePOS - barcode rule to insert product in TakePOS NEW: TakePOS - pagination on search results NEW: TakePOS - show product reference +NEW: TakePOS - add constant to hide categories +NEW: TakePOS - add constant to show category description +NEW: TakePOS - add constant to show only the products in stock NEW: The backup tools has an "lowmemory" option for mysqldump on large database NEW: The 'reposition' class works on ajax constantonoff that make redirects NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice @@ -136,7 +137,6 @@ NEW: total mark rate in list NEW: uncheck "send message" by default on a ticket when private messages has been checked NEW: VAT Report by month - Show detail by rate and also by code NEW: Ticket triggers: allow to automatically send messages on new tickets -NEW: Accountancy - Add hidden feature for accounting reconciliation NEW: Can store the session into database (instead of beeing managed by PHP) NEW: Added MMK currency (Myanmar Kyat) NEW: On a form to send an email, we show all emails of contacts of object @@ -161,7 +161,7 @@ NEW: Identification of tr is possible with by attribute data-id on some pages NEW: Import with select boxes V2 NEW: Can use current entity filter on 'chkbxlst' NEW: Creation of the function select_bom() used to display bom select list -NEW: add printFieldListWhere hook in product reassort card + NEW: Add trigger and event on completely received status change NEW: Add utility function send backup by mail NEW: add WordPress OAuth to save a token (not SSO) @@ -194,6 +194,7 @@ NEW: Add hook before the public ticket list NEW: Add hook doaction in takepos invoice NEW: Add hook for Notif NEW: Add hook for more buttons +NEW: add hook printFieldListWhere in product ressort card NEW: Add hook printFieldListWhere in "show_contacts" function NEW: Add hook printFieldWhere in load_state_board function NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts From 7c04468246f9a92cbb16460e7c92960910990916 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 10:36:54 +0200 Subject: [PATCH 427/507] fix bug#22057 --- htdocs/compta/resultat/clientfourn.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index ed4dac6c3f3..a79729453b7 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy', 'loan')); From f4a4ecfdf3ac40d8a4650cbe0bf40e279448d6ee Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Sep 2022 10:52:33 +0200 Subject: [PATCH 428/507] NEW private and public note on user.php use same code on Dolibarr --- htdocs/install/mysql/tables/llx_user.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index a47b40cb3d1..7b86b5c3396 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -76,7 +76,7 @@ create table llx_user idpers3 varchar(128), note_public text, - note text DEFAULT NULL, + note_private text DEFAULT NULL, model_pdf varchar(255) DEFAULT NULL, datelastlogin datetime, datepreviouslogin datetime, From 55f8d722194c7530e7acd1d3f1156d16a7b820c1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Sep 2022 10:56:19 +0200 Subject: [PATCH 429/507] Update 16.0.0-17.0.0.sql --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) 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 2c093019e72..016dc7283df 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 @@ -142,3 +142,5 @@ CREATE TABLE llx_bank_extrafields )ENGINE=innodb; ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); + +ALTER TABLE llx_user RENAME COLUMN note TO note_private; From a8465d16fa852e61e369305d39fd9000696fe020 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:05:03 +0200 Subject: [PATCH 430/507] Update code --- htdocs/comm/propal/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index fb75b3f0c6b..553e3e8ea9c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2010-2021 Philippe Grand + * Copyright (C) 2010-2022 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Florian Henry @@ -448,7 +448,7 @@ if (empty($reshook)) { $object->origin_id = GETPOST('originid'); // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } @@ -1653,7 +1653,7 @@ if ($action == 'create') { $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1663,7 +1663,7 @@ if ($action == 'create') { } } } else { - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } } @@ -1865,7 +1865,7 @@ if ($action == 'create') { print ""; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print '"; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print '"; print '"; @@ -2518,7 +2518,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print '"; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print '"; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print '"; print '"; @@ -2535,7 +2535,7 @@ if ($action == 'create' && $usercancreate) { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print '
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -1937,7 +1937,7 @@ if ($action == 'create') { } print '
    '.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."
    '.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).'
    '.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva)."
    '.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc)."
    '; @@ -2649,7 +2649,7 @@ if ($action == 'create') { print ''; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; From 98362881a673d3f2d9556254c6dd5e346b820dc4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Sep 2022 11:06:38 +0200 Subject: [PATCH 431/507] Update note.php --- htdocs/user/note.php | 84 +++++++++++++------------------------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/htdocs/user/note.php b/htdocs/user/note.php index e0ac0bd4dcf..c0c93a75d64 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -27,6 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +// Get parameters $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'usernote'; // To manage different context of search @@ -39,16 +40,19 @@ $object->fetch($id, '', '', 1); $object->getrights(); // If user is not user read and no permission to read other users, we stop -if (($object->id != $user->id) && (!$user->hasRight("user", "user", "read"))) { +if (($object->id != $user->id) && (!$user->rights->user->user->lire)) { accessforbidden(); } +// Permissions +$permissionnote = $user->hasRight("user", "self", "write"); // Used by the include of actions_setnotes.inc.php + // Security check $socid = 0; if ($user->socid > 0) { $socid = $user->socid; } -$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); +$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); @@ -59,37 +63,23 @@ $hookmanager->initHooks(array('usercard', 'usernote', 'globalcard')); /* * Actions */ - $parameters = array('id'=>$socid); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - if (empty($reshook)) { - if ($action == 'update' && $user->hasRight("user", "user", "write") && !GETPOST("cancel")) { - $db->begin(); - - $res = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5)); - if ($res < 0) { - $mesg = '
    '.$adh->error.'
    '; - $db->rollback(); - } else { - $db->commit(); - } - } + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once } /* * View */ -$form = new Form($db); -$person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname; -$title = $person_name." - ".$langs->trans('Notes'); -$help_url = ''; -llxHeader('', $title, $help_url); +llxHeader(); + +$form = new Form($db); if ($id) { $head = user_prepare_head($object); @@ -99,7 +89,7 @@ if ($id) { $linkback = ''; - if ($user->hasRight("user", "user", "read") || $user->admin) { + if ($user->rights->user->user->lire || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } @@ -107,7 +97,7 @@ if ($id) { $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); $morehtmlref .= ''; - dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); print '
    '; @@ -127,7 +117,7 @@ if ($id) { print '
    '; - $editenabled = (($action == 'edit') && $user->hasRight("user", "user", "write")); - - // Note - print ''; - print '"; - print "
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; $addadmin = ''; if (property_exists($object, 'admin')) { - if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) { + if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); } elseif (!empty($object->admin)) { $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); @@ -138,46 +128,20 @@ if ($id) { } print '
    '.$langs->trans("Note").''; - if ($editenabled) { - print ""; - print "id."\">"; - // Editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_8, '90%'); - $doleditor->Create(); - } else { - print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); - } - print "
    "; + print ''; + + //print '
    '; + + //print '
    '; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + print dol_get_fiche_end(); - - if ($action == 'edit') { - print $form->buttonsSaveCancel(); - } - - - /* - * Actions - */ - - print '
    '; - - if ($user->hasRight("user", "user", "write") && $action != 'edit') { - print ''.$langs->trans('Modify').""; - } - - print "
    "; - - print "\n"; +} else { + $langs->load("errors"); + print $langs->trans("ErrorRecordNotFound"); } // End of page From e10ce6a6a0002cd65bb31942484da026fc82bf29 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:07:45 +0200 Subject: [PATCH 432/507] Update code --- htdocs/comm/propal/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 31c4489d47f..fb47a3d918a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2011 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand + * Copyright (C) 2010-2022 Philippe Grand * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry @@ -227,13 +227,13 @@ $arrayfields = array( 'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), 'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), 'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), - 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), - 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), + 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), + 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), From a0bb17aea90612341608e5b19f0e616358702b9c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Sep 2022 11:07:47 +0200 Subject: [PATCH 433/507] wip --- htdocs/core/tpl/notes.tpl.php | 2 ++ htdocs/user/class/user.class.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 1110e91b019..dfa9b0e4591 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -91,6 +91,8 @@ if ($module == 'propal') { $permission = $user->rights->produit->creer; } elseif ($module == 'ecmfiles') { $permission = $user->rights->ecm->setup; +} elseif ($module == 'user') { + $permission = $user->hasRight("user", "self", "write"); } //else dol_print_error('','Bad value '.$module.' for param module'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index df2b6bc0174..a521be145ef 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -433,7 +433,7 @@ class User extends CommonObject $sql .= " u.socialnetworks,"; $sql .= " u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile,"; $sql .= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,"; - $sql .= " u.admin, u.login, u.note as note_private, u.note_public,"; + $sql .= " u.admin, u.login, u.note_private, u.note_public,"; $sql .= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,"; $sql .= " u.fk_soc, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid, u.fk_user_expense_validator, u.fk_user_holiday_validator,"; $sql .= " u.statut, u.lang, u.entity,"; @@ -1979,7 +1979,7 @@ class User extends CommonObject $sql .= ", dateemploymentend=".(strval($this->dateemploymentend) != '' ? "'".$this->db->idate($this->dateemploymentend)."'" : 'null'); $sql .= ", datestartvalidity=".(strval($this->datestartvalidity) != '' ? "'".$this->db->idate($this->datestartvalidity)."'" : 'null'); $sql .= ", dateendvalidity=".(strval($this->dateendvalidity) != '' ? "'".$this->db->idate($this->dateendvalidity)."'" : 'null'); - $sql .= ", note = '".$this->db->escape($this->note_private)."'"; + $sql .= ", note_private = '".$this->db->escape($this->note_private)."'"; $sql .= ", note_public = '".$this->db->escape($this->note_public)."'"; $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); $sql .= ", openid = ".($this->openid ? "'".$this->db->escape($this->openid)."'" : "null"); From f9a404795fbc1b49570d29f429e5434899326592 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:09:05 +0200 Subject: [PATCH 434/507] Update code --- htdocs/comm/propal/class/propal.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 51c07f15269..c91d13d6b9c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2010-2017 Philippe Grand + * Copyright (C) 2010-2022 Philippe Grand * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry @@ -335,11 +335,11 @@ class Propal extends CommonObject 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>220), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>225), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>230), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>235), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240, 'isameasure'=>1), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245, 'isameasure'=>1), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>260), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), From 120fb10738811fe906f8d8d82c5a02ebbf27ec02 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:09:59 +0200 Subject: [PATCH 435/507] Update code --- htdocs/commande/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 73bf27c0cfd..3d70261e0da 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2022 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2012 Cedric Salvador @@ -13,7 +13,7 @@ * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2022 Gauthier VERDOL * * 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 @@ -1664,7 +1664,7 @@ if ($action == 'create' && $usercancreate) { $date_delivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1692,7 +1692,7 @@ if ($action == 'create' && $usercancreate) { $remise_absolue = 0; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : ''; - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } @@ -1913,7 +1913,7 @@ if ($action == 'create' && $usercancreate) { print "
    '.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).''; @@ -1992,7 +1992,7 @@ if ($action == 'create' && $usercancreate) { print '
    '.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc)."
    '.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).'
    '.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva)."
    '.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc)."
    '; @@ -2646,7 +2646,7 @@ if ($action == 'create' && $usercancreate) { print ''; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; From 4a8f61838dea468573b4608c989f06219aa5760f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:11:38 +0200 Subject: [PATCH 436/507] Update code --- htdocs/commande/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 438a00bbb56..12a85f0bf11 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -192,11 +192,11 @@ $arrayfields = array( 'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75), 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80), 'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85), - 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90), - 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95), - 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100), - 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), - 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), + 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>90), + 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>95), + 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>100), + 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>105), + 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), From 98b88fab9b301e1b6913fefed4438f748c264f64 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 3 Sep 2022 11:12:45 +0200 Subject: [PATCH 437/507] Update note.php --- htdocs/user/note.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/user/note.php b/htdocs/user/note.php index c0c93a75d64..2b9e8388063 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -40,7 +40,7 @@ $object->fetch($id, '', '', 1); $object->getrights(); // If user is not user read and no permission to read other users, we stop -if (($object->id != $user->id) && (!$user->rights->user->user->lire)) { +if (($object->id != $user->id) && (!$user->hasRight("user", "user", "read"))) { accessforbidden(); } @@ -52,7 +52,7 @@ $socid = 0; if ($user->socid > 0) { $socid = $user->socid; } -$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); +$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); @@ -89,7 +89,7 @@ if ($id) { $linkback = ''; - if ($user->rights->user->user->lire || $user->admin) { + if ($user->hasRight("user", "user", "read") || $user->admin) { $linkback = ''.$langs->trans("BackToList").''; } @@ -97,7 +97,7 @@ if ($id) { $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); $morehtmlref .= ''; - dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); + dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref); print '
    '; @@ -117,7 +117,7 @@ if ($id) { print '
    '; print ''; print ''; - //if (!empty($conf->multicurrency->enabled)) { + //if (isModEnabled("multicurrency")) { // print ''; //} print ''; @@ -1575,7 +1575,7 @@ if ($action == 'create') { // Price print '\n"; // Price multicurrency - /*if (!empty($conf->multicurrency->enabled)) { + /*if (isModEnabled("multicurrency")) { print ''; }*/ // Quantity @@ -1718,7 +1718,7 @@ if ($action == 'create') { print ''; // Price multicurrency - /*if (!empty($conf->multicurrency->enabled)) { + /*if (isModEnabled("multicurrency")) { print ''; }*/ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4aeed158dc5..8be014b8959 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2010-2020 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2022 Philippe Grand * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2012 Cedric Salvador @@ -5086,7 +5086,7 @@ abstract class CommonObject print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; } print ''; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 49dccc2d0fa..b76ad8c7a47 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -830,7 +830,7 @@ class dolReceiptPrinter extends Printer $row = $this->db->fetch_object($resql); $spacestoadd = $nbcharactbyline - strlen($langs->transnoentitiesnoconv("PaymentTypeShort".$row->code)) - 12; $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); - $amount_payment = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount; + $amount_payment = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount; if ($row->code == "LIQ") { $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4efea43b044..3b0c2250c49 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1868,7 +1868,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0) } if (empty($reshook)) { if (empty($hidedetails) || $hidedetails > 1) { - $subprice = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice); + $subprice = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice); $result .= price($sign * $subprice, 0, $outputlangs); } } @@ -2253,7 +2253,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) if ($object->lines[$i]->special_code == 3) { $result .= $outputlangs->transnoentities("Option"); } elseif (empty($hidedetails) || $hidedetails > 1) { - $total_ht = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); + $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); if (!empty($object->lines[$i]->situation_percent) && $object->lines[$i]->situation_percent > 0) { // TODO Remove this. The total should be saved correctly in database instead of being modified here. $prev_progress = 0; @@ -2309,7 +2309,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0) if ($object->lines[$i]->special_code == 3) { $result .= $outputlangs->transnoentities("Option"); } elseif (empty($hidedetails) || $hidedetails > 1) { - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc); + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc); if ($object->lines[$i]->situation_percent > 0) { // TODO Remove this. The total should be saved correctly in database instead of being modified here. $prev_progress = 0; From 53b7540d6037a5e801f276c04d456126416ea1fb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:17:05 +0200 Subject: [PATCH 441/507] Update code --- htdocs/core/modules/modCommande.class.php | 6 +++--- htdocs/core/modules/modFacture.class.php | 8 ++++---- htdocs/core/modules/modFournisseur.class.php | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 4f2b58ff00d..6a88c14271b 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -211,7 +211,7 @@ class modCommande extends DolibarrModules 'cd.tva_tx'=>"LineVATRate", 'cd.qty'=>"LineQty", 'cd.total_ht'=>"LineTotalHT", 'cd.total_tva'=>"LineTotalVAT", 'cd.total_ttc'=>"LineTotalTTC", 'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -328,7 +328,7 @@ class modCommande extends DolibarrModules 'c.fk_statut' => 'Status*' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -405,7 +405,7 @@ class modCommande extends DolibarrModules 'cd.rang' => 'LinePosition' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index a819dae666c..f7d902d22f1 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -267,7 +267,7 @@ class modFacture extends DolibarrModules 'f.note_private' => 'NotePrivate', 'f.model_pdf' => 'Model' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -399,7 +399,7 @@ class modFacture extends DolibarrModules // fk_user_modif // ref_ext ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -518,7 +518,7 @@ class modFacture extends DolibarrModules 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic" ); // Add multicurrency fields - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -647,7 +647,7 @@ class modFacture extends DolibarrModules 'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef' ); $this->export_help_array[$r] = array('f.paye'=>'InvoicePaidCompletelyHelp'); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index afc6fec4fc6..e05d7964094 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -317,7 +317,7 @@ class modFournisseur extends DolibarrModules 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -391,7 +391,7 @@ class modFournisseur extends DolibarrModules 'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", 'p.rowid'=>'PaymentId', 'pf.amount'=>'AmountPayment', 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'p.fk_bank'=>'IdTransaction', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -458,7 +458,7 @@ class modFournisseur extends DolibarrModules 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -557,7 +557,7 @@ class modFournisseur extends DolibarrModules 'f.model_pdf' => 'Model', 'f.date_valid' => 'Validation Date' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -649,7 +649,7 @@ class modFournisseur extends DolibarrModules 'fd.date_end' => 'End Date', 'fd.fk_unit' => 'Unit' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -735,7 +735,7 @@ class modFournisseur extends DolibarrModules 'c.model_pdf' => 'Model' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -817,7 +817,7 @@ class modFournisseur extends DolibarrModules 'cd.fk_unit' => 'Unit' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; From 30c58ab74db0d7ee9481ec6f4db880f79b22408f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:19:18 +0200 Subject: [PATCH 442/507] Update code --- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 4 ++-- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 +++--- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 6 +++--- htdocs/core/modules/modProduct.class.php | 4 ++-- htdocs/core/modules/modPropale.class.php | 6 +++--- htdocs/core/modules/modService.class.php | 4 ++-- 6 files changed, 15 insertions(+), 15 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 de378ee79a8..e313c612eb0 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -669,13 +669,13 @@ class pdf_standard_asset extends ModelePDFAsset // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } else { $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } } else { - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $sign * $object->lines[$i]->total_tva; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d34c66c0def..b1476b393d0 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -529,7 +529,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collection of totals by value of vat in $this->vat["rate"] = total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -938,14 +938,14 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 28003fff639..34cdb41e6b8 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -754,7 +754,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Collection of totals by value of vat in $this->tva["rate"] = total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -1152,14 +1152,14 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index f3c79de5ab8..604d96fd4cd 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -791,7 +791,7 @@ class modProduct extends DolibarrModules 'sp.remise_percent'=>'DiscountQtyMin' )); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( 'sp.fk_multicurrency'=>'CurrencyCodeId', //ideally this should be automatically obtained from the CurrencyCode on the next line 'sp.multicurrency_code'=>'CurrencyCode', @@ -853,7 +853,7 @@ class modProduct extends DolibarrModules // TODO Make this field not required and calculate it from price and qty 'sp.remise_percent' => '20' )); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array( 'sp.fk_multicurrency'=>'eg: 2, rowid for code of multicurrency currency', 'sp.multicurrency_code'=>'GBP', diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 13991cdcafa..524aa0086ea 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -197,7 +197,7 @@ class modPropale extends DolibarrModules 'cd.tva_tx'=>"LineVATRate", 'cd.qty'=>"LineQty", 'cd.total_ht'=>"LineTotalHT", 'cd.total_tva'=>"LineTotalVAT", 'cd.total_ttc'=>"LineTotalTTC", 'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->export_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->export_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->export_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -300,7 +300,7 @@ class modPropale extends DolibarrModules 'c.date_livraison' => 'DeliveryDate', 'c.fk_user_valid' => 'ValidatedById' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate'; $this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; @@ -388,7 +388,7 @@ class modPropale extends DolibarrModules 'cd.date_end' => 'End Date', 'cd.buy_price_ht' => 'LineBuyPriceHT' ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency'; $this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate'; $this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 598c9131efb..d2431d3e22c 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -740,7 +740,7 @@ class modService extends DolibarrModules 'sp.remise_percent'=>'DiscountQtyMin' )); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( 'sp.fk_multicurrency'=>'CurrencyCodeId', //ideally this should be automatically obtained from the CurrencyCode on the next line 'sp.multicurrency_code'=>'CurrencyCode', @@ -782,7 +782,7 @@ class modService extends DolibarrModules // TODO Make this field not required and calculate it from price and qty 'sp.remise_percent' => '20' )); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array( 'sp.fk_multicurrency'=>'eg: 2, rowid for code of multicurrency currency', 'sp.multicurrency_code'=>'GBP', From 7cf367f0cbd997275927890bcaa541a0c398eca0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:21:11 +0200 Subject: [PATCH 443/507] Update code --- .../modules/facture/doc/pdf_crabe.modules.php | 22 ++++++++--------- .../facture/doc/pdf_sponge.modules.php | 24 +++++++++---------- .../modules/mrp/doc/pdf_vinci.modules.php | 4 ++-- .../product/doc/pdf_standard.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 6 ++--- .../modules/propale/doc/pdf_cyan.modules.php | 6 ++--- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 3b82e92f1ab..2a94a94103e 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -298,9 +298,9 @@ class pdf_crabe extends ModelePDFFactures if ($conf->facture->dir_output) { $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Definition of $dir and $file if ($object->specimen) { @@ -707,13 +707,13 @@ class pdf_crabe extends ModelePDFFactures // Collection of totals by value of VAT in $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } else { $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } } else { - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $sign * $object->lines[$i]->total_tva; @@ -966,7 +966,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top + $y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $pdf->MultiCell(20, 3, $text, 0, 'L', 0); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); @@ -1016,7 +1016,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top + $y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); @@ -1323,14 +1323,14 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { @@ -1545,8 +1545,8 @@ class pdf_crabe extends ModelePDFFactures } $pdf->SetTextColor(0, 0, 0); - $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received - $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received + $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if (!empty($object->paye)) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index a537e35223f..cb1c2fb64e0 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -331,9 +331,9 @@ class pdf_sponge extends ModelePDFFactures if ($conf->facture->multidir_output[$conf->entity]) { $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Definition of $dir and $file if ($object->specimen) { @@ -871,13 +871,13 @@ class pdf_sponge extends ModelePDFFactures // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } else { $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } } else { - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $sign * $object->lines[$i]->total_tva; @@ -1128,7 +1128,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top + $y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $pdf->MultiCell(20, 3, $text, 0, 'L', 0); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); @@ -1164,7 +1164,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($tab3_posx, $tab3_top + $y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); @@ -1557,7 +1557,7 @@ class pdf_sponge extends ModelePDFFactures // Get Total HT - $total_ht = (!empty($conf->multicurrency->enabled) && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (isModEnabled("multicurrency") && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); // Total remise $total_line_remise = 0; @@ -1595,14 +1595,14 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { @@ -1847,8 +1847,8 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 0); - $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received - $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received + $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if (!empty($object->paye)) { diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index ba41c94ab4f..ed10b5ee2bf 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -819,7 +819,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); @@ -943,7 +943,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFillColor(224, 224, 224); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 3f75a87fc73..e4bcc0e4f04 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -421,7 +421,7 @@ class pdf_standard extends ModelePDFProduct $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; $localtax1ligne=$object->lines[$i]->total_localtax1; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3d209fce798..86d6306a576 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -640,7 +640,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -1113,14 +1113,14 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 224e3979f38..ec04a8e8906 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -764,7 +764,7 @@ class pdf_cyan extends ModelePDFPropales // Collection of totals by value of vat in $this->tva["rate"] = total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -1238,14 +1238,14 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { From c3cb372f4c5645d0d6b78a3755ad95cdf80a8c45 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:22:57 +0200 Subject: [PATCH 444/507] Update code --- .../doc/pdf_eagle_proforma.modules.php | 4 ++-- .../doc/pdf_canelle.modules.php | 18 +++++++++--------- .../supplier_order/doc/pdf_cornas.modules.php | 6 +++--- .../doc/pdf_muscadet.modules.php | 6 +++--- .../doc/pdf_aurore.modules.php | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) 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 9a6ee3c5f01..fa49b0b6d44 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -682,7 +682,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes // Collection of totals by value of vat in $this->tva["rate"] = total_tva - if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva; + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva; else $tvaligne = $object->lines[$i]->total_tva; $localtax1ligne = $object->lines[$i]->total_localtax1; @@ -1035,7 +1035,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes /*$pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); - $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);*/ 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 5cbdad90b03..39a9aab7e78 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -232,9 +232,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $nblines = count($object->lines); if ($conf->fournisseur->facture->dir_output) { - $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); - $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); + $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Definition of $dir and $file if ($object->specimen) { @@ -499,7 +499,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collection of totals by VAT value in $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -683,14 +683,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $this->atleastoneratenotnull = 0; foreach ($this->tva as $tvakey => $tvaval) { @@ -802,8 +802,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->SetTextColor(0, 0, 0); - $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received - $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); + $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received + $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); if (!empty($object->paye)) { @@ -1036,7 +1036,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($tab3_posx, $tab3_top + $y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); 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 a8f671fb528..00d1e2e28e7 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -693,7 +693,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -975,7 +975,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); @@ -1099,7 +1099,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFillColor(224, 224, 224); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); 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 12b5b990648..410a631fa62 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -573,7 +573,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; @@ -856,7 +856,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); @@ -980,7 +980,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(224, 224, 224); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index f5825957845..28c8ed0a3bd 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -573,7 +573,7 @@ class pdf_aurore extends ModelePDFSupplierProposal */ // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $object->lines[$i]->total_tva; From 79fc182201b3523e8aaf6118f2c1f2f71feba78a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:24:17 +0200 Subject: [PATCH 445/507] Update code --- htdocs/core/tpl/objectline_create.tpl.php | 6 +++--- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- htdocs/core/tpl/objectline_title.tpl.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- htdocs/core/tpl/originproductline.tpl.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/fichinter/card.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 54e64ccc769..81a1692c6a3 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -65,7 +65,7 @@ if (empty($inputalsopricewithtax)) { } // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { +if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { $colspan++; //Add column for Total (currency) if required } if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) { @@ -119,7 +119,7 @@ if ($nolinesbefore) { ?> - multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> + multicurrency_code != $conf->currency) { ?> @@ -399,7 +399,7 @@ if ($nolinesbefore) { multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { + if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { $coldisplay++; ?> '; - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { + if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { $coldisplay++; print ''; } diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 79d4ebeae11..9646d8ce88f 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -88,7 +88,7 @@ print ''; print ''; // Multicurrency -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { +if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { print ''; } @@ -152,7 +152,7 @@ if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) { print ''; // Multicurrency -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { +if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index b660bd89d93..fc1e74f1ac4 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -282,7 +282,7 @@ print vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' -multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> +multicurrency_code != $conf->currency) { ?> special_code == 3) { ?> print ''; } print ''; - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { + if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { print ''; $coldisplay++; } diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index 25c799ffbfd..090ba834ba1 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -32,7 +32,7 @@ print ''; print ''; print ''; print ''; -if (!empty($conf->multicurrency->enabled)) { +if (isModEnabled("multicurrency")) { print ''; } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 0be623ab6bf..aef309b90b5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -558,7 +558,7 @@ if ($id > 0 || !empty($ref)) { print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; $addadmin = ''; if (property_exists($object, 'admin')) { - if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) { $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); } elseif (!empty($object->admin)) { $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); From 7997776cbbb46105f4e6b54fb5954cb814630069 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:12:52 +0200 Subject: [PATCH 438/507] Update code --- htdocs/commande/class/commande.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ca7d462a432..683074490a8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -348,12 +348,12 @@ class Commande extends CommonOrder 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225), 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>230), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>235), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>260, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>265, 'isameasure'=>1), + 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>260, 'isameasure'=>1), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>265, 'isameasure'=>1), 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275), 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280), From 5a98b72faff4e08384ccdc3860713313e62a6db1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:14:05 +0200 Subject: [PATCH 439/507] Update code --- htdocs/compta/facture/class/facture.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 594ee548da7..c6281e77e67 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -348,12 +348,12 @@ class Facture extends CommonInvoice 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>260), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265), 'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>275), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>280), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>285, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>290, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>291, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>292, 'isameasure'=>1), + 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>275), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>280), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>285, 'isameasure'=>1), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>290, 'isameasure'=>1), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>291, 'isameasure'=>1), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>292, 'isameasure'=>1), 'fk_fac_rec_source' =>array('type'=>'integer', 'label'=>'RecurringInvoiceSource', 'enabled'=>1, 'visible'=>-1, 'position'=>305), 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>310), 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315), From d96c60ec8b0f86227d2e7326ef30a3864422724c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:16:00 +0200 Subject: [PATCH 440/507] Update code --- htdocs/contrat/card.php | 6 +++--- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/class/dolreceiptprinter.class.php | 2 +- htdocs/core/lib/pdf.lib.php | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 564122f3137..30b884d288c 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1514,7 +1514,7 @@ if ($action == 'create') { print ''.$langs->trans("ServiceNb", $cursorline).''.$langs->trans("VAT").''.$langs->trans("PriceUHT").''.$langs->trans("PriceUHTCurrency").''.$langs->trans("Qty").''.($objp->subprice != '' ? price($objp->subprice) : '')."'.price($objp->multicurrency_subprice).''.price($objp->multicurrency_subprice).''.$langs->trans('Description').''.$langs->trans('VATRate').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHTCurrency').''.$langs->trans('Qty').'trans('VAT'); ?> trans('PriceUHT'); ?>trans('PriceUHTCurrency'); ?> diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index b2974ffbbfc..d755c3996a8 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -70,7 +70,7 @@ if (!empty($inputalsopricewithtax)) { if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', 'facturerec', 'invoice', 'commande', 'order', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) { $colspan++; // With this, there is a column move button } -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { +if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { $colspan += 2; } if (isModEnabled('asset') && $object->element == 'invoice_supplier') { @@ -214,7 +214,7 @@ $coldisplay++; } print '>'.$langs->trans('PriceUHT').''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'subprice); ?>multicurrency_subprice); ?> '.price($sign * $line->multicurrency_total_ht).''.$this->tpl['label'].''.$this->tpl['description'].''.$this->tpl['vat_rate'].''.$this->tpl['price'].''.$this->tpl['multicurrency_price'].'
    '; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 1c83726f7e6..97d3bfaaf7d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -998,7 +998,7 @@ if ($action == 'create') { print '"; - if (!empty($conf->multicurrency->enabled)) + if (isModEnabled("multicurrency")) { print ''; print '"; From 3737a854705add1df874f828acc6e61599160be4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:25:51 +0200 Subject: [PATCH 446/507] Update code --- htdocs/fourn/class/fournisseur.commande.class.php | 14 +++++++------- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/class/fournisseur.product.class.php | 2 +- htdocs/fourn/class/paiementfourn.class.php | 2 +- htdocs/fourn/commande/card.php | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8a1dcf682b2..30d95361ca1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -191,7 +191,7 @@ class CommandeFournisseur extends CommonOrder * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) @@ -247,11 +247,11 @@ class CommandeFournisseur extends CommonOrder 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>3, 'position'=>205), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>3, 'position'=>210), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>220), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>225), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>230), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>235), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>240), + 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>220), + 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>225), + 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>230), + 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235), + 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240), 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>500), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>1, 'notnull'=>1, 'position'=>46), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>1000, 'index'=>1), @@ -1888,7 +1888,7 @@ class CommandeFournisseur extends CommonOrder } } - if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) { + if (isModEnabled("multicurrency") && $pu_ht_devise > 0) { $pu = 0; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2103b97d2e1..e3c3ce8ef36 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2125,7 +2125,7 @@ class FactureFournisseur extends CommonInvoice $product_type = $type; } - if (!empty($conf->multicurrency->enabled) && $pu_devise > 0) { + if (isModEnabled("multicurrency") && $pu_devise > 0) { $pu = 0; } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 25b26c75852..276c5b20ed9 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -296,7 +296,7 @@ class ProductFournisseur extends Product // Multicurrency $multicurrency_unitBuyPrice = null; $fk_multicurrency = null; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (empty($multicurrency_tx)) { $multicurrency_tx = 1; } diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 386c34483de..e0b3fcac0c6 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -862,7 +862,7 @@ class PaiementFourn extends Paiement global $conf; $way = 'dolibarr'; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { foreach ($this->multicurrency_amounts as $value) { if (!empty($value)) { // one value found then payment is in invoice currency $way = 'customer'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 660d555676f..f6263fe1304 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1616,7 +1616,7 @@ if ($action == 'create') { $datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '')); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1634,7 +1634,7 @@ if ($action == 'create') { $cond_reglement_id = !empty($societe->cond_reglement_supplier_id) ? $societe->cond_reglement_supplier_id : 0; $mode_reglement_id = !empty($societe->mode_reglement_supplier_id) ? $societe->mode_reglement_supplier_id : 0; - if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($societe->multicurrency_code)) { $currency_code = $societe->multicurrency_code; } @@ -1772,7 +1772,7 @@ if ($action == 'create') { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print '"; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; @@ -2165,7 +2165,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { print ''; print ''; print ''; @@ -991,7 +991,7 @@ if ($id > 0 || !empty($ref)) { print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { // Price print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print ''; print ''; print '"; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print '"; print '"; @@ -2613,7 +2613,7 @@ if ($action == 'create') { $resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $multicurrency_totalpaid = $object->getSommePaiement(1); $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); @@ -3046,7 +3046,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    ' . $langs->trans('AmountTTC') . '' . price($objectsrc->total_ttc) . "
    ' . $langs->trans('MulticurrencyAmountHT') . '' . price($objectsrc->multicurrency_total_ht) . '
    ' . $langs->trans('MulticurrencyAmountVAT') . '' . price($objectsrc->multicurrency_total_tva) . "
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -1819,7 +1819,7 @@ if ($action == 'create') { print '
    '.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc)."
    '.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).'
    '.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva).'
    '.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc).'
    '; From 62529b10e4949e410215c79caa3a5805f1457f1a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:28:48 +0200 Subject: [PATCH 447/507] Update code --- htdocs/fourn/commande/dispatch.php | 12 ++++++------ htdocs/fourn/facture/card-rec.php | 2 +- htdocs/fourn/facture/card.php | 18 +++++++++--------- htdocs/fourn/facture/list.php | 14 +++++++------- htdocs/fourn/facture/paiement.php | 8 ++++---- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c7baf022d8e..d5f9a9e8e73 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -243,7 +243,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); if (!empty($dto)) { $unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU'); @@ -269,7 +269,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { } if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'), ''); if (empty($dto)) { $dto = 0; @@ -311,7 +311,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); if (!empty($dto)) { $unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU'); @@ -344,7 +344,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { } if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); //update supplier price if (GETPOSTISSET($saveprice)) { @@ -742,7 +742,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("Price").''.$langs->trans("ReductionShort").' (%)'.$langs->trans("UpdatePrice").''; print ''; diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 8f8d9ec9e47..be1693b7381 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1243,7 +1243,7 @@ if ($action == 'create') { print '
    '; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f0640681e7f..11b7332f587 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1915,7 +1915,7 @@ if ($action == 'create') { if (GETPOST('socid', 'int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid', 'int')); - if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($societe->multicurrency_code)) { $currency_code = $societe->multicurrency_code; } } @@ -1964,7 +1964,7 @@ if ($action == 'create') { $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : ''; $transport_mode_id = (!empty($objectsrc->transport_mode_id) ? $objectsrc->transport_mode_id : (!empty($soc->transport_mode_id) ? $soc->transport_mode_id : 0)); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1991,7 +1991,7 @@ if ($action == 'create') { $datetmp = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int')); $datedue = ($datetmp == '' ?-1 : $datetmp); - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } } @@ -2428,7 +2428,7 @@ if ($action == 'create') { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print '
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -2537,7 +2537,7 @@ if ($action == 'create') { } print '
    '.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc)."
    '.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).'
    '.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva)."
    '.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc)."
    '; @@ -3169,7 +3169,7 @@ if ($action == 'create') { print ''; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; @@ -3256,7 +3256,7 @@ if ($action == 'create') { if (!empty($conf->incoterm->enabled)) { $nbrows++; } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $nbrows += 5; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0072349c06b..305c50b29d5 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -195,13 +195,13 @@ $arrayfields = array( 'u.login'=>array('label'=>"Author", 'checked'=>1), 'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0), 'rtp'=>array('label'=>"Rest", 'checked'=>0), - 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), // Not enabled by default because slow + 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 09507929daf..d9b755fdf4e 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -575,7 +575,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; @@ -612,7 +612,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); $multicurrency_deposits = $invoice->getSumDepositsUsed(1); @@ -653,7 +653,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Currency print '\n"; @@ -767,7 +767,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Print total print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; From 371f5ee581d3413325c385932ac96f9f0c78f057 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:30:24 +0200 Subject: [PATCH 448/507] Update code --- htdocs/modulebuilder/index.php | 2 +- .../template/class/myobject.class.php | 2 +- .../mymodule/doc/pdf_standard_myobject.modules.php | 4 ++-- htdocs/multicurrency/multicurrency_rate.php | 2 +- htdocs/product/fournisseurs.php | 14 +++++++------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 0762d95d154..81da2909779 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -907,7 +907,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 1d6b6650d27..8265bbadaf8 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -84,7 +84,7 @@ class MyObject extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) 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 561c09f88d6..3990d49fa6d 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 @@ -634,13 +634,13 @@ class pdf_standard_myobject extends ModelePDFMyObject // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } else { $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; } } else { - if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) { + if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva; } else { $tvaligne = $sign * $object->lines[$i]->total_tva; diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 06fe91c120d..3f20476f72a 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -102,7 +102,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); // Access control // TODO Open this page to a given permission so a sale representative can modify change rates. Permission should be added into module multicurrency. // One permission to read rates (history) and one to add/edit rates. -if (!$user->admin || empty($conf->multicurrency->enabled)) { +if (!$user->admin || !isModEnabled("multicurrency")) { accessforbidden(); } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 164dac7d185..03e7881dffb 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -243,7 +243,7 @@ if (empty($reshook)) { $_POST["price"] = 0; } } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!GETPOST("multicurrency_code")) { $error++; $langs->load("errors"); @@ -299,7 +299,7 @@ if (empty($reshook)) { }*/ $object->packaging = $packaging; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha')); $multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha')); $multicurrency_code = GETPOST("multicurrency_code", 'alpha'); @@ -630,7 +630,7 @@ if ($id > 0 || $ref) { '; } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Currency print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Price for the quantity in currency print ''; From 8108a60aacf7a388b60449e3d98416e4867d770a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 3 Sep 2022 11:32:24 +0200 Subject: [PATCH 449/507] Update code --- htdocs/societe/card.php | 18 +++++++++--------- htdocs/supplier_proposal/card.php | 14 +++++++------- .../class/supplier_proposal.class.php | 10 +++++----- htdocs/supplier_proposal/list.php | 10 +++++----- htdocs/webhook/class/target.class.php | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index f8beacdbb2e..c6ee771472f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -540,7 +540,7 @@ if (empty($reshook)) { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } @@ -1174,7 +1174,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->forme_juridique_code = GETPOST('forme_juridique_code'); // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency; } /* Show create form */ @@ -1740,7 +1740,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''; print ''; } else { print ''.$langs->trans("Currency".$conf->currency).''; @@ -1788,7 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; print ''; } else { print '"> '.$langs->trans("Currency".$conf->currency).''; @@ -2494,7 +2494,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; print ''; print ''; print ''; print '"; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print '"; print '"; @@ -1685,7 +1685,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print ''; // ID - print ''; + print ''; // Date print ''; @@ -535,11 +535,11 @@ if (is_array($blocks)) { // User print ''; // Action - print ''; + print ''; // Ref print ''; if (!$i) { @@ -2332,7 +2332,7 @@ if ($resql) { } // Date modification if (!empty($arrayfields['f.tms']['checked'])) { - print ''; if (!$i) { @@ -2341,7 +2341,7 @@ if ($resql) { } // Date closing if (!empty($arrayfields['f.date_closing']['checked'])) { - print ''; if (!$i) { From 81865ec55bd4b69753c619ddd5910fab0664e570 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Sep 2022 09:39:54 +0200 Subject: [PATCH 464/507] NEW Support IP type in extrafields --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 12 ++++++------ htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 8dcc1edf017..7814560be9b 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -191,17 +191,17 @@ if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_a array('varchar', 'phone', 'mail', 'url', 'select', 'password', 'text', 'html'), + 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'), 'double'=>array('double', 'price'), 'price'=>array('double', 'price'), 'text'=>array('text', 'html'), 'html'=>array('text', 'html'), 'password'=>array('password', 'varchar'), - 'mail'=>array('ip', 'varchar', 'phone', 'mail', 'url', 'select'), - 'url'=>array('ip', 'varchar', 'phone', 'mail', 'url', 'select'), - 'phone'=>array('ip', 'varchar', 'phone', 'mail', 'url', 'select'), - 'ip'=>array('ip', 'varchar', 'phone', 'mail', 'url', 'select'), - 'select'=>array('varchar', 'phone', 'mail', 'url', 'select'), + 'mail'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'url'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'phone'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'ip'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), + 'select'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'date'=>array('date', 'datetime') ); /* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6fe10207247..cc3e1252b31 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -441,6 +441,7 @@ ExtrafieldPhone = Phone ExtrafieldPrice = Price ExtrafieldMail = Email ExtrafieldUrl = Url +ExtrafieldIP = IP ExtrafieldSelect = Select list ExtrafieldSelectList = Select from table ExtrafieldSeparator=Separator (not a field) From 9a4a740d4b5efb9964bb5fa313be1b9e4eaa3c05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Sep 2022 11:13:30 +0200 Subject: [PATCH 465/507] Doc --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a5461f3b666..8a5751d72b3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1577,7 +1577,7 @@ function dol_ucwords($string, $encoding = "UTF-8") * @param int $level Log level * On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr * On Linux LOG_ERR=3, LOG_WARNING=4, LOG_NOTICE=5, LOG_INFO=6, LOG_DEBUG=7 - * @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1 + * @param int $ident 1=Increase ident of 1 (after log), -1=Decrease ident of 1 (before log) * @param string $suffixinfilename When output is a file, append this suffix into default log filename. * @param string $restricttologhandler Force output of log only to this log handler * @param array|null $logcontext If defined, an array with extra informations (can be used by some log handlers) From 33ad0de37e50d4c01314f2ebdcbec03e2000cf71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Sep 2022 12:27:06 +0200 Subject: [PATCH 466/507] NEW Show also shceduled task never finished in scheduled task widget --- htdocs/core/boxes/box_scheduled_jobs.php | 20 ++++++++++++++++-- htdocs/core/lib/admin.lib.php | 26 ++++++++++++++---------- htdocs/cron/list.php | 4 ++++ htdocs/langs/en_US/admin.lang | 4 +++- htdocs/langs/en_US/cron.lang | 1 + htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index cd610543e47..915884d6f43 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -86,7 +86,7 @@ class box_scheduled_jobs extends ModeleBoxes $result = 0; $sql = "SELECT t.rowid, t.datelastrun, t.datenextrun, t.datestart,"; - $sql .= " t.label, t.status, t.test, t.lastresult"; + $sql .= " t.label, t.status, t.test, t.lastresult, t.processing"; $sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t"; $sql .= " WHERE status <> ".$cronstatic::STATUS_DISABLED; $sql .= " AND entity IN (0, ".$conf->entity.")"; @@ -95,6 +95,7 @@ class box_scheduled_jobs extends ModeleBoxes $result = $this->db->query($sql); $line = 0; $nbjobsinerror = 0; + $nbjobsnotfinished = 0; if ($result) { $num = $this->db->num_rows($result); @@ -109,6 +110,7 @@ class box_scheduled_jobs extends ModeleBoxes } if ($line == 0 || ($nextrun < $cronstatic->datenextrun && (empty($objp->nbrun) || empty($objp->maxrun) || $objp->nbrun < $objp->maxrun))) { + // Save in cronstatic the job if it is a job to run in future $cronstatic->id = $objp->rowid; $cronstatic->ref = $objp->rowid; $cronstatic->label = $langs->trans($objp->label); @@ -117,6 +119,7 @@ class box_scheduled_jobs extends ModeleBoxes $cronstatic->datelastrun = $this->db->jdate($objp->datelastrun); } if ($line == 0) { + // Save the first line in loop that is the most recent executed job (due to the sort on datelastrun DESC) $resultarray[$line] = array( $langs->trans("LastExecutedScheduledJob"), $cronstatic->getNomUrl(1), @@ -127,6 +130,9 @@ class box_scheduled_jobs extends ModeleBoxes $line++; } + if ($objp->processing && $this->db->jdate($objp->datelastrun) < (dol_now() - 3600 * 24)) { + $nbjobsnotfinished++; + } if (!empty($objp->lastresult)) { $nbjobsinerror++; } @@ -168,9 +174,19 @@ class box_scheduled_jobs extends ModeleBoxes 'td' => 'class="tdoverflowmax300" colspan="3"', 'text' => $langs->trans("NumberScheduledJobError") ); + $textnoformat = ''; + if ($nbjobsnotfinished) { + $textnoformat .= '
    '.$nbjobsnotfinished.'
    '; + } + if ($nbjobsinerror) { + $textnoformat .= '
    '.$nbjobsinerror.'
    '; + } + if (empty($nbjobsnotfinished) && empty($nbjobsinerror)) { + $textnoformat .= '
    0
    '; + } $this->info_box_contents[$line][] = array( 'td' => 'class="center"', - 'textnoformat' => ($nbjobsinerror ? '
    '.$nbjobsinerror.'
    ' : '
    0
    ') + 'textnoformat' => $textnoformat ); } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 53193db176c..0ea8b49d04a 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -151,18 +151,18 @@ function versiondolibarrarray() * Install process however does not use it. * Note that Sql files must have all comments at start of line. Also this function take ';' as the char to detect end of sql request * - * @param string $sqlfile Full path to sql file - * @param int $silent 1=Do not output anything, 0=Output line for update page - * @param int $entity Entity targeted for multicompany module - * @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). - * @param string $handler Handler targeted for menu (replace __HANDLER__ with this value) - * @param string $okerror Family of errors we accept ('default', 'none') - * @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined) - * @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0) + * @param string $sqlfile Full path to sql file + * @param int $silent 1=Do not output anything, 0=Output line for update page + * @param int $entity Entity targeted for multicompany module + * @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). + * @param string $handler Handler targeted for menu (replace __HANDLER__ with this value) + * @param string $okerror Family of errors we accept ('default', 'none') + * @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined) + * @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0) * @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value - * @param int $colspan 2=Add a colspan=2 on td + * @param int $colspan 2=Add a colspan=2 on td * @param int $onlysqltoimportwebsite Only sql resquests used to import a website template is allowed - * @return int <=0 if KO, >0 if OK + * @return int <=0 if KO, >0 if OK */ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0) { @@ -523,7 +523,11 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle }); }); '; - print ' - '.$langs->trans("ShowHideDetails").''; + if (count($arraysql)) { + print ' - '.$langs->trans("ShowHideDetails").''; + } else { + print ' - '.$langs->trans("ScriptIsEmpty").''; + } //} print '
    '."\n"; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 2732e41dc14..41082fa79cd 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -64,6 +64,7 @@ $search_status = (GETPOSTISSET('search_status') ?GETPOST('search_status', 'int') $search_label = GETPOST("search_label", 'alpha'); $search_module_name = GETPOST("search_module_name", 'alpha'); $search_lastresult = GETPOST("search_lastresult", "alphawithlgt"); +$search_processing = GETPOST("search_processing", "int"); $securitykey = GETPOST('securitykey', 'alpha'); $outputdir = $conf->cron->dir_output; @@ -277,6 +278,9 @@ if ($search_status >= 0 && $search_status < 2 && $search_status != '') { if ($search_lastresult != '') { $sql .= natural_search("t.lastresult", $search_lastresult, 1); } +if (GETPOSTISSET('search_processing')) { + $sql .= " AND t.processing = ".((int) $search_processing); +} //Manage filter if (is_array($filter) && count($filter) > 0) { foreach ($filter as $key => $value) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cc3e1252b31..cbec6cfc5ea 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2307,4 +2307,6 @@ MAIN_MAIL_SMTPS_AUTH_TYPE=Authentification method UsePassword=Use a password UseOauth=Use a OAUTH token Images=Images -MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form \ No newline at end of file +MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form +ScriptIsEmpty=The script is empty +ShowHideTheNRequests=Show/hide the %s SQL request(s) \ No newline at end of file diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index d5f784248be..d9bdd2691eb 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -93,3 +93,4 @@ JobXMustBeEnabled=Job %s must be enabled LastExecutedScheduledJob=Last executed scheduled job NextScheduledJobExecute=Next scheduled job to execute NumberScheduledJobError=Number of scheduled jobs in error +NumberScheduledJobNeverFinished=Number of scheduled jobs never finished diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 51599816c37..dcff3c4b7a1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -821,6 +821,9 @@ textarea.centpercent { .nounderline { text-decoration: none; } +.nounderlineimp { + text-decoration: none !important; +} .nopadding { padding: 0; } @@ -1532,6 +1535,7 @@ table[summary="list_of_modules"] .fa-cog { .clearboth { clear:both; } .hideobject { display: none; } +.minwidth25 { min-width: 25px; } .minwidth50 { min-width: 50px; } .minwidth75 { min-width: 75px; } /* rule for not too small screen only */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index db65e797f95..1eb0fa7d71f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -973,6 +973,9 @@ textarea.centpercent { .nounderline { text-decoration: none; } +.nounderlineimp { + text-decoration: none !important; +} .nopadding { padding: 0; } @@ -1623,6 +1626,7 @@ tr.nobottom td { .clearboth { clear:both; } .hideobject { display: none; } +.minwidth25 { min-width: 25px; } .minwidth50 { min-width: 50px; } .minwidth75 { min-width: 75px; } /* rule for not too small screen only */ From 7344b1946a35a35e7b0eb3700f0ef976a07ccad0 Mon Sep 17 00:00:00 2001 From: Radarjr2002 <112626442+Radarjr2002@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:40:39 +0200 Subject: [PATCH 467/507] Update card_presend.tpl.php TODO Get also the main_lastdoc field of $object --- htdocs/core/tpl/card_presend.tpl.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 596feae69d1..18668e7fae2 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -43,14 +43,18 @@ if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); if (!in_array($object->element, array('user', 'member'))) { - // TODO get also the main_lastdoc field of $object. If not found, try to guess with following code - - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - // Special case - if ($object->element == 'invoice_supplier') { - $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); - } else { - $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); + //$fileparams['fullname'] can be filled from the card + //Get also the main_lastdoc field of $object. If not found, try to guess with following code + if(!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file ( DOL_DATA_ROOT.'/'.$object->last_main_doc )){ + $fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc; + } else { + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // Special case + if ($object->element == 'invoice_supplier') { + $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); + } else { + $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); + } } $file = $fileparams['fullname']; From c2a7741607bed10d2e9995b5c287a535d2b71c20 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 5 Sep 2022 11:50:10 +0000 Subject: [PATCH 468/507] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 18668e7fae2..826a8e0a12a 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -45,9 +45,9 @@ if ($action == 'presend') { if (!in_array($object->element, array('user', 'member'))) { //$fileparams['fullname'] can be filled from the card //Get also the main_lastdoc field of $object. If not found, try to guess with following code - if(!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file ( DOL_DATA_ROOT.'/'.$object->last_main_doc )){ - $fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc; - } else { + if (!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { + $fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc; + } else { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Special case if ($object->element == 'invoice_supplier') { From 4262d666cab9708e1c45588ceebb3ac2074fcfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Mon, 5 Sep 2022 16:15:13 +0200 Subject: [PATCH 469/507] PHP V8 warning and $objectidnext = $object->getIdReplacingInvoice(); not present --- htdocs/fourn/facture/card.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c2fc4e8511a..b928cc5bdf9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2642,6 +2642,8 @@ if ($action == 'create') { /* * View card */ + $objectidnext = $object->getIdReplacingInvoice(); + $head = facturefourn_prepare_head($object); $titre = $langs->trans('SupplierInvoice'); @@ -2934,7 +2936,7 @@ if ($action == 'create') { } print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } - if (isset($facidnext) && $facidnext > 0) { + if (isset($objectidnext) && $objectidnext > 0) { $facthatreplace = new FactureFournisseur($db); $facthatreplace->fetch($facidnext); print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; @@ -3266,7 +3268,7 @@ if ($action == 'create') { } $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,'; - $sql .= ' c.id as paiement_type,'; + $sql .= ' c.id as paiement_type, c.code as payment_code,'; $sql .= ' pf.amount,'; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; @@ -3303,7 +3305,7 @@ if ($action == 'create') { $paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid); $paymentstatic->num_payment = $objp->num_payment; - $paymentstatic->payment_code = $objp->payment_code; + $paymentstatic->paiementcode = $objp->payment_code; print ''; print ''; // Label @@ -197,13 +199,13 @@ if ($object->id > 0) { // Amount Local Taxes //TODO: Place into a function to control showing by country or study better option - if ($societe->localtax1_assuj == "1") { //Localtax1 - print ''; + if ($mysoc->localtax1_assuj == "1") { //Localtax1 + print ''; print ''; print ''; } - if ($societe->localtax2_assuj == "1") { //Localtax2 - print ''; + if ($mysoc->localtax2_assuj == "1") { //Localtax2 + print ''; print ''; print ''; } From c6d03b694cdd986cd9b354f460fada1e1bc19fa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Sep 2022 18:31:48 +0200 Subject: [PATCH 471/507] Fix css for ip exrafield type --- htdocs/core/class/extrafields.class.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 004a0cbe5e8..a3925c9160a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1881,36 +1881,27 @@ class ExtraFields { global $conf, $langs; + $type = 'varchar'; if (!empty($extrafieldsobjectkey)) { $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - } else { - $type = $this->attribute_type[$key]; } $cssstring = ''; - if ($type == 'date') { + if (in_array($type, array('date', 'datetime'))) { $cssstring = "center"; - } elseif ($type == 'datetime') { - $cssstring = "center"; - } elseif ($type == 'int') { + } elseif (in_array($type, array('int', 'price', 'double'))) { $cssstring = "right"; - } elseif ($type == 'price') { - $cssstring = "right"; - } elseif ($type == 'double') { - $cssstring = "right"; - } elseif ($type == 'boolean') { + } elseif (in_array($type, array('boolean', 'radio', 'checkbox', 'ip'))) { $cssstring = "center"; - } elseif ($type == 'radio') { - $cssstring = "center"; - } elseif ($type == 'checkbox') { - $cssstring = "center"; - } elseif ($type == 'price') { - $cssstring = "right"; } if (!empty($this->attributes[$extrafieldsobjectkey]['csslist'][$key])) { $cssstring .= ($cssstring ? ' ' : '').$this->attributes[$extrafieldsobjectkey]['csslist'][$key]; + } else { + if (in_array($type, array('ip'))) { + $cssstring .= ($cssstring ? ' ' : '').'tdoverflowmax150'; + } } return $cssstring; From c3afd7ab4f950aaafca33e00e7b9420a3935be71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2022 01:44:52 +0200 Subject: [PATCH 472/507] Menu position --- htdocs/core/modules/modCron.class.php | 2 +- htdocs/core/modules/modEmailCollector.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 00d73dd7d14..3a84b28eef3 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -141,7 +141,7 @@ class modCron extends DolibarrModules 'titre'=>'CronList', 'url'=>'/cron/list.php?leftmenu=admintools', 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>200, + 'position'=>500, 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 145dd966044..ef823856a57 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -175,7 +175,7 @@ class modEmailCollector extends DolibarrModules 'titre'=>'EmailCollectors', 'url'=>'/admin/emailcollector_list.php?leftmenu=admintools', 'langs'=>'admin', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>201, + 'position'=>400, 'enabled'=>'$conf->emailcollector->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', From faee162b916a3f83c875b48eb028f2447e797965 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 6 Sep 2022 04:48:26 +0200 Subject: [PATCH 473/507] FIX Travis - Complete WIP #22059 --- htdocs/core/modules/modUser.class.php | 10 +++++----- htdocs/user/list.php | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 719c90c6dab..dc0da3e0ac3 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -225,7 +225,7 @@ class modUser extends DolibarrModules 'u.accountancy_code'=>"UserAccountancyCode", 'u.address'=>"Address", 'u.zip'=>"Zip", 'u.town'=>"Town", 'u.office_phone'=>'Phone', 'u.user_mobile'=>"Mobile", 'u.office_fax'=>'Fax', - 'u.email'=>"Email", 'u.note'=>"Note", 'u.signature'=>'Signature', + 'u.email'=>"Email", 'u.note_public'=>"NotePublic", 'u.note_private'=>"NotePrivate", 'u.signature'=>'Signature', 'u.fk_user'=>'HierarchicalResponsible', 'u.thm'=>'THM', 'u.tjm'=>'TJM', 'u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmploymentStart', 'u.dateemploymentend'=>'DateEmploymentEnd', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey', 'u.birth'=>'DateOfBirth', @@ -242,7 +242,7 @@ class modUser extends DolibarrModules 'u.accountancy_code'=>'Text', 'u.address'=>"Text", 'u.zip'=>"Text", 'u.town'=>"Text", 'u.office_phone'=>'Text', 'u.user_mobile'=>'Text', 'u.office_fax'=>'Text', - 'u.email'=>'Text', 'u.datec'=>"Date", 'u.tms'=>"Date", 'u.admin'=>"Boolean", 'u.statut'=>'Status', 'u.note'=>"Text", 'u.signature'=>"Text", 'u.datelastlogin'=>'Date', + 'u.email'=>'Text', 'u.datec'=>"Date", 'u.tms'=>"Date", 'u.admin'=>"Boolean", 'u.statut'=>'Status', 'u.note_public'=>"Text", 'u.note_private'=>"Text", 'u.signature'=>"Text", 'u.datelastlogin'=>'Date', 'u.fk_user'=>"FormSelect:select_dolusers", 'u.birth'=>'Date', 'u.datepreviouslogin'=>'Date', @@ -261,7 +261,7 @@ class modUser extends DolibarrModules 'u.accountancy_code'=>'user', 'u.address'=>"user", 'u.zip'=>"user", 'u.town'=>"user", 'u.office_phone'=>'user', 'u.user_mobile'=>'user', 'u.office_fax'=>'user', - 'u.email'=>'user', 'u.note'=>"user", 'u.signature'=>'user', + 'u.email'=>'user', 'u.note_public'=>"user", 'u.note_private'=>"user", 'u.signature'=>'user', 'u.fk_user'=>'user', 'u.thm'=>'user', 'u.tjm'=>'user', 'u.weeklyhours'=>'user', 'u.dateemployment'=>'user', 'u.dateemploymentend'=>'user', 'u.salary'=>'user', 'u.color'=>'user', 'u.api_key'=>'user', 'u.birth'=>'user', @@ -303,7 +303,7 @@ class modUser extends DolibarrModules 'u.pass_crypted'=>"Password", 'u.admin'=>"Administrator", 'u.fk_soc'=>"Company*", 'u.address'=>"Address", 'u.zip'=>"Zip", 'u.town'=>"Town", 'u.fk_state'=>"StateId", 'u.fk_country'=>"CountryCode", 'u.office_phone'=>"Phone", 'u.user_mobile'=>"Mobile", 'u.office_fax'=>"Fax", - 'u.email'=>"Email", 'u.note'=>"Note", 'u.signature'=>'Signature', + 'u.email'=>"Email", 'u.note_public'=>"NotePublic", 'u.note_private'=>"NotePrivate", 'u.signature'=>'Signature', 'u.fk_user'=>'HierarchicalResponsible', 'u.thm'=>'THM', 'u.tjm'=>'TJM', 'u.weeklyhours'=>'WeeklyHours', 'u.dateemployment'=>'DateEmploymentStart', 'u.dateemploymentend'=>'DateEmploymentEnd', 'u.salary'=>'Salary', 'u.color'=>'Color', 'u.api_key'=>'ApiKey', 'u.birth'=>'DateOfBirth', @@ -339,7 +339,7 @@ class modUser extends DolibarrModules 'u.pass_crypted'=>'Encrypted password', 'u.fk_soc'=>'0 (internal user) or company name (external user)', 'u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'), 'u.address'=>"61 jump street", 'u.zip'=>"123456", 'u.town'=>"Big town", 'u.fk_country'=>'US, FR, DE...', 'u.office_phone'=>"0101010101", 'u.office_fax'=>"0101010102", - 'u.email'=>"test@mycompany.com", 'u.salary'=>"10000", 'u.note'=>"This is an example of note for record", 'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00", + 'u.email'=>"test@mycompany.com", 'u.salary'=>"10000", 'u.note_public'=>"This is an example of public note for record", 'u.note_private'=>"This is an example of private note for record", 'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00", 'u.statut'=>"0 (closed) or 1 (active)", ); $this->import_updatekeys_array[$r] = array('u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'u.login'=>'Login'); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 858a46887ba..416e913d6c9 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -110,7 +110,8 @@ $fieldstosearchall = array( 'u.office_phone'=>"PhonePro", 'u.user_mobile'=>"PhoneMobile", 'u.email'=>"EMail", - 'u.note'=>"Note", + 'u.note_public'=>"NotePublic", + 'u.note_private'=>"NotePrivate", ); if (!empty($conf->api->enabled)) { $fieldstosearchall['u.api_key'] = "ApiKey"; From a13f232d2d577859ddc2df9319a815a34cbecf16 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 6 Sep 2022 05:42:04 +0200 Subject: [PATCH 474/507] FIX #22057 --- htdocs/compta/resultat/clientfourn.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index ed4dac6c3f3..3658fdbda6b 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; // Load translation files required by the page From 2c58aeafed1b21632a9155f5eba0ed2c23a570e1 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Tue, 6 Sep 2022 08:31:05 +0200 Subject: [PATCH 475/507] FIX - php V8 html form documents --- htdocs/core/class/html.formfile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 441ddb60255..05489c3dc50 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1471,10 +1471,10 @@ class FormFile if ($nboffiles > 1 && $conf->browser->layout != 'phone') { print ''; } else { From c6349ce51a137cf6c91e9118c4d0bc1e75758052 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 6 Sep 2022 11:06:48 +0200 Subject: [PATCH 476/507] Fix : Yogosha report 12245 bad field verification --- htdocs/holiday/card.php | 6 ++++++ htdocs/langs/en_US/holiday.lang | 1 + 2 files changed, 7 insertions(+) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 96a6b40f71b..f1faf827b34 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -254,6 +254,12 @@ if (empty($reshook)) { $error++; } + $approverslist = $object->fetch_users_approver_holiday(); + if (!in_array($approverid, $approverslist)) { + setEventMessages($langs->transnoentitiesnoconv('InvalidValidator'), null, 'errors'); + $error++; + } + $result = 0; if (!$error) { diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 04f47c8428d..95c8f54d211 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -58,6 +58,7 @@ ConfirmDeleteCP=Confirm the deletion of this leave request? ErrorCantDeleteCP=Error you don't have the right to delete this leave request. CantCreateCP=You don't have the right to make leave requests. InvalidValidatorCP=You must choose the approver for your leave request. +InvalidValidator=The user chosen isn't an approver. NoDateDebut=You must select a start date. NoDateFin=You must select an end date. ErrorDureeCP=Your leave request does not contain working day. From e40d925a572cf8c7942d17b3202504fcbde99d99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2022 12:43:07 +0200 Subject: [PATCH 477/507] css --- htdocs/societe/paymentmodes.php | 2 +- htdocs/theme/eldy/global.inc.php | 8 ++++++++ htdocs/theme/md/style.css.php | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index b8a0d4e11f2..20cce294586 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -863,7 +863,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; print ''; print img_picto($langs->trans("CreateCustomerOnStripe"), 'stripe'); - print ''; + print ''; print ''; } print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index dcff3c4b7a1..b8326171eb4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3545,6 +3545,14 @@ input.button[name="upload"] { input.button.smallpaddingimp, input.buttonreset.smallpaddingimp { font-size: 0.8em; } +input.buttonlink { + color: var(--colortextlink); + background-color: transparent; + cursor: pointer; +} +input.buttonlink:hover { + text-decoration: underline; +} input.buttonreset { margin-top: 3px; margin-bottom: 3px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1eb0fa7d71f..47892574efb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3511,6 +3511,14 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd .smallpaddingimp { padding: 4px !important; } +input.buttonlink { + color: var(--colortextlink); + background-color: transparent; + cursor: pointer; +} +input.buttonlink:hover { + text-decoration: underline; +} input.buttonreset { margin-top: 3px; margin-bottom: 3px; From c06963f2ff49994ef5240b8376c4271f4564741e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2022 14:21:32 +0200 Subject: [PATCH 478/507] Trans --- htdocs/langs/en_US/withdrawals.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 75cee952bcd..c7820a965aa 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -118,7 +118,7 @@ WithdrawRequestErrorNilAmount=Unable to create direct debit request for empty am SepaMandate=SEPA Direct Debit Mandate SepaMandateShort=SEPA Mandate PleaseReturnMandate=Please return this mandate form by email to %s or by mail to -SEPALegalText=By signing this mandate form, you authorize (A) %s to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with the instructions from %s. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. Your rights regarding the above mandate are explained in a statement that you can obtain from your bank. +SEPALegalText=By signing this mandate form, you authorize (A) %s and its payment service provider to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with the instructions from %s. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. Your rights regarding the above mandate are explained in a statement that you can obtain from your bank. CreditorIdentifier=Creditor Identifier CreditorName=Creditor Name SEPAFillForm=(B) Please complete all the fields marked * From 3df3bd8c4af3bb8e341ca37661221a771174d1b5 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 6 Sep 2022 15:37:00 +0200 Subject: [PATCH 479/507] Fix ; permission check code --- htdocs/core/boxes/box_activity.php | 6 +- htdocs/core/boxes/box_birthdays.php | 2 +- htdocs/core/boxes/box_clients.php | 2 +- ...box_customers_outstanding_bill_reached.php | 2 +- htdocs/core/boxes/box_fournisseurs.php | 2 +- htdocs/core/boxes/box_last_ticket.php | 2 +- htdocs/core/boxes/box_prospect.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 864 +++++++++--------- htdocs/holiday/list.php | 8 +- htdocs/hrm/index.php | 4 +- htdocs/user/class/user.class.php | 2 +- 11 files changed, 448 insertions(+), 448 deletions(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 20c2e814d82..017c5fe3d02 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -62,9 +62,9 @@ class box_activity extends ModeleBoxes // FIXME: Pb into some status $this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments) - $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) - || (isModEnabled('commande') && $user->rights->commande->lire) - || (isModEnabled('propal') && $user->rights->propale->lire) + $this->hidden = !((isModEnabled('facture') && $user->hasRight('facture', 'read')) + || (isModEnabled('commande') && $user->hasRight('commande', 'read')) + || (isModEnabled('propal') && $user->hasRight('propale', 'read')) ); } diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 6aec6f4064a..945552753ea 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -60,7 +60,7 @@ class box_birthdays extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->user->user->lire && empty($user->socid)); + $this->hidden = !($user->hasRight('user', 'user', 'read') && empty($user->socid)); } /** diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 4a7ea965006..364b79932ef 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -65,7 +65,7 @@ class box_clients extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid)); } /** diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 0f1fe97dfee..2bf5a2c0693 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -65,7 +65,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid)); } /** diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 2dceee98dda..59280aeec62 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -60,7 +60,7 @@ class box_fournisseurs extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid)); } /** diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index f73566fe972..32efe7293fa 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -84,7 +84,7 @@ class box_last_ticket extends ModeleBoxes 'text' => $langs->trans("BoxLastTicketContent"), ); - if ($user->rights->ticket->read) { + if ($user->hasRight('ticket', 'read')) { $sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut as status, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email,"; $sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label,"; $sql .= " s.nom as company_name, s.email as socemail, s.client, s.fournisseur"; diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index e9824339f1e..205cf09419c 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -67,7 +67,7 @@ class box_prospect extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !($user->hasRight('societe', 'read') && empty($user->socid)); } /** diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 5c6a9e64c4d..01bc426458e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -96,7 +96,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( 'enabled' => (isModEnabled('adherent')), - 'perms' => (!empty($user->rights->adherent->lire)), + 'perms' => (!empty($user->hasRight('adherent', 'lire'))), 'module' => 'adherent' ); $menu_arr[] = array( @@ -125,7 +125,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ) || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) ), - 'perms'=> (!empty($user->rights->societe->lire) || !empty($user->rights->fournisseur->lire) || !empty($user->rights->supplier_order->lire) || !empty($user->rights->supplier_invoice->lire) || !empty($user->rights->supplier_proposal->lire)), + 'perms'=> (!empty($user->hasRight('societe', 'lire')) || !empty($user->hasRight('fournisseur', 'lire')) || !empty($user->hasRight('supplier_order', 'lire')) || !empty($user->hasRight('supplier_invoice', 'lire')) || !empty($user->hasRight('supplier_proposal', 'lire'))), 'module'=>'societe|fournisseur' ); $menu_arr[] = array( @@ -150,7 +150,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), - 'perms'=> (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) || !empty($user->rights->expedition->lire)), + 'perms'=> (!empty($user->hasRight('produit', 'lire')) || !empty($user->hasRight('service', 'lire')) || !empty($user->hasRight('expedition', 'lire'))), 'module'=>'product|service' ); $menu_arr[] = array( @@ -177,7 +177,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // MRP - GPAO $tmpentry = array( 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), - 'perms'=>(!empty($user->rights->bom->read) || !empty($user->rights->mrp->read)), + 'perms'=>(!empty($user->hasRight('bom', 'read')) || !empty($user->hasRight('mrp', 'read'))), 'module'=>'bom|mrp' ); $menu_arr[] = array( @@ -202,7 +202,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( 'enabled'=> (isModEnabled('projet') ? 1 : 0), - 'perms'=> (!empty($user->rights->projet->lire) ? 1 : 0), + 'perms'=> (!empty($user->hasRight('projet', 'lire')) ? 1 : 0), 'module'=>'projet' ); $menu_arr[] = array( @@ -234,25 +234,25 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = || isModEnabled('contrat') || isModEnabled('ficheinter') ) ? 1 : 0, - 'perms'=>(!empty($user->rights->propal->lire) - || !empty($user->rights->commande->lire) - || !empty($user->rights->supplier_proposal->lire) - || !empty($user->rights->fournisseur->lire) - || !empty($user->rights->fournisseur->commande->lire) - || !empty($user->rights->supplier_order->lire) - || !empty($user->rights->contrat->lire) - || !empty($user->rights->ficheinter->lire) + 'perms'=>(!empty($user->hasRight('propal', 'lire')) + || !empty($user->hasRight('commande', 'lire')) + || !empty($user->hasRight('supplier_proposal', 'lire')) + || !empty($user->hasRight('fournisseur', 'lire')) + || !empty($user->hasRight('fournisseur', 'commande', 'lire')) + || !empty($user->hasRight('supplier_order', 'lire')) + || !empty($user->hasRight('contrat', 'lire')) + || !empty($user->hasRight('ficheinter', 'lire')) ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); - $onlysupplierorder = !empty($user->rights->fournisseur->commande->lire) && - empty($user->rights->propal->lire) && - empty($user->rights->commande->lire) && - empty($user->rights->supplier_order->lire) && - empty($user->rights->supplier_proposal->lire) && - empty($user->rights->contrat->lire) && - empty($user->rights->ficheinter->lire); + $onlysupplierorder = !empty($user->hasRight('fournisseur', 'commande', 'lire')) && + empty($user->hasRight('propal', 'lire')) && + empty($user->hasRight('commande', 'lire')) && + empty($user->hasRight('supplier_order', 'lire')) && + empty($user->hasRight('supplier_proposal', 'lire')) && + empty($user->hasRight('contrat', 'lire')) && + empty($user->hasRight('ficheinter', 'lire')); $menu_arr[] = array( 'name' => 'Commercial', @@ -283,9 +283,9 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = isModEnabled('loan') || isModEnabled('margins') ) ? 1 : 0, - 'perms'=>(!empty($user->rights->facture->lire) || !empty($user->rights->don->contact->lire) - || !empty($user->rights->tax->charges->lire) || !empty($user->rights->salaries->read) - || !empty($user->rights->fournisseur->facture->lire) || !empty($user->rights->loan->read) || !empty($user->rights->margins->liretous)), + 'perms'=>(!empty($user->hasRight('facture', 'lire')) || !empty($user->hasRight('don', 'contact', 'lire')) + || !empty($user->hasRight('tax', 'charges', 'lire')) || !empty($user->hasRight('salaries', 'read')) + || !empty($user->hasRight('fournisseur', 'facture', 'lire')) || !empty($user->hasRight('loan', 'read')) || !empty($user->hasRight('margins', 'liretous'))), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' ); $menu_arr[] = array( @@ -310,7 +310,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), - 'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)), + 'perms'=>(!empty($user->hasRight('banque', 'lire')) || !empty($user->hasRight('prelevement', 'lire')) || !empty($user->hasRight('paymentbybanktransfer', 'read'))), 'module'=>'banque|prelevement|paymentbybanktransfer' ); $menu_arr[] = array( @@ -335,7 +335,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), - 'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->comptarapport->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)), + 'perms'=>(!empty($user->hasRight('compta', 'resultat', 'lire')) || !empty($user->hasRight('accounting', 'comptarapport', 'lire')) || !empty($user->hasRight('accounting', 'mouvements', 'lire')) || !empty($user->hasRight('asset', 'read')) || !empty($user->hasRight('intracommreport', 'read'))), 'module'=>'comptabilite|accounting|asset|intracommreport' ); $menu_arr[] = array( @@ -360,7 +360,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), - 'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)), + 'perms'=>(!empty($user->hasRight('user', 'user', 'lire')) || !empty($user->hasRight('holiday', 'read')) || !empty($user->hasRight('deplacement', 'lire')) || !empty($user->hasRight('expensereport', 'lire')) || !empty($user->hasRight('recruitment', 'recruitmentjobposition', 'read'))), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -386,7 +386,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knowledge base $tmpentry = array( 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), - 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), + 'perms'=>(!empty($user->hasRight('ticket', 'read')) || !empty($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read'))), 'module'=>'ticket|knowledgemanagement' ); $link = ''; @@ -1150,20 +1150,20 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } } - $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); - if ($user->rights->user->user->lire) { + $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + if ($user->hasRight('user', 'user', 'read')) { if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { - $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); + $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'lire') || $user->admin); $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); + $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } - $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'lire') || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight("user", "group_advance", "create") : $user->hasRight("user", "user", "create")) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'lire')) || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); } } } @@ -1187,9 +1187,9 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le // Societes if (isModEnabled('societe')) { $langs->load("companies"); - $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->hasRight('societe', 'lire'), '', $mainmenu, 'thirdparties', 0, '', '', '', img_picto('', 'company', 'class="paddingright pictofixedwidth"')); - if ($user->rights->societe->creer) { + if ($user->hasRight('societe', 'creer')) { $newmenu->add("/societe/card.php?action=create", $langs->trans("MenuNewThirdParty"), 1); if (!$conf->use_javascript_ajax) { $newmenu->add("/societe/card.php?action=create&private=1", $langs->trans("MenuNewPrivateIndividual"), 1); @@ -1202,30 +1202,30 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le // Prospects if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); - $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'prospects'); + $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("ListProspectsShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects'); /* no more required, there is a filter that can do more - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->rights->societe->lire); - if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->rights->societe->lire); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=-1", $langs->trans("LastProspectDoNotContact"), 2, $user->hasRight('societe', 'lire')); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=0", $langs->trans("LastProspectNeverContacted"), 2, $user->hasRight('societe', 'lire')); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=1", $langs->trans("LastProspectToContact"), 2, $user->hasRight('societe', 'lire')); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=2", $langs->trans("LastProspectContactInProcess"), 2, $user->hasRight('societe', 'lire')); + if ($usemenuhider || empty($leftmenu) || $leftmenu=="prospects") $newmenu->add("/societe/list.php?type=p&sortfield=s.datec&sortorder=desc&begin=&search_stcomm=3", $langs->trans("LastProspectContactDone"), 2, $user->hasRight('societe', 'lire')); */ - $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->rights->societe->creer); + $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); } // Customers/Prospects if (isModEnabled('societe') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $langs->load("commercial"); - $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->rights->societe->lire, '', $mainmenu, 'customers'); + $newmenu->add("/societe/list.php?type=c&leftmenu=customers", $langs->trans("ListCustomersShort"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers'); - $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->rights->societe->creer); + $newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer')); } // Suppliers if (isModEnabled('societe') && (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) || isModEnabled('supplier_proposal'))) { $langs->load("suppliers"); - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire), '', $mainmenu, 'suppliers'); - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->rights->societe->creer && ($user->rights->fournisseur->lire || $user->rights->supplier_order->lire || $user->rights->supplier_invoice->lire || $user->rights->supplier_proposal->lire)); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers'); + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); } // Categories @@ -1240,36 +1240,36 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { $menutoshow = $langs->trans("ProspectsCategoriesShort"); } - $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } // Categories suppliers if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { - $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 1, $user->hasRight('categorie', 'lire')); } } // Contacts - $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->rights->societe->contact->lire, '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/societe/index.php?leftmenu=thirdparties", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); - $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); + $newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer')); + $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire')); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire')); } if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->hasRight('societe', 'contact', 'lire')); } if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { - $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->hasRight('societe', 'contact', 'lire')); } - $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->rights->societe->contact->lire); - //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); + $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("ContactOthers"), 2, $user->hasRight('societe', 'contact', 'lire')); + //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); // Categories if (isModEnabled('categorie')) { $langs->load("categories"); // Categories Contact - $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } } @@ -1294,98 +1294,98 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left // Customer proposal if (isModEnabled('propal')) { $langs->load("propal"); - $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); - $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); + $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propale', 'lire'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/comm/propal/card.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propale', 'creer')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propale', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") { - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->rights->propale->lire); - $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->rights->propale->lire); - //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->rights->propale->lire); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propale', 'lire')); + $newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propale', 'lire')); + //$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propale', 'lire')); } - $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->rights->propale->lire); + $newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propale', 'lire')); } // Customers orders if (isModEnabled('commande')) { $langs->load("orders"); - $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); - $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); + $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); + $newmenu->add("/commande/list.php?leftmenu=orders", $langs->trans("List"), 1, $user->hasRight('commande', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); if (isModEnabled('expedition')) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); } - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); - //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); + //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); } - $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); + $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->hasRight('commande', 'lire')); } // Supplier proposal if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); - $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->rights->supplier_proposal->lire, '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->rights->supplier_proposal->creer); - $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->rights->supplier_proposal->lire); - $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->supplier_proposal->lire); + $newmenu->add("/supplier_proposal/index.php?leftmenu=propals_supplier", $langs->trans("SupplierProposalsShort"), 0, $user->hasRight('supplier_proposal', 'lire'), '', $mainmenu, 'propals_supplier', 300, '', '', '', img_picto('', 'supplier_proposal', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals", $langs->trans("SupplierProposalNew"), 1, $user->hasRight('supplier_proposal', 'creer')); + $newmenu->add("/supplier_proposal/list.php?leftmenu=supplier_proposals", $langs->trans("List"), 1, $user->hasRight('supplier_proposal', 'lire')); + $newmenu->add("/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('supplier_proposal', 'lire')); } // Suppliers orders if (isModEnabled('supplier_order')) { $langs->load("orders"); - $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->hasRight('fournisseur', 'commande', 'lire'), '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->hasRight('fournisseur', 'commande', 'creer')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) { - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); } - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->rights->fournisseur->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); } - // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->rights->fournisseur->commande->lire); + // Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->hasRight('fournisseur', 'commande', 'lire')); - $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); + $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'commande', 'lire')); } // Contrat if (isModEnabled('contrat')) { $langs->load("contracts"); - $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer); - $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire); + $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); + $newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->hasRight('contrat', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "contracts") { - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->rights->contrat->lire); - $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->rights->contrat->lire); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4", $langs->trans("MenuRunningServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=4&filter=expired", $langs->trans("MenuExpiredServices"), 2, $user->hasRight('contrat', 'lire')); + $newmenu->add("/contrat/services_list.php?leftmenu=contracts&mode=5", $langs->trans("MenuClosedServices"), 2, $user->hasRight('contrat', 'lire')); } } // Interventions if (isModEnabled('ficheinter')) { $langs->load("interventions"); - $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); - $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); + $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); + $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 202); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->rights->ficheinter->lire, '', '', '', 203); + $newmenu->add("/fichinter/card-rec.php?leftmenu=ficheinter", $langs->trans("ListOfTemplates"), 1, $user->hasRight('ficheinter', 'lire'), '', '', '', 203); } - $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->ficheinter->lire); + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->hasRight('ficheinter', 'lire')); } } } @@ -1410,69 +1410,69 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Customers invoices if (isModEnabled('facture')) { $langs->load("bills"); - $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|_draft|_notpaid|_paid|_canceled)$/', $leftmenu)) { - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->facture->lire); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->rights->facture->lire); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('facture', 'lire')); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('facture', 'lire')); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('facture', 'lire')); + $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3", $langs->trans("BillShortStatusCanceled"), 2, $user->hasRight('facture', 'lire')); } - $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->rights->facture->creer, '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. + $newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates", $langs->trans("ListOfTemplates"), 1, $user->hasRight('facture', 'creer'), '', $mainmenu, 'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice. - $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment'); + $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->rights->facture->lire, '', $mainmenu, 'customer_bills_tovalid'); + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); } if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { - $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_payment_report'); + $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); } - $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_stats'); + $newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_stats'); } // Suppliers invoices if (isModEnabled('societe') && isModEnabled('supplier_invoice')) { $langs->load("bills"); - $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), '', $mainmenu, 'suppliers_bills_create'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid'); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&search_status=0", $langs->trans("BillShortStatusDraft"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_draft'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&search_status=1", $langs->trans("BillShortStatusNotPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_notpaid'); + $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_paid'); } - $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'supplierinvoicestemplate_list'); + $newmenu->add("/fourn/facture/list-rec.php?leftmenu=supplierinvoicestemplate_list", $langs->trans("ListOfTemplates"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'supplierinvoicestemplate_list'); - $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment'); + $newmenu->add("/fourn/paiement/list.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { - $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment_report'); + $newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_payment_report'); } - $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats'); + $newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_stats'); } // Orders if (isModEnabled('commande')) { $langs->load("orders"); if (isModEnabled('facture')) { - $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } // Supplier Orders to bill if (isModEnabled('supplier_invoice')) { if (!empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) { $langs->load("supplier"); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); } } @@ -1480,58 +1480,58 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Donations if (isModEnabled('don')) { $langs->load("donations"); - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { - $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->rights->don->creer); - $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->rights->don->lire); + $newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer')); + $newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire')); } - // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); + // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->hasRight('don', 'lire')); } // Taxes and social contributions if (isModEnabled('tax')) { - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->hasRight('tax', 'charges', 'lire')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i', $leftmenu)) { - $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create", $langs->trans("MenuNewSocialContribution"), 2, $user->hasRight('tax', 'charges', 'creer')); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); } // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { global $mysoc; - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing", $langs->transcountry("VAT", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire'), '', $mainmenu, 'tax_vat'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i', $leftmenu)) { - $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); + $newmenu->add("/compta/tva/list.php?leftmenu=tax_vat", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/tva/payments.php?mode=tvaonly&leftmenu=tax_vat", $langs->trans("Payments"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); } //Local Taxes 1 if ($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj == "1")) { - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1", $langs->transcountry("LT1", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i', $leftmenu)) { - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); } } //Local Taxes 2 if ($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj == "1")) { - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2", $langs->transcountry("LT2", $mysoc->country_code), 1, $user->hasRight('tax', 'charges', 'lire')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i', $leftmenu)) { - $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->rights->tax->charges->creer); - $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->rights->tax->charges->lire); - $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2", $langs->trans("New"), 2, $user->hasRight('tax', 'charges', 'creer')); + $newmenu->add("/compta/localtax/list.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("List"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByMonth"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByThirdparties"), 2, $user->hasRight('tax', 'charges', 'lire')); + $newmenu->add("/compta/localtax/quadri_detail.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByQuarter"), 2, $user->hasRight('tax', 'charges', 'lire')); } } } @@ -1540,32 +1540,32 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Salaries if (isModEnabled('salaries')) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->hasRight('salaries', 'read'), '', $mainmenu, 'tax_salary', 0, '', '', '', img_picto('', 'salary', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->rights->salaries->write); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->rights->salaries->read); - $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->rights->salaries->read); - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->rights->salaries->read); + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("New"), 1, $user->hasRight('salaries', 'write')); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("List"), 1, $user->hasRight('salaries', 'read')); + $newmenu->add("/salaries/payments.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->hasRight('salaries', 'read')); + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->hasRight('salaries', 'read')); } } // Loan if (isModEnabled('loan')) { $langs->load("loan"); - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->hasRight('loan', 'read'), '', $mainmenu, 'tax_loan', 0, '', '', '', img_picto('', 'loan', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { - $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->rights->loan->write); - //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->hasRight('loan', 'write')); + //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->hasRight('loan', 'read')); } } // Various payment if (isModEnabled('banque') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->rights->banque->modifier); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->rights->banque->lire); + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->hasRight('banque', 'modifier')); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->hasRight('banque', 'lire')); } } } @@ -1591,75 +1591,75 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Accounting (Double entries) if (isModEnabled('accounting')) { - //$permtoshowmenu = (isModEnabled('accounting') || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); + //$permtoshowmenu = (isModEnabled('accounting') || $user->hasRight('accounting', 'bind', 'write') || $user->hasRight('compta', 'resultat', 'lire')); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Configuration - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"), 0, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin', 1, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/', $leftmenu)) { global $mysoc; - $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_general', 10); + $newmenu->add("/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("General"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_general', 10); // Fiscal year - Not really yet used. In a future will lock some periods. if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->rights->accounting->fiscalyear->write, '', $mainmenu, 'fiscalyear', 20); + $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'fiscalyear', 20); } - $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 30); - $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 40); - $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); - $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 41); - $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 50); - $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 60); + $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_journal', 30); + $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); + $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); + $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 50); + $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); if (isModEnabled('banque')) { - $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 70); + $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); } if (isModEnabled('facture') || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { - $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 80); + $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); } if (isModEnabled('tax')) { - $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 90); + $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 90); } if (isModEnabled('expensereport')) { - $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 100); + $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100); } - $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110); + $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_closure', 120); + $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); } - $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_export', 130); + $newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130); } // Transfer in accounting - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_transfer", $langs->trans("TransferInAccounting"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'transfer', 1, '', '', '', img_picto('', 'long-arrow-alt-right', 'class="paddingright pictofixedwidth"')); // Binding - // $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch'); + // $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch'); if (isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { - $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { - $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); + $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); } } if (isModEnabled('supplier_invoice') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { - $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy", $langs->trans("SuppliersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_supplier'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/', $leftmenu)) { - $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); + $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); } } if (isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { - $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy", $langs->trans("ExpenseReportsVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_expensereport'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/', $leftmenu)) { - $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->rights->accounting->bind->write); - $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->rights->accounting->bind->write); + $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); + $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport", $langs->trans("Binded"), 2, $user->hasRight('accounting', 'bind', 'write')); } } // Journals - if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', '', ''); + if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { + $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', '', ''); // Multi journal $sql = "SELECT rowid, code, label, nature"; @@ -1714,13 +1714,13 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef if ($nature) { $langs->load('accountancy'); $journallabel = $langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ... - $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } $i++; } } else { // Should not happend. Entries are added - $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } } else { dol_print_error($db); @@ -1730,80 +1730,80 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Files if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); } // Accounting - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire || $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); // General Ledger - $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); // Journals - $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); // Account Balance - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); // Closure - $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->rights->accounting->fiscalyear->write, '', $mainmenu, 'closure'); + $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); // Reports - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_report", $langs->trans("Reportings"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'ca'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); } $modecompta = 'CREANCES-DETTES'; - if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); } } $modecompta = 'RECETTES-DEPENSES'; - //if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + //if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->rights->accounting->comptarapport->lire); - //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); - //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + //$newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); + //$newmenu->add("/compta/stats/byratecountry.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByVatRate"),3,$user->hasRight('accounting', 'comptarapport', 'lire')); } } $modecompta = 'CREANCES-DETTES'; - if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. } if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); } } $modecompta = 'RECETTES-DEPENSES'; - if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. } if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->rights->accounting->comptarapport->lire); + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); } } } @@ -1812,79 +1812,79 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef if (isModEnabled('comptabilite')) { // Files if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { - $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); } // Bilan, resultats - $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->hasRight('compta', 'resultat', 'lire'), '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { - $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); /* On verra ca avec module compabilite expert - $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->hasRight('compta', 'resultat', 'lire')); */ /* - $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->hasRight('compta', 'resultat', 'lire')); if (isModEnabled('propal')) { - $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->hasRight('compta', 'resultat', 'lire')); } */ $modecompta = 'CREANCES-DETTES'; - $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->hasRight('compta', 'resultat', 'lire')); $modecompta = 'RECETTES-DEPENSES'; - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); //Achats $modecompta = 'CREANCES-DETTES'; - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->hasRight('compta', 'resultat', 'lire')); /* $modecompta = 'RECETTES-DEPENSES'; - $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 1, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->hasRight('compta', 'resultat', 'lire')); */ // Journals - $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); - $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); + $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 50); + $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->hasRight('compta', 'resultat', 'lire'), '', '', '', 51); } - //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire); + //if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journals"),1,$user->hasRight('compta', 'resultat', 'lire')||$user->hasRight('accounting', 'comptarapport', 'lire')); } // Intracomm report if (isModEnabled('intracommreport')) { - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReport"), 0, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 60, '', '', '', img_picto('', 'intracommreport', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { // DEB / DES - $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->rights->intracommreport->write, '', $mainmenu, 'intracommreport', 1); - $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->rights->intracommreport->read, '', $mainmenu, 'intracommreport', 1); + $newmenu->add("/intracommreport/card.php?action=create&leftmenu=intracommreport", $langs->trans("MenuIntracommReportNew"), 1, $user->hasRight('intracommreport', 'write'), '', $mainmenu, 'intracommreport', 1); + $newmenu->add("/intracommreport/list.php?leftmenu=intracommreport", $langs->trans("MenuIntracommReportList"), 1, $user->hasRight('intracommreport', 'read'), '', $mainmenu, 'intracommreport', 1); } } // Assets if (isModEnabled('asset')) { - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); - $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)), '', $mainmenu, 'asset_model'); + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'read'))), '', $mainmenu, 'asset_model'); if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read))); + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'write')))); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'read')))); } } } @@ -1910,56 +1910,56 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = // Bank-Cash account if (isModEnabled('banque')) { - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); - $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->lire, '', $mainmenu, 'bank'); - $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->rights->banque->lire); - $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->rights->banque->lire); + $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); + $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank'); + $newmenu->add("/compta/bank/bankentries_list.php", $langs->trans("ListTransactions"), 1, $user->hasRight('banque', 'lire')); + $newmenu->add("/compta/bank/budget.php", $langs->trans("ListTransactionsByCategory"), 1, $user->hasRight('banque', 'lire')); - $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); + $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); } if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags'); - $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->banque->configurer, '', $mainmenu, 'tags'); + $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); + $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); } // Direct debit order if (isModEnabled('prelevement')) { - $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank", $langs->trans("PaymentByDirectDebit"), 0, $user->hasRight('prelevement', 'bons', 'lire'), '', $mainmenu, 'withdraw', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { - $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer); + $newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->hasRight('prelevement', 'bons', 'creer')); - $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); - $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); + $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->hasRight('prelevement', 'bons', 'lire')); + $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->hasRight('prelevement', 'bons', 'lire')); + $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('prelevement', 'bons', 'lire')); + $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('prelevement', 'bons', 'lire')); } } // Bank transfer order if (isModEnabled('paymentbybanktransfer')) { - $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->hasRight('paymentbybanktransfer', 'read'), '', $mainmenu, 'banktransfer', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { - $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create); + $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->hasRight('paymentbybanktransfer', 'create')); - $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->hasRight('paymentbybanktransfer', 'read')); + $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->hasRight('paymentbybanktransfer', 'read')); + $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->hasRight('paymentbybanktransfer', 'read')); + $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->hasRight('paymentbybanktransfer', 'read')); } } // Management of checks if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled('banque') && (isModEnabled('facture') || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { - $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if (preg_match('/checks/', $leftmenu)) { - $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->rights->banque->cheque); - $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->rights->banque->cheque); + $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); + $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank", $langs->trans("List"), 1, $user->hasRight('banque', 'cheque')); } } @@ -1990,88 +1990,88 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if ($mainmenu == 'products') { // Products if (isModEnabled('product')) { - $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); - $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); - $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); + $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->hasRight('produit', 'lire'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); + $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('produit', 'creer')); + $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('produit', 'lire')); if (isModEnabled('stock')) { - $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); } if (isModEnabled('productbatch')) { $langs->load("stocks"); - $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); - $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); } if (isModEnabled('variants')) { - $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); + $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('produit', 'lire')); } if (isModEnabled('propal') || (isModEnabled('commande') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('facture') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire); + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('produit', 'lire')); } // Categories if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); } } // Services if (isModEnabled('service')) { - $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); - $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); - $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); + $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'lire'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); + $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); + $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'lire')); if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { - $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire); + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'lire')); } // Categories if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); + //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); } } // Warehouse if (isModEnabled('stock')) { $langs->load("stocks"); - $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); - $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); - $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); - $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); + $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); + $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->hasRight('stock', 'creer')); + $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); + $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->hasRight('stock', 'mouvement', 'lire')); - $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); + $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer')); if (isModEnabled('supplier_order')) { - $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); + $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); } - $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('produit', 'lire') && $user->hasRight('stock', 'lire')); // Categories for warehouses if (isModEnabled('categorie')) { - $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } if (isModEnabled('stocktransfer')) { - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->rights->stocktransfer->stocktransfer->read, '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); - $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->rights->stocktransfer->stocktransfer->write); - $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->rights->stocktransfer->stocktransfer->read); + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans("ModuleStockTransferName"), 0, $user->hasRight('stocktransfer', 'stocktransfer', 'read'), '', $mainmenu, 'stocktransfer', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); + $newmenu->add('/product/stock/stocktransfer/stocktransfer_card.php?action=create', $langs->trans('StockTransferNew'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'write')); + $newmenu->add('/product/stock/stocktransfer/stocktransfer_list.php', $langs->trans('List'), 1, $user->hasRight('stocktransfer', 'stocktransfer', 'read')); } // Inventory if (isModEnabled('stock')) { $langs->load("stocks"); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'lire'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'creer')); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'lire')); } } else { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->hasRight('stock', 'inventory_advance', 'read'), '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->hasRight('stock', 'inventory_advance', 'write')); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->hasRight('stock', 'inventory_advance', 'read')); } } } @@ -2079,33 +2079,33 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme // Shipments if (isModEnabled('expedition')) { $langs->load("sendings"); - $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); - $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); - $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); + $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); + $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); + $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->hasRight('expedition', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->rights->expedition->lire); - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->rights->expedition->lire); - $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=0", $langs->trans("StatusSendingDraftShort"), 2, $user->hasRight('expedition', 'lire')); + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=1", $langs->trans("StatusSendingValidatedShort"), 2, $user->hasRight('expedition', 'lire')); + $newmenu->add("/expedition/list.php?leftmenu=sendings&search_status=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->hasRight('expedition', 'lire')); } - $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); + $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->hasRight('expedition', 'lire')); } // Receptions if (isModEnabled('reception')) { $langs->load("receptions"); - $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); - $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); - $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); + $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); + $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer')); + $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=0", $langs->trans("StatusReceptionDraftShort"), 2, $user->hasRight('reception', 'lire')); } if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=1", $langs->trans("StatusReceptionValidatedShort"), 2, $user->hasRight('reception', 'lire')); } if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { - $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->rights->reception->lire); + $newmenu->add("/reception/list.php?leftmenu=receptions&search_status=2", $langs->trans("StatusReceptionProcessedShort"), 2, $user->hasRight('reception', 'lire')); } - $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->rights->reception->lire); + $newmenu->add("/reception/stats/index.php?leftmenu=receptions", $langs->trans("Statistics"), 1, $user->hasRight('reception', 'lire')); } } } @@ -2129,17 +2129,17 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if (isModEnabled('bom') || isModEnabled('mrp')) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom'); - $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); + $newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom'); + $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom'); } if (isModEnabled('mrp')) { $langs->load("mrp"); - $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo'); - $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo'); + $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, 'mo'); + $newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mo'); } } } @@ -2166,7 +2166,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $tmpentry = array( 'enabled'=>(isModEnabled('projet')), - 'perms'=>(!empty($user->rights->projet->lire)), + 'perms'=>(!empty($user->hasRight('projet', 'lire'))), 'module'=>'projet' ); $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); @@ -2184,8 +2184,8 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Project assigned to user - $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); + $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); @@ -2197,23 +2197,23 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); } - $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); // Categories if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } if (empty($conf->global->PROJECT_HIDE_TASKS)) { // Project affected to user - $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); - $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); - $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'tasks', 0, '', '', '', img_picto('', 'projecttask', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->hasRight('projet', 'creer')); + $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); + $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); } } } @@ -2238,32 +2238,32 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if (isModEnabled('hrm')) { $langs->load("hrm"); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->hasRight('user', 'user', 'write')); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'read')); - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); // Skills - $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); - //$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->rights->hrm->all->write); - //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Skills"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); + //$newmenu->add("/hrm/skill_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewSkill"), 1, $user->hasRight('hrm', 'all', 'write')); + //$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read')); // Job (Description of work to do and skills required) - $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); - //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->rights->hrm->all->write); - //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); + //$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->hasRight('hrm', 'all', 'write')); + //$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read')); // Position = Link job - user - $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->rights->hrm->all->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user-cog', 'class="paddingright pictofixedwidth"')); - //$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->rights->hrm->all->write); - //$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->all->read); + $newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("EmployeePositions"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user-cog', 'class="paddingright pictofixedwidth"')); + //$newmenu->add("/hrm/position.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Position")), 1, $user->hasRight('hrm', 'all', 'write')); + //$newmenu->add("/hrm/position_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read')); // Evaluation - $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evals"), 1, $user->rights->hrm->evaluation->read, '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); - //$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->rights->hrm->evaluation->write); - //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->rights->hrm->evaluation->read); - $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read); + $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evals"), 1, $user->hasRight('hrm', 'evaluation', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + //$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->hasRight('hrm', 'evaluation', 'write')); + //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'evaluation', 'read')); + $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->hasRight('hrm', 'evaluation', 'read') || $user->hasRight('hrm', 'compare_advance', 'read')); } // Leave/Holiday/Vacation module @@ -2271,47 +2271,47 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = // Load translation files required by the page $langs->loadLangs(array("holiday", "trips")); - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write, '', $mainmenu); - $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("NewHolidayForGroup"), 1, ($user->rights->holiday->writeall && $user->rights->holiday->readall), '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->rights->holiday->read, '', $mainmenu); + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); + $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") { - $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); } - $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall, '', $mainmenu, 'holiday_sm'); - $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday, '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->hasRight('holiday', 'readall'), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->hasRight('holiday', 'define_holiday'), '', $mainmenu, 'holiday_sm'); } // Trips and expenses (old module) if (isModEnabled('deplacement')) { $langs->load("trips"); - $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); - $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); - $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); + $newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('deplacement', 'lire'), '', $mainmenu, 'tripsandexpenses', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('deplacement', 'creer')); + $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('deplacement', 'lire')); + $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('deplacement', 'lire')); } // Expense report if (isModEnabled('expensereport')) { $langs->loadLangs(array("trips", "bills")); - $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); - $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); + $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { - $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); } - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->rights->expensereport->lire); - $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, $user->hasRight('expensereport', 'lire')); + $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); } if (isModEnabled('projet')) { @@ -2320,7 +2320,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $search_project_user = GETPOST('search_project_user', 'int'); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); } } } @@ -2348,22 +2348,22 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu } if (isModEnabled('mailing')) { - $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer); - $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire); + $newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->hasRight('mailing', 'creer')); + $newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->hasRight('mailing', 'lire')); } if (isModEnabled('export')) { $langs->load("exports"); - $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); - //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire); + $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->hasRight('export', 'lire'), '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->hasRight('export', 'creer')); + //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->hasRight('export', 'lire')); } if (isModEnabled('import')) { $langs->load("exports"); - $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); + $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->hasRight('import', 'run'), '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->hasRight('import', 'run')); } } } @@ -2387,39 +2387,39 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Load translation files required by the page $langs->loadLangs(array("members", "compta")); - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->rights->adherent->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->rights->adherent->creer); - $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->rights->adherent->lire); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->rights->adherent->lire); - $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->hasRight('adherent', 'read'), '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->hasRight('adherent', 'write')); + $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read')); - $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->rights->adherent->export); + $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); if (!empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu == 'none' || $leftmenu == "members" || $leftmenu == "export")) { - $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); + $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->hasRight('adherent', 'export')); } if (isModEnabled('categorie')) { $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'read'), '', $mainmenu, 'cat'); } - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer); - $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire); - $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->hasRight('adherent', 'cotisation', 'read'), '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->hasRight('adherent', 'cotisation', 'write')); + $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'cotisation', 'read')); + $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read')); - //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - //if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->hasRight('adherent', 'export'), '', $mainmenu, 'export'); + //if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->hasRight('adherent', 'export')); // Type - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->hasRight('adherent', 'configurer'), '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->hasRight('adherent', 'configurer')); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'configurer')); } } } diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index d4d2c3fff36..521695b45f2 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -209,9 +209,9 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Holiday'; $objectlabel = 'Holiday'; - $permissiontoread = $user->rights->holiday->read; - $permissiontodelete = $user->rights->holiday->delete; - $permissiontoapprove = $user->rights->holiday->approve; + $permissiontoread = $user->hasRight('holiday', 'read'); + $permissiontodelete = $user->hasRight('holiday', 'delete'); + $permissiontoapprove = $user->hasRight('holiday', 'approve'); $uploaddir = $conf->holiday->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -580,7 +580,7 @@ if ($resql) { // Approver if (!empty($arrayfields['cp.fk_validator']['checked'])) { - if ($user->rights->holiday->readall) { + if ($user->hasRight('holiday', 'readall')) { print '\n"; $totalbuyingprice = 0; +$totalcurrentstock = 0; +$totalvirtualstock = 0; $i = 0; while ($i < ($limit ? min($num, $limit) : $num)) { @@ -550,6 +552,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($mode == 'future') { // Current stock print ''; + $totalcurrentstock += $currentstock; print ''; @@ -558,6 +561,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Final virtual stock print ''; + $totalvirtualstock += $virtualstock; } else { // Stock at date print ''; @@ -591,6 +595,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Current stock print ''; + $totalcurrentstock += $currentstock; } // Action @@ -619,8 +624,23 @@ if ($mode == 'future') { if (empty($date) || !$dateIsValid) { print ''; } else { - print ''; - print ''; + print ''; + print ''; + print ''; + if ($mode == 'future') { + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + print ''; + print ''; + print ''; + print ''; + } + print ''; + print ''; } print '
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.$langs->trans('RefSupplier').''.$langs->trans('Date').''.$langs->trans('DateMaxPayment').''.$langs->trans('Currency').''.$langs->trans('MulticurrencyAmountTTC').''.$langs->trans('MulticurrencyAlreadyPaid').''.$objp->multicurrency_code."
    '.$langs->trans('TotalTTC').':   
    '.$langs->trans("Currency").''; @@ -973,7 +973,7 @@ END; } print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); } if (!empty($arrayfields['pfp.unitprice']['checked'])) { @@ -982,7 +982,7 @@ END; if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) { print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right '); } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); @@ -1089,7 +1089,7 @@ END; print $productfourn->fourn_price ? ''.price($productfourn->fourn_price).'' : ""; print ''; print $productfourn->fourn_multicurrency_price ? ''.price($productfourn->fourn_multicurrency_price).'' : ""; @@ -1112,7 +1112,7 @@ END; } // Currency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : ''; print '
    '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''.$langs->trans("Currency".$object->multicurrency_code).'
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -2002,7 +2002,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code; } } @@ -2439,7 +2439,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$object->multicurrency_code).'
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -2930,7 +2930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print '
    '.$langs->trans('Capital').''; if ($object->capital) { - if (!empty($conf->multicurrency->enabled) && !empty($object->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($object->multicurrency_code)) { print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code); } else { print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); @@ -2971,7 +2971,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print '
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5228f0ccac2..b7270037a09 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -307,7 +307,7 @@ if (empty($reshook)) { $object->origin_id = GETPOST('originid'); // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } @@ -1190,7 +1190,7 @@ if ($action == 'create') { $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1201,7 +1201,7 @@ if ($action == 'create') { } else { $cond_reglement_id = $soc->cond_reglement_supplier_id; $mode_reglement_id = $soc->mode_reglement_supplier_id; - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } } @@ -1334,7 +1334,7 @@ if ($action == 'create') { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print '
    '.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; @@ -1381,7 +1381,7 @@ if ($action == 'create') { } print '
    '.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc)."
    '.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).'
    '.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva)."
    '.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc)."
    '; @@ -1778,7 +1778,7 @@ if ($action == 'create') { print ''; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 24b45c992eb..276178fa2d8 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -518,7 +518,7 @@ class SupplierProposal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) { + if (isModEnabled("multicurrency") && $pu_ht_devise > 0) { $pu = 0; } @@ -720,7 +720,7 @@ class SupplierProposal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) { + if (isModEnabled("multicurrency") && $pu_ht_devise > 0) { $pu = 0; } @@ -1779,7 +1779,7 @@ class SupplierProposal extends CommonObject if (empty($ref_fourn)) { $ref_fourn = $product->ref_supplier; } - if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) { list($fk_multicurrency, $multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $product->multicurrency_code); } $productsupplier->id = $product->fk_product; @@ -1842,7 +1842,7 @@ class SupplierProposal extends CommonObject $product->tva_tx, $user->id ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($product->multicurrency_code)) { include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($this->db); //need to fetch because empty fk_multicurrency and rate @@ -1863,7 +1863,7 @@ class SupplierProposal extends CommonObject $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_fournisseur_price '; $sql .= '(datec, fk_product, fk_soc, ref_fourn, price, quantity, unitprice, tva_tx, fk_user'; - if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) { $sql .= ',fk_multicurrency, multicurrency_code, multicurrency_unitprice, multicurrency_price, multicurrency_tx'; } $sql .= ') VALUES ('.implode(',', $values).')'; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 6a8ad41dbd2..3b04695da20 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -180,11 +180,11 @@ $arrayfields = array( 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), 'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), - 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), + 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10), 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 1e82580fac9..30d541f33af 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -74,7 +74,7 @@ class Target extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) From 013bdc5c5f6a9ca59ca8d9d2717c4130f3e66581 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 11:51:28 +0200 Subject: [PATCH 450/507] Update 16.0.0-17.0.0.sql --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 016dc7283df..f1b18c740c5 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 @@ -143,4 +143,4 @@ CREATE TABLE llx_bank_extrafields ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); -ALTER TABLE llx_user RENAME COLUMN note TO note_private; +ALTER TABLE llx_user CHANGE COLUMN note note_private text; From cacad721234e0450cada25709628a257d817c94a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 11:53:14 +0200 Subject: [PATCH 451/507] Update note.php --- htdocs/user/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 2b9e8388063..2b5a05dcd68 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -64,7 +64,7 @@ $hookmanager->initHooks(array('usercard', 'usernote', 'globalcard')); * Actions */ $parameters = array('id'=>$socid); -$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } From b2131f80dbebb4c0a7e95b20c53b301978af7ebc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 12:42:52 +0200 Subject: [PATCH 452/507] Doc --- htdocs/main.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index bb82b0ac7e3..f189c90da72 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -504,6 +504,8 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { $token = dol_hash(uniqid(mt_rand(), false), 'md5'); // Generates a hash of a random number. We don't need a secured hash, just a changing random value. $_SESSION['newtoken'] = $token; dol_syslog("NEW TOKEN generated by : ".$_SERVER['PHP_SELF'], LOG_DEBUG); + // TODO Warning, if a user succeed in entering a data from a public page, he can enter a link that make a token regeneration making + // the use of the backoffice no more possible ! } } } From 6c947c9f9e3bacb796edcb1a0cf77d609303366e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 18:00:31 +0200 Subject: [PATCH 453/507] Doc --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f189c90da72..06ff00e474f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -500,12 +500,12 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { } if (!isset($_SESSION['newtoken']) || getDolGlobalInt('MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL')) { + // Note: Using MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL is not recommended: if a user succeed in entering a data from + // a public page with a link that make a token regeneration, it can make use of the backoffice no more possible ! // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] $token = dol_hash(uniqid(mt_rand(), false), 'md5'); // Generates a hash of a random number. We don't need a secured hash, just a changing random value. $_SESSION['newtoken'] = $token; dol_syslog("NEW TOKEN generated by : ".$_SERVER['PHP_SELF'], LOG_DEBUG); - // TODO Warning, if a user succeed in entering a data from a public page, he can enter a link that make a token regeneration making - // the use of the backoffice no more possible ! } } } From 6406fbdc7ebe9c310eff0229b973bc6f3680febf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 19:02:42 +0200 Subject: [PATCH 454/507] NEW Add a way to enter LICENSE file content in property of website --- htdocs/core/lib/website2.lib.php | 21 ++++++++ htdocs/langs/en_US/website.lang | 4 +- htdocs/website/class/website.class.php | 3 ++ htdocs/website/index.php | 70 +++++++++++++++++++++++++- 4 files changed, 94 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 58a0c6a64dd..6f532e078b3 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -533,6 +533,27 @@ function dolSaveReadme($file, $content) return $result; } +/** + * Save content of a page on disk + * + * @param string $file Full path of filename to generate + * @param string $content Content of file + * @return boolean True if OK + */ +function dolSaveLicense($file, $content) +{ + global $conf, $pathofwebsite; + + dol_syslog("Save LICENSE file into ".$file); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($file, $content); + if (!empty($conf->global->MAIN_UMASK)) { + @chmod($file, octdec($conf->global->MAIN_UMASK)); + } + + return $result; +} /** * Show list of themes. Show all thumbs of themes/skins diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 3d5a57e91d3..379eadef08f 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -16,9 +16,9 @@ WEBSITE_HTML_HEADER=Addition at bottom of HTML Header (common to all pages) WEBSITE_ROBOT=Robot file (robots.txt) WEBSITE_HTACCESS=Website .htaccess file WEBSITE_MANIFEST_JSON=Website manifest.json file -WEBSITE_README=README.md file WEBSITE_KEYWORDSDesc=Use a comma to separate values -EnterHereLicenseInformation=Enter here meta data or license information to fille a README.md file. if you distribute your website as a template, the file will be included into the temptate package. +EnterHereReadmeInformation=Enter here a description of the website. If you distribute your website as a template, the file will be included into the temptate package. +EnterHereLicenseInformation=Enter here the LICENSE of the code of the website. If you distribute your website as a template, the file will be included into the temptate package. HtmlHeaderPage=HTML header (specific to this page only) PageNameAliasHelp=Name or alias of the page.
    This alias is also used to forge a SEO URL when website is ran from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "%s" to edit this alias. EditTheWebSiteForACommonHeader=Note: If you want to define a personalized header for all pages, edit the header on the site level instead of on the page/container. diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 811c0e9c7cc..b18daba1031 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -979,6 +979,9 @@ class Website extends CommonObject dol_syslog("Copy pages from ".$srcdir." into ".$destdir); dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array('old', 'back')); + // Copy file README.md from containers to root + dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md', $conf->website->dir_temp.'/'.$website->ref.'/README.md'); + // Copy files into medias/image $srcdir = DOL_DATA_ROOT.'/medias/image/'.$website->ref; $destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f92642556d0..ac92d6166e7 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -243,6 +243,7 @@ $fileindex = $pathofwebsite.'/index.php'; $filewrapper = $pathofwebsite.'/wrapper.php'; $filemanifestjson = $pathofwebsite.'/manifest.json.php'; $filereadme = $pathofwebsite.'/README.md'; +$filelicense = $pathofwebsite.'/LICENSE'; $filemaster = $pathofwebsite.'/master.inc.php'; // Define $urlwithroot @@ -1191,6 +1192,11 @@ if ($action == 'addcontainer' && $usercanedit) { $result = dolSaveReadme($filereadme, $readmecontent); } + if (!dol_is_file($filelicense)) { + $licensecontent = "MIT License"; + $result = dolSaveLicense($filelicense, $licensecontent); + } + $action = 'preview'; } } @@ -1669,6 +1675,43 @@ if ($action == 'updatecss' && $usercanedit) { $error++; } + $dataposted = trim(GETPOST('WEBSITE_LICENSE', 'restricthtml')); + $dataposted = str_replace('\n";*/ + + $licensecontent .= $dataposted."\n"; + + /*$readmecontent.= '"."\n";*/ + + $result = dolSaveLicense($filelicense, $licensecontent); + if (!$result) { + $error++; + setEventMessages('Failed to write file '.$filelicense, null, 'errors'); + } + } else { + $error++; + } // Save wrapper.php $result = dolSaveIndexPage($pathofwebsite, '', '', $filewrapper, $object); @@ -3365,6 +3408,17 @@ if ($action == 'editcss') { //$readmecontent.=""; } + if (!GETPOSTISSET('WEBSITE_LICENSE')) { + $licensecontent = @file_get_contents($filelicense); + // Clean the readme file to remove php code and get only html part + $licensecontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $licensecontent); + } else { + $licensecontent = GETPOST('WEBSITE_LICENSE', 'none'); + } + if (!trim($licensecontent)) { + //$readmecontent.=""; + } + print dol_get_fiche_head(); print ''."\n"; @@ -3507,8 +3561,8 @@ if ($action == 'editcss') { // README.md print '
    '; + // LICENSE + print ''; + // RSS print ''; + print ''; } // Type @@ -143,7 +143,7 @@ if ($id) { print ''; // Company - print ''; + print ''; // Civility print ''; From cfd3eeb2451af364035645c15091cd21fd15f51c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 20:08:13 +0200 Subject: [PATCH 457/507] NEW All ajax pages have now a top_httphead() --- htdocs/adherents/note.php | 2 +- htdocs/admin/dolistore/ajax/image.php | 17 +- htdocs/blockedlog/ajax/authority.php | 7 + htdocs/blockedlog/ajax/block-add.php | 7 + htdocs/blockedlog/ajax/block-info.php | 2 + htdocs/blockedlog/ajax/check_signature.php | 6 + htdocs/comm/action/rapport/index.php | 2 +- htdocs/core/ajax/fetchKnowledgeRecord.php | 2 + htdocs/core/ajax/fileupload.php | 7 + htdocs/core/ajax/onlineSign.php | 2 + htdocs/core/ajax/selectsearchbox.php | 2 + htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 36 +---- .../{rapport.pdf.php => rapport.class.php} | 2 +- htdocs/core/tpl/ajax/fileupload_main.tpl.php | 96 ------------ htdocs/core/tpl/ajax/fileupload_view.tpl.php | 147 ------------------ .../objectlinked_lineimport.tpl.php | 0 htdocs/mrp/ajax/ajax_bom.php | 4 +- htdocs/product/ajax/products.php | 2 + .../inventory/ajax/searchfrombarcode.php | 7 + htdocs/salaries/ajax/ajaxsalaries.php | 2 + htdocs/stripe/ajax/ajax.php | 2 + test/phpunit/CodingPhpTest.php | 18 ++- 23 files changed, 84 insertions(+), 290 deletions(-) rename htdocs/core/modules/action/{rapport.pdf.php => rapport.class.php} (99%) delete mode 100644 htdocs/core/tpl/ajax/fileupload_main.tpl.php delete mode 100644 htdocs/core/tpl/ajax/fileupload_view.tpl.php rename htdocs/core/tpl/{ajax => }/objectlinked_lineimport.tpl.php (100%) diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 532dd6e4c59..7e445e41a37 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -146,7 +146,7 @@ if ($id) { print ''; // Civility - print ''; + print ''; print ''; print "
    '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '; - $htmlhelp = $langs->trans("EnterHereLicenseInformation"); - print $form->textwithpicto($langs->trans('WEBSITE_README'), $htmlhelp, 1, 'help', '', 0, 2, 'readmetooltip'); + $htmlhelp = $langs->trans("EnterHereReadmeInformation"); + print $form->textwithpicto($langs->trans("File").' README.md', $htmlhelp, 1, 'help', '', 0, 2, 'readmetooltip'); print ''; $poscursor = array('x'=>GETPOST('WEBSITE_README_x'), 'y'=>GETPOST('WEBSITE_README_y')); @@ -3517,6 +3571,18 @@ if ($action == 'editcss') { print '
    '; + $htmlhelp = $langs->trans("EnterHereLicenseInformation"); + print $form->textwithpicto($langs->trans("File").' LICENSE', $htmlhelp, 1, 'help', '', 0, 2, 'licensetooltip'); + print ''; + + $poscursor = array('x'=>GETPOST('WEBSITE_LICENSE_x'), 'y'=>GETPOST('WEBSITE_LICENSE_y')); + $doleditor = new DolEditor('WEBSITE_LICENSE', $licensecontent, '', '220', 'ace', 'In', true, false, 'ace', 0, '100%', '', $poscursor); + print $doleditor->Create(1, '', true, $langs->trans("File").' LICENSE', 'text'); + + print '
    '; $htmlhelp = $langs->trans('RSSFeedDesc'); From 6b38b89c3b568bb4d77efb3850e4793cf747853f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 19:05:25 +0200 Subject: [PATCH 455/507] NEW Add a way to enter LICENSE file content in property of website --- htdocs/website/class/website.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index b18daba1031..bddb8b43c24 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -979,8 +979,13 @@ class Website extends CommonObject dol_syslog("Copy pages from ".$srcdir." into ".$destdir); dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array('old', 'back')); - // Copy file README.md from containers to root - dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md', $conf->website->dir_temp.'/'.$website->ref.'/README.md'); + // Copy file README.md and LICENSE from directory containers into directory root + if (dol_is_file($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md')) { + dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/README.md', $conf->website->dir_temp.'/'.$website->ref.'/README.md'); + } + if (dol_is_file($conf->website->dir_temp.'/'.$website->ref.'/containers/LICENSE')) { + dol_copy($conf->website->dir_temp.'/'.$website->ref.'/containers/LICENSE', $conf->website->dir_temp.'/'.$website->ref.'/LICENSE'); + } // Copy files into medias/image $srcdir = DOL_DATA_ROOT.'/medias/image/'.$website->ref; From a7c17f59b9a280976538c380f1f9123843637e71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 19:16:28 +0200 Subject: [PATCH 456/507] Clean code --- htdocs/adherents/note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 0d05bb85523..532dd6e4c59 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -129,7 +129,7 @@ if ($id) { // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print '
    '.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
    '.$langs->trans("Login").' / '.$langs->trans("Id").''.dol_escape_htmltag($object->login).'
    '.$langs->trans("Company").''.$object->company.'
    '.$langs->trans("Company").''.dol_escape_htmltag($object->company).'
    '.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
    '.$langs->trans("Company").''.dol_escape_htmltag($object->company).'
    '.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
    '.$langs->trans("UserTitle").''.$object->getCivilityLabel().'
    "; diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index e601da43e06..6beb96a9e66 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -27,14 +27,17 @@ if (!defined('NOTOKENRENEWAL')) { * \ingroup admin * \brief Page des informations dolistore */ + require "../../../main.inc.php"; - -// CORE - -global $lang, $user, $conf; - - require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; + + +/* + * View + */ + +top_httphead('image'); + $dolistore = new Dolistore(); $id_product = GETPOST('id_product', 'int'); @@ -51,7 +54,7 @@ try { ); //echo $url; $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); - header('Content-type:image'); + print $request['response']; } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors diff --git a/htdocs/blockedlog/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index 78f944f692a..2da0544e0a7 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -44,6 +44,13 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php'; $user = new User($db); $user->fetch(1); //TODO conf user authority + +/* + * View + */ + +top_httphead(); + $auth = new BlockedLogAuthority($db); $signature = GETPOST('s'); diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index 53093f02d18..e2009a01da1 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -42,6 +42,13 @@ $id = GETPOST('id', 'int'); $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'aZ09'); + +/* + * View + */ + +top_httphead(); + if ($element === 'facture') { require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index e6f9ea0de15..da27b8fc50e 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -54,6 +54,8 @@ $langs->loadLangs(array("admin")); * View */ +top_httphead(); + print '
    '; print ''; diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 4d59b56a981..60a763635c0 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -48,6 +48,12 @@ if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) { } +/* + * View + */ + +top_httphead(); + $auth = new BlockedLogAuthority($db); $auth->syncSignatureWithAuthority(); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 9b3f9a27140..4414981b6fb 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.class.php'; // Load translation files required by the page $langs->loadLangs(array("agenda", "commercial")); diff --git a/htdocs/core/ajax/fetchKnowledgeRecord.php b/htdocs/core/ajax/fetchKnowledgeRecord.php index 0182887c225..179d8169465 100644 --- a/htdocs/core/ajax/fetchKnowledgeRecord.php +++ b/htdocs/core/ajax/fetchKnowledgeRecord.php @@ -66,6 +66,8 @@ $lang = GETPOST('lang', 'aZ09'); * View */ +top_httphead('application/json'); + if ($action == "getKnowledgeRecord") { $response = ''; $sql = "SELECT kr.rowid, kr.ref, kr.question, kr.answer,kr.url,ctc.code"; diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 0e05036de02..53d65e4ab75 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -50,6 +50,13 @@ $element = GETPOST('element', 'alpha'); $upload_handler = new FileUpload(null, $fk_element, $element); + +/* + * View + */ + +top_httphead(); + header('Pragma: no-cache'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Content-Disposition: inline; filename="files.json"'); diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 5f59abea0b5..8f3cb23b396 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -91,6 +91,8 @@ if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(!isModEnable * View */ +top_httphead(); + if ($action == "importSignature") { if (!empty($signature) && $signature[0] == "image/png;base64") { $signature = $signature[1]; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 54e3e1e4470..201a4b89991 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -25,6 +25,8 @@ // This script is called with a POST method or as an include. if (!isset($usedbyinclude) || empty($usedbyinclude)) { + top_httphead('application/json'); + if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', 1); // Disables token renewal } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 838aea25f53..a738bce9004 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8635,7 +8635,7 @@ class Form print '
    '.$langs->trans('Field').''.$langs->trans('Value').'
    '; if (!empty($compatibleImportElementsList)) { - $res = @include dol_buildpath('core/tpl/ajax/objectlinked_lineimport.tpl.php'); + $res = @include dol_buildpath('core/tpl/objectlinked_lineimport.tpl.php'); } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 612e555a6b0..441ddb60255 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -71,7 +71,7 @@ class FormFile * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). - * Deprecated 2 should never be used and if 1 is used, option should no be enabled. + * Deprecated 2 should never be used and if 1 is used, option should not be enabled. * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) @@ -104,7 +104,8 @@ class FormFile // TODO: This does not support option savingdocmask // TODO: This break feature to upload links too // TODO: Thisdoes not work when param nooutput=1 - return $this->_formAjaxFileUpload($object); + //return $this->_formAjaxFileUpload($object); + return 'Feature too bugged so removed'; } else { //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { @@ -1919,37 +1920,6 @@ class FormFile // Fin de zone } - /** - * Show form to upload a new file with jquery fileupload. - * This form use the fileupload.php file. - * - * @param Object $object Object to use - * @return void - */ - private function _formAjaxFileUpload($object) - { - global $langs, $conf; - - // PHP post_max_size - $post_max_size = ini_get('post_max_size'); - $mul_post_max_size = substr($post_max_size, -1); - $mul_post_max_size = ($mul_post_max_size == 'M' ? 1048576 : ($mul_post_max_size == 'K' ? 1024 : ($mul_post_max_size == 'G' ? 1073741824 : 1))); - $post_max_size = $mul_post_max_size * (int) $post_max_size; - // PHP upload_max_filesize - $upload_max_filesize = ini_get('upload_max_filesize'); - $mul_upload_max_filesize = substr($upload_max_filesize, -1); - $mul_upload_max_filesize = ($mul_upload_max_filesize == 'M' ? 1048576 : ($mul_upload_max_filesize == 'K' ? 1024 : ($mul_upload_max_filesize == 'G' ? 1073741824 : 1))); - $upload_max_filesize = $mul_upload_max_filesize * (int) $upload_max_filesize; - // Max file size - $max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize); - - // Include main - include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_main.tpl.php'; - - // Include template - include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_view.tpl.php'; - } - /** * Show array with linked files * diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.class.php similarity index 99% rename from htdocs/core/modules/action/rapport.pdf.php rename to htdocs/core/modules/action/rapport.class.php index 2b4ec29c880..61579399247 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/action/rapport.pdf.php + * \file htdocs/core/modules/action/rapport.class.php * \ingroup commercial * \brief File to build PDF with events */ diff --git a/htdocs/core/tpl/ajax/fileupload_main.tpl.php b/htdocs/core/tpl/ajax/fileupload_main.tpl.php deleted file mode 100644 index 8be24f7450f..00000000000 --- a/htdocs/core/tpl/ajax/fileupload_main.tpl.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) { - print "Error, template page can't be called as URL"; - exit; -} - -?> - - - - diff --git a/htdocs/core/tpl/ajax/fileupload_view.tpl.php b/htdocs/core/tpl/ajax/fileupload_view.tpl.php deleted file mode 100644 index 22f8d687db0..00000000000 --- a/htdocs/core/tpl/ajax/fileupload_view.tpl.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) { - print "Error, template page can't be called as URL"; - exit; -} - -?> - - - - -
    - - - - -
    -
    - - - - trans('AddFiles'); ?> - 0) { - print ''; // MAX_FILE_SIZE must precede the field type=file - } - ?> - - - - - -
    - -
    - - - -
     
    -
    -
    - -
    -
    - - -
    - - - - - - - -
    - diff --git a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/objectlinked_lineimport.tpl.php similarity index 100% rename from htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php rename to htdocs/core/tpl/objectlinked_lineimport.tpl.php diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index 280a0c98cdd..54bfaf893ab 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -46,13 +46,15 @@ require '../../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; $idbom = GETPOST('idbom', 'alpha'); -$action = GETPOST('action', 'aZ09'); +//$action = GETPOST('action', 'aZ09'); /* * View */ +top_httphead('application/json'); + $object = new BOM($db); $result = $object->fetch($idbom); if ($result > 0) { diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 74fa53dccb8..0e606932ce2 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -79,6 +79,8 @@ if ($action == 'fetch' && !empty($id)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + top_httphead('application/json'); + $outjson = array(); $object = new Product($db); diff --git a/htdocs/product/inventory/ajax/searchfrombarcode.php b/htdocs/product/inventory/ajax/searchfrombarcode.php index 68ffee43c23..2d29e1d9d2e 100644 --- a/htdocs/product/inventory/ajax/searchfrombarcode.php +++ b/htdocs/product/inventory/ajax/searchfrombarcode.php @@ -58,6 +58,13 @@ $warehousefound = 0; $warehouseid = 0; $objectreturn = array(); + +/* + * View + */ + +top_httphead('application/json'); + if ($action == "existbarcode" && !empty($barcode)) { if (!empty($mode) && $mode == "lotserial") { $sql = "SELECT ps.fk_entrepot, ps.fk_product, p.barcode, ps.reel, pb.batch"; diff --git a/htdocs/salaries/ajax/ajaxsalaries.php b/htdocs/salaries/ajax/ajaxsalaries.php index adea28ee8ce..0e0428b9074 100644 --- a/htdocs/salaries/ajax/ajaxsalaries.php +++ b/htdocs/salaries/ajax/ajaxsalaries.php @@ -52,6 +52,8 @@ restrictedArea($user, 'salaries'); * View */ +top_httphead('application/json'); + $fk_user = GETPOST('fk_user', 'int'); $return_arr = array(); diff --git a/htdocs/stripe/ajax/ajax.php b/htdocs/stripe/ajax/ajax.php index cf6ec53d580..fa5392349eb 100644 --- a/htdocs/stripe/ajax/ajax.php +++ b/htdocs/stripe/ajax/ajax.php @@ -59,6 +59,8 @@ if (empty($user->rights->takepos->run)) { * View */ +top_httphead('application/json'); + if ($action == 'getConnexionToken') { try { // Be sure to authenticate the endpoint for creating connection tokens. diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index dd0e6827ec1..e8631c5b28b 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -198,7 +198,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase || preg_match('/boxes\/box_/', $file['relativename']) || preg_match('/modules\/.*\/doc\/(doc|pdf)_/', $file['relativename']) || preg_match('/modules\/(import|mailings|printing)\//', $file['relativename']) - || in_array($file['name'], array('modules_boxes.php', 'rapport.pdf.php', 'TraceableDB.php'))) { + || in_array($file['name'], array('modules_boxes.php', 'TraceableDB.php'))) { // Check into Class files if (! in_array($file['name'], array( 'api.class.php', @@ -247,6 +247,20 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase } } + // Check we don't miss top_httphead() into any ajax pages + if (preg_match('/ajax\//', $file['relativename'])) { + print "Analyze ajax page ".$file['relativename']."\n"; + $ok=true; + $matches=array(); + preg_match_all('/top_httphead/', $filecontent, $matches, PREG_SET_ORDER); + if (count($matches) == 0) { + $ok=false; + } + //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; + $this->assertTrue($ok, 'Did not find top_httphead into the ajax page '.$file['relativename']); + //exit; + } + // Check if a var_dump has been forgotten if (!preg_match('/test\/phpunit/', $file['fullname'])) { $ok=true; @@ -463,7 +477,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase foreach ($matches as $key => $val) { //var_dump($val); if (!in_array($val[1], array( - "'replacestring'", "'htmlheader'", "'WEBSITE_HTML_HEADER'", "'WEBSITE_CSS_INLINE'", "'WEBSITE_JS_INLINE'", "'WEBSITE_MANIFEST_JSON'", "'PAGE_CONTENT'", "'WEBSITE_README'", + "'replacestring'", "'htmlheader'", "'WEBSITE_HTML_HEADER'", "'WEBSITE_CSS_INLINE'", "'WEBSITE_JS_INLINE'", "'WEBSITE_MANIFEST_JSON'", "'PAGE_CONTENT'", "'WEBSITE_README'", "'WEBSITE_LICENSE'", '"mysqldump"', '"postgresqldump"', "'db_pass_root'", "'db_pass'", '"pass"', '"pass1"', '"pass2"', '"password"', "'password'", '"MAIN_MAIL_SMTPS_PW"', '"MAIN_MAIL_SMTPS_PW_EMAILING"', '"MAIN_MAIL_SMTPS_PW_TICKET"'))) { From b81bde20f3027afd2f15faf2cf7fe6358b82b9d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Sep 2022 20:20:39 +0200 Subject: [PATCH 458/507] css --- htdocs/blockedlog/admin/blockedlog_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 934ef9fba7b..9bb4456e840 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -527,7 +527,7 @@ if (is_array($blocks)) { print '
    '.$block->id.''.dol_escape_htmltag($block->id).''.dol_print_date($block->date_creation, 'dayhour').''; //print $block->getUser() - print $block->user_fullname; + print dol_escape_htmltag($block->user_fullname); print ''.$langs->trans('log'.$block->action).''.$langs->trans('log'.$block->action).''; From 66d42049bea250f7a90bad7ac4bfb83749ddfa49 Mon Sep 17 00:00:00 2001 From: mikygee Date: Sun, 4 Sep 2022 13:24:23 +0200 Subject: [PATCH 459/507] Bug #22064 effectif should be 51-100 and 101-500 (not 100-500) --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) 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 f1b18c740c5..9b52b09ba2a 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 @@ -144,3 +144,5 @@ CREATE TABLE llx_bank_extrafields ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); ALTER TABLE llx_user CHANGE COLUMN note note_private text; + +UPDATE llx_c_effectif SET code='EF101-500', libelle='101 - 500' WHERE code='EF100-500'; From 6c8f088cc2b32412cbafeefd0dc519727a41743f Mon Sep 17 00:00:00 2001 From: mikygee Date: Sun, 4 Sep 2022 13:46:19 +0200 Subject: [PATCH 460/507] Bug #22064 effectif should be 51-100 and 101-500 (not 100-500) --- htdocs/install/mysql/data/llx_c_effectif.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_effectif.sql b/htdocs/install/mysql/data/llx_c_effectif.sql index cb67da5d73c..f3c5b0cd03f 100644 --- a/htdocs/install/mysql/data/llx_c_effectif.sql +++ b/htdocs/install/mysql/data/llx_c_effectif.sql @@ -36,5 +36,5 @@ insert into llx_c_effectif (id,code,libelle) values (1, 'EF1-5', '1 - 5'); insert into llx_c_effectif (id,code,libelle) values (2, 'EF6-10', '6 - 10'); insert into llx_c_effectif (id,code,libelle) values (3, 'EF11-50', '11 - 50'); insert into llx_c_effectif (id,code,libelle) values (4, 'EF51-100', '51 - 100'); -insert into llx_c_effectif (id,code,libelle) values (5, 'EF100-500', '100 - 500'); +insert into llx_c_effectif (id,code,libelle) values (5, 'EF101-500', '101 - 500'); insert into llx_c_effectif (id,code,libelle) values (6, 'EF500-', '> 500'); From ab1cef6dd01f797252d875534429b4a5ceab6e81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Sep 2022 18:59:11 +0200 Subject: [PATCH 461/507] Can show all y serie value on a point in dolgraph --- htdocs/core/class/dolgraph.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index e24afd73879..57f0bca4e36 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -515,7 +515,7 @@ class DolGraph /** * Show pointvalue or not * - * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value + * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value, 2=Show values for each serie on same point * @return void */ public function setShowPointValue($showpointvalue) @@ -1299,8 +1299,12 @@ class DolGraph $type = 'line'; } + // Set options $this->stringtoshow .= 'var options = { maintainAspectRatio: false, aspectRatio: 2.5, '; $this->stringtoshow .= $xaxis; + if ($this->showpointvalue == 2) { + $this->stringtoshow .= 'interaction: { intersect: true, mode: \'index\'}, '; + } /* For Chartjs v2.9 */ /* From 61419fac68e140854cea39ec7b189bd564702067 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 4 Sep 2022 21:58:21 +0200 Subject: [PATCH 462/507] Add permissions --- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index f93373a64fa..5cc07ecdca0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -405,7 +405,7 @@ if (empty($reshook)) { } // Add a product line - if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') && $usercancreate) { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); $vat_rate = str_replace('*', '', $vat_rate); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 65ae4e81150..6959bc828a1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1383,7 +1383,7 @@ if (empty($reshook)) { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } elseif ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + } elseif ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') && $usercancreate) { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); $vat_rate = str_replace('*', '', $vat_rate); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 9719928ab75..c4fa9b9a3e7 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -546,7 +546,7 @@ if (empty($reshook)) { } // Add a product line - if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + if ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha') && $usercancreate) { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); $vat_rate = str_replace('*', '', $vat_rate); From 3e9df092f480b93260a2214546d9fce3944fb509 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Sep 2022 09:15:45 +0200 Subject: [PATCH 463/507] css --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8c6092d68c4..44dd7225dad 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2323,7 +2323,7 @@ if ($resql) { print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['f.datec']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_closing), 'dayhour', 'tzuser'); print '
    '; @@ -3648,7 +3650,7 @@ if ($action == 'create') { || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discount->id))) && ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) { // A paid invoice (partially or completely) - if (!$facidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice + if (!$objectidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice print ''.$langs->trans('ReOpen').''; } else { if ($usercancreate) { From e1a1ce55517ce522e1749d76ce5764543ea3b829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Mon, 5 Sep 2022 17:31:30 +0200 Subject: [PATCH 470/507] php V8 warning --- htdocs/fourn/facture/note.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 682d92b4515..eebd40e5b95 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -179,11 +179,13 @@ if ($object->id > 0) { } print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } + /* if ($facidnext > 0) { $facthatreplace = new FactureFournisseur($db); $facthatreplace->fetch($facidnext); print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; } + */ print '
    '.$langs->transcountry("AmountLT1", $societe->country_code).'
    '.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $societe->country_code).'
    '.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'
    '; if ($i > 0) { - print 'id.'">'.img_up('default', 0, 'imgupforline').''; + print 'id.'">'.img_up('default', 0, 'imgupforline').''; } if ($i < ($nboffiles - 1)) { - print 'id.'">'.img_down('default', 0, 'imgdownforline').''; + print 'id.'">'.img_down('default', 0, 'imgdownforline').''; } print '
    '; $validator = new UserGroup($db); $excludefilter = $user->admin ? '' : 'u.rowid <> '.$user->id; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index cbbd66cec47..e8554c9da3d 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -270,7 +270,7 @@ if (isModEnabled('holiday') && $user->rights->holiday->read) { // Latest expense report -if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { +if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,"; $sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; @@ -342,7 +342,7 @@ if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { // Last modified job position -if (isModEnabled('recruitment') && $user->rights->recruitment->recruitmentjobposition->read) { +if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) { $staticrecruitmentcandidature = new RecruitmentCandidature($db); $staticrecruitmentjobposition = new RecruitmentJobPosition($db); $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status,"; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a521be145ef..54f1cbe4fc9 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2703,7 +2703,7 @@ class User extends CommonObject global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; - if (!$user->rights->user->user->lire && $user->id != $this->id) { + if (!$user->hasRight('user', 'user', 'read') && $user->id != $this->id) { $option = 'nolink'; } From f41f1199343acb9411a595524fe375be25502c3a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 17:51:04 +0200 Subject: [PATCH 480/507] Update conferenceorbooth_card.php --- .../conferenceorbooth_card.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 368da1c889a..1e71af81492 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -17,27 +17,29 @@ */ /** - * \file htdocs/eventorganization/conferenceorbooth_card.php - * \ingroup eventorganization - * \brief Page to create/edit/view conferenceorbooth + * \file htdocs/eventorganization/conferenceorbooth_card.php + * \ingroup eventorganization + * \brief Page to create/edit/view conferenceorbooth */ -require '../main.inc.php'; +// Load Dolibarr environment +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; global $dolibarr_main_url_root; // Load translation files required by the page -$langs->loadLangs(array("eventorganization", "projects")); +$langs->loadLangs(array('eventorganization', 'projects')); +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); @@ -45,7 +47,6 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'co $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -// Get parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $withproject = GETPOST('withproject', 'int'); @@ -79,6 +80,7 @@ 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->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); From a3e56e38db141d8951aaa5a64341e5e53aed57cb Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 17:53:54 +0200 Subject: [PATCH 481/507] Update conferenceorbooth_contact.php // Load Dolibarr environment - clean double entries --- .../eventorganization/conferenceorbooth_contact.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 62bd64441b5..2c304bd8562 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -22,17 +22,18 @@ * \brief Tab for contacts linked to ConferenceOrBooth */ + +// 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.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + // Load translation files required by the page $langs->loadLangs(array('companies', 'eventorganization', 'mails', 'others', 'projects')); From 635142020efde50913796d009b356dcb18dea309 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 17:55:58 +0200 Subject: [PATCH 482/507] Update conferenceorbooth_document.php --- .../conferenceorbooth_document.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index d056a5b900c..56b34f68b03 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -22,21 +22,25 @@ * \brief Tab for documents linked to ConferenceOrBooth */ +// Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + // Load translation files required by the page $langs->loadLangs(array("eventorganization", "projects", "companies", "other", "mails")); +// Get Parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $cancel = GETPOST('cancel', 'aZ09'); @@ -49,8 +53,6 @@ $ref = GETPOST('ref', 'alpha'); $withproject = GETPOST('withproject', 'int'); $project_ref = GETPOST('project_ref', 'alpha'); - -// Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -88,6 +90,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity ? $object->entity : $conf->entity]."/conferenceorbooth/".get_exdir(0, 0, 0, 1, $object); } +// Permissions $permissiontoread = $user->rights->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); From 700da1492f8bfe437ba89e24e71624c9f2f03d64 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:02:11 +0200 Subject: [PATCH 483/507] Update conferenceorbooth_list.php --- .../conferenceorbooth_list.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 7866a83a024..520435c9cdc 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -17,21 +17,26 @@ */ /** - * \file conferenceorbooth_list.php - * \ingroup eventorganization - * \brief List page for conferenceorbooth + * \file htdocs/eventorganization/conferenceorbooth_list.php + * \ingroup eventorganization + * \brief List page for conferenceorbooth */ + +// Load Dolibarr environment require '../main.inc.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; + +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; global $dolibarr_main_url_root; @@ -41,6 +46,7 @@ global $dolibarr_main_url_root; // Load translation files required by the page $langs->loadLangs(array("eventorganization", "other", "projects", "companies")); +// 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 ? From 9392e889b4ef1bc22af60fc5e10067d3e978c67a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:07:40 +0200 Subject: [PATCH 484/507] Update conferenceorboothattendee_card.php --- .../conferenceorboothattendee_card.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 79b7b1aaa55..14a8c871232 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -16,20 +16,23 @@ */ /** - * \file conferenceorboothattendee_card.php - * \ingroup eventorganization - * \brief Page to create/edit/view conferenceorboothattendee + * \file htdocs/eventorganization/conferenceorboothattendee_card.php + * \ingroup eventorganization + * \brief Page to create/edit/view conferenceorboothattendee */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page @@ -108,6 +111,7 @@ if ($object->fk_project > 0) { $fk_project = $object->fk_project; } +// Permissions $permissiontoread = $user->rights->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); From 98b7cf13dda5738516c0371f5a766ab59eadc25d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:11:43 +0200 Subject: [PATCH 485/507] Update conferenceorboothattendee_list.php --- .../conferenceorboothattendee_list.php | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 7b8b6258e5e..1ec6a9efe96 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -17,21 +17,24 @@ */ /** - * \file conferenceorboothattendee_list.php - * \ingroup eventorganization - * \brief List page for conferenceorboothattendee + * \file htdocs/eventorganization/conferenceorboothattendee_list.php + * \ingroup eventorganization + * \brief List page for conferenceorboothattendee */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -44,15 +47,16 @@ global $dolibarr_main_url_root; // Load translation files required by the page $langs->loadLangs(array("eventorganization", "other", "projects")); -$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 ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeelist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Get Paramters +$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 ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeelist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); @@ -139,6 +143,7 @@ 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->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; $permissiontodelete = $user->rights->eventorganization->delete; From a3d7627bb6725f4d4d71bd376b8876a519bdf337 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:15:41 +0200 Subject: [PATCH 486/507] Update conferenceorboothattendee_note.php --- .../conferenceorboothattendee_note.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 5739e19f0cc..b6e343e4496 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -17,9 +17,9 @@ */ /** - * \file conferenceorboothattendee_note.php - * \ingroup eventorganization - * \brief Tab for notes on ConferenceOrBoothAttendee + * \file htdocs/eventorganization/conferenceorboothattendee_note.php + * \ingroup eventorganization + * \brief Tab for notes on ConferenceOrBoothAttendee */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -42,6 +42,7 @@ //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + // Load Dolibarr environment $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) @@ -77,7 +78,7 @@ dol_include_once('/eventorganization/class/conferenceorboothattendee.class.php') dol_include_once('/eventorganization/lib/eventorganization_conferenceorboothattendee.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("eventorganization@eventorganization", "companies")); +$langs->loadLangs(array('eventorganization', 'companies')); // Get parameters $id = GETPOST('id', 'int'); @@ -105,6 +106,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->eventorganization->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissionnote = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_setnotes.inc.php $permissiontoadd = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_addupdatedelete.inc.php From c4322c5edcc195a4e9d475ec4eaab5b760651032 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 6 Sep 2022 16:17:03 +0000 Subject: [PATCH 487/507] Fixing style errors. --- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 1ec6a9efe96..167a79959f5 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -143,7 +143,7 @@ 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 +// Permissions $permissiontoread = $user->rights->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; $permissiontodelete = $user->rights->eventorganization->delete; From 3cebf6767ed741469d0b7227ec42b9c8ed69b2aa Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:24:26 +0200 Subject: [PATCH 488/507] Update info.php --- htdocs/compta/bank/info.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 1bbab933e7b..729ccc53fdc 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -16,23 +16,29 @@ */ /** - * \file htdocs/compta/bank/info.php - * \ingroup banque - * \brief Onglet info d'une ecriture bancaire + * \file htdocs/compta/bank/info.php + * \ingroup compta/bank + * \brief Info tab of bank statement */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'companies')); + +// Get Parameters $id = GETPOST("rowid", 'int'); $accountid = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int')); $ref = GETPOST('ref', 'alpha'); + // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); From ee799693b144a7c8b31a76fdcff05111f0dd450a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:27:07 +0200 Subject: [PATCH 489/507] Update bilan.php --- htdocs/compta/bank/bilan.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 6edee79f86b..c2e93b27e59 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -17,17 +17,20 @@ */ /** - * \file htdocs/compta/bank/bilan.php - * \ingroup banque - * \brief Page de bilan + * \file htdocs/compta/bank/bilan.php + * \ingroup compta/bank + * \brief Page of Balance sheet */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories')); +// Security Check Access Control if (empty($user->rights->banque->lire)) { accessforbidden(); } From 86377a337e0fc6a9689a19717b70efe385505268 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:30:10 +0200 Subject: [PATCH 490/507] Update categ.php --- htdocs/compta/bank/categ.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index aa60c1ddf41..fbb52fe4a58 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -21,29 +21,38 @@ */ /** - * \file htdocs/compta/bank/categ.php - * \ingroup compta - * \brief Page ajout de categories bancaires + * \file htdocs/compta/bank/categ.php + * \ingroup compta/bank + * \brief Page to manage Bank Categories */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; + // Load translation files required by the page $langs->loadLangs(array('banks', 'categories')); + +// Get Parameters $action = GETPOST('action', 'aZ09'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$categid = GETPOST('categid'); +$label = GETPOST("label"); + +// Initialize technical objects +$bankcateg = new BankCateg($db); + + +// Security Check Access Control if (!$user->rights->banque->configurer) { accessforbidden(); } -$bankcateg = new BankCateg($db); -$categid = GETPOST('categid'); -$label = GETPOST("label"); - /* From 079dab3a2cc6199feb0feb5aaab6677c94317ba2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:37:03 +0200 Subject: [PATCH 491/507] Update supplier_turnover_by_thirdparty.php --- .../stats/supplier_turnover_by_thirdparty.php | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 28e932dcb4a..494ad591766 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -16,17 +16,19 @@ */ /** - * \file htdocs/compta/stats/supplier_turnover_by_thirdparty.php - * \brief Page reporting purchase turnover by thirdparty + * \file htdocs/compta/stats/supplier_turnover_by_thirdparty.php + * \brief Page reporting purchase turnover by thirdparty */ + +// Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.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/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page @@ -38,6 +40,7 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } +// Sort Order $sortorder = GETPOST("sortorder", 'aZ09comma'); $sortfield = GETPOST("sortfield", 'aZ09comma'); if (!$sortorder) { @@ -47,6 +50,7 @@ if (!$sortfield) { $sortfield = "nom"; } + $socid = GETPOST('socid', 'int'); // Category @@ -59,13 +63,17 @@ if (GETPOST('subcat', 'alpha') === 'yes') { // Hook $hookmanager->initHooks(array('supplierturnoverbythirdpartylist')); -// Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); + +// Search Parameters $search_societe = GETPOST("search_societe", 'alpha'); $search_zip = GETPOST("search_zip", 'alpha'); $search_town = GETPOST("search_town", 'alpha'); $search_country = GETPOST("search_country", 'alpha'); + + +// Date range +$year = GETPOST("year", 'int'); +$month = GETPOST("month", 'int'); $date_startyear = GETPOST("date_startyear", 'alpha'); $date_startmonth = GETPOST("date_startmonth", 'alpha'); $date_startday = GETPOST("date_startday", 'alpha'); From fb4620baf3d6b07b7fcb110b98e64ce13f258d18 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 18:55:42 +0200 Subject: [PATCH 492/507] Update ChangeLog --- ChangeLog | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a127d4fcee..9a5513031e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -103,32 +103,33 @@ NEW: Module BOM - Add tabs for nets Bom NEW: Module BOM - Add the possibility to add sub-BOMs to BOM NEW: Module Recruitment - Add a public page with all list of open job positions. NEW: Module Recruitment - Add a tab with list of application on the jobposition file. -NEW: Module website now supports the multicompany module +NEW: Module Website - supports now the multicompany module NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens) NEW: on redirect of page in website module, GET parameters are kept. NEW: optional display warning icons on ticket list -NEW: option to default check "notify tier at creation" in ticket module -NEW: option update prices on proposal cloning NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439) NEW: possibility to consume multiple batch NEW: Reverse movement product consumption NEW: Send email to the supplier order contact NEW: add permission to report time on timesheet NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level -NEW: Show number of votes into the label of tab "Results" of a survey NEW: Some core tables are created only at module activation NEW: MRP - split consumption line on MO +NEW: Proposals - option update prices on proposal cloning NEW: stock filter in reassort lists NEW: stock limit in stock export CSV NEW: Supplier order - Show ref supplier of reception in linked object block NEW: support user_modif in order +NEW: Surveys - Show number of votes into the label of tab "Results" of a survey NEW: TakePOS - barcode rule to insert product in TakePOS NEW: TakePOS - pagination on search results NEW: TakePOS - show product reference NEW: TakePOS - add constant to hide categories NEW: TakePOS - add constant to show category description NEW: TakePOS - add constant to show only the products in stock +NEW: Tickets - option to default check "notify tier at creation" +NEW: Tickets - Trigger: allow to automatically send messages on new tickets NEW: The backup tools has an "lowmemory" option for mysqldump on large database NEW: The 'reposition' class works on ajax constantonoff that make redirects NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice @@ -136,7 +137,6 @@ NEW: thumbnail field in product list NEW: total mark rate in list NEW: uncheck "send message" by default on a ticket when private messages has been checked NEW: VAT Report by month - Show detail by rate and also by code -NEW: Ticket triggers: allow to automatically send messages on new tickets NEW: Can store the session into database (instead of beeing managed by PHP) NEW: Added MMK currency (Myanmar Kyat) NEW: On a form to send an email, we show all emails of contacts of object @@ -161,20 +161,17 @@ NEW: Identification of tr is possible with by attribute data-id on some pages NEW: Import with select boxes V2 NEW: Can use current entity filter on 'chkbxlst' NEW: Creation of the function select_bom() used to display bom select list - NEW: Add trigger and event on completely received status change NEW: Add utility function send backup by mail NEW: add WordPress OAuth to save a token (not SSO) NEW: A module can embed a sql script run at each Dolibarr upgrade -NEW: Add option INVOICEREC_SET_AUTOFILL_DATE_START/END NEW: Add param to keep the robot=index meta tag on public pages NEW: Add method hintindex() in database handlers. NEW: add modifications for new function "$db->prefix()" NEW: addMoreActionsButtonsList hook for button in list NEW: Standardize a lot of code. NEW: Add a protection into PHPunit to avoid to forget a var_dump -NEW: Add hidden option on contract PDF line to hide qty and price -NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action + API: NEW: API Proposals - Add POST lines @@ -191,7 +188,6 @@ Hooks: NEW: Hook getNomUrl available everywhere in tooltip of ref links NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook NEW: Add hook before the public ticket list -NEW: Add hook doaction in takepos invoice NEW: Add hook for Notif NEW: Add hook for more buttons NEW: add hook printFieldListWhere in product ressort card @@ -209,6 +205,12 @@ NEW: Add hook to getSellPrice function NEW: TakePos - add hooks complete product display NEW: TakePos - add hooks for cart display NEW: TakePos - add hooks to complete ajax return array +NEW: TakePOS - add hook doaction in TakePOS invoice + +Config Options: +NEW: Add hidden option on contract PDF line to hide qty and price +NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END +NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action WARNING: From 8ee927f593b30dc3274fa5d01a40fbb34e1c1505 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2022 20:53:51 +0200 Subject: [PATCH 493/507] Fix search --- htdocs/user/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 858a46887ba..3a0714ab540 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -110,7 +110,8 @@ $fieldstosearchall = array( 'u.office_phone'=>"PhonePro", 'u.user_mobile'=>"PhoneMobile", 'u.email'=>"EMail", - 'u.note'=>"Note", + 'u.note_public'=>"PublicNote", + 'u.note_private'=>"PrivateNote" ); if (!empty($conf->api->enabled)) { $fieldstosearchall['u.api_key'] = "ApiKey"; From 17a4e20abb96a48b86f1cbb6ac8989d84196513c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:22:52 +0200 Subject: [PATCH 494/507] Update list.php --- htdocs/fourn/product/list.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index a89b25c2201..4bd64a60fc8 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -21,18 +21,24 @@ */ /** - * \file htdocs/fourn/product/list.php - * \ingroup produit - * \brief Page to list supplier products and services + * \file htdocs/fourn/product/list.php + * \ingroup product + * \brief Page to list supplier products and services */ + +// Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.class.php'; -$langs->loadLangs(array("products", "suppliers")); +// Load translation files required by the page +$langs->loadLangs(array('products', 'suppliers')); + + +// Get Parameters $sref = GETPOST('sref', 'alphanohtml'); $sRefSupplier = GETPOST('srefsupplier'); $snom = GETPOST('snom', 'alphanohtml'); @@ -72,6 +78,7 @@ if (empty($user->rights->produit->lire) && empty($user->rights->service->lire)) accessforbidden(); } +// Permissions $permissiontoadd = ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')); @@ -111,6 +118,7 @@ if (empty($reshook)) { } } + /* * View */ From 8973d7b2b51fe4abc077b12493a7e6355ed42e84 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:27:14 +0200 Subject: [PATCH 495/507] Update card.php --- htdocs/fourn/paiement/card.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index d9144b3a83f..c7c1297e0e8 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -19,26 +19,34 @@ */ /** - * \file htdocs/fourn/paiement/card.php - * \ingroup facture, fournisseur - * \brief Tab to show a payment of a supplier invoice - * \remarks Fichier presque identique a compta/paiement/card.php + * \file htdocs/fourn/paiement/card.php + * \ingroup facture, fournisseur + * \brief Tab to show a payment of a supplier invoice + * \remarks Fichier presque identique a compta/paiement/card.php */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers')); -$id = GETPOST('id', 'int'); +// Load translation files required by the page +$langs->loadLangs(array('banks', 'bills', 'companies', 'suppliers')); + + +// Get Parameters +$id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); +// Initialize objects $object = new PaiementFourn($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('supplierpaymentcard', 'globalcard')); From b4034c0a210b1f20ce26a0abe7eca4a4a6880b70 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:30:09 +0200 Subject: [PATCH 496/507] Update document.php --- htdocs/fourn/paiement/document.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index b69e081cf16..e26734ed9c6 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -23,30 +23,36 @@ */ /** - * \file htdocs/fourn/paiement/document.php - * \ingroup facture, fournisseur - * \brief Management page of attached documents to a payment + * \file htdocs/fourn/paiement/document.php + * \ingroup facture, fournisseur + * \brief Management page of attached documents to a payment */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -// Load translation files required by the page -$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers', 'other')); +// Load translation files required by the page +$langs->loadLangs(array('banks', 'bills', 'companies', 'suppliers', 'other')); + + +// Get Parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); + // Security check if ($user->socid) { $socid = $user->socid; From da61cb5b868b8f8b608946fefe0dd99ae2773d30 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 6 Sep 2022 21:34:30 +0200 Subject: [PATCH 497/507] Update info.php --- htdocs/fourn/paiement/info.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index 8032b2b418f..5979c2ff1ee 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -18,20 +18,26 @@ */ /** - * \file htdocs/fourn/paiement/info.php - * \ingroup facture - * \brief Onglet info d'un paiement fournisseur + * \file htdocs/fourn/paiement/info.php + * \ingroup facture, fournisseur + * \brief Tab for Supplier Payment Information */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; + +// Load translation files required by the page $langs->loadLangs(array("bills", "suppliers", "companies")); +// Get Parameters $id = GETPOST('id', 'int'); +// Initialize Objects $object = new PaiementFourn($db); // Load object From 8666e193a2bc7172a87e28e94ccc7694f8dcf854 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Sep 2022 22:56:09 +0200 Subject: [PATCH 498/507] Fix td balance --- htdocs/product/stock/stockatdate.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index d4f1bbf4861..0b7baf643ff 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -476,6 +476,8 @@ print $hookmanager->resPrint; print "
    '.$currentstock.''.$virtualstock.''.($stock ? $stock : ''.$stock.'').''.($currentstock ? $currentstock : '0').'
    '.$langs->trans("EnterADateCriteria").'
    '.$langs->trans("Totalforthispage").''.price(price2num($totalbuyingprice, 'MT')).'
    '.$langs->trans("Totalforthispage").''.price(price2num($totalcurrentstock, 'MS')).''.price(price2num($totalvirtualstock, 'MS')).''.price(price2num($totalbuyingprice, 'MT')).''.($productid > 0 ? price(price2num($totalcurrentstock, 'MS')) : '').'
    '; From bfb93609dd0a1d5ce7546db1bcb0da8efe1a18a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:56:02 +0200 Subject: [PATCH 499/507] php V8 Warning --- htdocs/compta/facture/card.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d8db9191c32..27ad83d35d4 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2237,8 +2237,9 @@ if (empty($reshook)) { $desc = $product_desc; $type = GETPOST('type'); $fk_unit = GETPOST('units', 'alpha'); - $pu_ht_devise = price2num($price_ht_devise, 'MU'); } + + $pu_ht_devise = price2num($price_ht_devise, 'MU'); // Margin $fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); @@ -2286,10 +2287,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty-$conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { From 0886f8557967071952693d7c3fe1067032d66cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:57:51 +0200 Subject: [PATCH 500/507] Update card.php --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 27ad83d35d4..f60f1da089d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -659,10 +659,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { From 3144362c6ca337528bdff4ddcb5c4a8d30b98318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:38:20 +0200 Subject: [PATCH 501/507] php V8 warning --- htdocs/fourn/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 305c50b29d5..09dbd4c84ac 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -10,7 +10,7 @@ * Copyright (C) 2015 Abbes Bahfir * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2018-2022 Charlene Benke * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2019-2021 Alexandre Spangaro * @@ -649,7 +649,7 @@ if (!$search_all) { } } // Add GroupBy from hooks - $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); + $parameters = array('all' => $search_all, 'fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } else { @@ -682,7 +682,7 @@ if ($resql) { $arrayofselected = is_array($toselect) ? $toselect : array(); - if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { + if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { $obj = $db->fetch_object($resql); $id = $obj->facid; From 7a3b94a1e90243b4af1b1c91b21fb6e174d29ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:53:43 +0200 Subject: [PATCH 502/507] Update list.php --- htdocs/fourn/facture/list.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 09dbd4c84ac..4c5b84ea4ee 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1291,6 +1291,14 @@ if ($resql) { if ($num > 0) { $i = 0; $totalarray = array(); + $totalarray['nbfield']=0; + $totalarray['val'] = array(); + $totalarray['val']['f.total_ht']=0; + $totalarray['val']['f.total_vat']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_ttc']=0; + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From fbbdcd1d4c2b37afc5b25025212e3590041c3844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 7 Sep 2022 10:28:23 +0200 Subject: [PATCH 503/507] fix php8 warnings --- htdocs/comm/propal/card.php | 2 +- .../core/modules/propale/doc/pdf_azur.modules.php | 2 +- .../core/modules/propale/doc/pdf_cyan.modules.php | 2 +- htdocs/datapolicy/admin/setupmail.php | 2 +- .../product/class/propalmergepdfproduct.class.php | 8 ++++---- htdocs/product/document.php | 14 +++++++------- htdocs/societe/paymentmodes.php | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 53ba07ba441..388a4f97d4b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -722,7 +722,7 @@ if (empty($reshook)) { $ret = $deposit->fetch($deposit->id); // Reload to get new records $outputlangs = $langs; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($deposit->thirdparty->default_lang); $outputlangs->load('products'); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 86d6306a576..c2971c9344e 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); } else { $filetomerge->fetch_by_product($line->fk_product); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index ec04a8e8906..9d52132db56 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -918,7 +918,7 @@ class pdf_cyan extends ModelePDFPropales // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); } else { $filetomerge->fetch_by_product($line->fk_product); diff --git a/htdocs/datapolicy/admin/setupmail.php b/htdocs/datapolicy/admin/setupmail.php index e2f562ee79b..825bd13b142 100644 --- a/htdocs/datapolicy/admin/setupmail.php +++ b/htdocs/datapolicy/admin/setupmail.php @@ -106,7 +106,7 @@ print '
    '; print ''; print ''; print ''; -if ($conf->global->MAIN_MULTILANGS) { +if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index e69c75c7336..b4b85c3852a 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -107,7 +107,7 @@ class Propalmergepdfproduct extends CommonObject $sql = "INSERT INTO ".$this->db->prefix()."propal_merge_pdf_product("; $sql .= "fk_product,"; $sql .= "file_name,"; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $sql .= "lang,"; } $sql .= "fk_user_author,"; @@ -116,7 +116,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= ") VALUES ("; $sql .= " ".(!isset($this->fk_product) ? 'NULL' : ((int) $this->fk_product)).","; $sql .= " ".(!isset($this->file_name) ? 'NULL' : "'".$this->db->escape($this->file_name)."'").","; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $sql .= " ".(!isset($this->lang) ? 'NULL' : "'".$this->db->escape($this->lang)."'").","; } $sql .= " ".((int) $user->id).","; @@ -186,7 +186,7 @@ class Propalmergepdfproduct extends CommonObject $this->fk_product = $obj->fk_product; $this->file_name = $obj->file_name; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $this->lang = $obj->lang; } $this->fk_user_author = $obj->fk_user_author; @@ -311,7 +311,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " file_name=".(isset($this->file_name) ? "'".$this->db->escape($this->file_name)."'" : "null").","; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $sql .= " lang=".(isset($this->lang) ? "'".$this->db->escape($this->lang)."'" : "null").","; } $sql .= " fk_user_mod=".$user->id; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 2aaa2356879..ee5ba79a284 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -154,14 +154,14 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge_file_array = GETPOST('filetoadd'); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $lang_id = GETPOST('lang_id', 'aZ09'); } // Delete all file already associated $filetomerge = new Propalmergepdfproduct($db); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $result = $filetomerge->delete_by_product($user, $object->id, $lang_id); } else { $result = $filetomerge->delete_by_product($user, $object->id); @@ -176,7 +176,7 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge->fk_product = $object->id; $filetomerge->file_name = $filetomerge_file; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $filetomerge->lang = $lang_id; } @@ -271,7 +271,7 @@ if ($object->id) { if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $lang_id = GETPOST('lang_id', 'aZ09'); $result = $filetomerge->fetch_by_product($object->id, $lang_id); } else { @@ -305,7 +305,7 @@ if ($object->id) { print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).''."\n"; print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print '
    '; // Get language - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $langs->load("languages"); print ''; print '
    '; @@ -316,7 +316,7 @@ if ($object->id) { print Form::selectarray('lang_id', $langs_available, $default_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; } @@ -328,7 +328,7 @@ if ($object->id) { $checked = ''; $filename = $filetoadd['name']; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { if (array_key_exists($filetoadd['name'].'_'.$default_lang, $filetomerge->lines)) { $filename = $filetoadd['name'].' - '.$langs->trans('Language_'.$default_lang); $checked = ' checked '; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 20cce294586..e7899db813e 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1467,7 +1467,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $allowgenifempty = 0; // Language code (if multilang) - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); $defaultlang = $langs->getDefaultLang(); From 445da580c6d3fd533a4d123cc50bfe473aaabd04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 13:42:31 +0200 Subject: [PATCH 504/507] Fix regression --- htdocs/core/menus/standard/eldy.lib.php | 76 ++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 01bc426458e..66f85c3739c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -95,8 +95,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => (isModEnabled('adherent')), - 'perms' => (!empty($user->hasRight('adherent', 'lire'))), + 'enabled' => isModEnabled('adherent'), + 'perms' => $user->hasRight('adherent', 'lire'), 'module' => 'adherent' ); $menu_arr[] = array( @@ -125,7 +125,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ) || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) ), - 'perms'=> (!empty($user->hasRight('societe', 'lire')) || !empty($user->hasRight('fournisseur', 'lire')) || !empty($user->hasRight('supplier_order', 'lire')) || !empty($user->hasRight('supplier_invoice', 'lire')) || !empty($user->hasRight('supplier_proposal', 'lire'))), + 'perms'=> ($user->hasRight('societe', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), 'module'=>'societe|fournisseur' ); $menu_arr[] = array( @@ -150,7 +150,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), - 'perms'=> (!empty($user->hasRight('produit', 'lire')) || !empty($user->hasRight('service', 'lire')) || !empty($user->hasRight('expedition', 'lire'))), + 'perms'=> ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire') || $user->hasRight('expedition', 'lire')), 'module'=>'product|service' ); $menu_arr[] = array( @@ -177,7 +177,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // MRP - GPAO $tmpentry = array( 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), - 'perms'=>(!empty($user->hasRight('bom', 'read')) || !empty($user->hasRight('mrp', 'read'))), + 'perms'=>($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), 'module'=>'bom|mrp' ); $menu_arr[] = array( @@ -202,7 +202,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( 'enabled'=> (isModEnabled('projet') ? 1 : 0), - 'perms'=> (!empty($user->hasRight('projet', 'lire')) ? 1 : 0), + 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), 'module'=>'projet' ); $menu_arr[] = array( @@ -234,25 +234,25 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = || isModEnabled('contrat') || isModEnabled('ficheinter') ) ? 1 : 0, - 'perms'=>(!empty($user->hasRight('propal', 'lire')) - || !empty($user->hasRight('commande', 'lire')) - || !empty($user->hasRight('supplier_proposal', 'lire')) - || !empty($user->hasRight('fournisseur', 'lire')) - || !empty($user->hasRight('fournisseur', 'commande', 'lire')) - || !empty($user->hasRight('supplier_order', 'lire')) - || !empty($user->hasRight('contrat', 'lire')) - || !empty($user->hasRight('ficheinter', 'lire')) + 'perms'=>($user->hasRight('propal', 'lire') + || $user->hasRight('commande', 'lire') + || $user->hasRight('supplier_proposal', 'lire') + || $user->hasRight('fournisseur', 'lire') + || $user->hasRight('fournisseur', 'commande', 'lire') + || $user->hasRight('supplier_order', 'lire') + || $user->hasRight('contrat', 'lire') + || $user->hasRight('ficheinter', 'lire') ), 'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter' ); - $onlysupplierorder = !empty($user->hasRight('fournisseur', 'commande', 'lire')) && - empty($user->hasRight('propal', 'lire')) && - empty($user->hasRight('commande', 'lire')) && - empty($user->hasRight('supplier_order', 'lire')) && - empty($user->hasRight('supplier_proposal', 'lire')) && - empty($user->hasRight('contrat', 'lire')) && - empty($user->hasRight('ficheinter', 'lire')); + $onlysupplierorder = $user->hasRight('fournisseur', 'commande', 'lire') && + !$user->hasRight('propal', 'lire') && + !$user->hasRight('commande', 'lire') && + !$user->hasRight('supplier_order', 'lire') && + !$user->hasRight('supplier_proposal', 'lire') && + !$user->hasRight('contrat', 'lire') && + !$user->hasRight('ficheinter', 'lire'); $menu_arr[] = array( 'name' => 'Commercial', @@ -283,9 +283,9 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = isModEnabled('loan') || isModEnabled('margins') ) ? 1 : 0, - 'perms'=>(!empty($user->hasRight('facture', 'lire')) || !empty($user->hasRight('don', 'contact', 'lire')) - || !empty($user->hasRight('tax', 'charges', 'lire')) || !empty($user->hasRight('salaries', 'read')) - || !empty($user->hasRight('fournisseur', 'facture', 'lire')) || !empty($user->hasRight('loan', 'read')) || !empty($user->hasRight('margins', 'liretous'))), + 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') + || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') + || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' ); $menu_arr[] = array( @@ -310,7 +310,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), - 'perms'=>(!empty($user->hasRight('banque', 'lire')) || !empty($user->hasRight('prelevement', 'lire')) || !empty($user->hasRight('paymentbybanktransfer', 'read'))), + 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), 'module'=>'banque|prelevement|paymentbybanktransfer' ); $menu_arr[] = array( @@ -335,7 +335,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( 'enabled'=>(isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), - 'perms'=>(!empty($user->hasRight('compta', 'resultat', 'lire')) || !empty($user->hasRight('accounting', 'comptarapport', 'lire')) || !empty($user->hasRight('accounting', 'mouvements', 'lire')) || !empty($user->hasRight('asset', 'read')) || !empty($user->hasRight('intracommreport', 'read'))), + 'perms'=>($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), 'module'=>'comptabilite|accounting|asset|intracommreport' ); $menu_arr[] = array( @@ -360,7 +360,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( 'enabled'=>(isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), - 'perms'=>(!empty($user->hasRight('user', 'user', 'lire')) || !empty($user->hasRight('holiday', 'read')) || !empty($user->hasRight('deplacement', 'lire')) || !empty($user->hasRight('expensereport', 'lire')) || !empty($user->hasRight('recruitment', 'recruitmentjobposition', 'read'))), + 'perms'=>($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -386,7 +386,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knowledge base $tmpentry = array( 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), - 'perms'=>(!empty($user->hasRight('ticket', 'read')) || !empty($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read'))), + 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), 'module'=>'ticket|knowledgemanagement' ); $link = ''; @@ -1658,7 +1658,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Journals - if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->hasRight('accounting', 'comptarapport', 'lire'), '', '', ''); // Multi journal @@ -1759,7 +1759,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } if ($modecompta) { @@ -1773,7 +1773,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - //if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + //if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); @@ -1785,7 +1785,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. } if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { @@ -1797,7 +1797,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - if (isModEnabled('accounting') && !empty($user->hasRight('accounting', 'comptarapport', 'lire')) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && $user->hasRight('accounting', 'comptarapport', 'lire') && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. } if ($modecompta && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice'))) { @@ -1881,10 +1881,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'read'))), '', $mainmenu, 'asset_model'); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'write')))); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('asset', 'model_advance', 'read')))); + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read'))); } } } @@ -2165,8 +2165,8 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $search_project_user = GETPOST('search_project_user', 'int'); $tmpentry = array( - 'enabled'=>(isModEnabled('projet')), - 'perms'=>(!empty($user->hasRight('projet', 'lire'))), + 'enabled'=>isModEnabled('projet'), + 'perms'=>$user->hasRight('projet', 'lire'), 'module'=>'projet' ); $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); From 967e2033193105c54297a4fcb31a6740b0aea6c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 13:55:02 +0200 Subject: [PATCH 505/507] Fix fetch missing fields --- htdocs/fourn/facture/card.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b928cc5bdf9..75aa5898574 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2643,7 +2643,7 @@ if ($action == 'create') { * View card */ $objectidnext = $object->getIdReplacingInvoice(); - + $head = facturefourn_prepare_head($object); $titre = $langs->trans('SupplierInvoice'); @@ -3305,7 +3305,10 @@ if ($action == 'create') { $paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid); $paymentstatic->num_payment = $objp->num_payment; + $paymentstatic->paiementcode = $objp->payment_code; + $paymentstatic->type_code = $objp->payment_code; + $paymentstatic->type_label = $objp->payment_type; print '
    '; From ea6f751fd3a27457613aad536088c8ea0675a73e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 14:21:36 +0200 Subject: [PATCH 506/507] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d56f9419989..723ff70139d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -602,7 +602,7 @@ if (empty($reshook)) { $result = $object->create($user); - if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email)) { + if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email) && !empty($object->no_email)) { // Add mass emailing flag into table mailing_unsubscribe $result = $object->setNoEmail($object->no_email); if ($result < 0) { From 56f1964c68e19b0db6e28eb5f97dae1b96be7ce3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 14:23:24 +0200 Subject: [PATCH 507/507] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 723ff70139d..cc0b92fca00 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -602,7 +602,7 @@ if (empty($reshook)) { $result = $object->create($user); - if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email) && !empty($object->no_email)) { + if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email) && $object->no_email == 1) { // Add mass emailing flag into table mailing_unsubscribe $result = $object->setNoEmail($object->no_email); if ($result < 0) {