From 9ef27355205dc9067792b8a37271ce07c1d602a1 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 2 Dec 2021 18:25:14 +0100 Subject: [PATCH 001/183] Adds import for customer invoices and invoices lines --- .../facture/class/paymentterm.class.php | 10 +- htdocs/core/modules/modFacture.class.php | 268 ++++++++++++++++++ 2 files changed, 276 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index f94ad573a81..143f4bcf746 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -172,9 +172,10 @@ class PaymentTerm // extends CommonObject * Load object in memory from database * * @param int $id Id object + * @param string $code * @return int <0 if KO, >0 if OK */ - public function fetch($id) + public function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -192,7 +193,12 @@ class PaymentTerm // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; - $sql .= " WHERE t.rowid = ".((int) $id); + if ($id) { + $sql .= " WHERE t.rowid = ".((int) $id); + } + if ($code) { + $sql .= " WHERE t.code='".$this->db->escape($code)."' AND t.entity IN (".getEntity('payment_term').")"; + } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index ef341c83e89..73ca71bcf73 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -232,6 +232,274 @@ class modFacture extends DolibarrModules $this->menu = 1; // This module add menu entries. They are coded into menu manager. + // Imports + //-------- + $r = 1; + + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "Invoices"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('f' => MAIN_DB_PREFIX.'facture', 'extra' => MAIN_DB_PREFIX.'facture_extrafields'); + $this->import_tables_creator_array[$r] = array('f' => 'fk_user_author'); // Fields to store import user id + $this->import_fields_array[$r] = array( + 'f.ref' => 'InvoiceRef*', + 'f.ref_ext' => 'ExternalRef', + 'f.ref_int' => 'ExternalRef', + 'f.ref_client' => 'CutomerRef', + 'f.type' => 'Type*', + 'f.fk_soc' => 'Customer*', + 'f.datec' => 'InvoiceDateCreation', + 'f.datef' => 'DateInvoice', + 'f.date_valid' => 'Validation Date', + 'f.paye' => 'InvoicePaid', + 'f.remise_percent' => 'RemisePercent', + 'f.remise_absolue' => 'RemiseAbsolue', + 'f.remise' => 'Remise', + 'f.total_tva' => 'TotalVAT', + 'f.total_ht' => 'TotalHT', + 'f.total_ttc' => 'TotalTTC', + 'f.fk_statut' => 'InvoiceStatus', + 'f.fk_user_modif' => 'Modifier Id', + 'f.fk_user_valid' => 'Validator Id', + 'f.fk_user_closing' => 'Closer Id', + 'f.fk_facture_source' => 'Invoice Source Id', + 'f.fk_projet' => 'Project Id', + 'f.fk_account' => 'Bank Account', + 'f.fk_currency' => 'Currency*', + 'f.fk_cond_reglement' => 'Payment Condition', + 'f.fk_mode_reglement' => 'Payment Mode', + 'f.date_lim_reglement' => 'DateMaxPayment', + 'f.note_public' => 'InvoiceNote', + 'f.note_private' => 'NotePrivate', + 'f.model_pdf' => 'Model' + ); + if (!empty($conf->multicurrency->enabled)) { + $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'; + $this->import_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; + $this->import_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; + } + // Add extra fields + $import_extrafield_sample = array(); + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : ''); + $import_extrafield_sample[$fieldname] = $fieldlabel; + } + } + // End add extra fields + $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facture'); + $this->import_regex_array[$r] = array('f.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency'); + $import_sample = array( + 'f.ref' => '(PROV0001)', + 'f.ref_ext' => '', + 'f.ref_int' => '', + 'f.ref_client' => '', + 'f.type' => '0', + 'f.fk_soc' => '80LIMIT', + 'f.datec' => '2021-11-24', + 'f.datef' => '2021-11-24', + 'f.date_valid' => '2021-11-24', + 'f.paye' => '1', + 'f.remise_percent' => '0', + 'f.remise_absolue' => '0', + 'f.remise' => '0', + 'f.total_tva' => '21', + 'f.total_ht' => '100', + 'f.total_ttc' => '121', + 'f.fk_statut' => '1', + 'f.fk_user_modif' => '', + 'f.fk_user_valid' => '', + 'f.fk_user_closing' => '', + 'f.fk_facture_source' => '', + 'f.fk_projet' => '', + 'f.fk_account' => '', + 'f.fk_currency' => 'EUR', + 'f.fk_cond_reglement' => '30D', + 'f.fk_mode_reglement' => 'VIR', + 'f.date_lim_reglement' => '2021-12-24', + 'f.note_public' => '', + 'f.note_private' => '', + 'f.model_pdf' => 'crabe', + 'f.multicurrency_code' => 'EUR', + 'f.multicurrency_tx' => '1', + 'f.multicurrency_total_ht' => '100', + 'f.multicurrency_total_tva' => '21', + 'f.multicurrency_total_ttc' => '121' + ); + $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample); + $this->import_updatekeys_array[$r] = array('f.ref' => 'Ref'); + $this->import_convertvalue_array[$r] = array( + 'f.fk_soc' => array( + 'rule' => 'fetchidfromref', + 'file' => '/societe/class/societe.class.php', + 'class' => 'Societe', + 'method' => 'fetch', + 'element' => 'ThirdParty' + ), + 'f.fk_projet' => array( + 'rule' => 'fetchidfromref', + 'file' => '/projet/class/project.class.php', + 'class' => 'Project', + 'method' => 'fetch', + 'element' => 'facture' + ), + 'f.fk_cond_reglement' => array( + 'rule' => 'fetchidfromcodeorlabel', + 'file' => '/compta/facture/class/paymentterm.class.php', + 'class' => 'PaymentTerm', + 'method' => 'fetch', + 'element' => 'c_payment_term' + ) + ); + + //Import Supplier Invoice Lines + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "InvoiceLine"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('fd' => MAIN_DB_PREFIX.'facturedet', 'extra' => MAIN_DB_PREFIX.'facturedet_extrafields'); + $this->import_fields_array[$r] = array( + 'fd.fk_facture' => 'InvoiceRef*', + 'fd.fk_parent_line' => 'FacParentLine', + 'fd.fk_product' => 'IdProduct', + 'fd.label' => 'Label', + 'fd.description' => 'LineDescription*', + 'fd.vat_src_code' => 'Vat Source Code', + 'fd.tva_tx' => 'LineVATRate*', + // localtax1_tx + // localtax1_type + // localtax2_tx + // localtax2_type + 'fd.qty' => 'LineQty', + 'fd.remise_percent' => 'Reduc. (%)', + // remise + // fk_remise_except + // subprice + // price + 'fd.total_ht' => 'LineTotalHT', + 'fd.total_tva' => 'LineTotalVAT', + // total_localtax1 + // total_localtax2 + 'fd.total_ttc' => 'LineTotalTTC', + 'fd.product_type' => 'TypeOfLineServiceOrProduct', + 'fd.date_start' => 'Start Date', + 'fd.date_end' => 'End Date', + // info_bits + // buy_price_ht + // fk_product_fournisseur_price + // specia_code + // rang + // fk_contract_line + 'fd.fk_unit' => 'Unit', + // fk_code_ventilation + // situation_percent + // fk_prev_id + // fk_user_author + // fk_user_modif + // ref_ext + ); + if (!empty($conf->multicurrency->enabled)) { + $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'; + $this->import_fields_array[$r]['fd.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; + $this->import_fields_array[$r]['fd.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; + } + // Add extra fields + $import_extrafield_sample = array(); + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_det' AND entity IN (0, ".$conf->entity.")"; + $resql = $this->db->query($sql); + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $fieldname = 'extra.'.$obj->name; + $fieldlabel = ucfirst($obj->label); + $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : ''); + $import_extrafield_sample[$fieldname] = $fieldlabel; + } + } + // End add extra fields + $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'facturedet'); + $this->import_regex_array[$r] = array( + 'fd.fk_product' => 'rowid@'.MAIN_DB_PREFIX.'product', + 'fd.multicurrency_code' => 'code@'.MAIN_DB_PREFIX.'multicurrency' + ); + $import_sample = array( + 'fd.fk_facture' => '(PROV00001)', + 'fd.fk_parent_line' => '', + 'fd.fk_product' => '', + 'fd.label' => '', + 'fd.description' => 'Test product', + 'fd.vat_src_code' => '', + 'fd.tva_tx' => '21', + // localtax1_tx + // localtax1_type + // localtax2_tx + // localtax2_type + 'fd.qty' => '1', + 'fd.remise_percent' => '0', + // remise + // fk_remise_except + // subprice + // price + 'fd.total_ht' => '100', + 'fd.total_tva' => '21', + // total_localtax1 + // total_localtax2 + 'fd.total_ttc' => '121', + 'fd.product_type' => '0', + 'fd.date_start' => '', + 'fd.date_end' => '', + // info_bits + // buy_price_ht + // fk_product_fournisseur_price + // specia_code + // rang + // fk_contract_line + 'fd.fk_unit' => '', + // fk_code_ventilation + // situation_percent + // fk_prev_id + // fk_user_author + // fk_user_modif + // ref_ext + 'fd.multicurrency_code' => 'EUR', + 'fd.multicurrency_tx' => '21', + 'fd.multicurrency_total_ht' => '100', + 'fd.multicurrency_total_tva' => '21', + 'fd.multicurrency_total_ttc' => '121' + ); + $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample); + $this->import_updatekeys_array[$r] = array( + 'fd.rowid' => 'Row Id', + 'fd.fk_facture' => 'Invoice Id' + ); + $this->import_convertvalue_array[$r] = array( + 'fd.fk_facture' => array( + 'rule' => 'fetchidfromref', + 'file' => '/compta/facture/class/facture.class.php', + 'class' => 'Facture', + 'method' => 'fetch', + 'element' => 'facture' + ), + 'fd.fk_projet' => array( + 'rule' => 'fetchidfromref', + 'file' => '/projet/class/project.class.php', + 'class' => 'Project', + 'method' => 'fetch', + 'element' => 'facture' + ), + ); + + // Exports //-------- $r = 1; From e58d783ced53ba4101bbeb4d7c1dd151abdeff54 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 6 Jan 2022 10:41:38 +0100 Subject: [PATCH 002/183] add comment to parameter --- htdocs/compta/facture/class/paymentterm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 143f4bcf746..fd842e3485f 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -172,7 +172,7 @@ class PaymentTerm // extends CommonObject * Load object in memory from database * * @param int $id Id object - * @param string $code + * @param string $code Code object * @return int <0 if KO, >0 if OK */ public function fetch($id, $code = '') From 4e118ba1ae30d6396eda536bd8e167ff2d904585 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Wed, 1 Jun 2022 22:54:05 +0200 Subject: [PATCH 003/183] Fix deposit management on accountancy supplier index --- htdocs/accountancy/supplier/index.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 9ea8fd0a307..3d5a5e99f8d 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -299,10 +299,14 @@ $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND aa.account_number IS NULL"; +if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.")"; +} else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.")"; +} $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; -$sql .= ' ORDER BY aa.account_number'; -dol_syslog('htdocs/accountancy/supplier/index.php'); +dol_syslog('htdocs/accountancy/supplier/index.php sql='.$sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -375,11 +379,17 @@ $sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'"; if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } +$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; -$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy +if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; +} else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; +} $sql .= " AND aa.account_number IS NOT NULL"; $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; +$sql .= ' ORDER BY aa.account_number'; dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); @@ -394,6 +404,7 @@ if ($resql) { print length_accountg($row[0]); } print ''; + print ''; if ($row[0] == 'tobind') { print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind")); @@ -401,6 +412,7 @@ if ($resql) { print $row[1]; } print ''; + for ($i = 2; $i <= 12; $i++) { print ''.price($row[$i]).''; } @@ -416,7 +428,6 @@ print "\n"; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange. Why showing a report that should rely on result of this step ? print '
'; print '
'; @@ -453,9 +464,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } + $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; - $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; + } else { + $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; + } dol_syslog('htdocs/accountancy/supplier/index.php'); $resql = $db->query($sql); From 88cf8187b87ef0cdd2bb4679fcc6d330bc9692e0 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 5 Jun 2022 14:32:21 +0200 Subject: [PATCH 004/183] FIX #20444 --- htdocs/societe/card.php | 54 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 301e5bfb288..e20f54eecfd 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1139,6 +1139,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country = $tmparray['label']; } $object->forme_juridique_code = GETPOST('forme_juridique_code'); + + // We set multicurrency_code if enabled + if (!empty($conf->multicurrency->enabled)) { + $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency; + } /* Show create form */ $linkback = ""; @@ -1261,6 +1266,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { });'; print ''."\n"; } + if (!empty($conf->multicurrency->enabled)) { + print ''."\n"; + } } dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); @@ -1605,8 +1620,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).''; print ' '; - print ''.$langs->trans("Currency".$conf->currency).''; - + if (!empty($conf->multicurrency->enabled)) { + print ''.$langs->trans("Currency".$object->multicurrency_code).''; + } else { + print ''.$langs->trans("Currency".$conf->currency).''; + } if (!empty($conf->global->MAIN_MULTILANGS)) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); @@ -1656,7 +1674,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); + print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code), 'multicurrency_code', 1); print ''; } @@ -1854,6 +1872,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; } + + // We set multicurrency_code if enabled + if (!empty($conf->multicurrency->enabled)) { + $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code; + } } if ($object->localtax1_assuj == 0) { @@ -1942,6 +1965,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { })'; print ''."\n"; + + if (!empty($conf->multicurrency->enabled)) { + print "\n".''."\n"; + } } print '
'; @@ -2285,7 +2319,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$form->editfieldkey('Capital', 'capital', '', $object, 0).''; print ' '.$langs->trans("Currency".$conf->currency).''; + if (!empty($conf->multicurrency->enabled)) { + print '"> '.$langs->trans("Currency".$object->multicurrency_code).''; + } else { + print '"> '.$langs->trans("Currency".$conf->currency).''; + } // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -2340,7 +2378,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); + print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code), 'multicurrency_code', 1); print ''; } @@ -2763,7 +2801,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''.$langs->trans('Capital').''; if ($object->capital) { - print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); + if (!empty($conf->multicurrency->enabled)) { + print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code); + } else { + print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); + } } else { print ' '; } From ccfc730786a3f6e94a28579e7b948dfdd1ceeefa Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 5 Jun 2022 12:56:26 +0000 Subject: [PATCH 005/183] Fixing style errors. --- 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 e20f54eecfd..1bb85fdf008 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1872,7 +1872,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; } - + // We set multicurrency_code if enabled if (!empty($conf->multicurrency->enabled)) { $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code; From cd17fec00e8c36bd7dd2ae23fc29665574f1fd89 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 7 Jun 2022 10:40:00 +0200 Subject: [PATCH 006/183] FIX #20444 --- htdocs/societe/card.php | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1bb85fdf008..6855bdbdb8d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1266,16 +1266,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { });'; print ''."\n"; } - if (!empty($conf->multicurrency->enabled)) { - print ''."\n"; - } } dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); @@ -1674,7 +1664,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code), 'multicurrency_code', 1); + print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); print ''; } @@ -1965,17 +1955,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { })'; print ''."\n"; - - if (!empty($conf->multicurrency->enabled)) { - print "\n".''."\n"; - } } print ''; @@ -2378,7 +2357,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code), 'multicurrency_code', 1); + print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); print ''; } From 9731f0658a3dbf96e703d7c27738cad543e0c296 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 7 Jun 2022 11:23:50 +0200 Subject: [PATCH 007/183] FIX #20444 --- 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 6855bdbdb8d..3ef501aeac6 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2780,7 +2780,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''.$langs->trans('Capital').''; if ($object->capital) { - if (!empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled) && !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); From a29aa48100535db440af5b2314c5e4421a48faea Mon Sep 17 00:00:00 2001 From: Abdelaziz MISBAH Date: Tue, 7 Jun 2022 13:11:30 +0100 Subject: [PATCH 008/183] Send Notification Without File when E-mail Template does'nt attach file When we create an Email Template that does'nt require main file to be attached, we still send notification with an attached file, eg: when we send a notification when validating proposal it send proposal with attached file with mention NOT VALIDATED. I added OR condition on checking pdf_path. --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 452d066886e..e66b378ca38 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -615,7 +615,7 @@ class Notify $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref.".pdf"; - if (!dol_is_file($pdf_path)) { + if (!dol_is_file($pdf_path)||!$arraydefaultmessage->joinfiles) { // We can't add PDF as it is not generated yet. $filepdf = ''; } else { From 1cf8b3421f777155b71eb60152613a579dffc278 Mon Sep 17 00:00:00 2001 From: melina Date: Tue, 7 Jun 2022 17:46:17 +0200 Subject: [PATCH 009/183] add constant for freezone --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3a55d82b8ad..3b0861956b7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -585,7 +585,7 @@ if (empty($reshook)) { $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); + $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') ? 'HT' : 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } From 4d327dcc185f75b6eb685ef45b319489f625067e Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:00:04 +0200 Subject: [PATCH 010/183] datee and dateo not filled now we user date_end and date_start --- htdocs/projet/class/project.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b66452b2c5f..9937a551c1a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2014-2017 Marcos García * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2022 Charlene Benke * * 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 @@ -1212,11 +1213,11 @@ class Project extends CommonObject if (!empty($this->thirdparty_name)) { $label .= ($label ? '
' : '').''.$langs->trans('ThirdParty').': '.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto } - if (!empty($this->dateo)) { - $label .= ($label ? '
' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto + if (!empty($this->date_start)) { + $label .= ($label ? '
' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->date_start, 'day'); // The space must be after the : to not being explode when showing the title in img_picto } - if (!empty($this->datee)) { - $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto + if (!empty($this->date_ent)) { + $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->date_end, 'day'); // The space must be after the : to not being explode when showing the title in img_picto } if ($moreinpopup) { $label .= '
'.$moreinpopup; @@ -2073,7 +2074,7 @@ class Project extends CommonObject $project_static->statut = $obj->status; $project_static->opp_status = $obj->fk_opp_status; - $project_static->datee = $this->db->jdate($obj->datee); + $project_static->date_end = $this->db->jdate($obj->datee); if ($project_static->hasDelay()) { $response->nbtodolate++; @@ -2155,13 +2156,13 @@ class Project extends CommonObject if (!($this->statut == self::STATUS_VALIDATED)) { return false; } - if (!$this->datee && !$this->date_end) { + if (!$this->date_end) { return false; } $now = dol_now(); - return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay); + return ($this->date_end) < ($now - $conf->projet->warning_delay); } From 61d5e8967712a7bb395584e5e6fc94ce99045c63 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Jun 2022 04:01:02 +0200 Subject: [PATCH 011/183] Look & Feel - Align amount to right on card --- htdocs/compta/facture/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fefbbab118..985a10c392e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4711,36 +4711,36 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } // Amount print ''.$langs->trans('AmountHT').''; - print ''.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).''; // Vat - print ''.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; print ''; // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; - print ''.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).''; } if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; - print ''.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; } // Revenue stamp @@ -4796,7 +4796,7 @@ if ($action == 'create') { } // Total with tax - print ''.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; print ''; From 89d0a57eab92a49ee9761cb89900e91e605209e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 11:12:17 +0200 Subject: [PATCH 012/183] add var_dump check --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 44d784ea091..2020976d754 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,23 +93,26 @@ install: echo - | - echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION" + echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION" if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then composer -n require phpunit/phpunit ^5 \ php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then composer -n require phpunit/phpunit ^6 \ php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then composer -n require phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi # phpunit 9 is required for php 8 @@ -117,6 +120,7 @@ install: composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ + php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi echo From 003713953ce4ca97d55f6ea1d49a25ed4c8ca7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 11:17:21 +0200 Subject: [PATCH 013/183] Update .travis.yml --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2020976d754..ed7c6fc685c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -170,6 +170,10 @@ before_script: which phpcs phpcs --version | head - phpcs -i | head - + # Check PHP Vardump check version + echo "PHP Vardump check version" + which var_dump_check + var_dump_check --version # Check PHPUnit version echo "PHPUnit version" which phpunit From 33f10c3aeb1c4dffb0b198d8f638a59e0f44c217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 11:59:19 +0200 Subject: [PATCH 014/183] Update .travis.yml --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index ed7c6fc685c..2da4f7fbbb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -305,6 +305,17 @@ script: set +e echo +- | + echo "Checking missing debug" + # Ensure we catch errors + set -e + # Exclusions are defined in the ruleset.xml file + #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ . + #fi + set +e + echo + - | export INSTALL_FORCED_FILE=htdocs/install/install.forced.php echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation" From 14e7c5454ec0d983c1540b8b951b1fa737e3374c Mon Sep 17 00:00:00 2001 From: Abdelaziz MISBAH Date: Thu, 9 Jun 2022 11:47:34 +0100 Subject: [PATCH 015/183] FIX #21141 Update condition to check for attached file to E-mail Template Update condition to check for attached file to E-ail Template, initial Commit doesn't check for if null (may generate fatal error depending on context), now we check if is an object, before checking if we join files. --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e66b378ca38..92e0272c00c 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -615,7 +615,7 @@ class Notify $ref = dol_sanitizeFileName($newref); $pdf_path = $dir_output."/".$ref.".pdf"; - if (!dol_is_file($pdf_path)||!$arraydefaultmessage->joinfiles) { + if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { // We can't add PDF as it is not generated yet. $filepdf = ''; } else { From cae9ca1bcf2609881d7a80c42e55e44b205a24f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 12:50:35 +0200 Subject: [PATCH 016/183] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2da4f7fbbb5..caa04c56e25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -311,7 +311,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then - var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ . + var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude public/test/ . #fi set +e echo From 89f7781733f45ce45f35996299094a23cf87a941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 12:51:33 +0200 Subject: [PATCH 017/183] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index caa04c56e25..9897612f9bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -311,7 +311,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then - var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude public/test/ . + var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ . #fi set +e echo From e438bcb70a6f6be777ed61631a53638159b5b599 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Thu, 9 Jun 2022 13:35:50 +0200 Subject: [PATCH 018/183] FIX - php V8 order card --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cc35cfc65a9..3613f052e8d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; $usercancreateintervention = $user->hasRight('ficheinter', 'creer'); -$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'creer') || $user->hasRight('supplier_order', 'creer')); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php From 793e95d88c96c85df10d2a432136df55740e4943 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Thu, 9 Jun 2022 14:04:32 +0200 Subject: [PATCH 019/183] fixing bug (colspan should be int) --- htdocs/core/class/commonobject.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9dad6b49279..4d09b8ae769 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7410,7 +7410,7 @@ abstract class CommonObject $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); } - $colspan = ''; + $colspan = 0; if (is_array($params) && count($params) > 0 && $display_type=='card') { if (array_key_exists('cols', $params)) { $colspan = $params['cols']; @@ -7423,6 +7423,7 @@ abstract class CommonObject } } } + $colspan = intval($colspan); switch ($mode) { case "view": @@ -7468,7 +7469,7 @@ abstract class CommonObject } } - $out .= $extrafields->showSeparator($key, $this, ($colspan + 1), $display_type); + $out .= $extrafields->showSeparator($key, $this, ($colspan ? $colspan + 1 : 2), $display_type); } else { $class = (!empty($extrafields->attributes[$this->table_element]['hidden'][$key]) ? 'hideobject ' : ''); $csstyle = ''; @@ -7489,7 +7490,7 @@ abstract class CommonObject $html_id = (empty($this->id) ? '' : 'extrarow-'.$this->element.'_'.$key.'_'.$this->id); if ($display_type=='card') { if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { - $colspan = '0'; + $colspan = 0; } if ($action == 'selectlines') { From fb9b3828ef56ffd5b1477063003931ef2256da37 Mon Sep 17 00:00:00 2001 From: Elisio Leonardo Date: Thu, 9 Jun 2022 14:51:37 +0200 Subject: [PATCH 020/183] Adding new language code for Portuguese Mozambique --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 820339e6875..349cb42fbab 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -93,6 +93,7 @@ Language_nl_BE=Dutch (Belgium) Language_nl_NL=Dutch Language_pl_PL=Polish Language_pt_AO=Portuguese (Angola) +Language_pt_MZ=Portuguese (Mozambique) Language_pt_BR=Portuguese (Brazil) Language_pt_PT=Portuguese Language_ro_MD=Romanian (Moldavia) From 429f9c027ec30ef6d8f2949a64ba11dfde7ee272 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:04:33 +0200 Subject: [PATCH 021/183] php V8 warning and little optimising code --- htdocs/core/tpl/card_presend.tpl.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 0c744e165d3..148def445bb 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Charlene Benke * * 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 @@ -58,11 +59,11 @@ if ($action == 'presend') { // Define output language $outputlangs = $langs; $newlang = ''; - if ($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 (GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); + } } if (!empty($newlang)) { From d335bb22a2340f3018bf6ef8fc6acf4832845c59 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:13:29 +0200 Subject: [PATCH 022/183] Update html.formmail.class.php --- htdocs/core/class/html.formmail.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..c99bad2bf72 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -395,7 +395,7 @@ class FormMail extends Form // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -584,7 +584,10 @@ class FormMail extends Form } // Add also company main email - $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) { + $liste['company'] = !empty($conf->global->MAIN_INFO_SOCIETE_NOM)?$conf->global->MAIN_INFO_SOCIETE_NOM:$conf->global->MAIN_INFO_SOCIETE_MAIL; + $liste['company'].=' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + } // Add also email aliases if there is some $listaliases = array( @@ -1540,7 +1543,7 @@ class FormMail extends Form $extrafields->fetch_name_optionals_label($product->table_element, true); - if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { + if (!empty($extrafields->attributes[$product->table_element]['label']) && is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) { $substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key]; } From 39d29d4cf3306cadb515c62ee62a617c104acf2a Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:20:00 +0200 Subject: [PATCH 023/183] Update card_presend.tpl.php --- htdocs/core/tpl/card_presend.tpl.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 148def445bb..025692d6199 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -213,7 +213,14 @@ if ($action == 'presend') { $formmail->setSubstitFromObject($object, $langs); } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); - $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; + $substitutionarray['__CHECK_READ__'] = ""; + if (is_object($object) && is_object($object->thirdparty)) { + $checkRead= 'global->MAILING_EMAIL_UNSUBSCRIBE_KEY)?urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY):""); + $checkRead.='" width="1" height="1" style="width:1px;height:1px" border="0"/>'; + $substitutionarray['__CHECK_READ__'] = $checkRead; + } $substitutionarray['__PERSONALIZED__'] = ''; // deprecated $substitutionarray['__CONTACTCIVNAME__'] = ''; $parameters = array( From de88a39bb6168023ff07f6a4e9d994e1320937eb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 9 Jun 2022 13:25:44 +0000 Subject: [PATCH 024/183] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 025692d6199..7b47c4676a6 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -63,7 +63,7 @@ if ($action == 'presend') { $newlang = $object->thirdparty->default_lang; if (GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); - } + } } if (!empty($newlang)) { From 293141e57898a68cbb8fd453930bf0a31098b8cb Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Thu, 9 Jun 2022 15:52:47 +0200 Subject: [PATCH 025/183] checkbox PHP error --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c7651c81d26..9f34fa3a15f 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2066,7 +2066,7 @@ class ExtraFields } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { - $value_key = implode($value_arr, ','); + $value_key = implode(',', $value_arr); } else { $value_key = ''; } From d786e16d0c37c5fe75d83ddf0fa3c470a01f312c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Thu, 9 Jun 2022 16:10:02 +0200 Subject: [PATCH 026/183] =?UTF-8?q?don=E2=80=99t=20discard=20all=20menu=20?= =?UTF-8?q?pics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/theme/md/main_menu_fa_icons.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/md/main_menu_fa_icons.inc.php b/htdocs/theme/md/main_menu_fa_icons.inc.php index 34827384139..0e0b144d187 100644 --- a/htdocs/theme/md/main_menu_fa_icons.inc.php +++ b/htdocs/theme/md/main_menu_fa_icons.inc.php @@ -22,8 +22,8 @@ font-size: 1.5em; } -div.mainmenu { - background-image: none !important; +div.mainmenu.menu { + background-image: none; } div.mainmenu.menu::before { From 82d1cb468229597944beecc44a2d3c5b323915b5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Jun 2022 17:30:16 +0200 Subject: [PATCH 027/183] FIX #20527 Accountancy Unbalanced entry proposed when an employee are declared on social contribution --- htdocs/accountancy/journal/bankjournal.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index bdda4583d54..19a9ca63c07 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -288,8 +288,16 @@ if ($result) { // get_url may return -1 which is not traversable if (is_array($links) && count($links) > 0) { + $is_sc = false; + foreach ($links as $v) { + if ($v['type'] == 'sc') { + $is_sc = true; + break; + } + } // Now loop on each link of record in bank (code similar to bankentries_list.php) foreach ($links as $key => $val) { + if ($links[$key]['type'] == 'user' && !$is_sc) continue; if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { // So we excluded 'company' and 'user' here. We want only payment lines From 588046d825abffb0ff375c4524c7d312bf5d51a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 21:33:39 +0200 Subject: [PATCH 028/183] use isModEnabled function --- htdocs/core/menus/standard/auguria.lib.php | 16 +- htdocs/core/menus/standard/eldy.lib.php | 236 ++++++++++----------- 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index ea6d21fe457..adc4f8d487c 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -229,7 +229,7 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode) */ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget) { - global $langs; + global $langs, $conf; $classnameimg = str_replace('class="', 'class="tmenuimage ', $classname); $classnametxt = str_replace('class="', 'class="tmenulabel ', $classname); @@ -339,7 +339,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid ? 1 : 0), 'auguria', $tabMenu); // We update newmenu for special dynamic menus - if (!empty($conf->banque->enabled) && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account + if (isModEnabled('banque') && $user->rights->banque->lire && $mainmenu == 'bank') { // Entry for each bank account include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example $sql = "SELECT rowid, label, courant, rappro, courant"; @@ -371,7 +371,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $db->free($resql); } - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { // Entry in accountancy journal for each bank account $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy', 10); // Multi journal @@ -393,18 +393,18 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { $nature = "sells"; } if ($objp->nature == 3 - && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) + && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice')) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } - if ($objp->nature == 4 && !empty($conf->banque->enabled)) { + if ($objp->nature == 4 && isModEnabled('banque')) { $nature = "bank"; } - if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { $nature = "expensereports"; } if ($objp->nature == 1) { @@ -441,7 +441,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $db->free($resql); } - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP + if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP $MAXFTP = 20; $i = 1; while ($i <= $MAXFTP) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index d305da30907..42752c57bb3 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -94,7 +94,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => (!empty($conf->adherent->enabled)), + 'enabled' => (isModEnabled('adherent')), 'perms' => (!empty($user->rights->adherent->lire)), 'module' => 'adherent' ); @@ -119,10 +119,10 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Third parties $tmpentry = array( - 'enabled'=> ((!empty($conf->societe->enabled) && + 'enabled'=> ((isModEnabled('societe') && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) ) - || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + || ((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)), 'module'=>'societe|fournisseur' @@ -148,16 +148,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( - 'enabled'=> (!empty($conf->product->enabled) || !empty($conf->service->enabled) || !empty($conf->expedition->enabled)), + 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), 'perms'=> (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) || !empty($user->rights->expedition->lire)), 'module'=>'product|service' ); $menu_arr[] = array( 'name' => 'Products', 'link' => '/product/index.php?mainmenu=products&leftmenu=', - 'title' => (!empty($conf->product->enabled) && !empty($conf->service->enabled)) + 'title' => (isModEnabled('product') && isModEnabled('service')) ? (array("TMenuProducts", " | ", "TMenuServices")) - : (!empty($conf->product->enabled) ? "TMenuProducts" : "TMenuServices"), + : (isModEnabled('product') ? "TMenuProducts" : "TMenuServices"), 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, @@ -175,7 +175,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // MRP - GPAO $tmpentry = array( - 'enabled'=>(!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)), + 'enabled'=>(isModEnabled('bom') || isModEnabled('mrp')), 'perms'=>(!empty($user->rights->bom->read) || !empty($user->rights->mrp->read)), 'module'=>'bom|mrp' ); @@ -200,7 +200,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( - 'enabled'=> (!empty($conf->projet->enabled) ? 1 : 0), + 'enabled'=> (isModEnabled('projet') ? 1 : 0), 'perms'=> (!empty($user->rights->projet->lire) ? 1 : 0), 'module'=>'projet' ); @@ -225,13 +225,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter) $tmpentry = array( - 'enabled'=>(!empty($conf->propal->enabled) - || !empty($conf->commande->enabled) - || !empty($conf->fournisseur->enabled) - || !empty($conf->supplier_proposal->enabled) - || !empty($conf->supplier_order->enabled) - || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) + 'enabled'=>(isModEnabled('propal') + || isModEnabled('commande') + || isModEnabled('fournisseur') + || isModEnabled('supplier_proposal') + || isModEnabled('supplier_order') + || isModEnabled('contrat') + || isModEnabled('ficheinter') ) ? 1 : 0, 'perms'=>(!empty($user->rights->propal->lire) || !empty($user->rights->commande->lire) @@ -274,13 +274,13 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Billing - Financial $tmpentry = array( - 'enabled'=>(!empty($conf->facture->enabled) || - !empty($conf->don->enabled) || - !empty($conf->tax->enabled) || - !empty($conf->salaries->enabled) || - !empty($conf->supplier_invoice->enabled) || - !empty($conf->loan->enabled) || - !empty($conf->margins->enabled) + 'enabled'=>(isModEnabled('facture') || + isModEnabled('don') || + isModEnabled('tax') || + isModEnabled('salaries') || + isModEnabled('supplier_invoice') || + 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) @@ -308,7 +308,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( - 'enabled'=>(!empty($conf->banque->enabled) || !empty($conf->prelevement->enabled)), + 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), 'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)), 'module'=>'banque|prelevement|paymentbybanktransfer' ); @@ -333,7 +333,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( - 'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)), + '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)), 'module'=>'comptabilite|accounting|asset|intracommreport' ); @@ -358,7 +358,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( - 'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)), + '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)), 'module'=>'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -384,12 +384,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knowledge base $tmpentry = array( - 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), + 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), 'module'=>'ticket|knowledgemanagement' ); $link = ''; - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; @@ -827,7 +827,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, (empty($user->socid) ? 0 : 1), 'eldy', $tabMenu); //var_dump($newmenu->liste); // - if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') { // Entry for FTP + if (isModEnabled('ftp') && $mainmenu == 'ftp') { // Entry for FTP $MAXFTP = 20; $i = 1; while ($i <= $MAXFTP) { @@ -1141,7 +1141,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"), 1); $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('ExternalResources'), 1); - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { + if (isModEnabled('product') || isModEnabled('service')) { $langs->load("products"); $newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); } @@ -1151,16 +1151,16 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($user->rights->user->user->lire) { if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); + $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->rights->user->user->creer || $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); - if (!empty($conf->categorie->enabled)) { + 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("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $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->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $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) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); + $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("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $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)); } } } @@ -1182,7 +1182,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le if ($mainmenu == 'companies') { // Societes - if (!empty($conf->societe->enabled)) { + 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"')); @@ -1197,7 +1197,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le $newmenu->add("/societe/list.php?leftmenu=thirdparties", $langs->trans("List"), 1); // Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_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'); /* no more required, there is a filter that can do more @@ -1211,7 +1211,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Customers/Prospects - if (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { + 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'); @@ -1219,14 +1219,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Suppliers - if (!empty($conf->societe->enabled) && (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->supplier_proposal->enabled))) { + 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)); } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { // Categories prospects/customers @@ -1240,7 +1240,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } // Categories suppliers - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + 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); } } @@ -1256,14 +1256,14 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le 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); } - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + 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=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); // Categories - if (!empty($conf->categorie->enabled)) { + 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'); @@ -1289,7 +1289,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left $langs->load("companies"); // Customer proposal - if (!empty($conf->propal->enabled)) { + 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); @@ -1306,7 +1306,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Customers orders - if (!empty($conf->commande->enabled)) { + 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); @@ -1314,7 +1314,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left 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); - if (!empty($conf->expedition->enabled)) { + 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=3", $langs->trans("StatusOrderDelivered"), 2, $user->rights->commande->lire); @@ -1325,7 +1325,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Supplier proposal - if (!empty($conf->supplier_proposal->enabled)) { + 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); @@ -1334,7 +1334,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Suppliers orders - if (!empty($conf->supplier_order->enabled)) { + 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); @@ -1359,7 +1359,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Contrat - if (!empty($conf->contrat->enabled)) { + 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); @@ -1374,7 +1374,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Interventions - if (!empty($conf->ficheinter->enabled)) { + 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); @@ -1405,7 +1405,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $langs->load("companies"); // Customers invoices - if (!empty($conf->facture->enabled)) { + 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); @@ -1432,7 +1432,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Suppliers invoices - if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { + 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'); @@ -1456,16 +1456,16 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Orders - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $langs->load("orders"); - if (!empty($conf->facture->enabled)) { + 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"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); } // Supplier Orders to bill - if (!empty($conf->supplier_invoice->enabled)) { + 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"')); @@ -1475,7 +1475,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen // Donations - if (!empty($conf->don->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") { @@ -1486,7 +1486,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Taxes and social contributions - if (!empty($conf->tax->enabled)) { + 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/sociales/list.php?leftmenu=tax_social", $langs->trans("MenuSocialContributions"), 1, $user->rights->tax->charges->lire); @@ -1535,7 +1535,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Salaries - if (!empty($conf->salaries->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { @@ -1547,7 +1547,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Loan - if (!empty($conf->loan->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { @@ -1557,7 +1557,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Various payment - if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_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"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { @@ -1587,8 +1587,8 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $langs->load("companies"); // Accounting (Double entries) - if (!empty($conf->accounting->enabled)) { - //$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); + if (isModEnabled('accounting')) { + //$permtoshowmenu = (isModEnabled('accounting') || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Configuration @@ -1608,16 +1608,16 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $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); - if (!empty($conf->banque->enabled)) { + 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); } - if (!empty($conf->facture->enabled) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + 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); } - if (!empty($conf->tax->enabled)) { + 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); } - if (!empty($conf->expensereport->enabled)) { + 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("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 110); @@ -1632,21 +1632,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Binding // $newmenu->add("", $langs->trans("Binding"), 0, $user->rights->accounting->bind->write, '', $mainmenu, 'dispatch'); - if (!empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + 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'); 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); } } - if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { + 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'); 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); } } - if (!empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + 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'); 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); @@ -1655,7 +1655,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Journals - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', '', ''); // Multi journal @@ -1677,21 +1677,21 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { + if ($objp->nature == 2 && isModEnabled('facture') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { $nature = "sells"; } if ($objp->nature == 3 - && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) + && ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_invoice')) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { $nature = "purchases"; } - if ($objp->nature == 4 && !empty($conf->banque->enabled)) { + if ($objp->nature == 4 && isModEnabled('banque')) { $nature = "bank"; } - if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { + if ($objp->nature == 5 && isModEnabled('expensereport') && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { $nature = "expensereports"; } - if ($objp->nature == 1 && !empty($conf->asset->enabled)) { + if ($objp->nature == 1 && isModEnabled('asset')) { $nature = "various"; // Warning: The page /accountancy/journal/variousjournal.php is bugged. It read tables that does not exists. } if ($objp->nature == 8) { @@ -1756,7 +1756,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED } if ($modecompta) { @@ -1770,7 +1770,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - //if (! empty($conf->accounting->enabled) && ! 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); @@ -1782,10 +1782,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'CREANCES-DETTES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPING'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + 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); @@ -1794,10 +1794,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. } - if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { + 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); @@ -1806,7 +1806,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Accountancy (simple) - if (!empty($conf->comptabilite->enabled)) { + 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'); @@ -1825,7 +1825,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef /* $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); - if (! empty($conf->propal->enabled)) { + 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); } @@ -1864,7 +1864,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || preg_match('/intracommreport/', $leftmenu)) { // DEB / DES @@ -1874,7 +1874,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } // Assets - if (!empty($conf->asset->enabled)) { + 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); @@ -1906,7 +1906,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); // Bank-Cash account - if (!empty($conf->banque->enabled)) { + 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/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->rights->banque->configurer); @@ -1917,14 +1917,14 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->rights->banque->transfer); } - if (!empty($conf->categorie->enabled)) { + 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'); } // Direct debit order - if (!empty($conf->prelevement->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") { @@ -1938,7 +1938,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Bank transfer order - if (!empty($conf->paymentbybanktransfer->enabled)) { + 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"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { @@ -1952,7 +1952,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Management of checks - if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))) { + 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"')); 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); @@ -1961,7 +1961,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Cash Control - if (!empty($conf->takepos->enabled) || !empty($conf->cashdesk->enabled)) { + if (isModEnabled('takepos') || isModEnabled('cashdesk')) { $permtomakecashfence = ($user->hasRight('cashdesk', 'run')|| $user->hasRight('takepos', 'run')); $newmenu->add("/compta/cashcontrol/cashcontrol_list.php?action=list", $langs->trans("POS"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="pictofixedwidth"')); $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); @@ -1986,27 +1986,27 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if ($mainmenu == 'products') { // Products - if (!empty($conf->product->enabled)) { + 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); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } - if (!empty($conf->productbatch->enabled)) { + 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/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } - if (!empty($conf->variants->enabled)) { + if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire); } - if (!empty($conf->propal->enabled) || (!empty($conf->commande->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + 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 && $user->rights->propale->lire); } // Categories - if (!empty($conf->categorie->enabled)) { + 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); @@ -2014,15 +2014,15 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Services - if (!empty($conf->service->enabled)) { + 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); - if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_oder->enabled) || !empty($conf->supplier_invoice->enabled)) { + 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 || $user->rights->product->lire); } // Categories - if (!empty($conf->categorie->enabled)) { + 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); @@ -2056,7 +2056,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Inventory - if (!empty($conf->stock->enabled)) { + 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"')); @@ -2074,7 +2074,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Shipments - if (!empty($conf->expedition->enabled)) { + 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); @@ -2088,7 +2088,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Receptions - if (!empty($conf->reception->enabled)) { + 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); @@ -2123,7 +2123,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($mainmenu == 'mrp') { // BOM - if (!empty($conf->bom->enabled) || !empty($conf->mrp->enabled)) { + 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="paddingrightonly pictofixedwidth"')); @@ -2131,7 +2131,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom'); } - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $langs->load("mrp"); $newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo', 0, '', '', '', img_picto('', 'mrp', 'class="paddingrightonly pictofixedwidth"')); @@ -2156,13 +2156,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme global $user, $conf, $langs; if ($mainmenu == 'project') { - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { $langs->load("projects"); $search_project_user = GETPOST('search_project_user', 'int'); $tmpentry = array( - 'enabled'=>(!empty($conf->projet->enabled)), + 'enabled'=>(isModEnabled('projet')), 'perms'=>(!empty($user->rights->projet->lire)), 'module'=>'projet' ); @@ -2197,7 +2197,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); // Categories - if (!empty($conf->categorie->enabled)) { + 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'); } @@ -2231,7 +2231,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if ($mainmenu == 'hrm') { // HRM module - if (!empty($conf->hrm->enabled)) { + 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="pictofixedwidth"')); @@ -2263,7 +2263,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Leave/Holiday/Vacation module - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { // Load translation files required by the page $langs->loadLangs(array("holiday", "trips")); @@ -2283,7 +2283,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Trips and expenses (old module) - if (!empty($conf->deplacement->enabled)) { + 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="pictofixedwidth"')); $newmenu->add("/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->deplacement->creer); @@ -2292,7 +2292,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Expense report - if (!empty($conf->expensereport->enabled)) { + 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="pictofixedwidth"')); $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); @@ -2309,7 +2309,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); } - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { if (empty($conf->global->PROJECT_HIDE_TASKS)) { $langs->load("projects"); @@ -2342,20 +2342,20 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu $newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); } - if (!empty($conf->mailing->enabled)) { + 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); } - if (!empty($conf->export->enabled)) { + 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); } - if (!empty($conf->import->enabled)) { + 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); @@ -2378,7 +2378,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen global $user, $conf, $langs; if ($mainmenu == 'members') { - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { // Load translation files required by the page $langs->loadLangs(array("members", "compta")); @@ -2398,7 +2398,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/htpasswd.php?leftmenu=export", $langs->trans("Filehtpasswd"), 1, $user->rights->adherent->export); } - if (!empty($conf->categorie->enabled)) { + 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'); } @@ -2409,7 +2409,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); //$newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Tools"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - //if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + //if (isModEnabled('export') && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->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"')); From e42cf5f3e8fc162a1b8d76e7ae7459d8e505aef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 21:51:48 +0200 Subject: [PATCH 029/183] use isModEnabled function --- htdocs/main.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 0093db5331c..48f61c5cf0f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -376,7 +376,7 @@ if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { register_shutdown_function('dol_shutdown'); // Load debugbar -if (!empty($conf->debugbar->enabled) && !GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) { +if (isModEnabled('debugbar') && !GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) { global $debugbar; include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php'; $debugbar = new DolibarrDebugBar(); @@ -1752,7 +1752,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (!$disablejs && !empty($conf->use_javascript_ajax)) { // CKEditor - if (empty($disableforlogin) && (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { + if (empty($disableforlogin) && (isModEnabled('fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { print ''."\n"; $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/'; $jsckeditor = 'ckeditor.js'; @@ -1780,7 +1780,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr // Browser notifications (if NOREQUIREMENU is on, it is mostly a page for popup, so we do not enable notif too. We hide also for public pages). if (!defined('NOBROWSERNOTIF') && !defined('NOREQUIREMENU') && !defined('NOLOGIN')) { $enablebrowsernotif = false; - if (!empty($conf->agenda->enabled) && !empty($conf->global->AGENDA_REMINDER_BROWSER)) { + if (isModEnabled('agenda') && !empty($conf->global->AGENDA_REMINDER_BROWSER)) { $enablebrowsernotif = true; } if ($conf->browser->layout == 'phone') { @@ -1959,7 +1959,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } // Link to module builder - if (!empty($conf->modulebuilder->enabled)) { + if (isModEnabled('modulebuilder')) { $text = ''; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); $text .= ''; From 3fe46c8028fb4486604c09f57a6f5edf64107421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:10:51 +0200 Subject: [PATCH 030/183] use isModEnabled function --- htdocs/core/lib/admin.lib.php | 8 ++++---- htdocs/core/lib/agenda.lib.php | 8 ++++---- htdocs/core/lib/company.lib.php | 24 ++++++++++++------------ htdocs/core/lib/fichinter.lib.php | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 8682939f267..cf327158f5f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1665,7 +1665,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print 'mymailmanlist
'; print 'mymailmanlist1,mymailmanlist2
'; print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2
'; - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2
'; } print ''; @@ -1697,7 +1697,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print "\n"; } elseif ($obj->type == 'html') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); } elseif ($obj->type == 'yesno') { print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, 1); @@ -1944,14 +1944,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6feee8c35d5..0f7334345fa 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -92,7 +92,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'minwidth100 maxwidth500 widthcentpercentminusxx'); print ''; - if (!empty($conf->resource->enabled)) { + if (isModEnabled('resource')) { include_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; $formresource = new FormResource($db); @@ -104,14 +104,14 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh } } - if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { + if (isModEnabled('societe') && !empty($user->rights->societe->lire)) { print '
'; print img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth inline-block"'); print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); print '
'; } - if (!empty($conf->projet->enabled) && !empty($user->rights->projet->lire)) { + if (isModEnabled('projet') && !empty($user->rights->projet->lire)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); @@ -423,7 +423,7 @@ function actions_prepare_head($object) $h++; // Tab to link resources - if ($conf->resource->enabled) { + if (isModEnabled('resource')) { include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $resource = new DolResource($db); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4938d20c3c4..37d206f0361 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 ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $supplier_module_enabled = 1; } if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { @@ -171,7 +171,7 @@ function societe_prepare_head(Societe $object) } // Tab to link resources - if (!empty($conf->resource->enabled) && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) { + if (isModEnabled('resource') && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) { $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); $head[$h][2] = 'resources'; @@ -179,7 +179,7 @@ function societe_prepare_head(Societe $object) } // Related items - if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) + if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->global->THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); @@ -195,7 +195,7 @@ function societe_prepare_head(Societe $object) $title = $langs->trans("PaymentModes"); - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { //$langs->load("stripe"); //$title = $langs->trans("BankAccountsAndGateways"); @@ -215,7 +215,7 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n"; $sql .= " WHERE n.fk_soc = ".((int) $object->id); - if (empty($conf->stripe->enabled)) { + if (!isModEnabled('stripe')) { $sql .= " AND n.stripe_card_ref IS NULL"; } else { $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))"; @@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object) dol_print_error($db); } - //if (! empty($conf->stripe->enabled) && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number + //if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number $head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode($object->id); $head[$h][1] = $title; @@ -242,7 +242,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (!empty($conf->website->enabled) && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) { + if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) { $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode($object->id); $head[$h][1] = $langs->trans("WebSiteAccounts"); $nbNote = 0; @@ -285,7 +285,7 @@ function societe_prepare_head(Societe $object) if ($user->socid == 0) { // Notifications - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $nbNotif = 0; // Enable caching of thirdparty count notifications require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -361,7 +361,7 @@ function societe_prepare_head(Societe $object) $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; $head[$h][1] = $langs->trans("Events"); - 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))) { $nbEvent = 0; // Enable caching of thirdrparty count actioncomm require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -1283,7 +1283,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') print ''; // Add to agenda - if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (isModEnabled('agenda')&& $user->rights->agenda->myactions->create) { print '
'; print img_object($langs->trans("Event"), "action"); print '   '; @@ -1665,7 +1665,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } - if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { + if (isModEnabled('agenda')|| (isModEnabled('mailing') && !empty($objcon->email))) { $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -2097,7 +2097,7 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) { global $conf, $langs, $db; // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. - if (!empty($conf->mailing->enabled) && !empty($objcon->email) + if (isModEnabled('mailing') && !empty($objcon->email) && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) { $langs->load("mails"); diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index fec64f931dc..6bfb7f717de 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -64,7 +64,7 @@ function fichinter_prepare_head($object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention'); // Tab to link resources - if ($conf->resource->enabled) { + if (isModEnabled('resource')) { require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $objectres = new Dolresource($db); $linked_resources = $objectres->getElementResources('fichinter', $object->id); From 400afc937f6da59032ae6b4d681e2f5416da7795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:16:48 +0200 Subject: [PATCH 031/183] use isModEnabled function --- htdocs/adherents/agenda.php | 4 ++-- htdocs/admin/dict.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/asset/agenda.php | 4 ++-- htdocs/asset/model/agenda.php | 4 ++-- htdocs/bom/bom_agenda.php | 4 ++-- htdocs/comm/card.php | 2 +- htdocs/comm/prospect/index.php | 2 +- htdocs/contact/agenda.php | 4 ++-- htdocs/contrat/agenda.php | 4 ++-- htdocs/core/class/html.formactions.class.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/contract.lib.php | 2 +- htdocs/core/lib/fourn.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/member.lib.php | 4 ++-- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/project.lib.php | 2 +- htdocs/core/lib/resource.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 6 +++--- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/modules/modCategorie.class.php | 2 +- .../modules/project/doc/doc_generic_project_odt.modules.php | 2 +- .../project/task/doc/doc_generic_task_odt.modules.php | 2 +- htdocs/fourn/card.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 4 ++-- htdocs/hrm/job_agenda.php | 4 ++-- htdocs/hrm/position_agenda.php | 4 ++-- htdocs/hrm/skill_agenda.php | 4 ++-- htdocs/index.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 4 ++-- htdocs/modulebuilder/template/myobject_agenda.php | 4 ++-- htdocs/mrp/mo_agenda.php | 4 ++-- htdocs/partnership/partnership_agenda.php | 4 ++-- htdocs/product/agenda.php | 4 ++-- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 4 ++-- htdocs/projet/element.php | 2 +- htdocs/projet/info.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 4 ++-- htdocs/recruitment/recruitmentjobposition_agenda.php | 4 ++-- htdocs/resource/agenda.php | 2 +- htdocs/societe/agenda.php | 4 ++-- htdocs/user/card.php | 6 +++--- htdocs/user/param_ihm.php | 2 +- 46 files changed, 70 insertions(+), 70 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 0a6abcd4955..5aeb3a281cf 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -162,11 +162,11 @@ if ($object->id > 0) { $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).($object->id > 0 ? '?id='.$object->id : '').'&origin=member&originid='.$id); } - 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))) { print '
'; $param = '&id='.$id; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 796e64223c4..e493cc02abe 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -488,7 +488,7 @@ $tabcond[2] = true; $tabcond[3] = true; $tabcond[4] = true; $tabcond[5] = (!empty($conf->societe->enabled) || !empty($conf->adherent->enabled)); -$tabcond[6] = !empty($conf->agenda->enabled); +$tabcond[6] = isModEnabled('agenda'); $tabcond[7] = !empty($conf->tax->enabled); $tabcond[8] = !empty($conf->societe->enabled); $tabcond[9] = true; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index abc434ed58f..3e7841befa7 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -226,7 +226,7 @@ if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { $elementList['expensereport_send'] = img_picto('', 'trip', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTExpenseReport')); } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); } if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 49a0c215701..3d40cf62328 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -179,7 +179,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 { @@ -189,7 +189,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/asset/model/agenda.php b/htdocs/asset/model/agenda.php index a915f540ce9..f1db3030dc2 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -181,7 +181,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 { @@ -191,7 +191,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/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 4bc9095a57e..bce63ed0625 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -220,7 +220,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 { @@ -230,7 +230,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/comm/card.php b/htdocs/comm/card.php index d0cb4d7be2f..4defa77f428 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1597,7 +1597,7 @@ if ($object->id > 0) { } // Add action - if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { + if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { if ($user->rights->agenda->myactions->create) { print ''; } else { diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 0bcf2662a44..e63aee6f240 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -169,7 +169,7 @@ print '
'; /* * Actions commerciales a faire */ -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { show_array_actions_to_do(10); } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 98b6ccea3b1..5f07922b2e4 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -252,7 +252,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $out = ''; $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') { @@ -267,7 +267,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - 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))) { print '
'; $param = '&id='.$id; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index d654ac38d9f..70761162153 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -243,7 +243,7 @@ if ($id > 0) { $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { $backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage); @@ -251,7 +251,7 @@ if ($id > 0) { } } - 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))) { print '
'; $param = '&id='.$id; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index fac32e62e5e..6ed0d623c40 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -226,7 +226,7 @@ class FormActions } $newcardbutton = ''; - if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { + if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) { $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 37d206f0361..896921ac436 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1410,7 +1410,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { // Recherche histo sur actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 5a0c6c376fb..60c53ee7abc 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -133,7 +133,7 @@ function contact_prepare_head(Contact $object) // Agenda / Events $head[$tab][0] = DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id; $head[$tab][1] = $langs->trans("Events"); - 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))) { $head[$tab][1] .= '/'; $head[$tab][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 885ddec7255..2d627532010 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -89,7 +89,7 @@ function contract_prepare_head(Contrat $object) $head[$h][0] = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id; $head[$h][1] .= $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 683b4b49912..2fd4ce3799a 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -223,7 +223,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/info.php?id='.$object->id; $head[$h][1] .= $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index be1ef43b47d..1aeeac416b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3352,7 +3352,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) - if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $type = 'AC_TEL'; $link = ''; if ($addlink == 'AC_FAX') { diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index ed3b69752f1..677d8cfdaef 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -112,10 +112,10 @@ function member_prepare_head(Adherent $object) $h++; // Show agenda tab - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id; $head[$h][1] = $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 117871b4712..12e1128ddfc 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -201,7 +201,7 @@ function product_prepare_head($object) // Log $head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 56aa24a8523..7f1b56bc8eb 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -312,7 +312,7 @@ function project_prepare_head(Project $project, $moreparam = '') $head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id; $head[$h][1] = $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index 29cd8a5b089..f222857b9d8 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -87,7 +87,7 @@ function resource_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 5b220553bfe..e1544e763df 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -126,7 +126,7 @@ function ticket_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; } $head[$h][1] = $langs->trans('Events'); - 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))) { $head[$h][1] .= '/'; $head[$h][1] .= $langs->trans("Agenda"); } @@ -304,7 +304,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } $sortfield_new = implode(',', $sortfield_new_list); - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { // Search histo on actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; @@ -565,7 +565,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning'); } - if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { + if (isModEnabled('agenda') || (!empty($conf->mailing->enabled) && !empty($objcon->email))) { $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index dac412f92a6..25945c4e83d 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -72,7 +72,7 @@ function user_prepare_head(User $object) $head[$h][2] = 'guisetup'; $h++; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (empty($conf->global->AGENDA_EXT_NB)) { $conf->global->AGENDA_EXT_NB = 5; } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 9e138c6ccef..c9a28863c97 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -157,7 +157,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->stock->enabled)) { $typeexample .= ($typeexample ? " / " : "")."9=Warehouse"; } - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $typeexample .= ($typeexample ? " / " : "")."10=Agenda event"; } if (!empty($conf->website->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 69a7a3f6232..35979503d15 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 @@ -64,7 +64,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->deplacement->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } 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 fc83ab505d2..d439ae32ce5 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 @@ -65,7 +65,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->deplacement->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 8ad44d198a8..2d649589282 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -881,7 +881,7 @@ if ($object->id > 0) { } // Add action - if (!empty($conf->agenda->enabled) && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { + if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) { if ($user->rights->agenda->myactions->create) { print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id, ''); } else { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 6c64672ee84..728986f5a88 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -201,7 +201,7 @@ if ($permok) { 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 { diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 87a09043a62..8d2d234dd43 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -198,7 +198,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 { @@ -208,7 +208,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/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 0d966e67416..b8008f009ea 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -189,14 +189,14 @@ if ($object->id > 0) { } - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } - 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/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index fda60a29259..24f2d9e32ef 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -197,7 +197,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 { @@ -207,7 +207,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/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index d73271a4f26..e1947741bde 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -191,7 +191,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 { @@ -201,7 +201,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/index.php b/htdocs/index.php index 5593eaffacf..d9bab584948 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -156,7 +156,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php'; // Number of actions to do (late) - if (!empty($conf->agenda->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) { + if (isModEnabled('agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->rights->agenda->myactions->read) { include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $board = new ActionComm($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 81750e720c7..003faa326d5 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -218,7 +218,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 { @@ -228,7 +228,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/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index b40092f93a7..164af332ed8 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -279,7 +279,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 { @@ -289,7 +289,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/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index e1b19d87ad0..3317ddcfd43 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -218,7 +218,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 { @@ -228,7 +228,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/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 4c68a83d4e2..9930093e6be 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -218,7 +218,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 { @@ -228,7 +228,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/product/agenda.php b/htdocs/product/agenda.php index b595bd3b9cb..8ec76640871 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -187,7 +187,7 @@ if ($id > 0 || $ref) { $out = ''; $morehtmlcenter = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { $permok = $user->rights->agenda->myactions->create; if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) { if (get_class($objproduct) == 'Product') { @@ -200,7 +200,7 @@ if ($id > 0 || $ref) { $morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus); } - 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))) { print '
'; $param = '&id='.$id; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index ccbdf12e712..f9b992e2bde 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -214,7 +214,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 { @@ -224,7 +224,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); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index caad4374da0..5d463d6a186 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -73,7 +73,7 @@ if (!empty($conf->deplacement->enabled)) { if (!empty($conf->expensereport->enabled)) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } if (!empty($conf->don->enabled)) { diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 9b0544bccf6..19897bf2859 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -167,7 +167,7 @@ if ($permok) { //print '
'; $morehtmlcenter = ''; -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); } diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 74a48994f71..54ac648d1d0 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -218,7 +218,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 { @@ -228,7 +228,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/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 45c84005743..1391ddb132d 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -217,7 +217,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 { @@ -227,7 +227,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/resource/agenda.php b/htdocs/resource/agenda.php index 363f334a7eb..cb13ce78e7d 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -164,7 +164,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); - 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/societe/agenda.php b/htdocs/societe/agenda.php index bebe542a6f9..89b69bda83c 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -157,13 +157,13 @@ if ($socid > 0) { } $newcardbutton = ''; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } - 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))) { print '
'; $param = '&socid='.urlencode($socid); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index f0b362b383e..254a3ea9e75 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1154,7 +1154,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // User color - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { print ''.$langs->trans("ColorUser").''; print ''; print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset'); @@ -1605,7 +1605,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; // Color user - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { print ''; print ''; print '\n"; // Ask for payment bank during supplier order /* Kept as hidden for the moment -if ($conf->banque->enabled) -{ +if (isModEnabled('banque')) { print ''; print ''; print ''; print ''; // Shipping Method - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { print ''; print ''; - if ($conf->paymentbybanktransfer->enabled) { + if (isModEnabled('paymentbybanktransfer')) { print ''; print ''; - if ($conf->prelevement->enabled) { + if (isModEnabled('prelevement')) { print ''; print ''; print ''; } // TODO ICS is not used with bank transfer ! - if ($conf->paymentbybanktransfer->enabled) { + if (isModEnabled('paymentbybanktransfer')) { print ''; print ''; print ''; @@ -1083,12 +1083,12 @@ if ($action == 'create') { print ''; print ''; - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { print ''; print ''; } - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (!empty(isModEnabled('paymentbybanktransfer'))) { print ''; print ''; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 1f3ccf70f3a..530457f45fa 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -486,7 +486,7 @@ $morefilter = ''; $moreforfilter = ''; // If the user can view categories of products -if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && ($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/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index fb4461f94e3..2cf87aaf550 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -132,7 +132,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $result = $object->create($user); if ($result > 0) { // Creation OK - if ($conf->categorie->enabled && method_exists($object, 'setCategories')) { + if (isModEnabled('categorie') && method_exists($object, 'setCategories')) { $categories = GETPOST('categories', 'array:int'); $object->setCategories($categories); } @@ -239,7 +239,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 31a48f38cf4..957026c2180 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -433,7 +433,7 @@ class FormTicket } // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 0109847c59a..8860f4126c4 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -60,7 +60,7 @@ function commande_prepare_head(Commande $object) $h++; } - if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) + if ((isModEnabled('expedition_bon') && $user->rights->expedition->lire) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)) { $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0; diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0d14811ef67..0d5991bb0ac 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -299,7 +299,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
"; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 67cb2c659ee..da6c0f8ee04 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -282,7 +282,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 742585ffb16..739e6f81036 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -257,7 +257,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 6d42d881ab8..958d1ab897d 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -382,7 +382,7 @@ if ($projectid > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index c60c0418d43..b02edfc4a34 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -327,7 +327,7 @@ if (!empty($withproject)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 878b1baf992..972e546255f 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -32,7 +32,7 @@ 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'; -if ($conf->categorie->enabled) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -510,7 +510,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 6e2bee75e6e..9d76d46cc97 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -40,7 +40,7 @@ if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if ($conf->contrat->enabled) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; } @@ -928,7 +928,7 @@ if ($action == 'create') { } // Contract - if ($conf->contrat->enabled) { + if (isModEnabled('contrat')) { $langs->load("contracts"); print '"; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 37ab6194da5..e6f560d7a42 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -224,15 +224,15 @@ class Loan extends CommonObject $this->error = "ErrorBadParameter"; return -2; } - if (($conf->accounting->enabled) && empty($this->account_capital)) { + if (isModEnabled('accounting') && empty($this->account_capital)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyCapitalCode")); return -2; } - if (($conf->accounting->enabled) && empty($this->account_insurance)) { + if (isModEnabled('accounting') && empty($this->account_insurance)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInsuranceCode")); return -2; } - if (($conf->accounting->enabled) && empty($this->account_interest)) { + if (isModEnabled('accounting') && empty($this->account_interest)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInterestCode")); return -2; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3b8b19a335c..1f63b5071bb 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2127,7 +2127,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Tags-Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 8d9188f1965..b77997fcfc7 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -206,7 +206,7 @@ if ($result || !($id > 0)) { print ''; // Tag - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; @@ -919,7 +919,7 @@ if ($action == 'create') { } // Tags-Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 4f7cb3ce7a0..65cf89c89da 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1001,7 +1001,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Tags-Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 3bea4b5db03..997f45a39d0 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -167,7 +167,7 @@ print nl2br($object->description); print ''; // Categories -if ($conf->categorie->enabled) { +if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 3230c325039..be130572704 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if ($conf->categorie->enabled) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -421,7 +421,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5d463d6a186..b8fe8572eb6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -343,7 +343,7 @@ print nl2br($object->description); print ''; // Categories -if ($conf->categorie->enabled) { +if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index c0dd96537a6..dda13754d31 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -216,7 +216,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index c08880e44ea..410b637f3e6 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -648,7 +648,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index e2686ded9f2..82628d5136b 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -258,7 +258,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 327d8783256..9718a0ffccb 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -289,7 +289,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 0e520989d8c..bd696e90434 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -245,7 +245,7 @@ if ($object->id > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 652b195afd4..206a92afb36 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -235,7 +235,7 @@ if ($object->id > 0) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 9fce4072183..5b0f097d22f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -333,7 +333,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 3718fe55e27..41545b96d34 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -868,7 +868,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 5f997a37e9c..bd4aacc3931 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -199,13 +199,13 @@ if ($object->fournisseur) { $obj = $db->fetch_object($resql); $nbCmdsFourn = $obj->nb; $thirdTypeArray['supplier'] = $langs->trans("supplier"); - if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { + if ((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); } - if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { + if ((isModEnabled('fournisseur') && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); } - if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) { + if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals'); } } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index e2ac40f8770..90be0b25850 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -838,16 +838,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $obj = $db->fetch_object($resql); $nbFactsClient = $obj->nb; $thirdTypeArray['customer'] = $langs->trans("customer"); - if ($conf->propal->enabled && $user->rights->propal->lire) { + if (isModEnabled('propal') && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if ($conf->commande->enabled && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if ($conf->facture->enabled && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if ($conf->contrat->enabled && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index ce791613bcb..59ee7e52d06 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1121,7 +1121,7 @@ if ($action == 'create' || $action == 'presend') { print '
'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
'.$langs->trans("ColorUser").''; print $formother->showColor($object->color, ''); @@ -2544,7 +2544,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // User color - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { print '
'.$langs->trans("ColorUser").''; if ($caneditfield) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index f92afe53a4f..c2ea42e6c6a 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -204,7 +204,7 @@ if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) if (!empty($conf->adherent->enabled)) { $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea'; } -if (!empty($conf->agenda->enabled)) { +if (isModEnabled('agenda')) { $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda'; } if (!empty($conf->ticket->enabled)) { From 5dcfc2891341b7ba8b75c01895fe84bae3884fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:41:59 +0200 Subject: [PATCH 032/183] use isModEnabled function --- htdocs/admin/supplier_order.php | 5 ++--- htdocs/bom/bom_card.php | 2 +- htdocs/commande/card.php | 8 ++++---- htdocs/compta/bank/card.php | 10 +++++----- htdocs/contrat/services_list.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 4 ++-- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/lib/order.lib.php | 2 +- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorbooth_document.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 4 ++-- htdocs/fichinter/card.php | 4 ++-- .../knowledgerecord_card.php | 2 +- htdocs/loan/class/loan.class.php | 6 +++--- htdocs/product/card.php | 4 ++-- htdocs/product/stats/card.php | 18 +++++++++--------- htdocs/product/stock/card.php | 4 ++-- htdocs/product/stock/movement_list.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 4 ++-- htdocs/projet/element.php | 2 +- htdocs/projet/ganttview.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/consumption.php | 6 +++--- htdocs/societe/paymentmodes.php | 8 ++++---- htdocs/ticket/card.php | 2 +- 36 files changed, 66 insertions(+), 67 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 0da79845d14..75f2badfda5 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -464,8 +464,7 @@ print "
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; @@ -521,7 +520,7 @@ print '
'.$langs->trans("UseDispatchStatus").''; -if ($conf->reception->enabled) { +if (isModEnabled('reception')) { print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").''; } else { if ($conf->use_javascript_ajax) { diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index aee1f6ba0bf..2d425c690ed 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -638,7 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Create MO - if ($conf->mrp->enabled) { + if (isModEnabled('mrp')) { if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) { print ''.$langs->trans("CreateMO").''."\n"; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c0aae93dff9..9ec8bca22a4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1753,7 +1753,7 @@ if ($action == 'create' && $usercancreate) { } // Shipping Method - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { print '
'.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); @@ -2383,7 +2383,7 @@ if ($action == 'create' && $usercancreate) { print '
'; $editenable = $usercancreate; print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable); @@ -2758,11 +2758,11 @@ if ($action == 'create' && $usercancreate) { // Ship $numshipping = 0; - if (!empty($conf->expedition->enabled)) { + if (isModEnabled('expedition')) { $numshipping = $object->nb_expedition(); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { - if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { + if ((isModEnabled('expedition_bon') && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { if ($user->rights->expedition->creer) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); } else { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index ce373bbf5b5..c08cf54ab4e 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -541,7 +541,7 @@ if ($action == 'create') { print '
'.$langs->trans($bickey).'
'.$langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation").' '; print img_picto($langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp"), 'info'); @@ -778,14 +778,14 @@ if ($action == 'create') { } print '
'.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').''.$object->ics.'
'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').''.$object->ics_transfer.'
'.$langs->trans($bickey).'
'.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').'
'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Contract").''; $numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1, 1); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 0c7ed519042..e9c58bf31a4 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2632,7 +2632,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1); print "
'.$langs->trans("Categories").''; $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth400'); @@ -303,49 +303,49 @@ if ($result || !($id > 0)) { } } - if ($conf->propal->enabled) { + if (isModEnabled('propal')) { $graphfiles['propal'] = array('modulepart'=>'productstats_proposals', 'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsProposals") : $langs->transnoentitiesnoconv("NumberOfProposals"))); } - if ($conf->supplier_proposal->enabled) { + if (isModEnabled('supplier_proposal')) { $graphfiles['proposalssuppliers'] = array('modulepart'=>'productstats_proposalssuppliers', 'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals") : $langs->transnoentitiesnoconv("NumberOfSupplierProposals"))); } - if ($conf->order->enabled) { + if (isModEnabled('order')) { $graphfiles['orders'] = array('modulepart'=>'productstats_orders', 'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders") : $langs->transnoentitiesnoconv("NumberOfCustomerOrders"))); } - if ($conf->supplier_order->enabled) { + if (isModEnabled('supplier_order')) { $graphfiles['orderssuppliers'] = array('modulepart'=>'productstats_orderssuppliers', 'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders") : $langs->transnoentitiesnoconv("NumberOfSupplierOrders"))); } - if ($conf->facture->enabled) { + if (isModEnabled('facture')) { $graphfiles['invoices'] = array('modulepart'=>'productstats_invoices', 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices") : $langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))); } - if ($conf->supplier_invoice->enabled) { + if (isModEnabled('supplier_invoice')) { $graphfiles['invoicessuppliers'] = array('modulepart'=>'productstats_invoicessuppliers', 'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices") : $langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))); } - if ($conf->contrat->enabled) { + if (isModEnabled('contrat')) { $graphfiles['contracts'] = array('modulepart'=>'productstats_contracts', 'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsContracts") : $langs->transnoentitiesnoconv("NumberOfContracts"))); } - if ($conf->mrp->enabled) { + if (isModEnabled('mrp')) { $graphfiles['mrp'] = array('modulepart'=>'productstats_mrp', 'file' => $object->id.'/mos12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsMos") : $langs->transnoentitiesnoconv("NumberOfMos"))); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 252763ef43b..2b8ee3db6a4 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -545,7 +545,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); $c = new Categorie($db); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 2ad77fca49e..775e07d6118 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -903,7 +903,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -1170,7 +1170,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'; From 0b8179d7ef59e990f73d867e91bf703975b52d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:49:48 +0200 Subject: [PATCH 033/183] use isModEnabled function --- htdocs/accountancy/supplier/index.php | 4 ++-- htdocs/barcode/codeinit.php | 2 +- htdocs/hrm/index.php | 4 ++-- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/recruitment/recruitmentindex.php | 8 ++++---- htdocs/ticket/class/ticket.class.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index e46b508512d..d350e2243a2 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -38,7 +38,7 @@ $validatemonth = GETPOST('validatemonth', 'int'); $validateyear = GETPOST('validateyear', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -75,7 +75,7 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 1a5f99b27ee..b4e365fe018 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -188,7 +188,7 @@ print ''; print '
'; // For thirdparty -if ($conf->societe->enabled) { +if (isModEnabled('societe')) { $nbno = $nbtotal = 0; print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index c573b78ed51..1160ee0fc14 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -343,11 +343,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 84e87dd32f1..5c68a373c11 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref = '
'; // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'
'; } // Project diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 65cf89c89da..6cc761d0ade 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -602,7 +602,7 @@ if ($action == 'create' && $user->rights->projet->creer) { } // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { print '
'; // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { print ''."\n"; } else { - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; $statstring .= ''; $statstring .= ""; } - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring .= ""; $statstring .= ''; $statstring .= ""; } $statstring2 = ''; - if (((!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { + if (((isModEnabled('societe') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; $statstring2 .= ''; $statstring2 .= ""; From b57a9d589645a7f06891c129be7369d5968e948a Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Fri, 10 Jun 2022 05:58:01 -0500 Subject: [PATCH 039/183] Save usermodid to updatePercent --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 19eb35376cd..831c64d2553 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2515,12 +2515,13 @@ class ActionComm extends CommonObject * @param int $percent The new percent value for the event * @return int 1 when update of the event was suscessfull, otherwise -1 */ - public function updatePercent($id, $percent) + public function updatePercent($id, $percent, $usermodid) { $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql .= " SET percent = ".(int) $percent; + if ($usermodid > 0) $sql .= ", fk_user_mod = ".$usermodid; $sql .= " WHERE id = ".((int) $id); if ($this->db->query($sql)) { From eb7fcb2f9b1eaa3d8c1cbc0e5d0a7a4aa8a3a278 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 10 Jun 2022 13:20:39 +0200 Subject: [PATCH 040/183] Fix reception list for search date extrafield --- htdocs/reception/list.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b83afc3f37d..8bdaa398d44 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -620,6 +620,22 @@ if ($search_array_options) { foreach ($search_array_options as $key => $val) { $crit = $val; $tmpkey = preg_replace('/search_options_/', '', $key); + if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) { + // date range from list filters is stored as array('start' => , 'end' => ) + // start date + $param .= '&search_options_'.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y'); + $param .= '&search_options_'.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m'); + $param .= '&search_options_'.$tmpkey.'_startday='.dol_print_date($val['start'], '%d'); + $param .= '&search_options_'.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H'); + $param .= '&search_options_'.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M'); + // end date + $param .= '&search_options_'.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y'); + $param .= '&search_options_'.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m'); + $param .= '&search_options_'.$tmpkey.'_endday='.dol_print_date($val['end'], '%d'); + $param .= '&search_options_'.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H'); + $param .= '&search_options_'.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); + $val = ''; + } if ($val != '') { $param .= '&search_options_'.$tmpkey.'='.urlencode($val); } From ef959ecddd43f2bf4ecd5aa0db99cf2405f21dba Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 11 Jun 2022 00:18:38 +0200 Subject: [PATCH 041/183] FIX#21093 --- .../modules/commande/doc/pdf_einstein.modules.php | 3 +++ .../modules/commande/doc/pdf_eratosthene.modules.php | 3 +++ .../core/modules/contract/doc/pdf_strato.modules.php | 3 +++ .../core/modules/delivery/doc/pdf_storm.modules.php | 3 +++ .../core/modules/delivery/doc/pdf_typhon.modules.php | 3 +++ .../modules/expedition/doc/pdf_espadon.modules.php | 3 +++ .../modules/expedition/doc/pdf_rouget.modules.php | 3 +++ .../expensereport/doc/pdf_standard.modules.php | 3 +++ htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 11 +++++++---- .../core/modules/facture/doc/pdf_sponge.modules.php | 3 +++ .../core/modules/fichinter/doc/pdf_soleil.modules.php | 3 +++ .../modules/movement/doc/pdf_standard.modules.php | 3 +++ .../core/modules/project/doc/pdf_baleine.modules.php | 3 +++ .../core/modules/project/doc/pdf_beluga.modules.php | 3 +++ .../modules/project/doc/pdf_timespent.modules.php | 3 +++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 3 +++ htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 3 +++ .../modules/reception/doc/pdf_squille.modules.php | 3 +++ .../core/modules/stock/doc/pdf_standard.modules.php | 3 +++ .../modules/supplier_order/doc/pdf_cornas.modules.php | 3 +++ .../supplier_order/doc/pdf_muscadet.modules.php | 3 +++ .../supplier_payment/doc/pdf_standard.modules.php | 3 +++ .../supplier_proposal/doc/pdf_aurore.modules.php | 3 +++ .../mymodule/doc/pdf_standard_myobject.modules.php | 3 +++ .../pdf_standard_recruitmentjobposition.modules.php | 3 +++ 25 files changed, 79 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 27d4fc9870e..069f3d60de9 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -612,6 +612,9 @@ class pdf_einstein extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 161c3c60345..61ed59414bb 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -836,6 +836,9 @@ class pdf_eratosthene extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 69a4d5ce96e..fbc066d8533 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -433,6 +433,9 @@ class pdf_strato extends ModelePDFContract $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 65912a8b9a0..f778711ffdb 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -575,6 +575,9 @@ class pdf_storm extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 5875814b546..c215a44c606 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -499,6 +499,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 00fa6bbbdc5..39df041bb51 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -708,6 +708,9 @@ class pdf_espadon extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 6b5d2e6fc3d..eededb90d67 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -614,6 +614,9 @@ class pdf_rouget extends ModelePdfExpedition if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index a4e3ab491a5..6f50fa89711 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -478,6 +478,9 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4e5c0431170..95d2b2a4eba 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -618,7 +618,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($pageposafter + 1); } @@ -796,6 +796,9 @@ class pdf_crabe extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { @@ -811,7 +814,7 @@ class pdf_crabe extends ModelePDFFactures } $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } } } @@ -936,7 +939,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); @@ -998,7 +1001,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $this->_pagehead($pdf, $object, 1, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 228b73d825a..72eb041f873 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -930,6 +930,9 @@ class pdf_sponge extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index bc2b75e219e..7a31553e347 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -419,6 +419,9 @@ class pdf_soleil extends ModelePDFFicheinter if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 48483066e5e..520115ef375 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -706,6 +706,9 @@ class pdf_standard extends ModelePDFMovement if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 776f2f9d1e6..6a4a904a7b5 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -471,6 +471,9 @@ class pdf_baleine extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index f71b0cdb6a7..91de73f9c79 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -736,6 +736,9 @@ class pdf_beluga extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 991ff794d72..a986f07a143 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -474,6 +474,9 @@ class pdf_timespent extends ModelePDFProjects if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6e89c17cb2c..de35f65bf57 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -727,6 +727,9 @@ class pdf_azur extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 50061cacd0a..307b0f40c8f 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -851,6 +851,9 @@ class pdf_cyan extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index c51209fa6c8..aa0d2218763 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -538,6 +538,9 @@ class pdf_squille extends ModelePdfReception $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 1597ee32c18..9336cd149ca 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -484,6 +484,9 @@ class pdf_standard extends ModelePDFStock if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { 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 2be12805685..7e7ae2b3703 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -778,6 +778,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { 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 11ae04993eb..5d12ae3d24b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -660,6 +660,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { 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 003cd999cde..5565b113e83 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -447,6 +447,9 @@ class pdf_standard extends ModelePDFSuppliersPayments if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 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 362d831f3af..14af31976d8 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -660,6 +660,9 @@ class pdf_aurore extends ModelePDFSupplierProposal if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == 1) { 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 1a435d3763d..8976bc1c9ed 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 @@ -751,6 +751,9 @@ class pdf_standard_myobject extends ModelePDFMyObject if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index cc215a855ff..556e9fba520 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -678,6 +678,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $this->_pagehead($pdf, $object, 0, $outputlangs); } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { From 71ef0749879a05b9015463d98ffa2d0407f2f4b9 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 11 Jun 2022 00:41:15 +0200 Subject: [PATCH 042/183] FIX#21093 --- .../modules/facture/doc/pdf_crabe.modules.php | 8 ++--- htdocs/societe/card.php | 33 ++++--------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 95d2b2a4eba..0c89d14992c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -618,7 +618,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); } @@ -814,7 +814,7 @@ class pdf_crabe extends ModelePDFFactures } $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } } } @@ -939,7 +939,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); @@ -1001,7 +1001,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->useTemplate($tplidx); } if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { - $this->_pagehead($pdf, $object, 1, $outputlangs); + $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($current_page); $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top + $y - 3, $tab3_width, $tab3_height); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3ef501aeac6..301e5bfb288 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1139,11 +1139,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country = $tmparray['label']; } $object->forme_juridique_code = GETPOST('forme_juridique_code'); - - // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { - $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency; - } /* Show create form */ $linkback = ""; @@ -1610,11 +1605,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''; print ''; - } else { - print ''.$langs->trans("Currency".$conf->currency).''; - } + print ''.$langs->trans("Currency".$conf->currency).''; + if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; print ''; print ''; } @@ -1862,11 +1854,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; } - - // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { - $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code; - } } if ($object->localtax1_assuj == 0) { @@ -2298,11 +2285,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; - } else { - print '"> '.$langs->trans("Currency".$conf->currency).''; - } + print '"> '.$langs->trans("Currency".$conf->currency).''; // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { @@ -2357,7 +2340,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print ''; } @@ -2780,11 +2763,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print ''; print "\n"; // Use vat for invoice creation -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { print ''; if (!empty($conf->banque->enabled)) { print ''; // Complementary action - if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { + if ((!empty($conf->banque->enabled) || isModEnabled('facture')) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { $company = new Societe($db); if ($object->fk_soc) { $result = $company->fetch($object->fk_soc); @@ -1003,7 +1003,7 @@ if ($rowid > 0) { print '>
'; } // Add invoice with no payments - if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->societe->enabled) && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>
'; } // Add invoice with payments - if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>'; print ''; print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 1df7ae4db62..320efa36ed6 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -658,7 +658,7 @@ if (count($amount)) { if (!empty($conf->commande->enabled) && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (!empty($conf->facture->enabled) && $key > 0) { + if (isModEnabled('facture') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 195a4d028f4..a72ea3d7d21 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -206,7 +206,7 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cd12fd12150..30189680bc7 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1241,7 +1241,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { print ''; @@ -1511,7 +1511,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index b7fc682d2c6..41a6a74dd4b 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -159,7 +159,7 @@ if ($object->thirdparty->client) { if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d17f5399679..3202d8598d0 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2071,7 +2071,7 @@ if ($action == 'create') { } } - if (!empty($conf->facture->enabled) && $object->statut > 0) { + if (isModEnabled('facture') && $object->statut > 0) { $langs->load("bills"); if ($user->rights->facture->creer) { print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index ae4f7c41515..de69e19c3e2 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -105,7 +105,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } @@ -120,7 +120,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S } // Customer payments -if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { +if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { $arrayresult['searchintocustomerpayments'] = array( 'position'=>170, 'img'=>'object_payment', diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 02b5070a96c..ea43eff12fc 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -62,7 +62,7 @@ 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 = !((!empty($conf->facture->enabled) && $user->rights->facture->lire) + $this->hidden = !((isModEnabled('facture') && $user->rights->facture->lire) || (!empty($conf->commande->enabled) && $user->rights->commande->lire) || (!empty($conf->propal->enabled) && $user->rights->propale->lire) ); @@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes // list the summary of the bills - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic = new Facture($this->db); diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 24be4100dab..28461e07de5 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -126,7 +126,7 @@ class box_dolibarr_state_board extends ModeleBoxes 'services' => !empty($conf->service->enabled) && $user->rights->service->lire, 'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire, 'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire, - 'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire, + 'invoices' => isModEnabled('facture') && $user->rights->facture->lire, 'donations' => !empty($conf->don->enabled) && $user->rights->don->lire, 'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire, 'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index adcc750a6a8..afed778912f 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -60,7 +60,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->db = $db; $this->hidden = !( - (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) + (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) || (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) ); @@ -107,7 +107,7 @@ class box_graph_product_distribution extends ModeleBoxes $showinvoicenb = 1; $showordernb = 1; } - if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) { + if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) { @@ -278,7 +278,7 @@ class box_graph_product_distribution extends ModeleBoxes } - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showinvoicenb) { $langs->load("bills"); @@ -372,7 +372,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } - if (!empty($conf->facture->enabled) || !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersInvoices"); $stringtoshow .= '   '; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c5c9f7164ec..4fa721abf81 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8501,13 +8501,13 @@ class Form // To work with non standard path if ($objecttype == 'facture') { $tplpath = 'compta/'.$element; - if (empty($conf->facture->enabled)) { + if (!isModEnabled('facture')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'facturerec') { $tplpath = 'compta/facture'; $tplname = 'linkedobjectblockForRec'; - if (empty($conf->facture->enabled)) { + if (!isModEnabled('facture')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'propal') { @@ -8643,12 +8643,12 @@ class Form 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'), 'invoice'=>array( - 'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0), + 'enabled'=>isModEnabled('facture'), 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array( - 'enabled'=>(!empty($conf->facture->enabled) ? $conf->facture->enabled : 0), + 'enabled'=>isModEnabled('facture'), 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..a6c16329ff9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1618,7 +1618,7 @@ class FormMail extends Form if (!empty($conf->don->enabled)) { $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } if (!empty($conf->commande->enabled)) { @@ -1635,7 +1635,7 @@ class FormMail extends Form if (!empty($conf->don->enabled)) { $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } if (!empty($conf->commande->enabled)) { diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 60c53ee7abc..8ade2200724 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) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $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/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 786483e257b..580e30db650 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -254,7 +254,7 @@ function supplier_invoice_rec_prepare_head($object) function getNumberInvoicesPieChart($mode) { global $conf, $db, $langs, $user; - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; $now = date_create(date('Y-m-d', dol_now())); @@ -882,7 +882,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { $tmpinvoice = new Facture($db); $sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms"; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 12e1128ddfc..8c05307eedd 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -450,7 +450,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer invoices - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $nblines++; $ret = $product->load_stats_facture($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a2168eb7280..bcc6fde98c8 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 (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) - || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled) + || isModEnabled('facture') || !empty($conf->contrat->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts @@ -144,10 +144,10 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->commande->enabled)) { $nbElements += $project->getElementCount('order', 'commande'); } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice', 'facture'); } - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } if (!empty($conf->supplier_proposal->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 35979503d15..10b78673cf5 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 @@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->commande->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 d439ae32ce5..3702b1c8452 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 @@ -41,10 +41,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->commande->enabled)) { diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 06d93e5ea5f..e40f360051e 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -52,7 +52,7 @@ if (!empty($conf->commande->enabled)) { } print '
'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'invoice')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 1d46aec1008..8bd1e0d647d 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -91,7 +91,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Order to invoice if ($action == 'ORDER_CLOSE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) { + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE)) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $newobject = new Facture($this->db); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 3b906883c00..51a3f7ced7b 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -325,7 +325,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->commande->enabled)) { $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 (!empty($conf->facture->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)) { diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 42b8efba42f..a6782317802 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -128,7 +128,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } -if (!empty($conf->facture->enabled)) { +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)) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d341f293827..af508cf3291 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2477,7 +2477,7 @@ if ($action == 'create') { // TODO add alternative status // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order) if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) { - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); @@ -2496,7 +2496,7 @@ if ($action == 'create') { } // Create bill - if (!empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { + 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)) // If we do that, we must also make this option official. @@ -2514,7 +2514,7 @@ if ($action == 'create') { if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9d76d46cc97..4b7686449c7 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1659,7 +1659,7 @@ if ($action == 'create') { } // Invoicing - if (!empty($conf->facture->enabled) && $object->statut > Fichinter::STATUS_DRAFT) { + if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) { $langs->load("bills"); if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ab316edb56..0417554f8fd 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2573,7 +2573,7 @@ if ($action == 'create') { } // Create bill - //if (! empty($conf->facture->enabled)) + //if (isModEnabled('facture')) //{ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) { // statut 2 means approved, 7 means canceled if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { @@ -2584,7 +2584,7 @@ if ($action == 'create') { // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved - if (empty($conf->facture->enabled)) { + if (!isModEnabled('facture')) { print ''.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { diff --git a/htdocs/index.php b/htdocs/index.php index d9bab584948..08b818bac63 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -229,7 +229,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of invoices customers (paid) - if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { + if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $board = new Facture($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 4a9705c8ae7..30e7b45d198 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2011,7 +2011,7 @@ function migrate_modeles($db, $langs, $conf) dolibarr_install_syslog("upgrade2::migrate_modeles"); - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1261ee66b89..076ab0dbc6a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2445,7 +2445,7 @@ function printDropdownQuickadd() "title" => "NewBill@bills", "name" => "Bill@bills", "picto" => "object_bill", - "activation" => !empty($conf->facture->enabled) && $user->rights->facture->creer, // vs hooking + "activation" => isModEnabled('facture') && $user->rights->facture->creer, // vs hooking "position" => 50, ), array( diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 1f63b5071bb..a1b450f7a0c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php' if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } if (!empty($conf->commande->enabled)) { @@ -76,7 +76,7 @@ $langs->loadLangs(array('products', 'other')); if (!empty($conf->stock->enabled)) { $langs->load("stocks"); } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } if (!empty($conf->productbatch->enabled)) { @@ -2814,7 +2814,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == } // Factures - if (!empty($conf->facture->enabled) && $user->rights->facture->creer) { + if (isModEnabled('facture') && $user->rights->facture->creer) { $invoice = new Facture($db); $langs->load("bills"); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6cc761d0ade..813dccf8a73 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1326,7 +1326,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("orders"); print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, ''); } - if (!empty($conf->facture->enabled) && $user->rights->facture->creer) { + if (isModEnabled('facture') && $user->rights->facture->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, ''); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index b8fe8572eb6..fb4011ada8c 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -42,7 +42,7 @@ if (!empty($conf->stock->enabled)) { if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->facture->enabled)) { +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'; } @@ -104,7 +104,7 @@ if (!empty($conf->mrp->enabled)) { // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } if (!empty($conf->commande->enabled)) { diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 5553ee464c7..c0b88736ce3 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -533,11 +533,11 @@ if ($ispaymentok) { $emetteur_banque = ''; // Define default choice for complementary actions $option = ''; - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $option = 'bankviainvoice'; } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) { $option = 'bankdirect'; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $option = 'invoiceonly'; } if (empty($option)) { @@ -927,7 +927,7 @@ if ($ispaymentok) { } // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) { include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $invoice = new Facture($db); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 243135fbf6a..241a8427e8f 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -2084,7 +2084,7 @@ if ($action == 'create') { // TODO add alternative status // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order) if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) { - if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? print ''.$langs->trans("ClassifyUnbilled").''; } else { print ''.$langs->trans("ReOpen").''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index bd4aacc3931..f74758296a9 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -168,7 +168,7 @@ if ($object->client) { if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 90be0b25850..d623e5699de 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -784,7 +784,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index efa7d43a269..e40ed6aa2e7 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -83,7 +83,7 @@ class FactureTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; - if (empty($conf->facture->enabled)) { + if (!isModEnabled('facture')) { print __METHOD__." module customer invoice must be enabled.\n"; die(1); } if (! empty($conf->ecotaxdeee->enabled)) { From c23b5947b35d8d3ab704a4bc21a6d742a62a1cfc Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Sun, 12 Jun 2022 11:05:12 +0200 Subject: [PATCH 044/183] #21212 : add template invoices stats on products card --- htdocs/core/lib/product.lib.php | 19 ++ htdocs/product/class/product.class.php | 75 ++++++ htdocs/product/stats/facturerec.php | 313 +++++++++++++++++++++++++ 3 files changed, 407 insertions(+) create mode 100644 htdocs/product/stats/facturerec.php diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 117871b4712..053a4e7a67b 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -468,6 +468,25 @@ function show_stats_for_company($product, $socid) print ''; print ''; } + // Customer template invoices + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + $nblines++; + $ret = $product->load_stats_facturerec($socid); + if ($ret < 0) { + dol_print_error($db); + } + $langs->load("bills"); + print ''; + print ''; + } // Supplier invoices if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { $nblines++; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d5dce55b2ba..43e4c277f04 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3458,6 +3458,81 @@ class Product extends CommonObject } } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Charge tableau des stats facture recurrentes pour le produit/service + * + * @param int $socid Id societe + * @return int Array of stats in $this->stats_facture, <0 if ko or >0 if ok + */ + public function load_stats_facturerec($socid = 0) + { + // phpcs:enable + global $db, $conf, $user, $hookmanager; + + $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; + $sql .= " COUNT(fd.rowid) as nb_rows, SUM('fd.qty') as qty"; + $sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as fd"; + $sql .= ", ".MAIN_DB_PREFIX."facture_rec as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (empty($user->rights->societe->client->voir) && !$socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE f.rowid = fd.fk_facture"; + $sql .= " AND f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('invoice').")"; + $sql .= " AND fd.fk_product = ".((int) $this->id); + if (empty($user->rights->societe->client->voir) && !$socid) { + $sql .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + } + //$sql.= " AND f.fk_statut != 0"; + if ($socid > 0) { + $sql .= " AND f.fk_soc = ".((int) $socid); + } + + $result = $this->db->query($sql); + if ($result) { + $obj = $this->db->fetch_object($result); + $this->stats_facturerec['customers'] = $obj->nb_customers; + $this->stats_facturerec['nb'] = $obj->nb; + $this->stats_facturerec['rows'] = $obj->nb_rows; + $this->stats_facturerec['qty'] = $obj->qty ? $obj->qty : 0; + + // if it's a virtual product, maybe it is in invoice by extension + if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) { + $TFather = $this->getFather(); + if (is_array($TFather) && !empty($TFather)) { + foreach ($TFather as &$fatherData) { + $pFather = new Product($this->db); + $pFather->id = $fatherData['id']; + $qtyCoef = $fatherData['qty']; + + if ($fatherData['incdec']) { + $pFather->load_stats_facture($socid); + + $this->stats_facturerec['customers'] += $pFather->stats_facturerec['customers']; + $this->stats_facturerec['nb'] += $pFather->stats_facturerec['nb']; + $this->stats_facturerec['rows'] += $pFather->stats_facturerec['rows']; + $this->stats_facturerec['qty'] += $pFather->stats_facturerec['qty'] * $qtyCoef; + } + } + } + } + + $parameters = array('socid' => $socid); + $reshook = $hookmanager->executeHooks('loadStatsCustomerInvoiceRec', $parameters, $this, $action); + if ($reshook > 0) { + $this->stats_facturerec = $hookmanager->resArray['stats_facturerec']; + } + + return 1; + } else { + $this->error = $this->db->error(); + return -1; + } + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Charge tableau des stats facture pour le produit/service diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php new file mode 100644 index 00000000000..b71c24d75cb --- /dev/null +++ b/htdocs/product/stats/facturerec.php @@ -0,0 +1,313 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2022 Eric Seigne + * + * 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 htdocs/product/stats/facturerec.php + * \ingroup product service template facture + * \brief Page of template invoice statistics for a product + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array('companies', 'bills', 'products', 'supplier_proposal')); + +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +// Security check +$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); +$fieldtype = (!empty($ref) ? 'ref' : 'rowid'); +$socid = ''; +if (!empty($user->socid)) { + $socid = $user->socid; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('productstatsinvoice')); + +$showmessage = GETPOST('showmessage'); + +// Load variable for pagination +$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; +if (!$sortorder) { + $sortorder = "DESC"; +} +if (!$sortfield) { + $sortfield = "f.datec"; +} + +$search_month = GETPOST('search_month', 'int'); +$search_year = GETPOST('search_year', 'int'); + +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + $search_month = ''; + $search_year = ''; +} + +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + +/* + * View + */ + +$invoicestatic = new FactureRec($db); +$societestatic = new Societe($db); + +$form = new Form($db); +$formother = new FormOther($db); + +if ($id > 0 || !empty($ref)) { + $product = new Product($db); + $result = $product->fetch($id, $ref); + + $object = $product; + + $parameters = array('id'=>$id); + $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + $title = $langs->trans('ProductServiceCard'); + $helpurl = ''; + $shortlabel = dol_trunc($object->label, 16); + if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) { + $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers'); + $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { + $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers'); + $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } + + llxHeader('', $title, $helpurl); + + if ($result > 0) { + $head = product_prepare_head($product); + $titre = $langs->trans("CardProduct".$product->type); + $picto = ($product->type == Product::TYPE_SERVICE ? 'service' : 'product'); + print dol_get_fiche_head($head, 'referers', $titre, -1, $picto); + + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + $linkback = ''.$langs->trans("BackToList").''; + + $shownav = 1; + if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { + $shownav = 0; + } + + dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); + + print '
'; + + print '
'; + print '
'; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); @@ -898,7 +898,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print '
'; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index b4d943584cd..f028f2f8243 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -331,11 +331,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -402,11 +402,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e267ffce6c1..c93def7b49a 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2860,7 +2860,7 @@ class Ticket extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$user->socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; From e060e31e5bc24178d33c24e3da93e65ce5671c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:54:22 +0200 Subject: [PATCH 034/183] use isModEnabled function --- htdocs/modulebuilder/admin/setup.php | 2 +- htdocs/modulebuilder/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index e7c42578bd6..08791b8324a 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; global $conf, $langs, $user, $db; $langs->loadLangs(array("admin", "other", "modulebuilder")); -if (!$user->admin || empty($conf->modulebuilder->enabled)) { +if (!$user->admin || !isModEnabled('modulebuilder')) { accessforbidden(); } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 10a040ca7e5..68aa224423c 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -73,7 +73,7 @@ $objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha')); $dicname = dol_sanitizeFileName(GETPOST('dicname', 'alpha')); // Security check -if (empty($conf->modulebuilder->enabled)) { +if (!isModEnabled('modulebuilder')) { accessforbidden(); } if (!$user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) { From 59b24aa7d8c25aeab0e116d865b27d359990d40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 23:06:03 +0200 Subject: [PATCH 035/183] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9897612f9bd..2374718ce75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -311,7 +311,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then - var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ . + var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php . #fi set +e echo From 32b58789cd1d39d634d607dc5531f855c24d6565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Jun 2022 23:14:36 +0200 Subject: [PATCH 036/183] re enable limited test --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2374718ce75..a260c31e3f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -310,9 +310,9 @@ script: # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php . - #fi + fi set +e echo From b176d1a59d861be0b4965981cd7091e5e86737fe Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 9 Jun 2022 23:17:29 +0200 Subject: [PATCH 037/183] not my best day --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 9937a551c1a..28c8cb656d1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1216,7 +1216,7 @@ class Project extends CommonObject if (!empty($this->date_start)) { $label .= ($label ? '
' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->date_start, 'day'); // The space must be after the : to not being explode when showing the title in img_picto } - if (!empty($this->date_ent)) { + if (!empty($this->date_end)) { $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->date_end, 'day'); // The space must be after the : to not being explode when showing the title in img_picto } if ($moreinpopup) { From 5fdd57723019d8e418b281dc899a0f431dbd08c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Fri, 10 Jun 2022 08:16:33 +0200 Subject: [PATCH 038/183] use isModEnabled function --- htdocs/societe/index.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 597fc4b80ea..f4637186b4d 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -118,16 +118,16 @@ $result = $db->query($sql); if ($result) { while ($objp = $db->fetch_object($result)) { $found = 0; - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found = 1; $third['prospect']++; } - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found = 1; $third['customer']++; } - if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { + if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found = 1; $third['supplier']++; } - if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { + if (isModEnabled('societe') && $objp->client == 0 && $objp->fournisseur == 0) { $found = 1; $third['other']++; } if ($found) { @@ -144,16 +144,16 @@ $thirdpartygraph .= '
'.$langs->trans("St if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) { $thirdpartygraph .= '
'; $dataseries = array(); - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $dataseries[] = array($langs->trans("Prospects"), round($third['prospect'])); } - if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { + if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $dataseries[] = array($langs->trans("Customers"), round($third['customer'])); } - if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { + if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $dataseries[] = array($langs->trans("Suppliers"), round($third['supplier'])); } - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $dataseries[] = array($langs->trans("Others"), round($third['other'])); } include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; @@ -167,18 +167,18 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $thirdpartygraph .= $dolgraph->show(); $thirdpartygraph .= '
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '; - if (!empty($conf->multicurrency->enabled)) { - print ''.$langs->trans("Currency".$object->multicurrency_code).'
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); @@ -1664,7 +1656,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); + print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.$form->editfieldkey('Capital', 'capital', '', $object, 0).' '.$langs->trans("Currency".$object->multicurrency_code).'
'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code') : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)), 'multicurrency_code', 1); + print $form->selectMultiCurrency(($object->multicurrency_code ? $object->multicurrency_code : $conf->currency), 'multicurrency_code', 1); print '
'.$langs->trans('Capital').''; if ($object->capital) { - if (!empty($conf->multicurrency->enabled) && !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); - } + print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); } else { print ' '; } From 3fdbce7a31d167b1e8f6b3495e039ff1c33986d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 11 Jun 2022 09:46:28 +0200 Subject: [PATCH 043/183] use isModEnabled function --- htdocs/adherents/admin/member.php | 8 ++++---- htdocs/adherents/subscription.php | 10 +++++----- htdocs/admin/dict.php | 8 ++++---- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/fckeditor.php | 4 ++-- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/pdf_other.php | 2 +- htdocs/admin/stock.php | 2 +- htdocs/admin/tools/dolibarr_import.php | 2 +- htdocs/admin/workflow.php | 12 ++++++------ htdocs/blockedlog/class/blockedlog.class.php | 2 +- htdocs/comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/card.php | 14 ++++++-------- htdocs/comm/propal/card.php | 6 +++--- htdocs/comm/recap-client.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/accounting-files.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/index.php | 4 ++-- htdocs/compta/recap-compta.php | 4 ++-- htdocs/compta/resultat/index.php | 6 +++--- htdocs/compta/stats/cabyuser.php | 2 +- htdocs/compta/stats/casoc.php | 2 +- .../canvas/actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 4 ++-- htdocs/contact/consumption.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/core/ajax/selectsearchbox.php | 4 ++-- htdocs/core/boxes/box_activity.php | 4 ++-- htdocs/core/boxes/box_dolibarr_state_board.php | 2 +- .../core/boxes/box_graph_product_distribution.php | 8 ++++---- htdocs/core/class/html.form.class.php | 8 ++++---- htdocs/core/class/html.formmail.class.php | 4 ++-- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 4 ++-- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/project.lib.php | 6 +++--- .../doc/doc_generic_project_odt.modules.php | 4 ++-- .../task/doc/doc_generic_task_odt.modules.php | 4 ++-- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 2 +- ...erface_20_modWorkflow_WorkflowManager.class.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/expedition/card.php | 6 +++--- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 4 ++-- htdocs/index.php | 2 +- htdocs/install/upgrade2.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/product/card.php | 6 +++--- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/public/payment/paymentok.php | 6 +++--- htdocs/reception/card.php | 2 +- htdocs/societe/consumption.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- test/phpunit/FactureTest.php | 2 +- 58 files changed, 108 insertions(+), 110 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index bae229bc77b..80092ea96a5 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -108,7 +108,7 @@ if ($action == 'set_default') { $res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity); $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); // Use vat for invoice creation - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { @@ -241,10 +241,10 @@ $arraychoices = array('0'=>$langs->trans("None")); if (!empty($conf->banque->enabled)) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } -if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { +if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); } -if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { +if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); } print ''; @@ -256,7 +256,7 @@ print '
'.$langs->trans("VATToUseForSubscriptions").''; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 1cfbb80f65b..cf0ad445c92 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -831,11 +831,11 @@ if ($rowid > 0) { $bankviainvoice = 1; } } else { - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $bankviainvoice = 1; } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) { $bankdirect = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { $invoiceonly = 1; } } @@ -982,7 +982,7 @@ if ($rowid > 0) { print '">
'.$langs->trans("DeStockOnBill").''; -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_BILL', array(), null, 0, 0, 0, 2, 1); } else { diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 77dea6f23ab..c409d6a500b 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -189,7 +189,7 @@ if (in_array($type, array('mysql', 'mysqli'))) { $param .= " -U ".$dolibarr_main_db_user; $paramcrypted = $param; $paramclear = $param; - /*if (! empty($dolibarr_main_db_pass)) + /*if (!empty($dolibarr_main_db_pass)) { $paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass); $paramclear.=" -p".$dolibarr_main_db_pass; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index a68f49e36e3..47e6e87a244 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -68,7 +68,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(!empty($conf->commande->enabled) && !empty($conf->facture->enabled)), + 'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( @@ -91,7 +91,7 @@ $workflowcodes = array( 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>31, - 'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->facture->enabled)), + 'enabled'=>(!empty($conf->propal->enabled) && isModEnabled('facture')), 'picto'=>'propal', 'warning'=>'' ), @@ -112,7 +112,7 @@ $workflowcodes = array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), '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. @@ -165,7 +165,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, - 'enabled' => ! empty($conf->expedition->enabled) && ! empty($conf->facture->enabled), + 'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled), 'picto' => 'shipment' ), @@ -173,13 +173,13 @@ $workflowcodes = array( 'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'family' => 'link_ticket', 'position' => 75, - 'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled), + 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'picto' => 'ticket' ), 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'family' => 'link_ticket', 'position' => 76, - 'enabled' => ! empty($conf->ticket->enabled) && ! empty($conf->contract->enabled), + 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'picto' => 'ticket' ), ); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index ef4ca462008..ea5069cb840 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -140,7 +140,7 @@ class BlockedLog $this->trackedevents = array(); - if (!empty($conf->facture->enabled)) { + if (isModEnabled('facture')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 8dd6b008045..d2b089491a7 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -198,7 +198,7 @@ class CActionComm //var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire); $qualified = 0; // Special cases - if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { + 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)) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4defa77f428..4005ba45e65 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -40,10 +40,8 @@ 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.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -} -if (!empty($conf->facture->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (!empty($conf->propal->enabled)) { @@ -77,7 +75,7 @@ if (!empty($conf->commande->enabled)) { if (!empty($conf->expedition->enabled)) { $langs->load("sendings"); } -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } if (!empty($conf->projet->enabled)) { @@ -741,7 +739,7 @@ if ($object->id > 0) { } } - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { // Box factures $tmp = $object->getOutstandingBills('customer', 0); $outstandingOpened = $tmp['opened']; @@ -1311,7 +1309,7 @@ if ($object->id > 0) { /* * Latest invoices templates */ - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $sql = 'SELECT f.rowid as id, f.titre as ref'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1406,7 +1404,7 @@ if ($object->id > 0) { /* * Latest invoices */ - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { $sql = 'SELECT f.rowid as facid, f.ref, f.type'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1569,7 +1567,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->facture->enabled) && $object->status == 1) { + if (isModEnabled('facture') && $object->status == 1) { if (empty($user->rights->facture->creer)) { print ''; } else { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cc35cfc65a9..10ab441f442 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -696,7 +696,7 @@ if (empty($reshook)) { if ( !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' - && ! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! 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'; @@ -2001,7 +2001,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) && ! empty($conf->facture->enabled) && ! 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(); @@ -2801,7 +2801,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) { - if (!empty($conf->facture->enabled) && $usercancreateinvoice) { + if (isModEnabled('facture') && $usercancreateinvoice) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index ee32c0dd016..da37fe1048c 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page $langs->load("companies"); -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 9ec8bca22a4..1432d1f132f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2782,7 +2782,7 @@ if ($action == 'create' && $usercancreate) { // Create bill and Classify billed // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { - if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { + if (isModEnabled('facture') && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index cdabf9f2a5a..1e4c4d2e78a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1928,7 +1928,7 @@ if ($resql) { print $getNomUrl_cache[$obj->socid]; // If module invoices enabled and user with invoice creation permissions - if (!empty($conf->facture->enabled) && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) { + if (isModEnabled('facture') && !empty($conf->global->ORDER_BILLING_ALL_CUSTOMER)) { if ($user->rights->facture->creer) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 8f61261bc11..996ad22fbce 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -127,7 +127,7 @@ if (empty($entity)) { $error = 0; $listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)), + 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a2c22d7f878..5993bd39a7c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5415,7 +5415,7 @@ class Facture extends CommonInvoice $langs->load("bills"); - if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('facture')) { // Should not happen. If module disabled, cron job should not be visible. $this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture")); return 0; } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index def6318ed95..93b73d8ddd4 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -121,7 +121,7 @@ print '
'; // Latest modified customer invoices -if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { +if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { $langs->load("boxes"); $tmpinvoice = new Facture($db); @@ -582,7 +582,7 @@ if (!empty($conf->tax->enabled) && !empty($user->rights->tax->charges->lire)) { /* * Customers orders to be billed */ -if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { +if (isModEnabled('facture') && !empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { $commandestatic = new Commande($db); $langs->load("orders"); diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 8b2bf351094..4bd79a3c0d5 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; // Load translation files required by the page $langs->load("companies"); -if (!empty($conf->facture->enabled)) { +if (isModEnabled('facture')) { $langs->load("bills"); } @@ -116,7 +116,7 @@ if ($id > 0) { dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); print dol_get_fiche_end(); - if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + if (isModEnabled('facture') && $user->rights->facture->lire) { // Invoice list print load_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 68068dec866..719b1deb29a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -212,7 +212,7 @@ if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { $subtotal_ht = 0; $subtotal_ttc = 0; -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -269,7 +269,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod // Nothing from this table } -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // On ajoute les paiements clients anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; @@ -324,7 +324,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod $subtotal_ht = 0; $subtotal_ttc = 0; -if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 35d5028e938..2b8f40b3aba 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -484,7 +484,7 @@ if (count($amount)) { if (!empty($conf->commande->enabled) && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (!empty($conf->facture->enabled) && $key > 0) { + if (isModEnabled('facture') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : (''.$langs->trans("NoContactForAnyInvoice").''); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print '
'; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; + print ''; + print $product->stats_facture['customers']; + print ''; + print $product->stats_facturerec['nb']; + print ''; + print $product->stats_facturerec['qty']; + print '
'; + + $nboflines = show_stats_for_company($product, $socid); + + print "
"; + + print '
'; + print '
'; + + print dol_get_fiche_end(); + + if ($showmessage && $nboflines > 1) { + print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; + } elseif ($user->rights->facture->lire) { + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; + $sql .= "f.titre, f.datec, f.rowid as facid,"; + $sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used + if (empty($user->rights->societe->client->voir) && !$socid) { + $sql .= ", sc.fk_soc, sc.fk_user "; + } + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", ".MAIN_DB_PREFIX."facture_rec as f"; + $sql .= ", ".MAIN_DB_PREFIX."facturedet_rec as d"; + if (empty($user->rights->societe->client->voir) && !$socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('invoice').")"; + $sql .= " AND d.fk_facture = f.rowid"; + $sql .= " AND d.fk_product = ".((int) $product->id); + if (!empty($search_month)) { + $sql .= ' AND MONTH(f.datec) IN ('.$db->sanitize($search_month).')'; + } + if (!empty($search_year)) { + $sql .= ' AND YEAR(f.datec) IN ('.$db->sanitize($search_year).')'; + } + if (empty($user->rights->societe->client->voir) && !$socid) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + } + if ($socid) { + $sql .= " AND f.fk_soc = ".((int) $socid); + } + $sql .= $db->order($sortfield, $sortorder); + + // Calcul total qty and amount for global if full scan list + $total_ht = 0; + $total_qty = 0; + + // Count total nb of records + $totalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $result = $db->query($sql); + $totalofrecords = $db->num_rows($result); + } + + $sql .= $db->plimit($limit + 1, $offset); + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + + if ($limit > 0 && $limit != $conf->liste_limit) { + $option .= '&limit='.urlencode($limit); + } + if (!empty($id)) { + $option .= '&id='.$product->id; + } + if (!empty($search_month)) { + $option .= '&search_month='.urlencode($search_month); + } + if (!empty($search_year)) { + $option .= '&search_year='.urlencode($search_year); + } + + print ''."\n"; + print ''; + if (!empty($sortfield)) { + print ''; + } + if (!empty($sortorder)) { + print ''; + } + + print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); + + if (!empty($page)) { + $option .= '&page='.urlencode($page); + } + + print '
'; + print '
'; + print $langs->trans('Period').' ('.$langs->trans("DateInvoice").') - '; + print $langs->trans('Month').': '; + print $langs->trans('Year').':'.$formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; + print ''; + print ''; + print '
'; + print '
'; + print '
'; + + $i = 0; + print '
'; + print ''; + print ''; + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); + print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datec", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); + print "\n"; + + if ($num > 0) { + while ($i < min($num, $limit)) { + $objp = $db->fetch_object($result); + + if ($objp->type == FactureRec::TYPE_CREDIT_NOTE) { + $objp->qty = -($objp->qty); + } + + $total_ht += $objp->total_ht; + $total_qty += $objp->qty; + + $invoicestatic->id = $objp->facid; + $invoicestatic->ref = $objp->titre; + $societestatic->fetch($objp->socid); + $paiement = $invoicestatic->getSommePaiement(); + + print ''; + print '\n"; + print ''; + print "\n"; + print '"; + print '\n"; + print '\n"; + print ''; + print "\n"; + $i++; + } + } + print ''; + if ($num < $limit) { + print ''; + } else { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print "
'; + print $invoicestatic->getNomUrl(1); + print "'.$societestatic->getNomUrl(1).'".$objp->code_client."'; + print dol_print_date($db->jdate($objp->datec), 'dayhour')."'.$objp->qty."'.price($objp->total_ht)."'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).'
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.$total_qty.''.price($total_ht).'
"; + print '
'; + print ''; + } else { + dol_print_error($db); + } + $db->free($result); + } + } +} else { + dol_print_error(); +} + +// End of page +llxFooter(); +$db->close(); From 559ec051ab2d15be9d43175d4343bbcbb704846e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 11:17:11 +0200 Subject: [PATCH 045/183] Fix scrutinizer --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 21 +++++++++++---------- htdocs/core/class/html.formmail.class.php | 18 ++++++++++++++++++ htdocs/core/class/notify.class.php | 1 + htdocs/core/class/utils_diff.class.php | 10 ++++++---- htdocs/core/customreports.php | 20 ++++++++++---------- 6 files changed, 48 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b39facd16a4..1f64741385f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1659,13 +1659,13 @@ abstract class CommonObject // phpcs:enable global $conf; - if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) { + if (empty($this->socid) && empty($this->fk_soc) && empty($force_thirdparty_id)) { return 0; } require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty); + $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : 0); if ($force_thirdparty_id) { $idtofetch = $force_thirdparty_id; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c5c9f7164ec..ca5be02b1d9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4362,6 +4362,7 @@ class Form print ' selected'; } print '>'; + $value = ''; if ($format == 0) { $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 1) { @@ -9374,16 +9375,16 @@ class Form /** * Return select list of groups * - * @param string $selected Id group preselected - * @param string $htmlname Field name in form - * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @param string $exclude Array list of groups id to exclude - * @param int $disabled If select list must be disabled - * @param string $include Array list of groups id to include - * @param int $enableonly Array list of groups id to be enabled. All other must be disabled - * @param string $force_entity '0' or Ids of environment to force - * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) - * @param string $morecss More css to add to html component + * @param string $selected Id group preselected + * @param string $htmlname Field name in form + * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @param string|array $exclude Array list of groups id to exclude + * @param int $disabled If select list must be disabled + * @param string|array $include Array list of groups id to include + * @param int $enableonly Array list of groups id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) + * @param string $morecss More css to add to html component * @return string * @see select_dolusers() */ diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..9d87b63cbb8 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -116,6 +116,7 @@ class FormMail extends Form * @var int|string|array */ public $withto; // Show recipient emails + public $withreplyto; /** * @var int|string 0 = Do not Show free text for recipient emails @@ -1672,6 +1673,8 @@ class FormMail extends Form /** * ModelMail + * + * Object of table llx_c_email_templates */ class ModelMail { @@ -1685,6 +1688,16 @@ class ModelMail */ public $label; + /** + * @var int Owner of email template + */ + public $fk_user; + + /** + * @var int Is template private + */ + public $private; + /** * @var string Model mail topic */ @@ -1702,4 +1715,9 @@ class ModelMail * @var string Module the template is dedicated for */ public $module; + + /** + * @var int Position of template in a combo list + */ + public $position; } diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 452d066886e..0a06730bbcb 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -847,6 +847,7 @@ class Notify $mimefilename_list[] = $ref.".pdf"; } + $message = ''; $message .= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message .= "\n"; $message .= $mesg; diff --git a/htdocs/core/class/utils_diff.class.php b/htdocs/core/class/utils_diff.class.php index e18418d78a6..9abc1d899fe 100644 --- a/htdocs/core/class/utils_diff.class.php +++ b/htdocs/core/class/utils_diff.class.php @@ -12,6 +12,7 @@ /** * A class containing functions for computing diffs and formatting the output. + * We can compare 2 strings or 2 files (as one string or line by line) */ class Diff { @@ -236,7 +237,7 @@ class Diff * within 'span' elements, deletions are contained within 'del' elements, and * insertions are contained within 'ins' elements. The parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $separator the separator between lines; this optional parameter defaults to '
' * @return string HTML string */ @@ -275,7 +276,7 @@ class Diff /** * Returns a diff as an HTML table. The parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to '' * @param string $separator the separator between lines; this optional parameter defaults to '
' * @return string HTML string @@ -287,7 +288,8 @@ class Diff // loop over the lines in the diff $index = 0; - while ($index < count($diff)) { + $nbdiff = count($diff); + while ($index < $nbdiff) { // determine the line type switch ($diff[$index][1]) { // display the content on the left and right @@ -365,7 +367,7 @@ class Diff * Returns the content of the cell, for use in the toTable function. The * parameters are: * - * @param string $diff the diff array + * @param array $diff the diff array * @param string $indentation indentation to add to every line of the generated HTML * @param string $separator the separator between lines * @param string $index the current index, passes by reference diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 476b1d5a4da..46b885bd60a 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -507,16 +507,16 @@ if ($mode == 'grid') { ); } } - // Add measure from extrafields - if ($object->isextrafieldmanaged) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { - $arrayofyaxis['te.'.$key] = array( - 'label' => $extrafields->attributes[$object->table_element]['label'][$key], - 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], - 'table' => $object->table_element - ); - } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + $arrayofyaxis['te.'.$key] = array( + 'label' => $extrafields->attributes[$object->table_element]['label'][$key], + 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], + 'table' => $object->table_element + ); } } } From 426c1635c4123e7f06e896b1afede19ac29079f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 12:41:15 +0200 Subject: [PATCH 046/183] Clean code --- htdocs/admin/mails_templates.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index abc434ed58f..612bda6790f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -169,8 +169,6 @@ $tabhelp[25] = array( ); -$elementList = array(); - // We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']" $elementList = array(); // Add all and none after the sort @@ -435,7 +433,14 @@ if (empty($reshook)) { // Modifie valeur des champs $i = 0; foreach ($listfieldmodify as $field) { - $keycode = $listfieldvalue[$i]; + if ($field == 'entity') { + // entity not present on listfieldmodify array + $keycode = $field; + $_POST[$keycode] = $conf->entity; + } else { + $keycode = $listfieldvalue[$i]; + } + if ($field == 'lang') { $keycode = 'langcode'; } @@ -459,9 +464,6 @@ if (empty($reshook)) { if ($field == 'content_lines') { $_POST['content_lines'] = $_POST['content_lines-'.$rowid]; } - if ($field == 'entity') { - $_POST[$keycode] = $conf->entity; - } if ($i) { $sql .= ", "; From 562e9998fd522b165e48f907b958dc5f83bb6e50 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 13:22:55 +0200 Subject: [PATCH 047/183] Fix php 8 compatibility --- htdocs/core/boxes/box_members_last_modified.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 6b4a033f1a2..91ce3c93c36 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -109,7 +109,7 @@ class box_members_last_modified extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $datec = $this->db->jdate($objp->datec); - $datem = $this->db->jdate($objp->tms); + $datem = $this->db->jdate($objp->datem); $memberstatic->lastname = $objp->lastname; $memberstatic->firstname = $objp->firstname; From 503a5cdc82713b86e425a89efc2ab61197991833 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Sun, 12 Jun 2022 06:33:42 -0500 Subject: [PATCH 048/183] Add user who modified the percent --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 831c64d2553..156d5573ae8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2513,9 +2513,10 @@ class ActionComm extends CommonObject * * @param int $id The id of the event * @param int $percent The new percent value for the event + * @param int $usermodid The user who modified the percent * @return int 1 when update of the event was suscessfull, otherwise -1 */ - public function updatePercent($id, $percent, $usermodid) + public function updatePercent($id, $percent, $usermodid = 0) { $this->db->begin(); From 727fb63833abd6dec5fb8d3626df4aae1b6948b2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:21:14 +0200 Subject: [PATCH 049/183] Fix php 8 compatibility --- htdocs/product/class/api_products.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index d9ee85289b8..728bb048a16 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -258,7 +258,7 @@ class Products extends DolibarrApi if (is_array($product_static->stock_warehouse)) { foreach ($product_static->stock_warehouse as $keytmp => $valtmp) { - if (is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { + if (isset($this->product->stock_warehouse[$keytmp]->detail_batc) && is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { foreach ($product_static->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { unset($product_static->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); } @@ -2045,7 +2045,7 @@ class Products extends DolibarrApi if (is_array($this->product->stock_warehouse)) { foreach ($this->product->stock_warehouse as $keytmp => $valtmp) { - if (is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { + if (isset($this->product->stock_warehouse[$keytmp]->detail_batc) && is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { foreach ($this->product->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { unset($this->product->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); } From 295f5eb3eaba5326d4ab7942eb7a0d1e42adb287 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:23:24 +0200 Subject: [PATCH 050/183] Fix php 8 compatibilty --- htdocs/ecm/class/ecmfiles.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index d8d1da60e24..d70f5c863d7 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -569,7 +569,7 @@ class EcmFiles extends CommonObject $line = new EcmfilesLine(); $line->id = $obj->rowid; - $line->ref = $obj->ref; + $line->ref = $obj->rowid; $line->label = $obj->label; $line->share = $obj->share; $line->entity = $obj->entity; From c486e60d53593e39489cd53defbd7691bd6befeb Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:27:11 +0200 Subject: [PATCH 051/183] Fix php8 compatibility --- htdocs/categories/class/categorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 05b1822f45f..14cdfe84783 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -989,7 +989,7 @@ class Categorie extends CommonObject $categories[$i]['array_options'] = $category_static->array_options; // multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (!empty($conf->global->MAIN_MULTILANGS) && isset($category_static->multilangs)) { $categories[$i]['multilangs'] = $category_static->multilangs; } } From 66b792704a3d901eb4a3a233a001450d2e60a955 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:35:48 +0200 Subject: [PATCH 052/183] Fix php 8 compatibility --- htdocs/hrm/class/skillrank.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index aa1d70b430f..8e34465b420 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -415,7 +415,7 @@ class SkillRank extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif ($key !='customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From e02f194c0161b59f95683bfb7e3d0e335066979e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:37:36 +0200 Subject: [PATCH 053/183] Fix php 8 compatibility --- htdocs/hrm/skill_tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index faa8fa57f8e..11dcf9a5172 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -217,7 +217,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref = '
'; - $morehtmlref.= $object->label; + if (isset($object->label)) $morehtmlref.= $object->label; $morehtmlref .= '
'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype); From 7d35e94fc511c6bbd56360694d27d3a2db1d7ba4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:41:06 +0200 Subject: [PATCH 054/183] Fix php8 compatibility --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 254a3ea9e75..a30d2c70b21 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2505,7 +2505,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; } if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { print ''; print $object->socialnetworks[$key]; @@ -2513,7 +2513,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; } else { // if social network is not active but value exist we do not want to loose it - print ''; + print ''; } } } From e82c01d24ebb6baf078b813cd822e730dff20f20 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 14:48:14 +0200 Subject: [PATCH 055/183] Fix php8 compatibility --- htdocs/user/bank.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 4ec919358e1..117c9950efb 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -446,7 +446,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print "\n"; // Date of birth - if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) { + if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { print ''; print ''; print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer); @@ -457,7 +457,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Personal email - if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) { + if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { print ''; print ''; print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -468,7 +468,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Personal phone - if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) { + if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { print ''; print ''; print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -533,7 +533,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Employee Number - if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) { + if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { print ''; print ''; print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -544,7 +544,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // National registration number - if ($user->rights->hrm->read_personal_information->read || $user->rights->hrm->write_personal_information->write) { + if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { print ''; print ''; print $form->editfieldkey("NationalRegistrationNumber", 'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); From 3e6be4c7002aa495627da6923dfbcaacbb83eae9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 15:08:19 +0200 Subject: [PATCH 056/183] Fix php 8 compatibility --- htdocs/stripe/charge.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index d411796aba8..2cd61bfe5d0 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -53,7 +53,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $result = restrictedArea($user, 'banque'); - +$optioncss = GETPOST('optioncss', 'alpha'); /* * View @@ -162,15 +162,15 @@ if (!$rowid) { $status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1); } - if ($charge->payment_method_details->type == 'card') { + if (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'card') { $type = $langs->trans("card"); - } elseif ($charge->source->type == 'card') { + } elseif (isset($charge->source->type) && $charge->source->type == 'card') { $type = $langs->trans("card"); - } elseif ($charge->payment_method_details->type == 'three_d_secure') { + } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'three_d_secure') { $type = $langs->trans("card3DS"); - } elseif ($charge->payment_method_details->type == 'sepa_debit') { + } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'sepa_debit') { $type = $langs->trans("sepadebit"); - } elseif ($charge->payment_method_details->type == 'ideal') { + } elseif (isset($charge->payment_method_details->type) && $charge->payment_method_details->type == 'ideal') { $type = $langs->trans("iDEAL"); } @@ -206,6 +206,8 @@ if (!$rowid) { if (!empty($stripeacc)) { $connect = $stripeacc.'/'; + } else { + $connect = ''; } // Ref From 19a8fd0b73dd9702c586ebf406170a49a93fd6c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 18:40:21 +0200 Subject: [PATCH 057/183] Update card.php --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a30d2c70b21..ce91f4ce726 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2505,7 +2505,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; } if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { print ''; print $object->socialnetworks[$key]; @@ -2513,7 +2513,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; } else { // if social network is not active but value exist we do not want to loose it - print ''; + print ''; } } } From bea431cbb98d9568ba33dd33141d278a6480fcd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 18:48:47 +0200 Subject: [PATCH 058/183] Update skillrank.class.php --- htdocs/hrm/class/skillrank.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 8e34465b420..1f77a1d66be 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -414,15 +414,15 @@ class SkillRank extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.rowid') { - $sqlwhere[] = $key.'='.$value; - } elseif ($key !='customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + $sqlwhere[] = $key." = ".$value; + } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } From 74c4cb618d92f3e4f69664ef57ed55118d3e1cfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 18:49:14 +0200 Subject: [PATCH 059/183] Update skillrank.class.php --- htdocs/hrm/class/skillrank.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 1f77a1d66be..51768171049 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -414,7 +414,7 @@ class SkillRank extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.rowid') { - $sqlwhere[] = $key." = ".$value; + $sqlwhere[] = $key." = ".((int) $value); } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { From f0d0bf6442e5d00160586e2f7a83e3a3cfea3bea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 18:52:43 +0200 Subject: [PATCH 060/183] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 728bb048a16..ac4e1447b84 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -258,7 +258,7 @@ class Products extends DolibarrApi if (is_array($product_static->stock_warehouse)) { foreach ($product_static->stock_warehouse as $keytmp => $valtmp) { - if (isset($this->product->stock_warehouse[$keytmp]->detail_batc) && is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { + if (isset($this->product->stock_warehouse[$keytmp]->detail_batch) && is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { foreach ($product_static->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { unset($product_static->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); } @@ -2045,7 +2045,7 @@ class Products extends DolibarrApi if (is_array($this->product->stock_warehouse)) { foreach ($this->product->stock_warehouse as $keytmp => $valtmp) { - if (isset($this->product->stock_warehouse[$keytmp]->detail_batc) && is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { + if (isset($this->product->stock_warehouse[$keytmp]->detail_batch) && is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { foreach ($this->product->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { unset($this->product->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); } From b2bc6059dfe8f138b46f0f12884916435f077507 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 18:55:16 +0200 Subject: [PATCH 061/183] Fix test --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index ac4e1447b84..2566ca24919 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -258,7 +258,7 @@ class Products extends DolibarrApi if (is_array($product_static->stock_warehouse)) { foreach ($product_static->stock_warehouse as $keytmp => $valtmp) { - if (isset($this->product->stock_warehouse[$keytmp]->detail_batch) && is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { + if (isset($product_static->stock_warehouse[$keytmp]->detail_batch) && is_array($product_static->stock_warehouse[$keytmp]->detail_batch)) { foreach ($product_static->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { unset($product_static->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); } From 89d135288b0fddb2e8fc6f2158e86f9faa91af72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jun 2022 20:33:10 +0200 Subject: [PATCH 062/183] Doc --- htdocs/core/modules/modCommande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 80e5468b140..e75147ba78a 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -370,7 +370,7 @@ class modCommande extends DolibarrModules ), ); - //Import CPV Lines + //Import Order Lines $r++; $this->import_code[$r] = 'commande_lines_'.$r; $this->import_label[$r] = 'SaleOrderLines'; From fe557ce9db4d15e6e436c1c1c7385020a8a442f6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 20:41:27 +0200 Subject: [PATCH 063/183] Update bank.php --- htdocs/user/bank.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 117c9950efb..b7a9ea4ef2c 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -446,7 +446,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print "\n"; // Date of birth - if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { + if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) { print ''; print ''; print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer); @@ -457,7 +457,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Personal email - if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { + if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) { print ''; print ''; print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -468,7 +468,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Personal phone - if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { + if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) { print ''; print ''; print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -533,7 +533,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Employee Number - if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { + if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) { print ''; print ''; print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); @@ -544,7 +544,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // National registration number - if (isset($user->rights->hrm->read_personal_information->read) || isset($user->rights->hrm->write_personal_information->write)) { + if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) { print ''; print ''; print $form->editfieldkey("NationalRegistrationNumber", 'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer || $user->rights->hrm->write_personal_information->write); From 55afe1939d3398bcf9cfb72414e42945683c96f6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 12 Jun 2022 21:33:08 +0200 Subject: [PATCH 064/183] Fix php8 compatibility --- .../restler/framework/Luracast/Restler/CommentParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php index 6b8b9178f6b..d49211ae80c 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php @@ -420,7 +420,7 @@ class CommentParser $exception = $v1; array_shift($value); } - } elseif (count($value) && is_numeric($value[0])) { + } elseif (count($value) && isset($value[0]) && is_numeric($value[0])) { $code = $value[0]; array_shift($value); } From 683cc5594f104e6caa412d33aa956d9879c5e28d Mon Sep 17 00:00:00 2001 From: bagtaib Date: Mon, 13 Jun 2022 01:58:48 +0200 Subject: [PATCH 065/183] FIX #21138 --- htdocs/imports/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 01f152f1ea5..871c8bd7f6f 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -136,7 +136,7 @@ $step = (GETPOST('step') ? GETPOST('step') : 1); $import_name = GETPOST('import_name'); $hexa = GETPOST('hexa'); $importmodelid = GETPOST('importmodelid'); -$excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 1); +$excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2); $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); $separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ',')); From 3d5227918dc5b553da3b2ad242faf58b0ce6f203 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 03:53:35 +0200 Subject: [PATCH 066/183] Fix PHP8 on bank --- htdocs/compta/bank/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index c08cf54ab4e..722e39bef55 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -458,7 +458,7 @@ if ($action == 'create') { print ''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '90%'); + $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '90%'); $doleditor->Create(); print ''; From 74e74e237791187a027b7732dc34b21c5ffa1775 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 03:53:40 +0200 Subject: [PATCH 067/183] Fix PHP8 on bank --- htdocs/compta/bank/class/account.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 429d7c704c8..cee2874d8c5 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -145,6 +145,12 @@ class Account extends CommonObject */ public $iban_prefix; + /** + * Address of the bank + * @var string + */ + public $domiciliation; + /** * XML SEPA format: place Payment Type Information (PmtTpInf) in Credit Transfer Transaction Information (CdtTrfTxInf) * @var int From 9c8f7bd174fcfadc3a60a8da3515f2c16fd7920b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 03:56:46 +0200 Subject: [PATCH 068/183] Fix PHP8 on bank --- htdocs/compta/bank/treso.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 98a51947c0e..71e5cf37c87 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -1,8 +1,8 @@ - * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) - * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2015 Marcos García + * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) + * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -185,7 +185,7 @@ if (GETPOST("account") || GETPOST("ref")) { $solde = $object->solde(0); - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + if (getDolGlobalInt('MULTICOMPANY_INVOICE_SHARING_ENABLED')) { $colspan = 6; } else { $colspan = 5; @@ -199,7 +199,7 @@ if (GETPOST("account") || GETPOST("ref")) { print ''; print ''.$langs->trans("DateDue").''; print ''.$langs->trans("Description").''; - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + if (getDolGlobalInt('MULTICOMPANY_INVOICE_SHARING_ENABLED')) { print ''.$langs->trans("Entity").''; } print ''.$langs->trans("ThirdParty").''; From 25c2fb0528a9c3aa173dd3eeb51fd558c2090106 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 04:37:41 +0200 Subject: [PATCH 069/183] Fix PHP8 on bank --- htdocs/compta/bank/annuel.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 36a9d17315a..5d6c2045d47 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004-2017 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Charles-Fr BENKE +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Charles-Fr BENKE * * 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 @@ -78,6 +78,9 @@ if (!empty($ref)) { $id = $object->id; } +$annee = ''; +$totentrees = array(); +$totsorties = array(); // Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture) // plutot que sur llx_paiement + llx_paiementfourn @@ -192,14 +195,14 @@ for ($mois = 1; $mois < 13; $mois++) { $case = sprintf("%04s-%02s", $annee, $mois); print ' '; - if ($decaiss[$case] > 0) { + if (isset($decaiss[$case]) && $decaiss[$case] > 0) { print price($decaiss[$case]); $totsorties[$annee] += $decaiss[$case]; } print ""; print ' '; - if ($encaiss[$case] > 0) { + if (isset($encaiss[$case]) && $encaiss[$case] > 0) { print price($encaiss[$case]); $totentrees[$annee] += $encaiss[$case]; } @@ -211,7 +214,8 @@ for ($mois = 1; $mois < 13; $mois++) { // Total debit-credit print ''.$langs->trans("Total").""; for ($annee = $year_start; $annee <= $year_end; $annee++) { - print ''.price($totsorties[$annee]).''.price($totentrees[$annee]).''; + print ''. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .''; + print ''. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .''; } print "\n"; @@ -245,6 +249,7 @@ if ($resql) { print ''; +$nbcol = ''; print '"; print ''; print "\n"; @@ -267,7 +272,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } @@ -299,7 +304,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'"; $sql .= " AND b.amount > 0"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; @@ -381,7 +386,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'"; $sql .= " AND b.amount < 0"; - if ($id && $_GET["option"] != 'all') { + if ($id && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($id).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; From 3032de261d84bebb1d670e2351e84711bcf40303 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 04:37:56 +0200 Subject: [PATCH 070/183] Fix PHP8 on bank --- htdocs/compta/bank/graph.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 4c0efec57d2..459134dc68a 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -95,7 +95,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -137,7 +137,7 @@ if ($result < 0) { $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -165,7 +165,7 @@ if ($result < 0) { $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev < '".$db->escape($year)."-".sprintf("%02s", $month)."-01'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -279,7 +279,7 @@ if ($result < 0) { $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -307,7 +307,7 @@ if ($result < 0) { $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.datev < '".$db->escape($year)."-01-01'"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } @@ -415,7 +415,7 @@ if ($result < 0) { $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " WHERE b.fk_account = ba.rowid"; $sql .= " AND ba.entity IN (".getEntity('bank_account').")"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%Y%m%d')"; @@ -540,7 +540,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; $sql .= " AND b.amount > 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%d')"; @@ -575,7 +575,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-".$db->escape($month)."-01 00:00:00'"; $sql .= " AND b.datev < '".$db->escape($yearnext)."-".$db->escape($monthnext)."-01 00:00:00'"; $sql .= " AND b.amount < 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%d')"; @@ -649,7 +649,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; $sql .= " AND b.amount > 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%m');"; @@ -676,7 +676,7 @@ if ($result < 0) { $sql .= " AND b.datev >= '".$db->escape($year)."-01-01 00:00:00'"; $sql .= " AND b.datev <= '".$db->escape($year)."-12-31 23:59:59'"; $sql .= " AND b.amount < 0"; - if ($account && $_GET["option"] != 'all') { + if ($account && GETPOST("option") != 'all') { $sql .= " AND b.fk_account IN (".$db->sanitize($account).")"; } $sql .= " GROUP BY date_format(b.datev,'%m')"; @@ -748,7 +748,7 @@ if ($account) { if (!preg_match('/,/', $account)) { $moreparam = '&month='.$month.'&year='.$year.($mode == 'showalltime' ? '&mode=showalltime' : ''); - if ($_GET["option"] != 'all') { + if (GETPOST("option") != 'all') { $morehtml = ''.$langs->trans("ShowAllAccounts").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); } else { From 10ff06167215d4b837e61794f33910447661c8ab Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jun 2022 04:38:16 +0200 Subject: [PATCH 071/183] Fix PHP8 on bank --- htdocs/compta/bank/releve.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 9a0adb6957f..d424a3a8fef 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017 Patrick Delcroix - * Copyright (C) 2019 Nicolas ZABOURI +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2017 Patrick Delcroix + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2022 Alexandre Spangaro * * 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 @@ -57,6 +58,8 @@ $ve = GETPOST("ve", 'alpha'); $brref = GETPOST('brref', 'alpha'); $oldbankreceipt = GETPOST('oldbankreceipt', 'alpha'); $newbankreceipt = GETPOST('newbankreceipt', 'alpha'); +$rel = GETPOST("rel", 'alphanohtml'); +$backtopage = GETPOST('backtopage', 'alpha'); // Security check $fieldid = (!empty($ref) ? $ref : $id); @@ -112,7 +115,7 @@ $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id // Define number of receipt to show (current, previous or next one ?) $found = false; -if ($_GET["rel"] == 'prev') { +if ($rel == 'prev') { // Recherche valeur pour num = numero releve precedent $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -130,7 +133,7 @@ if ($_GET["rel"] == 'prev') { $found = true; } } -} elseif ($_GET["rel"] == 'next') { +} elseif ($rel == 'next') { // Recherche valeur pour num = numero releve precedent $sql = "SELECT DISTINCT(b.num_releve) as num"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -237,10 +240,10 @@ if (empty($numref)) { $sql .= $db->order($sortfield, $sortorder); // Count total nb of records - $nbtotalofrecords = ''; + $totalnboflines = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $totalnboflines = $db->num_rows($result); } $sql .= $db->plimit($conf->liste_limit + 1, $offset); @@ -399,9 +402,8 @@ if (empty($numref)) { $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); print load_fiche_titre($title, $morehtmlright, ''); - //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'bank_account', 0, '', '', 0, 1); - print "
"; + print ''; print ''; print ''; From bc11cf62f84ef087f573d926ea08449434103c0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 10:44:20 +0200 Subject: [PATCH 072/183] FIX #hunterdev2acfc8fe-247c-4f88-aeaa-042b6b8690a0 --- htdocs/adherents/card.php | 10 ++--- htdocs/admin/accountant.php | 42 +++++++++--------- htdocs/admin/company.php | 44 +++++++++---------- htdocs/admin/dict.php | 4 +- htdocs/admin/ldap.php | 2 +- htdocs/admin/mails_templates.php | 4 +- htdocs/admin/receiptprinter.php | 2 +- htdocs/admin/ticket_public.php | 2 +- htdocs/compta/bank/card.php | 8 ++-- htdocs/compta/facture/card-rec.php | 8 ++-- htdocs/contact/card.php | 2 +- htdocs/core/lib/functions.lib.php | 16 ++++--- htdocs/fourn/facture/card-rec.php | 6 +-- htdocs/fourn/facture/card.php | 30 ++++++------- htdocs/imports/import.php | 4 +- htdocs/modulebuilder/admin/setup.php | 12 ++--- htdocs/opensurvey/results.php | 2 +- htdocs/product/fournisseurs.php | 6 +-- .../public/eventorganization/attendee_new.php | 2 +- htdocs/public/members/new.php | 4 +- htdocs/public/opensurvey/studs.php | 4 +- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/user/card.php | 6 +-- htdocs/user/clicktodial.php | 2 +- htdocs/user/group/card.php | 6 +-- htdocs/website/index.php | 2 +- 26 files changed, 119 insertions(+), 113 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 88a63af0ae1..d7e46749de3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -285,7 +285,7 @@ if (empty($reshook)) { $object->lastname = trim(GETPOST("lastname", 'alphanohtml')); $object->gender = trim(GETPOST("gender", 'alphanohtml')); $object->login = trim(GETPOST("login", 'alphanohtml')); - $object->pass = trim(GETPOST("pass", 'alpha')); + $object->pass = trim(GETPOST("pass", 'none')); // For password, we must use 'none' $object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated $object->company = trim(GETPOST("societe", 'alphanohtml')); @@ -450,8 +450,8 @@ if (empty($reshook)) { $email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); $url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); $login = GETPOST("member_login", 'alphanohtml'); - $pass = GETPOST("password", 'alpha'); - $photo = GETPOST("photo", 'alpha'); + $pass = GETPOST("password", 'none'); // For password, we use 'none' + $photo = GETPOST("photo", 'alphanohtml'); $morphy = GETPOST("morphy", 'alphanohtml'); $public = GETPOST("public", 'alphanohtml'); @@ -999,7 +999,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password = getRandomPassword(false); print '
'; } @@ -1224,7 +1224,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; } // Morphy $morphys["phy"] = $langs->trans("Physical"); diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 693170862e9..c6d321707dc 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -53,18 +53,18 @@ if ($reshook < 0) { if (($action == 'update' && !GETPOST("cancel", 'alpha')) || ($action == 'updateedit')) { - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity); if ($action != 'updateedit' && !$error) { @@ -119,17 +119,17 @@ print ''."\n"; +print 'global->MAIN_INFO_ACCOUNTANT_NAME) ? ' autofocus="autofocus"' : '').'>'."\n"; // Address print ''."\n"; +print ''."\n"; print ''."\n"; +print ''."\n"; print ''."\n"; +print ''."\n"; // Country print ''."\n"; print ''."\n"; print ''; +print ''; print ''."\n"; print ''; +print ''; print ''."\n"; print ''; +print ''; print ''."\n"; // Web print ''; +print ''; print ''."\n"; // Code print ''."\n"; +print ''."\n"; // Note print ''."\n"; +print 'global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'>'."\n"; // Address print ''."\n"; +print ''."\n"; // Zip print ''."\n"; +print ''."\n"; print ''."\n"; +print ''."\n"; // Country print ''; +print ''; // GDPR contact print ''; +print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">'; // Capital print ''; +print ''; // Juridical Status print ''; print '
'.$langs->trans("CurrentBalance")."'.price($balance).'
'.$langs->trans("Password").''; - print ''; + print ''; print '
'.$langs->trans("Password").'pass).'">
'.$langs->trans("Password").'pass).'">
'.$langs-> // Name print '
'; -print 'global->MAIN_INFO_ACCOUNTANT_NAME) ? ' autofocus="autofocus"' : '').'>
'; -print '
'; -print '
'; -print '
'; @@ -142,33 +142,33 @@ print '
'; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); print '
'; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'; print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'; -print '
'; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index c3cb92dba8d..86800eea947 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -91,9 +91,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $db->begin(); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -178,19 +178,19 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) } } - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START", 'int'), 'chaine', 0, '', $conf->entity); @@ -403,18 +403,18 @@ print '
'.$langs-> // Name print '
'; -print 'global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'>
'; -print '
'; -print '
'; -print '
'; @@ -564,17 +564,17 @@ $langs->load("companies"); // Managing Director(s) print '
'; -print '
'; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; -print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">
'; -print '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b3bc612fde3..5c1a356e102 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -906,7 +906,7 @@ if (empty($reshook)) { } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { - $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } $i++; @@ -975,7 +975,7 @@ if (empty($reshook)) { } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { - $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } $i++; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index e122bdf5930..ef488943a4b 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -244,7 +244,7 @@ print ''.$langs->trans // Pass print ''; print '
'.$langs->trans("LDAPPassword").''; -print ''; +print ''; print ''.$langs->trans('Password').' (ex: secret)
'; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 1cb277de4e2..619a5003161 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -403,7 +403,7 @@ if (empty($reshook)) { } elseif (in_array($keycode, array('joinfiles', 'private', 'position', 'entity'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { - $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } $i++; } @@ -485,7 +485,7 @@ if (empty($reshook)) { } elseif (in_array($keycode, array('joinfiles', 'private', 'position'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { - $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; + $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } $i++; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index cb625dbe039..ac136af0c61 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -45,7 +45,7 @@ $printername = GETPOST('printername', 'alpha'); $printerid = GETPOST('printerid', 'int'); $parameter = GETPOST('parameter', 'alpha'); -$template = GETPOST('template', 'nohtml'); +$template = GETPOST('template', 'alphanohtml'); $templatename = GETPOST('templatename', 'alpha'); $templateid = GETPOST('templateid', 'int'); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 621eceb50a3..1a4e3342cd0 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -89,7 +89,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } } - $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml'); + $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alphanohtml'); if (!empty($topic_interface)) { $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity); } else { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index c08cf54ab4e..4ff73b2947c 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -125,11 +125,11 @@ if (empty($reshook)) { $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "nohtml")); + $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); - $object->owner_address = trim(GETPOST("owner_address", 'nohtml')); + $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->ics = trim(GETPOST("ics", 'alpha')); $object->ics_transfer = trim(GETPOST("ics_transfer", 'alpha')); @@ -226,11 +226,11 @@ if (empty($reshook)) { $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "nohtml")); + $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); - $object->owner_address = trim(GETPOST("owner_address", 'nohtml')); + $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->ics = trim(GETPOST("ics", 'alpha')); $object->ics_transfer = trim(GETPOST("ics_transfer", 'alpha')); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 39b8c16614d..e8346a11896 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -201,12 +201,12 @@ if (empty($reshook)) { } if (!$error) { - $object->titre = GETPOST('title', 'nohtml'); // deprecated - $object->title = GETPOST('title', 'nohtml'); + $object->titre = GETPOST('title', 'alphanohtml'); // deprecated + $object->title = GETPOST('title', 'alphanohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->model_pdf = GETPOST('modelpdf', 'alpha'); - $object->usenewprice = GETPOST('usenewprice', 'alpha'); + $object->model_pdf = GETPOST('modelpdf', 'alphanohtml'); + $object->usenewprice = GETPOST('usenewprice', 'alphanohtml'); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 30189680bc7..09d46d02b13 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1039,7 +1039,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print '
'; - print ''; + print ''; print '
'; if ($conf->use_javascript_ajax) { print ''.$langs->trans('CopyAddressFromSoc').'
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 44dcf0a57d0..ab6882e28a2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6634,12 +6634,18 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = if ($strip_tags) { $temp = strip_tags($temp); } else { - $temp = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning - $pattern = "/<[^<>]+>/"; - // Example of $temp: 0000-021 - $temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: 0000-021 - $temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021 // Remove '<' into remainging, so remove non closing html tags like '0000-021 + // pass 1 - $temp after pass 1: 0000-021 + // pass 2 - $temp after pass 2: 0000-021 + $tempbis = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning + $tempbis = preg_replace($pattern, '', $tempbis); + } while ($tempbis != $temp); + $temp = $tempbis; + + // Remove '<' into remaining, so remove non closing html tags like 'titre = GETPOST('title', 'nohtml'); // deprecated - $object->title = GETPOST('title', 'nohtml'); + $object->titre = GETPOST('title', 'alphanohtml'); // deprecated + $object->title = GETPOST('title', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f9250d255ca..4ad8555ba24 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -747,10 +747,10 @@ if (empty($reshook)) { $result = $object->fetch(GETPOST('fac_replacement', 'int')); $object->fetch_thirdparty(); - $object->ref = GETPOST('ref', 'nohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -812,11 +812,11 @@ if (empty($reshook)) { $tmpproject = GETPOST('projectid', 'int'); // Creation facture - $object->ref = GETPOST('ref', 'nohtml'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); - $object->label = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); + $object->label = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); @@ -903,13 +903,13 @@ if (empty($reshook)) { if (!$error) { $object->socid = GETPOST('socid', 'int'); - $object->type = GETPOST('type'); - $object->ref = GETPOST('ref'); + $object->type = GETPOST('type', 'alphanohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); $object->date = $dateinvoice; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); - $object->model_pdf = GETPOST('model'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); + $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); @@ -962,12 +962,12 @@ if (empty($reshook)) { // Creation invoice $object->socid = GETPOST('socid', 'int'); - $object->type = GETPOST('type'); - $object->ref = GETPOST('ref', 'nohtml'); - $object->ref_supplier = GETPOST('ref_supplier', 'nohtml'); + $object->type = GETPOST('type', 'alphanohtml'); + $object->ref = GETPOST('ref', 'alphanohtml'); + $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); - $object->libelle = GETPOST('label', 'nohtml'); // deprecated - $object->label = GETPOST('label', 'nohtml'); + $object->libelle = GETPOST('label', 'alphanohtml'); // deprecated + $object->label = GETPOST('label', 'alphanohtml'); $object->date = $dateinvoice; $object->date_echeance = $datedue; $object->note_public = GETPOST('note_public', 'restricthtml'); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index ab7bbd95266..c625b97e6a6 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -139,8 +139,8 @@ $importmodelid = GETPOST('importmodelid', 'int'); $excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 2); $endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : ''); $updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array()); -$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml', 3) : ''); -$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); +$separator = (GETPOST('separator', 'alphanohtml') ? GETPOST('separator', 'alphanohtml', 3) : ''); +$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " $separator_used = str_replace('\t', "\t", $separator); $objimport = new Import($db); diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 08791b8324a..da2cff7eff4 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -40,13 +40,13 @@ $backtopage = GETPOST('backtopage', 'alpha'); if ($action == "update") { $res1 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README', 'restricthtml'), 'chaine', 0, '', $conf->entity); - $res2 = dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTOR', GETPOST('MODULEBUILDER_ASCIIDOCTOR', 'nohtml'), 'chaine', 0, '', $conf->entity); - $res3 = dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTORPDF', GETPOST('MODULEBUILDER_ASCIIDOCTORPDF', 'nohtml'), 'chaine', 0, '', $conf->entity); - $res4 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_NAME', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_NAME', 'nohtml'), 'chaine', 0, '', $conf->entity); - $res5 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_URL', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_URL', 'nohtml'), 'chaine', 0, '', $conf->entity); - $res6 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_FAMILY', GETPOST('MODULEBUILDER_SPECIFIC_FAMILY', 'nohtml'), 'chaine', 0, '', $conf->entity); + $res2 = dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTOR', GETPOST('MODULEBUILDER_ASCIIDOCTOR', 'alphanohtml'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'MODULEBUILDER_ASCIIDOCTORPDF', GETPOST('MODULEBUILDER_ASCIIDOCTORPDF', 'alphanohtml'), 'chaine', 0, '', $conf->entity); + $res4 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_NAME', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_NAME', 'alphanohtml'), 'chaine', 0, '', $conf->entity); + $res5 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_URL', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_URL', 'alphanohtml'), 'chaine', 0, '', $conf->entity); + $res6 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_FAMILY', GETPOST('MODULEBUILDER_SPECIFIC_FAMILY', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res7 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_AUTHOR', GETPOST('MODULEBUILDER_SPECIFIC_AUTHOR', 'html'), 'chaine', 0, '', $conf->entity); - $res8 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_VERSION', GETPOST('MODULEBUILDER_SPECIFIC_VERSION', 'nohtml'), 'chaine', 0, '', $conf->entity); + $res8 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_VERSION', GETPOST('MODULEBUILDER_SPECIFIC_VERSION', 'alphanohtml'), 'chaine', 0, '', $conf->entity); if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index eda16dec32c..d726152eaa4 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -75,7 +75,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo } } - $nom = substr(GETPOST("nom", 'nohtml'), 0, 64); + $nom = substr(GETPOST("nom", 'alphanohtml'), 0, 64); // Check if vote already exists $sql = 'SELECT id_users, nom as name'; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 88ebb387850..96ce57c5bbe 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -192,7 +192,7 @@ if (empty($reshook)) { if (empty($ref_fourn_old)) { $ref_fourn_old = $ref_fourn; } - $quantity = price2num(GETPOST("qty", 'nohtml'), 'MS'); + $quantity = price2num(GETPOST("qty", 'alphanohtml'), 'MS'); $remise_percent = price2num(GETPOST('remise_percent', 'alpha')); $npr = preg_match('/\*/', GETPOST('tva_tx', 'alpha')) ? 1 : 0; @@ -555,7 +555,7 @@ if ($id > 0 || $ref) { print ''; print ''.$langs->trans("QtyMin").''; print ''; - $quantity = GETPOSTISSET('qty') ? price2num(GETPOST('qty', 'nohtml'), 'MS') : "1"; + $quantity = GETPOSTISSET('qty') ? price2num(GETPOST('qty', 'alphanohtml'), 'MS') : "1"; if ($rowid) { print ''; print $object->fourn_qty; @@ -577,7 +577,7 @@ if ($id > 0 || $ref) { print ''.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).''; print ''; - $packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'nohtml'), 'MS') : ((empty($rowid)) ? "1" : price2num($object->packaging, 'MS')); + $packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'alphanohtml'), 'MS') : ((empty($rowid)) ? "1" : price2num($object->packaging, 'MS')); print ''; // Units diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 40e082c6f2e..661ae6accfe 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -67,7 +67,7 @@ $action = GETPOST('action', 'aZ09'); $email = GETPOST("email"); $societe = GETPOST("societe"); $emailcompany = GETPOST("emailcompany"); -$note_public = GETPOST('note_public', "nohtml"); +$note_public = GETPOST('note_public', "restricthtml"); // Getting id from Post and decoding it $type = GETPOST('type', 'aZ09'); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 7a27ae14b62..31f1fa9f952 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -563,8 +563,8 @@ print 'global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Login").' *'."\n"; - print ''.$langs->trans("Password").' *'."\n"; - print ''.$langs->trans("PasswordAgain").' *'."\n"; + print ''.$langs->trans("Password").' *'."\n"; + print ''.$langs->trans("PasswordAgain").' *'."\n"; } // Gender print ''.$langs->trans("Gender").''; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 02ee2df87e2..acf1fb01b56 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -112,7 +112,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo } //Si le nom est bien entré - if (GETPOST('nom', 'nohtml')) { + if (GETPOST('nom', 'alphanohtml')) { $nouveauchoix = ''; for ($i = 0; $i < $nbcolonnes; $i++) { if (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '1') { @@ -124,7 +124,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo } } - $nom = substr(GETPOST("nom", 'nohtml'), 0, 64); + $nom = substr(GETPOST("nom", 'alphanohtml'), 0, 64); // Check if vote already exists $sql = 'SELECT id_users, nom as name'; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e1314f369a0..6bc194fed21 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2594,7 +2594,7 @@ class Ticket extends CommonObject if (is_array($internal_contacts) && count($internal_contacts) > 0) { // altairis: set default subject $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $subject = GETPOST('subject', 'nohtml') ? GETPOST('subject', 'nohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); + $subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); $message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id); $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index ce91f4ce726..36807533a66 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -997,11 +997,11 @@ if ($action == 'create' || $action == 'adduserldap') { } if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if (!empty($ldap_pass)) { // For very old system comaptibilty. Now clear password can't be viewed from LDAP read - $valuetoshow .= ($valuetoshow ? ', ' : '').''; // Dolibarr password is preffiled with LDAP known password + $valuetoshow .= ($valuetoshow ? ', ' : '').''; // Dolibarr password is preffiled with LDAP known password $valuetoshow .= preg_replace('/./i', '*', $ldap_pass); } else { // We do not use a field password but a field text to show new password to use. - $valuetoshow .= ($valuetoshow ? ', ' : '').''; + $valuetoshow .= ($valuetoshow ? ', ' : '').''; } } @@ -2348,7 +2348,7 @@ if ($action == 'create' || $action == 'adduserldap') { } if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($caneditpassword) { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 2207e3358ae..0dd38cc057b 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -139,7 +139,7 @@ if ($id > 0) { print 'ClickToDial '.$langs->trans("Password").''; print ''; - print ''; + print ''; print "\n"; print ''; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index fa9a438e350..1acfa858663 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -122,11 +122,11 @@ if (empty($reshook)) { // Action add group if ($action == 'add') { if ($caneditperms) { - if (!GETPOST("nom", "nohtml")) { + if (!GETPOST("nom", "alphanohtml")) { setEventMessages($langs->trans("NameNotDefined"), null, 'errors'); $action = "create"; // Go back to create page } else { - $object->name = GETPOST("nom", 'nohtml'); + $object->name = GETPOST("nom", 'alphanohtml'); $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); // Fill array 'array_options' with data from add form @@ -206,7 +206,7 @@ if (empty($reshook)) { $object->oldcopy = clone $object; - $object->name = GETPOST("nom", 'nohtml'); + $object->name = GETPOST("nom", 'alphanohtml'); $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml'))); // Fill array 'array_options' with data from add form diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 164f327a52d..0a58c0bcf44 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3323,7 +3323,7 @@ if ($action == 'editcss') { // Clean the php htaccesscontent file to remove php code and get only html part $htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent); } else { - $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); + $htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept " } if (!trim($htaccesscontent)) { $htaccesscontent .= "# Order allow,deny\n"; From e9d5ba5de3a2456fc80a859dbcf7b8c07f6ed21f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 10:58:21 +0200 Subject: [PATCH 073/183] Debug v16 --- htdocs/intracommreport/card.php | 17 +++++++++++++++-- .../class/intracommreport.class.php | 5 ++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php index e801416d63d..681320e0d75 100644 --- a/htdocs/intracommreport/card.php +++ b/htdocs/intracommreport/card.php @@ -68,6 +68,19 @@ $hookmanager->initHooks(array('intracommcard', 'globalcard')); $error = 0; +$permissiontoread = $user->rights->intracommreport->read; +$permissiontoadd = $user->rights->intracommreport->write; +$permissiontodelete = $user->rights->intracommreport->delete; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->intracommreport->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + /* * Actions @@ -80,7 +93,7 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $confirm == 'yes') { +if ($permissiontodelete && $action == 'confirm_delete' && $confirm == 'yes') { $result = $object->delete($id, $user); if ($result > 0) { if (!empty($backtopage)) { @@ -95,7 +108,7 @@ if ($user->rights->intracommreport->delete && $action == 'confirm_delete' && $co } } -if ($action == 'add' && $user->rights->intracommreport->write) { +if ($action == 'add' && $permissiontoadd) { $object->label = trim($label); $object->type = trim($exporttype); $object->type_declaration = $type_declaration; diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index ef13649f8c8..c34ad5d8f58 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -124,7 +124,6 @@ class IntracommReport extends CommonObject */ public function getXML($mode = 'O', $type = 'introduction', $period_reference = '') { - global $conf, $mysoc; /**************Construction de quelques variables********************/ @@ -437,7 +436,8 @@ class IntracommReport extends CommonObject */ public function getNextDeclarationNumber() { - $resql = $this->db->query('SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'"); + $sql = 'SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'"; + $resql = $this->db->query($sql); if ($resql) { $res = $this->db->fetch_object($resql); } @@ -463,7 +463,6 @@ class IntracommReport extends CommonObject */ public function generateXMLFile() { - $name = $this->periode.'.xml'; $fname = sys_get_temp_dir().'/'.$name; $f = fopen($fname, 'w+'); From 09f47cfd9d414592a1f0c787a1406d484523e3bf Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 11:36:46 +0200 Subject: [PATCH 074/183] FIX Srutinizer 'The property socid does not seem to exist on RecruitmentJobPosition' --- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 9a0a21484b1..e9da2466f8a 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -461,7 +461,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { From 5decd0014931649221ae3e8a4f3ea4034ce5ec9c Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Mon, 13 Jun 2022 10:40:41 +0000 Subject: [PATCH 075/183] fix: remove duplication bank transaction do not duplicate previous bank transaction when value is 0 --- htdocs/compta/paiement/list.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 20f69401fd6..8fcc4474909 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -441,9 +441,15 @@ while ($i < min($num, $limit)) { // Bank transaction if (!empty($arrayfields['transaction']['checked'])) { - $bankline->fetch($objp->fk_bank); - print ''.$bankline->getNomUrl(1, 0).''; - if (!$i) $totalarray['nbfield']++; + print ''; + if ($objp->fk_bank) { + $bankline->fetch($objp->fk_bank); + print $bankline->getNomUrl(1, 0); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Bank account From 00d3750ab105e65367de751b1bb5c541c378eb71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 13:10:56 +0200 Subject: [PATCH 076/183] Fix infinite loop --- htdocs/core/lib/functions.lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ab6882e28a2..45e2d51c344 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6636,13 +6636,17 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = } else { // Remove '<' into remainging, so remove non closing html tags like '0000-021 + // pass 1 - $temp after pass 1: 0000-021 + // pass 2 - $temp after pass 2: 0000-021 + $tempbis = $temp; do { - // Example of $temp: 0000-021 - // pass 1 - $temp after pass 1: 0000-021 - // pass 2 - $temp after pass 2: 0000-021 + $temp = $tempbis; $tempbis = str_replace('<>', '', $temp); // No reason to have this into a text, except if value is to try bypass the next html cleaning $tempbis = preg_replace($pattern, '', $tempbis); + //$idowhile++; print $temp.'-'.$tempbis."\n"; if ($idowhile > 100) break; } while ($tempbis != $temp); + $temp = $tempbis; // Remove '<' into remaining, so remove non closing html tags like ' Date: Mon, 13 Jun 2022 14:29:18 +0200 Subject: [PATCH 077/183] FIX : missins time spent list menu --- htdocs/core/menus/standard/eldy.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 58ddeb0fbf3..8f5ecad4af5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1783,7 +1783,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 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->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="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); + } + + } } From 41db1c53596431e1c571c4efab90a715bcb3f6a6 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 13 Jun 2022 14:31:19 +0200 Subject: [PATCH 078/183] Clean code --- htdocs/core/menus/standard/eldy.lib.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8f5ecad4af5..2b644b52705 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1786,8 +1786,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $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); } - - } } From 54777f9614affa45e62b144c9cc4e12c943bc4a9 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 14:33:23 +0200 Subject: [PATCH 079/183] array productCombinations implicitly converted to a boolean --- htdocs/variants/combinations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 9e1d791a626..b6ffd948bd6 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -915,7 +915,7 @@ if (!empty($id) || !empty($ref)) { print 'id.'">'.img_delete().''; print ''; print ''; - if ($productCombinations || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if (!empty($productCombinations) || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($prodstatic->id, $arrayofselected)) { $selected = 1; From fb0690d6eff6b32b6513104fa5a6126ad1ee8828 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 13 Jun 2022 12:38:14 +0000 Subject: [PATCH 080/183] Fixing style errors. --- htdocs/core/menus/standard/eldy.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2b644b52705..57f5238350c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1784,7 +1784,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $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="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); - } } } From 7ff9c868176df5961d060ae78b3d36b58ad5229d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 15:03:45 +0200 Subject: [PATCH 081/183] Fix phpcs --- .../class/intracommreport.class.php | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index c34ad5d8f58..5411e6b7aaa 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -24,6 +24,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; + /** * Class to manage intracomm report */ @@ -285,34 +286,34 @@ class IntracommReport extends CommonObject global $mysoc, $conf; if ($type == 'expedition' || $exporttype == 'des') { - $sql = 'SELECT f.ref as refinvoice, f.total_ht'; + $sql = "SELECT f.ref as refinvoice, f.total_ht"; $table = 'facture'; $table_extraf = 'facture_extrafields'; $tabledet = 'facturedet'; $field_link = 'fk_facture'; } else { // Introduction - $sql = 'SELECT f.ref_supplier as refinvoice, f.total_ht'; + $sql = "SELECT f.ref_supplier as refinvoice, f.total_ht"; $table = 'facture_fourn'; $table_extraf = 'facture_fourn_extrafields'; $tabledet = 'facture_fourn_det'; $field_link = 'fk_facture_fourn'; } - $sql .= ', l.fk_product, l.qty + $sql .= ", l.fk_product, l.qty , p.weight, p.rowid as id_prod, p.customcode , s.rowid as id_client, s.nom, s.zip, s.fk_pays, s.tva_intra , c.code , ext.mode_transport - FROM '.MAIN_DB_PREFIX.$tabledet.' l - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = l.'.$field_link.') - LEFT JOIN '.MAIN_DB_PREFIX.$table_extraf.' ext ON (ext.fk_object = f.rowid) - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = l.fk_product) - INNER JOIN '.MAIN_DB_PREFIX.'societe s ON (s.rowid = f.fk_soc) - LEFT JOIN '.MAIN_DB_PREFIX.'c_country c ON (c.rowid = s.fk_pays) + FROM ".MAIN_DB_PREFIX.$tabledet." l + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = l.".$this->db->escape($field_link).") + LEFT JOIN ".MAIN_DB_PREFIX.$table_extraf." ext ON (ext.fk_object = f.rowid) + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = l.fk_product) + INNER JOIN ".MAIN_DB_PREFIX."societe s ON (s.rowid = f.fk_soc) + LEFT JOIN ".MAIN_DB_PREFIX."c_country c ON (c.rowid = s.fk_pays) WHERE f.fk_statut > 0 - AND l.product_type = '.($exporttype == 'des' ? 1 : 0).' - AND f.entity = '.$conf->entity.' - AND (s.fk_pays <> '.$mysoc->country_id.' OR s.fk_pays IS NULL) - AND f.datef BETWEEN "'.$period_reference.'-01" AND "'.$period_reference.'-'.date('t').'"'; + AND l.product_type = ".($exporttype == "des" ? 1 : 0)." + AND f.entity = ".((int) $conf->entity)." + AND (s.fk_pays <> ".((int) $mysoc->country_id)." OR s.fk_pays IS NULL) + AND f.datef BETWEEN '".$this->db->escape($period_reference)."-01' AND '".$this->db->escape($period_reference)."-".date('t')."'"; return $sql; } @@ -398,27 +399,27 @@ class IntracommReport extends CommonObject } foreach ($TLinesFraisDePort as $res) { - $sql = 'SELECT p.customcode - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') - INNER JOIN '.MAIN_DB_PREFIX.'product p ON (p.rowid = d.fk_product) + $sql = "SELECT p.customcode + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") + INNER JOIN ".MAIN_DB_PREFIX."product p ON (p.rowid = d.fk_product) WHERE d.fk_product IS NOT NULL - AND f.entity = '.$conf->entity.' - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND f.entity = ".((int) $conf->entity)." + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.total_ht = ( SELECT MAX(d.total_ht) - FROM '.MAIN_DB_PREFIX.$tabledet.' d - INNER JOIN '.MAIN_DB_PREFIX.$table.' f ON (f.rowid = d.'.$field_link.') + FROM ".MAIN_DB_PREFIX.$tabledet." d + INNER JOIN ".MAIN_DB_PREFIX.$table." f ON (f.rowid = d.".$this->db->escape($field_link).") WHERE d.fk_product IS NOT NULL - AND '.$more_sql.' = "'.$res->refinvoice.'" + AND ".$more_sql." = '".$this->db->escape($res->refinvoice)."' AND d.fk_product NOT IN ( SELECT fk_product - FROM '.MAIN_DB_PREFIX.'categorie_product - WHERE fk_categorie = '.((int) $categ_fraisdeport->id).' + FROM ".MAIN_DB_PREFIX."categorie_product + WHERE fk_categorie = ".((int) $categ_fraisdeport->id)." ) - )'; + )"; $resql = $this->db->query($sql); $ress = $this->db->fetch_object($resql); @@ -436,7 +437,8 @@ class IntracommReport extends CommonObject */ public function getNextDeclarationNumber() { - $sql = 'SELECT MAX(numero_declaration) as max_declaration_number FROM '.MAIN_DB_PREFIX.$this->table_element." WHERE exporttype='".$this->db->escape($this->exporttype)."'"; + $sql = "SELECT MAX(numero_declaration) as max_declaration_number FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql .= " WHERE exporttype = '".$this->db->escape($this->exporttype)."'"; $resql = $this->db->query($sql); if ($resql) { $res = $this->db->fetch_object($resql); From a2c2ca20740f4c93a4f02e19ecc833f4f47bc4a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 15:10:35 +0200 Subject: [PATCH 082/183] Fix phpcs --- htdocs/compta/paiement/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 4e36890c5da..59d5e701f8c 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -517,14 +517,14 @@ while ($i < min($num, $limit)) { // Bank transaction if (!empty($arrayfields['transaction']['checked'])) { - print ''; - if ($objp->fk_bank > 0) { - $bankline->fetch($objp->fk_bank); - print $bankline->getNomUrl(1, 0); - } - print ''; - if (!$i) { - $totalarray['nbfield']++; + print ''; + if ($objp->fk_bank > 0) { + $bankline->fetch($objp->fk_bank); + print $bankline->getNomUrl(1, 0); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; } } From 6c9d177040f62939d70b8e22915d014329c11053 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 13 Jun 2022 15:17:36 +0200 Subject: [PATCH 083/183] FIX: warning (php7) / fatal (php8) if dol_eval returns a non-empty, non-string value --- 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 45e2d51c344..3ee5a6a995a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8505,7 +8505,7 @@ function verifCond($strToEvaluate) //dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition //var_dump($strToEvaluate); $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition - $rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false); + $rights = $rep && !is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false; //var_dump($rights); } return $rights; From f5b3890721d30093bdcce9cd0af30a7567dbfc89 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Mon, 13 Jun 2022 15:47:31 +0200 Subject: [PATCH 084/183] BUG FIX: checking if array is empty with empty() function instead of comparing it to a boolean --- htdocs/core/class/evalmath.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index ccd495bb623..78221de5c98 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -374,7 +374,7 @@ class EvalMath */ private function pfx($tokens, $vars = array()) { - if ($tokens == false) { + if (empty($tokens)) { return false; } From 9f82a0c2d8e73c5ec1dfc218c45c1c7003e7ce21 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 15:47:44 +0200 Subject: [PATCH 085/183] attribute socid doesnt exist on class Salary, so we use -1 on form --- htdocs/salaries/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 045b77ca0a4..b90c57a1490 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -191,7 +191,7 @@ if ($object->id) { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { From c058a6b75d0b406bfd83c1e071f1911ca1014d78 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 15:49:57 +0200 Subject: [PATCH 086/183] replaced 0 by -1 for no thirrd party id... --- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index e9da2466f8a..f9cd7b3c9dd 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -461,7 +461,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, 0, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { From c9900666e824d4e84184a9a296c217a0b6c13379 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 16:02:25 +0200 Subject: [PATCH 087/183] Class Salary does not contain attribute salary but amount instead --- htdocs/salaries/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 00591b5a32f..e4c4bb24464 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -232,7 +232,7 @@ if ($action == 'add' && empty($cancel)) { // Set user current salary as ref salary for the payment $fuser = new User($db); $fuser->fetch(GETPOST("fk_user", "int")); - $object->salary = $fuser->salary; + $object->amount = $fuser->salary; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); From ac395cace882047b40767c8fbc4da7bf255cf72b Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 16:05:41 +0200 Subject: [PATCH 088/183] wrong branch... --- htdocs/salaries/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index e4c4bb24464..00591b5a32f 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -232,7 +232,7 @@ if ($action == 'add' && empty($cancel)) { // Set user current salary as ref salary for the payment $fuser = new User($db); $fuser->fetch(GETPOST("fk_user", "int")); - $object->amount = $fuser->salary; + $object->salary = $fuser->salary; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); From fe4dac5ecbf218b8923d40312011738165dce3f3 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Mon, 13 Jun 2022 16:10:45 +0200 Subject: [PATCH 089/183] increasing the scope of the variable --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 63a4e90cdd0..909ff32acb9 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -84,6 +84,7 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + $i = 0; // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -113,7 +114,6 @@ class box_project extends ModeleBoxes if ($result) { $num = $this->db->num_rows($result); - $i = 0; while ($i < min($num, $max)) { $objp = $this->db->fetch_object($result); From 2f4a7759395f29adcb6688bab5805a72c4ae2659 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 13 Jun 2022 16:11:02 +0200 Subject: [PATCH 090/183] wrong branch... --- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index f9cd7b3c9dd..9a0a21484b1 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -461,7 +461,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1); + $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)) { From 9cfa7a719cd880bd55d9005d4640a5074ccc8567 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Mon, 13 Jun 2022 16:17:18 +0200 Subject: [PATCH 091/183] Increasing the scope of the variable --- htdocs/core/boxes/box_project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 63a4e90cdd0..022af9936d3 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -83,7 +83,7 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); - + $num = 0; // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; From 587f794fdf8e0be0af949eeeee4ff7dea33f0757 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 16:45:30 +0200 Subject: [PATCH 092/183] PHP8 --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/filefunc.inc.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45e2d51c344..45bf99577d4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3502,7 +3502,7 @@ function dolGetCountryCodeFromIp($ip) $countrycode = ''; if (!empty($conf->geoipmaxmind->enabled)) { - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='/usr/share/GeoIP/GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; @@ -3529,7 +3529,7 @@ function dol_user_country() $ret = ''; if (!empty($conf->geoipmaxmind->enabled)) { $ip = getUserRemoteIP(); - $datafile = $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE; + $datafile = getDolGlobalString('GEOIPMAXMIND_COUNTRY_DATAFILE'); //$ip='24.24.24.24'; //$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php'; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c2962836fa2..e5b7c62aae4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -294,8 +294,9 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:port if ($suburi == '/') { $suburi = ''; // If $suburi is /, it is now '' } -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) - +if (!defined('DOL_URL_ROOT')) { + define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) +} //print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n"; // Define prefix MAIN_DB_PREFIX From c4754d56a9d37b34ad89ed58ec3206c1b5874c99 Mon Sep 17 00:00:00 2001 From: bagtaib Date: Mon, 13 Jun 2022 16:56:37 +0200 Subject: [PATCH 093/183] assetmodel doesn't have socid but user does --- 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 f4cf1074dd2..3d3ec2f67d2 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -300,7 +300,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); From 8c8ae827007af2942a616a679dde186ff5dbcda5 Mon Sep 17 00:00:00 2001 From: bagtaib Date: Mon, 13 Jun 2022 17:22:00 +0200 Subject: [PATCH 094/183] removed deprecated code --- htdocs/comm/action/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ec80dc90a4c..3cec7fdbfe7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -848,7 +848,6 @@ if ($resql) { $event->fk_project = $obj->fk_project; $event->socid = $obj->fk_soc; - $event->thirdparty_id = $obj->fk_soc; $event->contact_id = $obj->fk_contact; // Defined date_start_in_calendar and date_end_in_calendar property From 985c581c0101cd388772ca97f3c9f414d1a3d591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jun 2022 18:09:06 +0200 Subject: [PATCH 095/183] php8 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1f64741385f..f429225640b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6148,7 +6148,7 @@ abstract class CommonObject //var_dump($this->oldcopy);exit; if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]); - if ($this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. + if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. $new_array_options[$key] = $this->array_options[$key]; // Value is kept } else { // var_dump($algo); From f2bade31887875734637e3bb4460ce67b7dbfae9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 13 Jun 2022 19:57:11 +0200 Subject: [PATCH 096/183] Update dolibarr_changes.txt --- dev/dolibarr_changes.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 204988c5442..cbfecbbc19f 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -275,6 +275,13 @@ RESTLER: with $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); + +* Replace CommentParser.php line 423 + elseif (count($value) && is_numeric($value[0])) + + with + + elseif (count($value) && isset($value[0]) && is_numeric($value[0])) +With swagger 2 provided into /explorer: From a757940f17bb5ee7e68f978653860fc3e8cb23a1 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Tue, 14 Jun 2022 09:14:30 +0200 Subject: [PATCH 097/183] FIX - Right --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3613f052e8d..6fc19979f81 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; $usercancreateintervention = $user->hasRight('ficheinter', 'creer'); -$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'creer') || $user->hasRight('supplier_order', 'creer')); +$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php From 4403fdc29c5941a4418312776dcc7508847faa1e Mon Sep 17 00:00:00 2001 From: atm-florian Date: Tue, 14 Jun 2022 09:46:15 +0200 Subject: [PATCH 098/183] Missing parentheses around or (||) condition --- 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 3ee5a6a995a..955043637c5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8505,7 +8505,7 @@ function verifCond($strToEvaluate) //dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition //var_dump($strToEvaluate); $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition - $rights = $rep && !is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false; + $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; From d1542d9b883519ea5c9727a2a7a68ce479e8255c Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Tue, 14 Jun 2022 09:54:51 +0200 Subject: [PATCH 099/183] FIX - Record count badge in custom modules tab --- 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 45bf99577d4..cac78407151 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8964,7 +8964,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2])); $label = make_substitutions($reg[1], $substitutionarray); } else { - $labeltemp = explode(':', $values[2]); + $labeltemp = explode(',', $values[2]); $label = $langs->trans($labeltemp[0]); if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) { dol_include_once($labeltemp[2]); From f26184699063f44c13d91202d5bac240a3cf6464 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 10:21:10 +0200 Subject: [PATCH 100/183] Fix look and feel v16 --- htdocs/commande/list.php | 14 ++++++++++++- htdocs/fourn/commande/list.php | 36 ++++++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1e4c4d2e78a..b4e1f19554e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1821,8 +1821,9 @@ if ($resql) { $total_ht = 0; $total_margin = 0; + $imaxinloop = ($limit ? min($num, $limit) : $num); $last_num = min($num, $limit); - while ($i < $last_num) { + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -2457,6 +2458,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index cc8bae4d907..22c4921b5b1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $error = 0; +$permissiontoread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); +$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontodelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer); +$permissiontovalidate = $permissiontoadd; +$permissiontoapprove = ($user->rights->fournisseur->commande->approuver || $user->rights->supplier_order->approuver); + /* * Actions @@ -302,9 +308,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'CommandeFournisseur'; $objectlabel = 'SupplierOrders'; - $permissiontoread = $user->rights->fournisseur->commande->lire; - $permissiontodelete = $user->rights->fournisseur->commande->supprimer; - $permissiontovalidate = $user->rights->fournisseur->commande->creer; $uploaddir = $conf->fournisseur->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -321,7 +324,7 @@ if (empty($reshook)) { $result = $objecttmp->valid($user); if ($result >= 0) { // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $permissiontoapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { $result = $objecttmp->approve($user); setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); } else { @@ -1096,7 +1099,7 @@ if ($resql) { ); if ($permissiontovalidate) { - if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { + if ($permissiontoapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"); } else { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); @@ -1106,7 +1109,7 @@ if ($resql) { if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } - if ($user->rights->fournisseur->commande->supprimer) { + if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { @@ -1119,7 +1122,7 @@ if ($resql) { $url .= '&socid='.((int) $socid); $url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid)); } - $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); + $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissitiontoadd); // Lines of title fields print '
'; @@ -1532,7 +1535,9 @@ if ($resql) { $totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array()); $totalarray['val']['cf.total_ht'] = 0; $totalarray['val']['cf.total_ttc'] = 0; - while ($i < min($num, $limit)) { + + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -1855,6 +1860,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); @@ -1876,8 +1892,8 @@ if ($resql) { $urlsource .= str_replace('&', '&', $param); $filedir = $diroutputmassaction; - $genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); - $delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } else { From 86274072ba18d2b2870da6f7cf0bf10003f3873f Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 14 Jun 2022 10:39:07 +0200 Subject: [PATCH 101/183] FetchLines does not exist on class emailcollector action but FetchLinesCommonDoes --- htdocs/emailcollector/class/emailcollectoraction.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 5ce35541a16..cb0a38975e1 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -272,7 +272,7 @@ class EmailCollectorAction extends CommonObject { $result = $this->fetchCommon($id, $ref); if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); + $this->fetchLinesCommon(); } return $result; } From f0f24291d4662f60ca97a79b087a2b29de47a3a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 10:40:10 +0200 Subject: [PATCH 102/183] Debug v16 --- htdocs/core/class/commonobject.class.php | 10 +++++++--- htdocs/core/tpl/commonfields_edit.tpl.php | 4 ++++ htdocs/langs/en_US/errors.lang | 1 + htdocs/partnership/class/partnership.class.php | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f429225640b..9b8fea19e5f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7556,11 +7556,15 @@ abstract class CommonObject if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong - $object->fetch($value, '', '', '', 0, 1, 1); + $result = $object->fetch($value, '', '', '', 0, 1, 1); } else { - $object->fetch($value); + $result = $object->fetch($value); + } + if ($result > 0) { + $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); + } else { + $value = ''; } - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 39103fdbb0a..1439ce73afe 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -63,9 +63,11 @@ foreach ($object->fields as $key => $val) { } print ''; print ''; + if (!empty($val['picto'])) { print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } + if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key; } elseif ($val['type'] == 'double') { @@ -78,6 +80,8 @@ foreach ($object->fields as $key => $val) { $check = 'restricthtml'; } $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; + } elseif (in_array($val['type'], array('date', 'datetime'))) { + $value = GETPOSTISSET($key) ? dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')) : $object->$key; } elseif ($val['type'] == 'price') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key); } elseif ($key == 'lang') { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3955f0f9bb3..ba9cf1cb19a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -287,6 +287,7 @@ ErrorInvoiceLoadThirdParty=Can't load third-party object for invoice "%s" ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s" ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status ErrorAjaxRequestFailed=Request failed +ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 126ea58076b..a14a5a93ff0 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -247,7 +247,7 @@ class Partnership extends CommonObject public function create(User $user, $notrigger = false) { if ($this->fk_soc <= 0 && $this->fk_member <= 0) { - $this->error[] = "ErrorThirpdartyOrMemberidIsManadatory"; + $this->error[] = "ErrorThirpdartyOrMemberidIsMandatory"; return -1; } @@ -555,7 +555,7 @@ class Partnership extends CommonObject public function update(User $user, $notrigger = false) { if ($this->fk_soc <= 0 && $this->fk_member <= 0) { - $this->error[] = "ErrorThirpdartyOrMemberidIsManadatory"; + $this->error[] = "ErrorThirpdartyOrMemberidIsMandatory"; return -1; } From 82ddaeda74306417f722140e4036a7d56cf4701d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 14 Jun 2022 10:41:32 +0200 Subject: [PATCH 103/183] FIX : $noback option --- htdocs/core/actions_addupdatedelete.inc.php | 8 ++++---- htdocs/mrp/mo_card.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index a4fbbd16c58..969d590be34 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -144,7 +144,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $urltogo); exit; } @@ -320,7 +320,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $backurlforlist); exit; } @@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } @@ -507,7 +507,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) $newid = $result; } - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object exit; } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 59cd99b7310..1f06c6c3f4c 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -135,7 +135,7 @@ if (empty($reshook)) { //Create MO with Childs if ($action == 'add' && empty($id) && !empty($TBomLineId)) { - $noback = 0; + $noback = 1; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; $mo_parent = $object; From 5775213844d1c6c4efda6b55fa9f2f39369f4f10 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 10:43:08 +0200 Subject: [PATCH 104/183] changing variable name --- htdocs/core/class/html.formticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 957026c2180..71dbff91254 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1211,7 +1211,7 @@ class FormTicket dol_delete_dir_recursive($upload_dir); } - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid unset($_SESSION["listofpaths".$keytoavoidconflict]); unset($_SESSION["listofnames".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]); @@ -1269,7 +1269,7 @@ class FormTicket $listofpaths = array(); $listofnames = array(); $listofmimes = array(); - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) { From 564ea7a960a9375ddec8f32076a4215714b10cda Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 10:48:42 +0200 Subject: [PATCH 105/183] changing variable name --- htdocs/core/boxes/box_project.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 022af9936d3..52a7190c1e5 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -83,7 +83,6 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); - $num = 0; // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; From 9ea7f8a223b3444b688f4624d85dfa9eee25961c Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 10:50:25 +0200 Subject: [PATCH 106/183] adding a line --- htdocs/core/boxes/box_project.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 52a7190c1e5..63a4e90cdd0 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -83,6 +83,7 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; From f247bda2267967002dc0fecb8199354cb6f0cb79 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 14 Jun 2022 10:54:12 +0200 Subject: [PATCH 107/183] Attribute datee doesn't exist on class Task --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 79152c6cfb9..9ee0c978133 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2304,7 +2304,7 @@ class Task extends CommonObjectLine $now = dol_now(); - $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); + $datetouse = ($this->date_end > 0) ? $this->date_end : 0; return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } From a52313bd830f4d4c52176893bbee99d9c6c2e7a9 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 11:02:14 +0200 Subject: [PATCH 108/183] changing function name to the existing one --- htdocs/core/class/stats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ae9a8e56e58..8128dd07ed8 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -86,7 +86,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->getNbByMonth($year, $format); + $datay[$year] = $this->_getNbByMonth($year, $format); $year++; } From 642810cb6d20965e16a0b2280368e15398b9398b Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 11:08:28 +0200 Subject: [PATCH 109/183] changing function name to the exisiting one --- htdocs/core/class/stats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ae9a8e56e58..ca6310aae9a 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -180,7 +180,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->getAmountByMonth($year, $format); + $datay[$year] = $this->_getAmountByMonth($year, $format); $year++; } From 293b08ab1d7d0d6a7daa1c74dd17752ad260cb31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 11:47:56 +0200 Subject: [PATCH 110/183] Debug v16 --- htdocs/admin/ihm.php | 2 ++ htdocs/core/lib/usergroups.lib.php | 7 ++++++- htdocs/langs/en_US/errors.lang | 3 ++- htdocs/theme/eldy/global.inc.php | 9 ++++++--- htdocs/theme/eldy/info-box.inc.php | 1 + htdocs/theme/md/info-box.inc.php | 2 ++ htdocs/theme/md/style.css.php | 14 ++++++++++---- htdocs/user/class/user.class.php | 16 +++++++++++++++- 8 files changed, 44 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index aedd91a34eb..d3afd4035e4 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -99,6 +99,8 @@ if ($action == 'update') { $error = 0; if ($mode == 'template') { + //dolibarr_del_const($db, "MAIN_THEME", 0); // To be sure we don't have this constant set for all entities + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 25945c4e83d..538fc299564 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -372,7 +372,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; } - print ''; + print ''; + + if (!empty($conf->global->MAIN_FORCETHEME)) { + $langs->load("errors"); + print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME); + } print ''."\n"; print '
'; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ba9cf1cb19a..2857d7a3f54 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -322,7 +322,8 @@ WarningCreateSubAccounts=Warning, you can't create directly a sub account, you m WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online payment features not working correctly. Use 'Lax' instead. - +WarningThemeForcedTo=Warning, theme has been forced to %s by hidden constant MAIN_FORCETHEME + # Validate RequireValidValue = Value not valid RequireAtLeastXString = Requires at least %s character(s) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 930d28550c3..5eda12f56de 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2377,6 +2377,9 @@ img.photoref, div.photoref { width: 80px; object-fit: contain; } +img.photokanban, div.photokanban { + padding: 0; +} div.photoref .fa, div.photoref .fas, div.photoref .far { font-size: 2.5em; } @@ -5339,11 +5342,11 @@ td.cal_other_month { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 2px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ } +.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; } +.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; } .treeview li table { min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } -.treeview .hitarea { margin-top: 3px; } /* ============================================================================== */ diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 77270b9d818..f1f82b757c0 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -489,6 +489,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { .box-flex-container { margin: 0 0 0 0px !important; width: 100% !important; + justify-content: space-between; } .info-box-module { width: 100%; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 8ffd6fc3f93..daf3c409397 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -193,7 +193,9 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { filter: saturate(global->THEME_SATURATE_RATIO; ?>); } + .info-box-sm .info-box-icon { + height: 80px; width: 80px; font-size: 25px; line-height: 92px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 298b8b5c46a..fdc2e9db2d7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2399,6 +2399,11 @@ img.photoref, div.photoref { object-fit: contain; } +img.photokanban, div.photokanban { + padding: 0; + border: none; +} + div.photoref .fa, div.photoref .fas, div.photoref .far { font-size: 2.5em; } @@ -4110,7 +4115,8 @@ tr.liste_titre_topborder td { background: transparent; } tr.liste_titre:last-child th.liste_titre, tr.liste_titre:last-child th.liste_titre_sel, tr.liste_titre td.liste_titre, tr.liste_titre td.liste_titre_sel, form.liste_titre div.tagtd { /* For last line of table headers only */ - border-bottom: 1px solid var(--colortopbordertitle1); + /* border-bottom: 1px solid var(--colortopbordertitle1); */ + border-bottom: none; } div.liste_titre { @@ -5180,11 +5186,11 @@ td.gtaskname { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview ul { background-color: transparent !important; margin-top: 0 !important; /* margin-bottom: 4px !important; padding-top: 2px !important; */ } +.treeview li { background-color: transparent !important; padding: 0 0 0 20px !important; min-height: 30px; } +.treeview .hitarea { width: 20px !important; margin-left: -20px !important; margin-top: 3px; } .treeview li table { min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } -.treeview .hitarea { margin-top: 3px; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 11d21f4e957..c073937b048 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2964,7 +2964,18 @@ class User extends CommonObject $return = '
'; $return .= '
'; $return .= ''; - $return .= img_picto('', $this->picto); + + $label = ''; + if (!empty($this->photo)) { + //$label .= '
'; + $label .= Form::showphoto('userphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); // Force height to 60 so we total height of tooltip can be calculated and collision can be managed + //$label .= '
'; + //$label .= '
'; + $return .= $label; + } else { + $return .= img_picto('', $this->picto); + } + //$return .= ''; // Can be image $return .= '
'; $return .= '
'; @@ -2972,6 +2983,9 @@ class User extends CommonObject if (property_exists($this, 'label')) { $return .= '
'.$this->label.''; } + if ($this->email) { + $return .= '
'.img_picto('', 'email').' '.$this->email.''; + } if (method_exists($this, 'getLibStatut')) { $return .= '
'.$this->getLibStatut(5).'
'; } From 050cc48d7e70ee9b460e4c4bffecae17117ec0b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 11:54:41 +0200 Subject: [PATCH 111/183] Debug v16 --- htdocs/user/param_ihm.php | 28 ++++++++++++++++++++++++++++ htdocs/user/perms.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c2ea42e6c6a..dd27bc36be8 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -341,7 +341,35 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + print '
'; + print '
'; + print ''; + + // Login + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } + print ''."\n"; + + print '
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $addadmin = ''; + if (property_exists($object, 'admin')) { + 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"'); + } + } + print showValueWithClipboardCPButton($object->login).$addadmin; + print '
'; + + print '
'; print dol_get_fiche_end(); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 55876016680..e8a4ed41a1c 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -282,7 +282,7 @@ print '
'; print '
'; - +print '
'; if ($user->admin) { print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules")); From 6ea785a4e7b6c0cc2af3a20d0cd60543840655b5 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 14 Jun 2022 13:37:15 +0200 Subject: [PATCH 112/183] BUG FIX Class PaiementFourn does not contain oper property anymore --- htdocs/fourn/class/api_supplier_invoices.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 418d8fa6600..17146eecd35 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -473,7 +473,6 @@ class SupplierInvoices extends DolibarrApi $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->paiementid = $payment_mode_id; $paiement->paiementcode = dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1); - $paiement->oper = $paiement->paiementcode; // For backward compatibility $paiement->num_payment = $num_payment; $paiement->note_public = $comment; From 8cce63fae34ec36760c79a35b26aca1b3395cdeb Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 14 Jun 2022 13:59:56 +0200 Subject: [PATCH 113/183] BUG FIX pays_code has become country_code on commonObject --- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3702b1c8452..d7076692835 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 @@ -133,8 +133,8 @@ class doc_generic_task_odt extends ModelePDFTask // Get source company $this->emetteur = $mysoc; - if (!$this->emetteur->pays_code) { - $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined + if (!$this->emetteur->country_code) { + $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined } } From 862ca7cf0476f73dce33b24d4e2f3defb343c01f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 14:39:32 +0200 Subject: [PATCH 114/183] Debug v16 --- htdocs/core/lib/date.lib.php | 26 +++++++++++++++++--------- htdocs/projet/tasks/time.php | 20 ++++++++++---------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 237adc9447a..558ba2aa322 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -322,20 +322,28 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l * Generate a SQL string to make a filter into a range (for second of date until last second of date). * This method allows to maje SQL request that will deal correctly the timezone of server. * - * @param string $datefield Name of SQL field where apply sql date filter - * @param int $day_date Day date - * @param int $month_date Month date - * @param int $year_date Year date - * @param int $excludefirstand Exclude first and - * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. - * Note: In database, dates are always fot the server TZ. - * @return string $sqldate String with SQL filter + * @param string $datefield Name of SQL field where apply sql date filter + * @param int|string $day_date Day date (Can be 0 or '' for filter on a month) + * @param int|string $month_date Month date (Can be 0 or '' for filter on a year) + * @param int|string $year_date Year date + * @param int $excludefirstand Exclude first and + * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. + * Note: In database, dates are always fot the server TZ. + * @return string $sqldate String with SQL filter */ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) { global $db; - $sqldate = ""; + $sqldate = ''; + + $day_date = intval($day_date); + $month_date = intval($month_date); + $year_date = intval($year_date); + if ($month_date > 0) { + if ($month_date > 12) { // protection for bad value of month + return " AND 1 = 2"; + } if ($year_date > 0 && empty($day_date)) { $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm)); $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f47eb2a49d3..f2b4476ed61 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1347,7 +1347,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($search_valuebilled == '0') { $sql .= ' AND (t.invoice_id = 0 OR t.invoice_id IS NULL)'; } + $sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year); + // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook @@ -1869,26 +1871,24 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Action column print ''; - if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid) { - print ''; + if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { + print ''; print ''; - print '
'; + print ' '; print ''; - } elseif ($user->rights->projet->time || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks - if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) { - if ($conf->MAIN_FEATURES_LEVEL >= 2) { + } elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks + if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { + if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; - print img_split(); + print img_split('', 'class="pictofixedwidth"'); print ''; } - print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; - print img_edit(); + print img_edit('default', 0, 'class="pictofixedwidth paddingleft"'); print ''; - print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_delete('default', 'class="pictodelete paddingleft"'); print ''; From e040363b81b45ec80261abb020ed3a6c4ad69133 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 14:41:10 +0200 Subject: [PATCH 115/183] Fix link in v16 --- htdocs/core/menus/standard/eldy.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ddb4b1fab95..9e88d4dda3d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2211,6 +2211,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 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->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="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); } } } From e62abce78c8de164d50dd2304ee0cc2adc925672 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 14:41:16 +0200 Subject: [PATCH 116/183] Revert "15.0 fix missing time spent list menu" --- htdocs/core/menus/standard/eldy.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 57f5238350c..58ddeb0fbf3 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1783,7 +1783,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 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->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="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); } } } From e991c614d38d7ebc5528e26acacca383aaff90bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 14:48:15 +0200 Subject: [PATCH 117/183] Debug v16 --- htdocs/projet/tasks/time.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f2b4476ed61..d0db633658a 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -919,15 +919,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $massactionbutton = ''; $arrayofmassactions = array(); - if ($projectstatic->usage_bill_time) { - $arrayofmassactions = array( - 'generateinvoice'=>$langs->trans("GenerateBill"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - } - if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { - $langs->load("interventions"); - $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); + + if ($projectstatic->id > 0) { + // If we are on a given project. + if ($projectstatic->usage_bill_time) { + $arrayofmassactions = array( + 'generateinvoice'=>$langs->trans("GenerateBill"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + } + if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { + $langs->load("interventions"); + $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); + } } //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete', 'generateinvoice', 'generateinter'))) { @@ -1251,7 +1255,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if ($projectstatic->thirdparty->id > 0) { - print ''; + print '
'; print ''; print ''; } if (!empty($allprojectforuser)) { - print ''; + print ''; } // Task if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task From 2666a283c729bb14485bca81fbaf8ce6e6efee5e Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 14 Jun 2022 14:53:14 +0200 Subject: [PATCH 118/183] BUG FIX typo on ref_invoice_supplier_source --- htdocs/core/lib/doc.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index d1a7cea5d9a..92cc140f299 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -78,12 +78,12 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { From 0aa69e534e9dd3478cd48e46f976c2e7d4d072ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 15:07:01 +0200 Subject: [PATCH 119/183] Fix: Must add a context for cli execution of hooks --- scripts/cron/cron_run_jobs.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 25ea4b4d415..820db6746ee 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -81,6 +81,8 @@ $userlogin = $argv[2]; $version = DOL_VERSION; $error = 0; +$hookmanager->initHooks(array('cli')); + /* * Main From 3f0f7f323d55a9a5adf79054521c09649112d837 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 16:05:26 +0200 Subject: [PATCH 120/183] css --- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/theme/md/style.css.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 4f30054155a..c191b3baeaa 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -431,7 +431,7 @@ $nav .= dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "%A").' '; $nav .= " ".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "day")." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -$nav .= ' '; +$nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 156080eefb3..79ee8c6172e 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -347,7 +347,7 @@ $nav = '".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%Y").", ".$langs->trans(date('F', mktime(0, 0, 0, $month, 10)))." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -$nav .= ' '; +$nav .= ' '; $picto = 'clock'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fdc2e9db2d7..3c05847a79c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -394,7 +394,7 @@ textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ border: 1px solid #aaa !important; } -input:focus, textarea:focus, button:focus, select:focus { +input:focus, textarea:focus, button:focus:not(.button_search_x):not(.button_search):not(.button_removefilter), select:focus { border-bottom: 1px solid #666; } @@ -4967,7 +4967,7 @@ span[phptag] { color: #000 !important; text-shadow: none; } -.bordertransp { +.bordertransp:not(.nobordertransp) { background-color: transparent; background-image: none; border: 1px solid #aaa; From 6c1c8058c19b738d09db8fe9271f83b1fcfd1255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 16:56:03 +0200 Subject: [PATCH 121/183] Doc --- htdocs/expedition/card.php | 3 ++- htdocs/reception/card.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index af508cf3291..dec016c9a1d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2414,7 +2414,8 @@ if ($action == 'create') { } print ""; - // Display lines extrafields + // Display lines extrafields. + // $line is a line of shipment if (!empty($extrafields)) { $colspan = 6; if ($origin && $origin_id > 0) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 241a8427e8f..1422e7ed566 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1238,7 +1238,9 @@ if ($action == 'create') { print "\n"; $extralabelslines = $extrafields->attributes[$line->table_element]; - //Display lines extrafields + + // Display lines extrafields + // $line is a line of reception (so CommandeFournisseurDispatch) if (is_array($extralabelslines) && count($extralabelslines) > 0) { $colspan = 5; if ($conf->productbatch->enabled) { @@ -1260,7 +1262,7 @@ if ($action == 'create') { } $line->array_options = array_merge($line->array_options, $srcLine->array_options); - print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked); + print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); } $indiceAsked++; From 267a6f908d200bf711a8577acf38c3be34383f0b Mon Sep 17 00:00:00 2001 From: bagtaib Date: Tue, 14 Jun 2022 17:26:18 +0200 Subject: [PATCH 122/183] The properties product_tosell & product_tobuy do not exist on OrderLine --- htdocs/commande/class/commande.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 44cc5c6effd..233655843c6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2060,7 +2060,7 @@ class Commande extends CommonOrder $sql .= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,'; $sql .= ' l.fk_unit,'; $sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,'; - $sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch, p.barcode as product_barcode,'; + $sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch, p.barcode as product_barcode,'; $sql .= ' p.weight, p.weight_units, p.volume, p.volume_units'; $sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)'; @@ -2124,8 +2124,6 @@ class Commande extends CommonOrder $line->product_ref = $objp->product_ref; $line->product_label = $objp->product_label; $line->product_desc = $objp->product_desc; - $line->product_tosell = $objp->product_tosell; - $line->product_tobuy = $objp->product_tobuy; $line->product_tobatch = $objp->product_tobatch; $line->product_barcode = $objp->product_barcode; From b5f77b4035da950557ae287d0bee9d734ab610a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 17:36:42 +0200 Subject: [PATCH 123/183] FIX #21237 --- htdocs/expedition/card.php | 4 ++- .../fournisseur.commande.dispatch.class.php | 2 +- htdocs/reception/card.php | 26 ++++++++----------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index dec016c9a1d..b07dfa778a4 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1571,7 +1571,8 @@ if ($action == 'create') { } } - // Line extrafield + // Display lines for extrafields of the Shipment line + // $line is a 'Order line' if (!empty($extrafields)) { //var_dump($line); $colspan = 5; @@ -1580,6 +1581,7 @@ if ($action == 'create') { $srcLine = new OrderLine($db); $srcLine->id = $line->id; $srcLine->fetch_optionals(); // fetch extrafields also available in orderline + $expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options); print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 5bfafff57b5..27c991e5896 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -75,7 +75,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine public $fk_product; /** - * @var int ID + * @var int ID. Should be named fk_origin_line ? */ public $fk_commandefourndet; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 1422e7ed566..7e910188b34 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -101,11 +101,13 @@ $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $object = new Reception($db); +$objectorder = new CommandeFournisseur($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element_line); +$extrafields->fetch_name_optionals_label($objectorder->table_element_line); // Load object. Make an object->fetch include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once @@ -1237,32 +1239,26 @@ if ($action == 'create') { print "\n"; - $extralabelslines = $extrafields->attributes[$line->table_element]; - - // Display lines extrafields - // $line is a line of reception (so CommandeFournisseurDispatch) - if (is_array($extralabelslines) && count($extralabelslines) > 0) { + // Display lines for extrafields of the Reception line + // $line is a 'CommandeFournisseurLigne', $dispatchLines contains values of Reception lines so properties of CommandeFournisseurDispatch + if (!empty($extrafields)) { + //var_dump($line); $colspan = 5; if ($conf->productbatch->enabled) { $colspan += 3; } + $recLine = new CommandeFournisseurDispatch($db); $srcLine = new CommandeFournisseurLigne($db); - $line = new CommandeFournisseurDispatch($db); - - $extrafields->fetch_name_optionals_label($srcLine->table_element); - $extrafields->fetch_name_optionals_label($line->table_element); - $srcLine->id = $line->id; $srcLine->fetch_optionals(); // fetch extrafields also available in orderline - $line->fetch_optionals(); - if (empty($line->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) { - $line->array_options = $dispatchLines[$indiceAsked]['array_options']; + if (empty($recLine->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) { + $recLine->array_options = $dispatchLines[$indiceAsked]['array_options']; } - $line->array_options = array_merge($line->array_options, $srcLine->array_options); + $recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options); - print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); + print $recLine->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); } $indiceAsked++; From dd392143e1a4fed22388f82ac3a685c41a8fe51d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 17:53:17 +0200 Subject: [PATCH 124/183] Fix conf->projet conf->project --- htdocs/admin/dict.php | 2 +- htdocs/admin/emailcollector_card.php | 2 +- htdocs/admin/expensereport.php | 4 ++-- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/pdf.php | 4 ++-- htdocs/bom/bom_agenda.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/action/card.php | 8 +++---- htdocs/comm/action/document.php | 4 ++-- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/info.php | 4 ++-- htdocs/comm/card.php | 2 +- htdocs/comm/propal/card.php | 8 +++---- htdocs/comm/propal/class/propal.class.php | 4 ++-- htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 4 ++-- htdocs/comm/propal/info.php | 4 ++-- htdocs/comm/propal/list.php | 4 ++-- htdocs/comm/propal/note.php | 4 ++-- htdocs/commande/card.php | 8 +++---- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/contact.php | 2 +- htdocs/commande/document.php | 4 ++-- htdocs/commande/info.php | 4 ++-- htdocs/commande/list.php | 4 ++-- htdocs/commande/note.php | 4 ++-- htdocs/compta/bank/various_payment/card.php | 8 +++---- .../compta/bank/various_payment/document.php | 2 +- htdocs/compta/bank/various_payment/info.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/deplacement/card.php | 4 ++-- htdocs/compta/facture/card-rec.php | 10 ++++---- htdocs/compta/facture/card.php | 10 ++++---- .../facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/contact.php | 4 ++-- htdocs/compta/facture/document.php | 4 ++-- htdocs/compta/facture/info.php | 4 ++-- .../compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 4 ++-- htdocs/compta/facture/note.php | 4 ++-- htdocs/compta/facture/prelevement.php | 2 +- htdocs/compta/sociales/card.php | 8 +++---- htdocs/compta/sociales/document.php | 6 ++--- htdocs/compta/sociales/info.php | 6 ++--- htdocs/compta/sociales/list.php | 16 ++++++------- htdocs/compta/sociales/note.php | 4 ++-- htdocs/compta/tva/document.php | 4 ++-- htdocs/contrat/agenda.php | 6 ++--- htdocs/contrat/card.php | 8 +++---- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/contrat/contact.php | 4 ++-- htdocs/contrat/document.php | 4 ++-- htdocs/contrat/note.php | 4 ++-- htdocs/core/actions_builddoc.inc.php | 2 +- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/ajax/ajaxdirpreview.php | 4 ++-- htdocs/core/ajax/selectsearchbox.php | 4 ++-- .../core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/core/class/fileupload.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/lib/company.lib.php | 6 ++--- htdocs/core/lib/contact.lib.php | 6 ++--- htdocs/core/lib/files.lib.php | 12 +++++----- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/project.lib.php | 6 ++--- htdocs/core/lib/security.lib.php | 4 ++-- htdocs/core/menus/init_menu_auguria.sql | 24 +++++++++---------- .../doc/pdf_standard.modules.php | 8 +++---- htdocs/core/modules/modCategorie.class.php | 6 ++--- .../doc/doc_generic_project_odt.modules.php | 16 ++++++------- .../project/doc/pdf_baleine.modules.php | 4 ++-- .../project/doc/pdf_beluga.modules.php | 4 ++-- .../project/doc/pdf_timespent.modules.php | 4 ++-- .../task/doc/doc_generic_task_odt.modules.php | 16 ++++++------- htdocs/delivery/card.php | 4 ++-- htdocs/don/card.php | 10 ++++---- htdocs/don/document.php | 6 ++--- htdocs/don/info.php | 6 ++--- htdocs/don/list.php | 10 ++++---- htdocs/don/note.php | 6 ++--- htdocs/ecm/index_auto.php | 6 ++--- htdocs/ecm/search.php | 4 ++-- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorboothattendee_note.php | 2 +- .../core/actions_massactions_mail.inc.php | 2 +- htdocs/expedition/card.php | 8 +++---- htdocs/expedition/contact.php | 4 ++-- htdocs/expedition/document.php | 4 ++-- htdocs/expedition/note.php | 4 ++-- htdocs/expedition/shipment.php | 6 ++--- htdocs/expensereport/card.php | 18 +++++++------- htdocs/fichinter/card-rec.php | 14 +++++------ htdocs/fichinter/card.php | 8 +++---- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fichinter/contact.php | 2 +- htdocs/fichinter/document.php | 4 ++-- htdocs/fichinter/info.php | 4 ++-- htdocs/fichinter/list.php | 12 +++++----- htdocs/fichinter/note.php | 4 ++-- .../class/fournisseur.commande.class.php | 2 +- .../class/fournisseur.facture-rec.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/commande/card.php | 10 ++++---- htdocs/fourn/commande/contact.php | 4 ++-- htdocs/fourn/commande/dispatch.php | 4 ++-- htdocs/fourn/commande/document.php | 4 ++-- htdocs/fourn/commande/info.php | 4 ++-- htdocs/fourn/commande/note.php | 4 ++-- htdocs/fourn/facture/card-rec.php | 10 ++++---- htdocs/fourn/facture/card.php | 10 ++++---- htdocs/fourn/facture/contact.php | 4 ++-- htdocs/fourn/facture/document.php | 4 ++-- htdocs/fourn/facture/info.php | 4 ++-- htdocs/fourn/facture/list-rec.php | 2 +- htdocs/fourn/facture/note.php | 4 ++-- htdocs/fourn/paiement/document.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_contact.php | 2 +- htdocs/hrm/job_contact.php | 2 +- htdocs/hrm/position_contact.php | 2 +- htdocs/hrm/skill_contact.php | 2 +- htdocs/index.php | 5 ++-- .../knowledgerecord_agenda.php | 2 +- .../knowledgerecord_card.php | 2 +- .../knowledgerecord_contact.php | 2 +- .../knowledgerecord_document.php | 2 +- .../knowledgerecord_note.php | 2 +- htdocs/loan/card.php | 4 ++-- htdocs/loan/document.php | 4 ++-- htdocs/loan/info.php | 4 ++-- htdocs/loan/note.php | 4 ++-- htdocs/loan/schedule.php | 2 +- .../template/class/myobject.class.php | 2 +- .../template/myobject_agenda.php | 2 +- .../modulebuilder/template/myobject_card.php | 2 +- .../template/myobject_contact.php | 2 +- .../template/myobject_document.php | 2 +- .../modulebuilder/template/myobject_note.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/mrp/mo_document.php | 2 +- htdocs/mrp/mo_movements.php | 2 +- htdocs/mrp/mo_note.php | 2 +- htdocs/mrp/mo_production.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/partnership/partnership_card.php | 2 +- htdocs/partnership/partnership_contact.php | 2 +- htdocs/partnership/partnership_document.php | 2 +- htdocs/partnership/partnership_note.php | 2 +- htdocs/product/inventory/card.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- htdocs/product/stock/card.php | 10 ++++---- htdocs/product/stock/class/entrepot.class.php | 2 +- .../stock/class/mouvementstock.class.php | 2 +- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/movement_card.php | 4 ++-- htdocs/product/stock/movement_list.php | 6 ++--- htdocs/product/stock/product.php | 4 ++-- .../stocktransfer/stocktransfer_agenda.php | 2 +- .../stocktransfer/stocktransfer_card.php | 2 +- .../stocktransfer/stocktransfer_contact.php | 2 +- .../stocktransfer/stocktransfer_document.php | 2 +- .../stocktransfer/stocktransfer_note.php | 2 +- .../product/stock/tpl/stockcorrection.tpl.php | 4 ++-- htdocs/projet/card.php | 6 ++--- htdocs/projet/class/project.class.php | 18 +++++++------- htdocs/projet/class/task.class.php | 18 +++++++------- htdocs/projet/document.php | 4 ++-- htdocs/projet/element.php | 2 +- htdocs/projet/list.php | 4 ++-- htdocs/projet/tasks.php | 4 ++-- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/list.php | 4 ++-- htdocs/projet/tasks/task.php | 4 ++-- htdocs/public/project/index.php | 2 +- htdocs/public/project/new.php | 2 +- htdocs/reception/card.php | 8 +++---- htdocs/reception/contact.php | 4 ++-- htdocs/reception/document.php | 4 ++-- htdocs/reception/note.php | 4 ++-- .../class/recruitmentjobposition.class.php | 2 +- .../recruitmentcandidature_agenda.php | 2 +- .../recruitmentcandidature_card.php | 2 +- .../recruitmentcandidature_document.php | 2 +- .../recruitmentcandidature_list.php | 2 +- .../recruitmentcandidature_note.php | 2 +- .../recruitmentjobposition_agenda.php | 2 +- .../recruitmentjobposition_applications.php | 2 +- .../recruitmentjobposition_card.php | 2 +- .../recruitmentjobposition_document.php | 2 +- .../recruitmentjobposition_note.php | 2 +- htdocs/resource/element_resource.php | 6 ++--- htdocs/salaries/card.php | 10 ++++---- htdocs/salaries/document.php | 6 ++--- htdocs/salaries/info.php | 6 ++--- htdocs/supplier_proposal/card.php | 8 +++---- htdocs/supplier_proposal/contact.php | 2 +- htdocs/supplier_proposal/document.php | 4 ++-- htdocs/supplier_proposal/info.php | 4 ++-- htdocs/supplier_proposal/list.php | 2 +- htdocs/supplier_proposal/note.php | 4 ++-- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/card.php | 6 ++--- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/ticket/contact.php | 2 +- htdocs/ticket/document.php | 2 +- htdocs/ticket/messaging.php | 2 +- htdocs/user/param_ihm.php | 2 +- htdocs/webservices/admin/index.php | 2 +- htdocs/website/websiteaccount_card.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- htdocs/workstation/workstation_card.php | 2 +- htdocs/workstation/workstation_document.php | 2 +- htdocs/workstation/workstation_note.php | 2 +- 217 files changed, 461 insertions(+), 462 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5c1a356e102..6453210e596 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -511,7 +511,7 @@ $tabcond[25] = !empty($conf->website->enabled); //$tabcond[26]= !empty($conf->product->enabled); $tabcond[27] = !empty($conf->societe->enabled); $tabcond[28] = !empty($conf->holiday->enabled); -$tabcond[29] = !empty($conf->projet->enabled); +$tabcond[29] = !empty($conf->project->enabled); $tabcond[30] = !empty($conf->label->enabled); //$tabcond[31]= !empty($conf->accounting->enabled); $tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 4f3cf10e77b..ab4f0c7def0 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -550,7 +550,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 'recordjoinpiece'=>'AttachJoinedDocumentsToObject', 'recordevent'=>'RecordEvent'); $arrayoftypesnocondition = $arrayoftypes; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; } $arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty'; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index fc63940f0b8..e5169ce55cc 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -148,7 +148,7 @@ if ($action == 'updateMask') { $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); $res3 = 0; - if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided + if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); } @@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm print ''; print ''."\n"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { print ''; // Show project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { print ''; print ''; - if ($object->elementtype == 'task' && !empty($conf->projet->enabled)) { + if ($object->elementtype == 'task' && !empty($conf->project->enabled)) { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''; print ''; print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -553,7 +553,7 @@ if ($id) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->banque->modifier) { diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index ad199caaf5a..b7cb8ee6bbf 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -97,7 +97,7 @@ if ($object->id) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index e50dc10ff7f..b46ab36ddf6 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -57,7 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob $morehtmlref = '
'; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 98cb0e27804..0091dc39512 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -161,7 +161,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->projet->enabled)), + 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)), diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 33b453cd0b4..59c2b373d1a 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -422,7 +422,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print '
'; print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -539,7 +539,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->tax->charges->creer) { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3de8687433f..2b0d17337a5 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -33,7 +33,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/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -121,7 +121,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 8363459171b..0976a76c26d 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -68,7 +68,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -90,7 +90,7 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 082a485f817..93c8dea0a3e 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -112,7 +112,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->projet->enabled))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))), '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), @@ -191,7 +191,7 @@ $formother = new FormOther($db); $bankstatic = new Account($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static = new ChargeSociales($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -199,7 +199,7 @@ llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; $sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; } $sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,"; @@ -209,7 +209,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; @@ -223,7 +223,7 @@ if ($search_ref) { if ($search_label) { $sql .= natural_search("cs.libelle", $search_label); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { if ($search_project_ref != '') { $sql .= natural_search("p.ref", $search_project_ref); } @@ -259,7 +259,7 @@ if ($search_typeid > 0) { $sql .= " AND cs.fk_type = ".((int) $search_typeid); } $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= ", p.rowid, p.ref, p.title"; } $sql .= $db->order($sortfield, $sortorder); @@ -560,7 +560,7 @@ while ($i < min($num, $limit)) { $chargesociale_static->label = $obj->label; $chargesociale_static->type_label = $obj->type_label; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; $projectstatic->title = $obj->project_label; diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index 0447d3168b1..8ede1c3b502 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 22b3f988a70..dc362e60051 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -34,7 +34,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/lib/vat.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 70761162153..a8dc5e7ee3b 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->projet->enabled)) { +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'; } @@ -110,7 +110,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -171,7 +171,7 @@ if ($id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3202d8598d0..ecc8ec22660 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 (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -1002,7 +1002,7 @@ llxHeader('', $langs->trans("Contract"), $help_url); $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1161,7 +1161,7 @@ if ($action == 'create') { print ""; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); $formproject = new FormProjets($db); @@ -1321,7 +1321,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 367fcba3a46..8b6d7490eaf 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->projet->enabled', 'visible'=>-1, 'position'=>75), + '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_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), diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d053a9a4fa0..1bd9d3388f6 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 953fd0002d2..ce386fe21b9 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 01378a65786..540491698c1 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index c813e8af4a0..69d46dae51c 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -26,7 +26,7 @@ // $id must be defined // $object must be defined and must have a method generateDocument(). // $permissiontoadd must be defined -// $upload_dir must be defined (example $conf->projet->dir_output . "/";) +// $upload_dir must be defined (example $conf->project->dir_output . "/";) // $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. if (!empty($permissioncreate) && empty($permissiontoadd)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5acc6b22ee2..9ec4db2bd11 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined @@ -455,7 +455,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->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { + if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { $objecttmp->fetch_projet(); } $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp); diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index c4b79d89920..ce47cc3568f 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -252,9 +252,9 @@ if ($type == 'directory') { } elseif ($module == 'salaries') { $upload_dir = $conf->salaries->dir_output; } elseif ($module == 'project') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'project_task') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'fichinter') { $upload_dir = $conf->ficheinter->dir_output; } elseif ($module == 'user') { diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index de69e19c3e2..c1199477f58 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -89,10 +89,10 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 28461e07de5..b25a42228e7 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -133,7 +133,7 @@ class box_dolibarr_state_board extends ModeleBoxes 'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), 'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), 'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - 'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire, + 'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire, 'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, 'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read, 'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read, diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 8e325fd13e2..b1e085fbff7 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -72,7 +72,7 @@ class FileUpload } elseif ($element == 'project_task') { $pathname = 'projet'; $filename = 'task'; - $dir_output = $conf->projet->dir_output; + $dir_output = $conf->project->dir_output; $parentForeignKey = 'fk_project'; $parentClass = 'Project'; $parentElement = 'projet'; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 957026c2180..cba880dfada 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -612,7 +612,7 @@ class FormTicket } if ($subelement != 'project') { - if (!empty($conf->projet->enabled) && !$this->ispublic) { + if (!empty($conf->project->enabled) && !$this->ispublic) { $formproject = new FormProjets($this->db); print '
'; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print "\n"; @@ -639,7 +639,7 @@ if (!empty($id) && $action == 'edit') { print "".''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/document.php b/htdocs/don/document.php index ab99ba3df1d..030ca5cb085 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -34,7 +34,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.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -99,7 +99,7 @@ if ($action == 'classin' && $user->rights->don->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -129,7 +129,7 @@ if ($object->id) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/info.php b/htdocs/don/info.php index 0057bf87dce..f326972f782 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -25,7 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -63,7 +63,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -77,7 +77,7 @@ $linkback = ''; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/list.php b/htdocs/don/list.php index d7697dba43d..891f7e6877b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -93,7 +93,7 @@ $fieldstosearchall = array( $donationstatic = new Don($db); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -219,7 +219,7 @@ if ($resql) { print '
'; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; @@ -249,7 +249,7 @@ if ($resql) { } print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder); } @@ -280,7 +280,7 @@ if ($resql) { } print ""; print ''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print "'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($object->fk_project)) { $projectid = $object->fk_project; @@ -1718,7 +1718,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 944f76266d2..669c6f8e56d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -149,7 +149,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 68336e8dbf6..d0729879017 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index d8d70b3cc49..e391d5be180 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 2919a42bdb7..a64e6c2b761 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -227,7 +227,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -287,7 +287,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 818b3d564a6..1a2718e7d9a 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->projet->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { @@ -1691,7 +1691,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -2055,7 +2055,7 @@ if ($action == 'create') { print '
'; //print ''; print ''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; } print ''; @@ -2100,7 +2100,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; @@ -2409,7 +2409,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if ($action != 'editline') { @@ -2486,7 +2486,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; } print ''; @@ -2515,7 +2515,7 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 1a289e61e2e..f25af036ae4 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->projet->enabled)) { +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'; } @@ -245,7 +245,7 @@ $companystatic = new Societe($db); if (!empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -273,7 +273,7 @@ if ($action == 'create') { print dol_get_fiche_head(); $rowspan = 4; - if (!empty($conf->projet->enabled) && $object->fk_project > 0) { + if (!empty($conf->project->enabled) && $object->fk_project > 0) { $rowspan++; } if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { @@ -315,7 +315,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); print "'; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("project"); @@ -1161,7 +1161,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index ac0f47ee4b3..aea22a9d10c 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -40,7 +40,7 @@ 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->projet->enabled', 'visible'=>-1, 'position'=>20), + '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), diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index f2f50963287..ef6ffc80881 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 7fdcaa151a0..d0dd326df07 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -34,7 +34,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/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($object->id) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index e5eea9f846c..589f1901cd6 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/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.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -78,7 +78,7 @@ $morehtmlref = '
'; // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 125b88c5b8e..ef71f01e228 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -34,7 +34,7 @@ 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.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } if (!empty($conf->contrat->enabled)) { @@ -43,7 +43,7 @@ if (!empty($conf->contrat->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'interventions')); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->contrat->enabled)) { @@ -120,7 +120,7 @@ $arrayfields = array( 'f.ref'=>array('label'=>'Ref', 'checked'=>1), 'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1), 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), 'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)), 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), @@ -202,7 +202,7 @@ $form = new Form($db); $formfile = new FormFile($db); $objectstatic = new Fichinter($db); $companystatic = new Societe($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projetstatic = new Project($db); } if (!empty($conf->contrat->enabled)) { @@ -234,7 +234,7 @@ if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,"; } $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus"; -if (!empty($conf->projet->enabled)) { +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)) { @@ -251,7 +251,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; -if (!empty($conf->projet->enabled)) { +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)) { diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 579760cf55f..be5f67da555 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -88,7 +88,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1d0e370355f..00208d53a19 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>45), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>45), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>64), diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 9464c06bd4c..fe9c00c75f3 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -195,7 +195,7 @@ class FactureFournisseurRec extends CommonInvoice 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85), + '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_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>175), '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), diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 948e1c01deb..48c5e88c2c5 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -297,7 +297,7 @@ class FactureFournisseur extends CommonInvoice 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130), 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>145), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>145), 'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>150), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0417554f8fd..b1f746b2245 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -49,7 +49,7 @@ if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -160,7 +160,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede // Project permission $caneditproject = false; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); } @@ -1534,7 +1534,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $productstatic = new Product($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1746,7 +1746,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2034,7 +2034,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index e521caf1080..f05251993a7 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 362741e1641..7b352a01abc 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index d54d5553efb..ca43b69fd5e 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -34,7 +34,7 @@ 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.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -131,7 +131,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 728986f5a88..771a6faf23f 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -29,7 +29,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.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -139,7 +139,7 @@ $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_ // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 1c67c03d727..d2c7398a98c 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -106,7 +106,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index cefc46599c4..e996f29b3c8 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->projet->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'; @@ -869,7 +869,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoice"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (! empty($conf->projet->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->projet->enabled)) $rowspan++; + if (! empty($conf->project->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print '
'; print $langs->trans('InterToUse'); @@ -1569,7 +1573,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print '
'; print $langs->trans('ProjectIsRequiredOnExpenseReports'); print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 619a5003161..e01c3142cc0 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -185,7 +185,7 @@ if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->re if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { $elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty')); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject')); } if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) { diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8729fce71d3..b95f73a399f 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -108,7 +108,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') { dolibarr_del_const($db, "PDF_SHOW_PROJECT", $conf->entity); dolibarr_del_const($db, "PDF_SHOW_PROJECT_TITLE", $conf->entity); @@ -482,7 +482,7 @@ print '
'.$langs->trans("PDF_SHOW_PROJECT").''; $tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel'); $showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref'; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index bce63ed0625..d2c64eea0b6 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index a5c9dd5cf68..ee619a589e3 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -476,7 +476,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b1ae9dee61b..351ab9212bc 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1234,7 +1234,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $projectid = GETPOST('projectid', 'int'); @@ -1737,7 +1737,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print '
'.$langs->trans("Project").''; @@ -1762,7 +1762,7 @@ if ($id > 0) { print '
'.$langs->trans("LinkedObject").''; $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility @@ -1946,7 +1946,7 @@ if ($id > 0) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').' '; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 38779e300ed..90ed4ea1944 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ec80dc90a4c..411a47c8b74 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 19f4c4bfa03..0ea24279df4 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->projet->enabled)) { +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'; } @@ -86,7 +86,7 @@ $morehtmlref = '
'; // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4005ba45e65..01d7102a47c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -78,7 +78,7 @@ if (!empty($conf->expedition->enabled)) { if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 177410622c4..5e327e1b706 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.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->projet->enabled)) { +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'; } @@ -1522,7 +1522,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1779,7 +1779,7 @@ if ($action == 'create') { print '
'.$langs->trans("Project").''; @@ -2211,7 +2211,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').''; if ($usercancreate) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 73e73fbe2f9..1ad6f121848 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -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->projet->enabled', 'visible'=>-1, 'position'=>24), + '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), '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), @@ -1367,7 +1367,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->projet->enabled)) + /*if (!empty($conf->project->enabled)) { $project = new Project($db); if ($this->fk_project > 0 && $project->fetch($this->fk_project)) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 989dcfe7098..d9942e9153c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -137,7 +137,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 804fedd623b..31cf2c18f42 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index dc43af9ceff..65ff9c19e2b 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 103ef815e48..e490a5ca7ac 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->projet->enabled) ? 0 : 1)), - 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 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)), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), 's.town'=>array('label'=>"Town", 'checked'=>-1), diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 13fa42edb29..7e40552fefb 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -107,7 +107,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1432d1f132f..c68390835f4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -1492,7 +1492,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1778,7 +1778,7 @@ if ($action == 'create' && $usercancreate) { // TODO How record was recorded OrderMode (llx_c_input_method) // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print '
'.$langs->trans("Project").''; @@ -2246,7 +2246,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 44cc5c6effd..874898eb0a4 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->projet->enabled', 'visible'=>-1, 'position'=>25), + '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), '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), diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index b89623fc3a0..5f4de8b59a0 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 684d8e61334..d85400243e7 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 38d8beba2ec..93b80b80f1c 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b4e1f19554e..350674370e9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -165,8 +165,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->projet->enabled) ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25), + '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), '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), diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 55140c30ae2..75d8e587ccb 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->projet->enabled)) { +if (!empty($conf->project->enabled)) { 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index ab4b24e3889..95d5ffa0e9e 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -311,7 +311,7 @@ $form = new Form($db); if (!empty($conf->accounting->enabled)) { $formaccounting = new FormAccounting($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -481,7 +481,7 @@ if ($action == 'create') { print '
'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e8346a11896..18a935cedb4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -34,7 +34,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.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->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } @@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -954,7 +954,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $rowspan++; } if ($object->fk_account > 0) { @@ -1047,7 +1047,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->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 '
'.$langs->trans('Project').''; @@ -1203,7 +1203,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fefbbab118..ca07f30f838 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -54,7 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -2874,7 +2874,7 @@ $formmargin = new FormMargin($db); $soc = new Societe($db); $paymentstatic = new Paiement($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -3658,7 +3658,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print '
'.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); @@ -4284,7 +4284,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { @@ -4803,7 +4803,7 @@ if ($action == 'create') { $nbrows = 8; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 34df7bcf097..f15f65954cf 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->projet->enabled', 'visible'=>-1, 'position'=>85), + '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_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), diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index b1799350ce8..1b75d43753e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index f55e9c4b36f..1685da08a2e 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.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->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index ceea7dcbb62..8b198e5f991 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 02925225df9..1f516c31795 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -257,7 +257,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-factur $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 54de9440b8b..cac6229f86b 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->projet->enabled) ? 0 : 1), 'position'=>40), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>41), + '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), '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), diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index cab6d3ac680..5b30d39da12 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index afdd871371c..8bd953f98b5 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -349,7 +349,7 @@ if ($object->id > 0) { } } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 900f1a179e9..fed5a42c04e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution 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.'/user/class/user.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -332,7 +332,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formsocialcontrib = new FormSocialContrib($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -406,7 +406,7 @@ if ($action == 'create') { print '
'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'
'; print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 896921ac436..cc99471a69f 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->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && (!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->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $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)); } diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 8ade2200724..220c088fc11 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->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && (!empty($user->rights->projet->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->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $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)); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 76948308c70..482831191d6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1443,7 +1443,7 @@ function dol_delete_preview($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->facture->dir_output; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -1525,7 +1525,7 @@ function dol_meta_create($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->dir_output.'/facture'; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -2812,7 +2812,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")"; - } elseif ($modulepart == 'project' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) { // Wrapping pour les projets if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; @@ -2824,9 +2824,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; - } elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) { if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project @@ -2837,7 +2837,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les commandes fournisseurs diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45bf99577d4..5f398da1ec8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7313,7 +7313,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; $substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__'; } - if (!empty($conf->projet->enabled)) { // Most objects + if (!empty($conf->project->enabled)) { // Most objects $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__'; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bcc6fde98c8..d53870128fc 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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbElements += $project->getElementCount('project_task', 'projet_task'); } if (!empty($conf->stock->enabled)) { @@ -275,7 +275,7 @@ function project_prepare_head(Project $project, $moreparam = '') } else { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($project->ref); + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $project->element, $project->id); $totalAttached = $nbFiles + $nbLinks; @@ -401,7 +401,7 @@ function task_prepare_head($object) } $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : ''); - $filesdir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); + $filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 19b4d01f9d9..056d28ab2cd 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -774,7 +774,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checkproject)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $projectid = $objectid; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -795,7 +795,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checktask)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $task = new Task($db); $task->fetch($objectid); $projectid = $task->fk_project; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 9270b946199..96625dd1f95 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -15,7 +15,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); @@ -404,19 +404,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Project -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->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 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->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 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->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->projet->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __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->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 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->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 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->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __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->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 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->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 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->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->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->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 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->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 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->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __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->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->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->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __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->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories 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->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 907688b4878..6dae41ca2af 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -152,7 +152,7 @@ class pdf_standard extends ModeleExpenseReport $this->posxqty = 150; $this->postotalht = 160; $this->postotalttc = 180; - // if (empty($conf->projet->enabled)) { + // if (empty($conf->project->enabled)) { // $this->posxtva-=20; // $this->posxup-=20; // $this->posxqty-=20; @@ -581,7 +581,7 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $nextColumnPosX = $this->posxtva; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nextColumnPosX = $this->posxprojet; } @@ -597,7 +597,7 @@ class pdf_standard extends ModeleExpenseReport //$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C'); // Project - //if (! empty($conf->projet->enabled)) + //if (! empty($conf->project->enabled)) //{ // $pdf->SetFont('','', $default_font_size - 1); // $pdf->SetXY($this->posxprojet, $curY); @@ -955,7 +955,7 @@ class pdf_standard extends ModeleExpenseReport // $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C'); //} - //if (!empty($conf->projet->enabled)) + //if (!empty($conf->project->enabled)) //{ // // Project // $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index c9a28863c97..57ac7a637dc 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -145,7 +145,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->bank->enabled)) { $typeexample .= ($typeexample ? " / " : "")."5=Bank account"; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $typeexample .= ($typeexample ? " / " : "")."6=Project"; } if (!empty($conf->user->enabled)) { @@ -379,7 +379,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->export_label[$r] = 'CatProjectsList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->projet->enabled)'; + $this->export_enabled[$r] = '!empty($conf->project->enabled)'; $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); @@ -568,7 +568,7 @@ class modCategorie extends DolibarrModules // 5 Bank accounts, TODO ? // 6 Projects - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $r++; $this->import_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->import_label[$r] = "CatProjectsLinks"; // Translation key 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 10b78673cf5..8bd8d030a37 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 @@ -522,7 +522,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -536,7 +536,7 @@ class doc_generic_project_odt extends ModelePDFProjects $object->fetch_thirdparty(); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -575,9 +575,9 @@ class doc_generic_project_odt extends ModelePDFProjects //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -615,7 +615,7 @@ class doc_generic_project_odt extends ModelePDFProjects $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -826,7 +826,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Replace tags of project files $listtasksfiles = $listlines->__get('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -861,7 +861,7 @@ class doc_generic_project_odt extends ModelePDFProjects try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); foreach ($filearray as $filedetail) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index cf9e84a3deb..bb6eb75bf75 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -195,11 +195,11 @@ class pdf_baleine extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index abd05f63651..4aa6f754ad9 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -242,11 +242,11 @@ class pdf_beluga extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index cb7430c3011..741476de117 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -195,11 +195,11 @@ class pdf_timespent extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } 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 3702b1c8452..457df1194ad 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 @@ -481,7 +481,7 @@ class doc_generic_task_odt extends ModelePDFTask // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -496,7 +496,7 @@ class doc_generic_task_odt extends ModelePDFTask $project->fetch($object->fk_project); $project->fetch_thirdparty(); - $dir = $conf->projet->dir_output."/".$project->ref."/"; + $dir = $conf->project->dir_output."/".$project->ref."/"; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -525,9 +525,9 @@ class doc_generic_task_odt extends ModelePDFTask //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -550,7 +550,7 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -708,7 +708,7 @@ class doc_generic_task_odt extends ModelePDFTask // Replace tags of project files $listtasksfiles = $odfHandler->setSegment('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -741,7 +741,7 @@ class doc_generic_task_odt extends ModelePDFTask try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 382e78df8d3..dba3d0de437 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -43,7 +43,7 @@ if (!empty($conf->expedition_bon->enabled)) { if (!empty($conf->stock->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -328,7 +328,7 @@ if ($action == 'create') { // Create. Seems to no be used // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 960ff7e7b2d..30a3ec24c6c 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -382,7 +382,7 @@ llxHeader('', $title, $help_url); $form = new Form($db); $formfile = new FormFile($db); $formcompany = new FormCompany($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -511,7 +511,7 @@ if ($action == 'create') { print '
".$langs->trans("Project").""; $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; print ' '; print ''; print ' '; print '".$donationstatic->getFullName($langs)."'.dol_print_date($db->jdate($objp->datedon), 'day').'"; if ($objp->pid) { $projectstatic->id = $objp->pid; diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 1629aa0f28f..8e1b5192ee2 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -84,7 +84,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 51a3f7ced7b..1fcdac35b0f 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -347,9 +347,9 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries"))); } - if (!empty($conf->projet->enabled)) { - $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); - $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); + if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); + $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index a6782317802..27a76d2ae6e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -143,8 +143,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($conf->tax->enabled)) { $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->projet->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); +if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } 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"))); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 292b55d0dc9..2ab747f12c1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -107,7 +107,7 @@ class ConferenceOrBooth extends ActionComm 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 533c9f4e8c0..b65d152189f 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1), 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index da6c0f8ee04..57f2a76c042 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -392,7 +392,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index b8fb87d39fa..4c5b2f394a9 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index cda9274e6d6..a446c04ca9a 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index b07dfa778a4..e873ef6e056 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -56,7 +56,7 @@ if (!empty($conf->propal->enabled)) { if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -815,7 +815,7 @@ if (empty($action)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -902,7 +902,7 @@ if ($action == 'create') { print '
'.$langs->trans('LineNb').''.$langs->trans('Piece').''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Type').''.dol_print_date($db->jdate($line->date), 'day').''; if ($line->fk_project > 0) { $projecttmp->id = $line->fk_project; @@ -2261,7 +2261,7 @@ if ($action == 'create') { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { // Add line with link to add new file or attach line to an existing file $colspan = 11; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { @@ -2336,7 +2336,7 @@ if ($action == 'create') { print ''; $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print '
'.$langs->trans('Date').''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$langs->trans('Type').''; $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print '
".$langs->trans("Project").""; $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; @@ -485,7 +485,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; @@ -804,7 +804,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->projet->enabled)) { + if (!empty($conf->project->enabled)) { 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 '); @@ -843,7 +843,7 @@ if ($action == 'create') { } print '
'; if ($objp->fk_project > 0) { $projectstatic->fetch($objp->fk_project); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 4b7686449c7..09411f29d50 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -787,7 +787,7 @@ $formfile = new FormFile($db); if (!empty($conf->contrat->enabled)) { $formcontract = new FormContract($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -908,7 +908,7 @@ if ($action == 'create') { print '
'; @@ -986,7 +986,7 @@ if ($action == 'create') { print ""; // Project - if (! empty($conf->projet->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 ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Projet associe @@ -424,7 +424,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 1ed3e644b7f..3bc60980245 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -28,7 +28,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/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -103,7 +103,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 3a5e95c7823..a0db5ca35a7 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -26,7 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -67,7 +67,7 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 0b982728b9e..c9b6ef0e679 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -30,7 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -92,7 +92,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 62ad7519ac9..0944142bc1c 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -149,7 +149,7 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
'.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 47c2ce00b63..d07f5375657 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -109,7 +109,7 @@ class MyObject extends CommonObject 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'), diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 164af332ed8..6b6f60bf8c6 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2b38b59b284..7702aa6699b 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index 64f5ebba976..01efbec8cdc 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index aa213461e24..df201c2653b 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index bda60f90d52..368803a78a5 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index b99d03050ce..eb7e99501f7 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -106,7 +106,7 @@ class Mo extends CommonObject 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>'$conf->stock->enabled', 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax200'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,), diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 3317ddcfd43..2e8b6691c0f 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -153,7 +153,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 59cd99b7310..1a105a8db0e 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -484,7 +484,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('ThirdParty').' '; $morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index acb5cb3e1c4..810ea7c3200 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -131,7 +131,7 @@ if ($object->id) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 634f1caa092..f9496224a77 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -327,7 +327,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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 6fb173c4295..865b3bf38ce 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 8f121f2788f..16249087403 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -520,7 +520,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->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 9930093e6be..ab6d7ea083a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 34896b46541..08164421f60 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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index a4a61c6e907..094380ab83b 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index f96eb6e58ec..3e7f78e5118 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 67f963b155e..3bd2b913163 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 750d3bbd1e4..0a21f9939ee 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2e157de504a..ea338e99971 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -493,7 +493,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 2b8ee3db6a4..0e7189ae038 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -277,7 +277,7 @@ $form = new Form($db); $formproduct = new FormProduct($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -310,7 +310,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = $object->fk_project; $langs->load('projects'); print ''; print ''; -print ''; -if (!empty($conf->projet->enabled)) { +print ''; +if (!empty($conf->project->enabled)) { print ''; print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($objectsrc->fk_project)) { $projectid = $objectsrc->fk_project; @@ -1381,7 +1381,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index a7cec515e29..4e04bdd2926 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index f592dba452a..c349a25fd8b 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -120,7 +120,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 725c23ae738..46e10002d76 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; dol_include_once('/fourn/class/fournisseur.commande.class.php'); -if (!empty($conf->projet->enabled)) { +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'; } @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 42279fe3a97..89351997596 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -104,7 +104,7 @@ class RecruitmentJobPosition extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'css'=>'nowraponall'), 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1), 'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), 'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), 'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail', 'picto'=>'email'), 'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 54ac648d1d0..bfe70deb075 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 93b43c99cc6..0da5badd7bc 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -448,7 +448,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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 22e011daf42..38715f412f2 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -131,7 +131,7 @@ if ($object->id) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 9a0a21484b1..3f537003fb7 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -444,7 +444,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index d35edaa3b91..c6fedf6fcea 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 1391ddb132d..07cecb0070e 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index c6e462161ed..16e19066be3 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -271,7 +271,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 65b6f0e8885..b2172aca80d 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -343,7 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index e3e79a5482e..43f90ca1fdd 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -131,7 +131,7 @@ if ($object->id) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index 883f5612b97..c5d8cc29533 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 6926983915b..09c7befc664 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -349,7 +349,7 @@ if (!$ret) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; @@ -517,7 +517,7 @@ if (!$ret) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$fichinter->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 00591b5a32f..7d57575dacd 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } @@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Card'); $help_url = ""; @@ -559,7 +559,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); print '
"; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $formproject = new FormProjets($db); @@ -1555,7 +1555,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index f1756f17814..bc5e555fa99 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -134,7 +134,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoedit) { diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index fa73ec22fa8..af2353c4d8f 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.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->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -121,7 +121,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 0b796937d2e..7bb6d4f7682 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/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.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -76,7 +76,7 @@ $morehtmlref = '
'; // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index a0e404dbd89..96f8a2b2cca 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 5a19a94b402..4ef46594e0e 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 76e136c1fd7..72c19c217b3 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -184,7 +184,7 @@ if (!empty($conf->societe->enabled)) { } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project'); if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a527aca93bf..e7fc3abba34 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.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->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; @@ -696,7 +696,7 @@ if (empty($reshook)) { $userstat = new User($db); $form = new Form($db); $formticket = new FormTicket($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -949,7 +949,7 @@ if ($action == 'create' || $action == 'presend') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 6bc194fed21..67fb1772ac4 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -267,7 +267,7 @@ class Ticket extends CommonObject 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), //'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ? 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1), 'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1), diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index ee76045ffec..5b1b73799f2 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -221,7 +221,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index d0c2d0a4a60..bf2b1c51fc4 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -156,7 +156,7 @@ if ($object->id) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index a3bf03467ce..4b887691f01 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -182,7 +182,7 @@ if (!empty($conf->societe->enabled)) { } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project'); if ($user->rights->ticket->write) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index dd27bc36be8..7916f4650d2 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -186,7 +186,7 @@ $tmparray = array('index.php'=>'Dashboard'); if (!empty($conf->societe->enabled)) { $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) { diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index f70a990ee95..14af2e88b3f 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -108,7 +108,7 @@ $webservices = array( 'supplier_invoice' => '!empty($conf->fournisseur->enabled)', 'actioncomm' => '!empty($conf->agenda->enabled)', 'category' => '!empty($conf->categorie->enabled)', - 'project' => '!empty($conf->projet->enabled)', + 'project' => '!empty($conf->project->enabled)', 'other' => '' ); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 118627f19ea..249398c322e 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 78140eddd40..ff30d062f38 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 37f24a38437..9e859dcc2d0 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -340,7 +340,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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index f52ef1fe796..50331b4b231 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -128,7 +128,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 3685b7daf4e..dc230dd38ff 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -101,7 +101,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; From 3718afb16fd2c4aa496d1c8818ac1217b5e49cbb Mon Sep 17 00:00:00 2001 From: bagtaib Date: Tue, 14 Jun 2022 17:56:55 +0200 Subject: [PATCH 125/183] timestamp type is int not tms --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index cee2874d8c5..13fdffcb3c9 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1206,7 +1206,7 @@ class Account extends CommonObject * Return current sold * * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) - * @param tms $date_end Date until we want to get bank account sold + * @param int $date_end Date until we want to get bank account sold * @param string $field dateo or datev * @return int current sold (value date <= today) */ From ff26031dc61f58aefa74e553ebbe17638516fc11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 17:56:53 +0200 Subject: [PATCH 126/183] phpv8 --- htdocs/core/lib/contact.lib.php | 2 +- test/phpunit/BuildDocTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 220c088fc11..b63e7b025c7 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) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 18a737ec50b..81b05486c72 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -121,7 +121,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase if (! $conf->propal->enabled) { print __METHOD__." propal module not enabled\n"; die(1); } - if (! $conf->projet->enabled) { + if (! $conf->project->enabled) { print __METHOD__." project module not enabled\n"; die(1); } if (! $conf->expedition->enabled) { @@ -377,7 +377,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $user=$this->savuser; $langs=$this->savlangs; $db=$this->savdb; - $conf->projet->dir_output.='/temp'; + $conf->project->dir_output.='/temp'; $localobject=new Project($this->savdb); $localobject->initAsSpecimen(); From 389c2e8faf069b0c3f11634cadce473bab2dd332 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Tue, 14 Jun 2022 18:11:19 +0200 Subject: [PATCH 127/183] FIX - php V8 Extrafields checkbox empty --- htdocs/core/class/extrafields.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9f34fa3a15f..4f9b0d06f16 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1709,7 +1709,9 @@ class ExtraFields $toprint = array(); if (is_array($value_arr)) { foreach ($value_arr as $keyval => $valueval) { - $toprint[] = '
  • '.$param['options'][$valueval].'
  • '; + if (!empty($valueval)) { + $toprint[] = '
  • '.$param['options'][$valueval].'
  • '; + } } } $value = '
      '.implode(' ', $toprint).'
    '; From 86f7cbb46cfea39ba3387ee786f9ffb26de4036f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 18:14:24 +0200 Subject: [PATCH 128/183] FIX #21244 --- htdocs/fichinter/card-rec.php | 1 - htdocs/fichinter/class/fichinter.class.php | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index f25af036ae4..3f644b074bd 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -178,7 +178,6 @@ if ($action == 'add') { $newinter->entity = $object->entity; $newinter->duree = $object->duree; - $newinter->datei = $object->date; $newinter->description = $object->description; $newinter->note_private = $object->note_private; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index aea22a9d10c..b9f0264ad46 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1473,9 +1473,19 @@ class FichinterLigne extends CommonObjectLine */ public $fk_fichinter; - public $desc; // Description ligne - public $datei; // Date intervention - public $duration; // Duree de l'intervention + public $desc; // Description ligne + + /** + * @var int Date of intervention + */ + public $date; // Date intervention + /** + * @var int Date of intervention + * @deprecated + */ + public $datei; // Date intervention + + public $duration; // Duration of intervention public $rang = 0; /** From abcf77c80a0eb3ed6b08276f4b58213e751564f3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 14 Jun 2022 18:16:41 +0200 Subject: [PATCH 129/183] FIX missing field entity --- htdocs/admin/website.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 53760aaa586..5f51bccb240 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -95,7 +95,7 @@ $tabfield[1] = "ref,description,virtualhost,position,date_creation"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue = array(); -$tabfieldvalue[1] = "ref,description,virtualhost,position"; +$tabfieldvalue[1] = "ref,description,virtualhost,position,entity"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert = array(); From ac3d3528ff7d8fbe5187d888acb0dab51d0ed46c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 18:19:02 +0200 Subject: [PATCH 130/183] Doc --- htdocs/core/class/evalmath.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index ccd495bb623..7ae9e5fcd90 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -366,9 +366,9 @@ class EvalMath } /** - * evaluate postfix notation + * Evaluate postfix notation * - * @param string $tokens Expression + * @param string $tokens An array of expression to evaluate ('operators'). The operand are into ->stack. * @param array $vars Array * @return string Output */ From f8ac203a4d01b92591cf158eacde0d13595e2c1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 19:55:04 +0200 Subject: [PATCH 131/183] Doc --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4dde6902787..13d44e1ec8a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8949,8 +8949,12 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, foreach ($conf->modules_parts['tabs'][$type] as $value) { $values = explode(':', $value); + $reg = array(); if ($mode == 'add' && !preg_match('/^\-/', $values[1])) { - if (count($values) == 6) { // new declaration with permissions: $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + if (count($values) == 6) { + // new declaration with permissions: + // $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + // $value='objecttype:+tabname1:Title1,class,pathfile,method:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' if ($values[0] != $type) { continue; } From 6f0c9bdbf9cb4658230032982bacc74cc682fa49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 20:42:44 +0200 Subject: [PATCH 132/183] Doc --- htdocs/core/class/html.formticket.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cba880dfada..91fad1dba09 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -47,6 +47,9 @@ class FormTicket */ public $db; + /** + * @var string The track_id of the ticket. Used also for the $keytoavoidconflict to name session vars to upload files. + */ public $track_id; /** From b67c4b39caa4ed6ec9134c6379ecefadf489d091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 20:57:58 +0200 Subject: [PATCH 133/183] Typo --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 709d6e5d404..ff0350a9552 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1490,12 +1490,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { From 2370ff4dfc91a97c3c4805e3b7c4420544bf0d81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jun 2022 21:00:05 +0200 Subject: [PATCH 134/183] Clean code --- htdocs/commande/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c68390835f4..a3d1fa2da04 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1755,8 +1755,7 @@ if ($action == 'create' && $usercancreate) { // Shipping Method if (isModEnabled('expedition')) { print '
    '; } From 22152dd2543df67046b60a7b5e02c7d4fd8060ba Mon Sep 17 00:00:00 2001 From: bagtaib Date: Wed, 15 Jun 2022 00:50:34 +0200 Subject: [PATCH 135/183] declaring the propreties product_tosell & product_tobuy --- htdocs/commande/class/commande.class.php | 4 +++- htdocs/core/class/commonorder.class.php | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 233655843c6..bcce7c76864 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2060,7 +2060,7 @@ class Commande extends CommonOrder $sql .= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,'; $sql .= ' l.fk_unit,'; $sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,'; - $sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobatch as product_tobatch, p.barcode as product_barcode,'; + $sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch, p.barcode as product_barcode,'; $sql .= ' p.weight, p.weight_units, p.volume, p.volume_units'; $sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)'; @@ -2123,6 +2123,8 @@ class Commande extends CommonOrder $line->product_ref = $objp->product_ref; $line->product_label = $objp->product_label; + $line->product_tosell = $objp->product_tosell; + $line->product_tobuy = $objp->product_tobuy; $line->product_desc = $objp->product_desc; $line->product_tobatch = $objp->product_tobatch; $line->product_barcode = $objp->product_barcode; diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 410bf41a601..870d4c1d8df 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -72,11 +72,23 @@ abstract class CommonOrderLine extends CommonObjectLine */ public $product_label; + /** + * Boolean that indicates whether the product is available for sale '1' or not '0' + * @var int + */ + public $product_tosell=0; + + /** + * Boolean that indicates whether the product is available for purchase '1' or not '0' + * @var int + */ + public $product_tobuy=0; + /** * Product description * @var string */ - public $product_desc; + public $product_desc; /** * Product use lot From 25ecbe3401769540d988e013c3e21e21f79cd9cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jun 2022 03:26:27 +0200 Subject: [PATCH 136/183] Debug v16 --- htdocs/comm/mailing/cibles.php | 8 ++++---- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- htdocs/core/modules/mailings/thirdparties.modules.php | 8 ++++++-- htdocs/core/modules/mailings/xinputfile.modules.php | 10 ++++++---- htdocs/core/modules/mailings/xinputuser.modules.php | 7 ++++--- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 95639a25997..aaf100d191a 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -640,10 +640,10 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } // Amount - print ''; - print ''; + print ''; + print ''; + + // VAT + print ''; + print ''; // Amount Local Taxes //TODO: Place into a function to control showing by country or study better option if ($societe->localtax1_assuj == "1") { //Localtax1 print ''; - print ''; + print ''; print ''; } if ($societe->localtax2_assuj == "1") { //Localtax2 print ''; - print ''; + print ''; print ''; } - print ''; + print ''; + print ''; + print ''; print '
    ' . $langs->trans('Project') . ''; @@ -1135,7 +1135,7 @@ if ($action == 'create') { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load('projects'); $morehtmlref .= '
    ' . $langs->trans('Project') . ' '; if ($usercancreate) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 4ad8555ba24..a7d03c901c9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -49,7 +49,7 @@ if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -1888,7 +1888,7 @@ $form = new Form($db); $formfile = new FormFile($db); $bankaccountstatic = new Account($db); $paymentstatic = new PaiementFourn($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -2405,7 +2405,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2861,7 +2861,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -3236,7 +3236,7 @@ if ($action == 'create') { } $nbrows = 9; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index faa852d7984..85885ae866e 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 5b7d797a02f..d2f7181856a 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.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->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -116,7 +116,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 0cbf0f17512..0f932c27bae 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -30,7 +30,7 @@ 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/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -82,7 +82,7 @@ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0 $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 7da3a224d4f..f876462e15f 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -248,7 +248,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 59902947cef..682d92b4515 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -30,7 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -110,7 +110,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index e1b0ce6f581..a8a41b3fde6 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -35,7 +35,7 @@ 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'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index b1f7057f6a5..afbd480e928 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 61af793b28a..0cc25901302 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 67da8ecfd91..76f6e73d690 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index a7246e3a82b..d26ea1bf575 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index d8fecd74610..5f284c4e72c 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/index.php b/htdocs/index.php index 08b818bac63..6ada359cee6 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -145,7 +145,6 @@ $boxstatFromHook = ''; $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); // Dolibarr Working Board with weather - if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; @@ -163,14 +162,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of project opened - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $board = new Project($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of tasks to do (late) - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $board = new Task($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 003faa326d5..37c6b9a6e3c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index e9c58bf31a4..baddd9e29a5 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -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->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index c338653b840..2b2facafc18 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index dbffe6aa3da..ec88c33d882 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 2e58480adec..0f56a6115a3 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->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 4bc539c1ff0..3ad898cda98 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -309,7 +309,7 @@ if ($action == 'create') { print '
    '.$langs->trans("Insurance").'
    '.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); @@ -431,7 +431,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { @@ -849,7 +849,7 @@ if ($action == 'create') { print '
    '.$langs->trans('Project').''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5d1da2b22ab..fb8c8d55768 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -129,7 +129,7 @@ class Entrepot extends CommonObject 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1), 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), - 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25), + 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), 'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1), 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1), diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 735fc3bfa64..b913fd0cf38 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -119,7 +119,7 @@ class MouvementStock extends CommonObject 'fk_origin' =>array('type'=>'integer', 'label'=>'Fk origin', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'origintype' =>array('type'=>'varchar(32)', 'label'=>'Origintype', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75), 'inventorycode' =>array('type'=>'varchar(128)', 'label'=>'InventoryCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'eatby' =>array('type'=>'date', 'label'=>'Eatby', 'enabled'=>1, 'visible'=>-1, 'position'=>90), diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index db6560a9970..de9f72fbcd6 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -59,7 +59,7 @@ $morehtmlref = '
    '; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 9dc82c7d09a..d7830d49615 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -425,7 +425,7 @@ $userstatic = new User($db); $form = new Form($db); $formother = new FormOther($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 775e07d6118..34a2a074ec5 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -593,7 +593,7 @@ $movement = new MouvementStock($db); $userstatic = new User($db); $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -800,7 +800,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate && 1 == 2) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b9fc1a201e5..3054e6785bd 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class. if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -524,7 +524,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans("Save")) { $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 6523d66552f..ed494bb58b5 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -148,7 +148,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 2a61d44eb9e..b88df4e1da1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -596,7 +596,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'
    '; } // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.=$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php index d2cb095932b..691d2ea2f9d 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php @@ -143,7 +143,7 @@ if ($object->id > 0) { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer'); } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->stocktransfer->stocktransfer->write) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index ab4b45b6864..e4675378d20 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -136,7 +136,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php index 41842d07ee5..1932b685e24 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 6afea0abe54..481b6c0fde3 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -156,8 +156,8 @@ if (!empty($conf->productbatch->enabled) && // Purchase price and project print '
    '.$langs->trans("UnitPurchaseValue").''.$langs->trans('Project').''; print img_picto('', 'project'); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 813dccf8a73..0cfe126d69b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -390,7 +390,7 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; $file = $upload_dir.'/'.GETPOST('file'); $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) { @@ -1394,7 +1394,7 @@ if ($action == 'create' && $user->rights->projet->creer) { * Generated documents */ $filename = dol_sanitizeFileName($object->ref); - $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire && $userAccess > 0); $delallowed = ($user->rights->projet->creer && $userWrite > 0); @@ -1418,7 +1418,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Presend form $modelmail = 'project'; $defaulttopic = 'SendProjectRef'; - $diroutput = $conf->projet->dir_output; + $diroutput = $conf->project->dir_output; $autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add $trackid = 'proj'.$object->id; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 28c8cb656d1..0c56ecf0677 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -546,9 +546,9 @@ class Project extends CommonObject if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) { // We remove directory - if ($conf->projet->dir_output) { - $olddir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref); - $newdir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->ref); + if ($conf->project->dir_output) { + $olddir = $conf->project->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->project->dir_output."/".dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $res = @rename($olddir, $newdir); @@ -909,8 +909,8 @@ class Project extends CommonObject if (empty($error)) { // We remove directory $projectref = dol_sanitizeFileName($this->ref); - if ($conf->projet->dir_output) { - $dir = $conf->projet->dir_output."/".$projectref; + if ($conf->project->dir_output) { + $dir = $conf->project->dir_output."/".$projectref; if (file_exists($dir)) { $res = @dol_delete_dir_recursive($dir); if (!$res) { @@ -1643,8 +1643,8 @@ class Project extends CommonObject if ($clone_project_file) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $clone_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($defaultref); - $ori_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($orign_project_ref); + $clone_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($defaultref); + $ori_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($orign_project_ref); if (dol_mkdir($clone_project_dir) >= 0) { $filearray = dol_dir_list($ori_project_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); @@ -2058,7 +2058,7 @@ class Project extends CommonObject $project_static = new Project($this->db); $response = new WorkboardResponse(); - $response->warning_delay = $conf->projet->warning_delay / 60 / 60 / 24; + $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) { @@ -2162,7 +2162,7 @@ class Project extends CommonObject $now = dol_now(); - return ($this->date_end) < ($now - $conf->projet->warning_delay); + return ($this->date_end) < ($now - $conf->project->warning_delay); } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 79152c6cfb9..c5fefc2e0b1 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -473,12 +473,12 @@ class Task extends CommonObjectLine if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) { // We remove directory - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { $project = new Project($this->db); $project->fetch($this->fk_project); - $olddir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref); - $newdir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref); + $olddir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $res = dol_move_dir($olddir, $newdir); @@ -600,11 +600,11 @@ class Task extends CommonObjectLine return -1 * $error; } else { //Delete associated link file - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { $projectstatic = new Project($this->db); $projectstatic->fetch($this->fk_project); - $dir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id); + $dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id); dol_syslog(get_class($this)."::delete dir=".$dir, LOG_DEBUG); if (file_exists($dir)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1957,8 +1957,8 @@ class Task extends CommonObjectLine $clone_project_ref = $ori_project_ref; } - $clone_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref); - $ori_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid); + $clone_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref); + $ori_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid); $filearray = dol_dir_list($ori_task_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); foreach ($filearray as $key => $file) { @@ -2205,7 +2205,7 @@ class Task extends CommonObjectLine $task_static = new Task($this->db); $response = new WorkboardResponse(); - $response->warning_delay = $conf->projet->task->warning_delay / 60 / 60 / 24; + $response->warning_delay = $conf->project->task->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("OpenedTasks"); if ($user->rights->projet->all->lire) { $response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project'; @@ -2306,6 +2306,6 @@ class Task extends CommonObjectLine $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); - return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); + return ($datetouse > 0 && ($datetouse < ($now - $conf->project->task->warning_delay))); } } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 2301017edd9..588043a56dc 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -49,7 +49,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob } if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref); } // Get parameters @@ -109,7 +109,7 @@ llxHeader('', $title, $help_url); $form = new Form($db); if ($object->id > 0) { - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); // To verify role of users //$userAccess = $object->restrictedProjectArea($user,'read'); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index fb4011ada8c..16b67dd4876 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -579,7 +579,7 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, - 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), + 'test'=>($conf->project->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), 'stock_mouvement'=>array( 'name'=>"MouvementStockAssociated", 'title'=>"ListMouvementStockProject", diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 31f74118261..eaf9c5022a3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -67,7 +67,7 @@ if (!$user->rights->projet->lire) { accessforbidden(); } -$diroutputmassaction = $conf->projet->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", "aZ09comma"); @@ -297,7 +297,7 @@ if (empty($reshook)) { $permissiontoread = $user->rights->projet->lire; $permissiontodelete = $user->rights->projet->supprimer; $permissiontoadd = $user->rights->projet->creer; - $uploaddir = $conf->projet->dir_output; + $uploaddir = $conf->project->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // Close records diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 410b637f3e6..f2e514afe56 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -137,7 +137,7 @@ $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. $result = restrictedArea($user, 'projet', $id, 'projet&project'); -$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('projecttaskscard', 'globalcard')); @@ -234,7 +234,7 @@ if (empty($reshook)) { $objectlabel = 'Tasks'; $permissiontoread = $user->rights->projet->lire; $permissiontodelete = $user->rights->projet->supprimer; - $uploaddir = $conf->projet->dir_output.'/tasks'; + $uploaddir = $conf->project->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index bd696e90434..ad0a2c0b628 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { $object->project = clone $projectstatic; - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 6d9e44c3799..bfda3ad31be 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -113,7 +113,7 @@ if (!$user->rights->projet->lire) { accessforbidden(); } -$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -237,7 +237,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Task'; $objectlabel = 'Tasks'; - $uploaddir = $conf->projet->dir_output.'/tasks'; + $uploaddir = $conf->project->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 5b0f097d22f..3df3cf8928e 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -177,7 +177,7 @@ if ($action == 'remove_file' && $user->rights->projet->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file')); $ret = dol_delete_file($file); @@ -647,7 +647,7 @@ if ($id > 0 || !empty($ref)) { * Generated documents */ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); - $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire); $delallowed = ($user->rights->projet->creer); diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 0add64bb700..e5dfeb59a8e 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -83,7 +83,7 @@ if ($resultproject < 0) { } // Security check -if (empty($conf->projet->enabled)) { +if (empty($conf->project->enabled)) { accessforbidden('', 0, 0, 1); } diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 4838c88c5a1..5b0c35c10f3 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -81,7 +81,7 @@ $object = new Project($db); $user->loadDefaultValues(); // Security check -if (empty($conf->projet->enabled)) { +if (empty($conf->project->enabled)) { accessforbidden('', 0, 0, 1); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7e910188b34..9c0d3b01136 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -57,7 +57,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +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'; } @@ -712,7 +712,7 @@ llxHeader('', $langs->trans('Reception'), 'Reception'); $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -797,7 +797,7 @@ if ($action == 'create') { print '
    '.$langs->trans("Project").''; @@ -794,7 +794,7 @@ if ($id) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 045b77ca0a4..99d0f1d7920 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -35,7 +35,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.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -132,7 +132,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Documents'); $help_url = ""; @@ -176,7 +176,7 @@ if ($object->id) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index a43d9010d8d..a2f05b791a6 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -100,7 +100,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) { * View */ -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Info'); $help_url = ""; @@ -139,7 +139,7 @@ if ($action != 'editlabel') { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5f11b6e3c02..366b510737b 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->projet->enabled)) { +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'; } @@ -1131,7 +1131,7 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = new FormMargin($db); $companystatic = new Societe($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1312,7 +1312,7 @@ if ($action == 'create') { print "
    '.$langs->trans('SendingMethod').''; - print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + print img_picto('', 'object_dolly', 'class="pictofixedwidth"').$form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print '
    '.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.''.$obj->lastname.''.$obj->firstname.''.$obj->other.''.img_picto('$obj->email', 'email', 'class="paddingright"').dol_escape_htmltag($obj->email).''.dol_escape_htmltag($obj->lastname).''.dol_escape_htmltag($obj->firstname).''.dol_escape_htmltag($obj->other).''; if (empty($obj->source_id) || empty($obj->source_type)) { print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index e3e349d2a17..decbc81716b 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -310,7 +310,7 @@ class mailing_contacts1 extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; + $s .= ''.$langs->trans("DefaultLang").': '; $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 073d45439eb..89bc2cf2b5e 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -117,6 +117,10 @@ class mailing_thirdparties extends MailingTargets $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; $addDescription = $langs->trans('DefaultLang')."="; } + if (GETPOST('filter_lang_thirdparties', 'alpha')) { + $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'"; + $addDescription = $langs->trans('DefaultLang')."="; + } $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; @@ -315,8 +319,8 @@ class mailing_thirdparties extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; - $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); + $s .= ''.$langs->trans("DefaultLang").': '; + $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; } diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 77044ddb29e..9a80484f83b 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -151,10 +151,12 @@ class mailing_xinputfile extends MailingTargets $cpt++; $buffer = trim(fgets($handle)); $tab = explode(';', $buffer, 4); - $email = $tab[0]; - $name = $tab[1]; - $firstname = $tab[2]; - $other = $tab[3]; + + $email = dol_string_nohtmltag($tab[0]); + $name = dol_string_nohtmltag(empty($tab[1]) ? '' : $tab[1]); + $firstname = dol_string_nohtmltag(empty($tab[2]) ? '' : $tab[2]); + $other = dol_string_nohtmltag(empty($tab[3]) ? '' : $tab[3]); + if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
    \n"; if (isValidEMail($email)) { diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 117a5722c3c..74ed18ba91f 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -127,10 +127,11 @@ class mailing_xinputuser extends MailingTargets require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $tmparray = explode(';', GETPOST('xinputuser')); + $email = $tmparray[0]; - $lastname = $tmparray[1]; - $firstname = $tmparray[2]; - $other = $tmparray[3]; + $lastname = empty($tmparray[1]) ? '' : $tmparray[1]; + $firstname = empty($tmparray[2]) ? '' : $tmparray[2]; + $other = empty($tmparray[3]) ? '' : $tmparray[3]; $cibles = array(); if (!empty($email)) { From a8e4aec5c238f0a9fa38ce12f4a3cfb9497742b2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 15 Jun 2022 04:46:58 +0200 Subject: [PATCH 137/183] Same modification on supplier invoice --- htdocs/fourn/facture/card.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a7d03c901c9..c2fc4e8511a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -8,10 +8,10 @@ * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2016-2021 Alexandre Spangaro + * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2019 Ferran Marcet - * 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 @@ -3169,23 +3169,28 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT 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)).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
    '.$langs->trans('AmountHT').''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountVAT').''.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); + print '
    '.$langs->trans('AmountHT').''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountVAT').''; if (GETPOST('calculationrule')) { $calculationrule = GETPOST('calculationrule', 'alpha'); } else { @@ -3203,25 +3208,28 @@ if ($action == 'create') { $s .= ' / '; $s .= ''.$langs->trans("Mode2").''; print '
    '; - print '         '; print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'
    '.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); + print '       '; print '
    '; } + print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); print '
    '.$langs->transcountry("AmountLT1", $societe->country_code).''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT2", $societe->country_code).''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).'
    '.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).'
    '; From f39c8e46d84fbdc08f0916b9acfb05d1819cbc62 Mon Sep 17 00:00:00 2001 From: Supermanu Date: Wed, 15 Jun 2022 10:26:44 +0200 Subject: [PATCH 138/183] Fix timezone issue in event list --- htdocs/comm/action/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 06e6684d99b..dd877e903e4 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -987,10 +987,10 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['a.datep']['checked'])) { print ''; if (empty($obj->fulldayevent)) { - print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); + print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuserrel'); } else { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); - print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel')); } $late = 0; if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) { @@ -1006,10 +1006,10 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['a.datep2']['checked'])) { print ''; if (empty($obj->fulldayevent)) { - print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser'); + print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuserrel'); } else { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); - print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser')); + print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel')); } print ''; } @@ -1091,11 +1091,11 @@ while ($i < $imaxinloop) { // Date creation if (!empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuser').''; + print ''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').''; } // Date update if (!empty($arrayfields['a.tms']['checked'])) { - print ''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuser').''; + print ''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').''; } if (!empty($arrayfields['a.percent']['checked'])) { // Status/Percent From 20ce5c53230321fe5737c3c60a6b8eb80ef78860 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 11:10:31 +0200 Subject: [PATCH 139/183] declaring a used abstract function in the Stats class --- htdocs/core/class/stats.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 8128dd07ed8..a31c9fc3349 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -33,6 +33,13 @@ abstract class Stats protected $lastfetchdate = array(); // Dates of cache file read by methods public $cachefilesuffix = ''; // Suffix to add to name of cache file (to avoid file name conflicts) + /** + * @param int $year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getNbByMonth($year, $format = 0); + /** * Return nb of elements by month for several years * @@ -86,7 +93,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->_getNbByMonth($year, $format); + $datay[$year] = $this->getNbByMonth($year, $format); $year++; } From 7d02cdeb62e1754d5bca8883af9bdbfcef2d19de Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 15 Jun 2022 11:18:27 +0200 Subject: [PATCH 140/183] Declared attribute salary in class Salary --- htdocs/salaries/card.php | 2 +- htdocs/salaries/class/salary.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index e4c4bb24464..00591b5a32f 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -232,7 +232,7 @@ if ($action == 'add' && empty($cancel)) { // Set user current salary as ref salary for the payment $fuser = new User($db); $fuser->fetch(GETPOST("fk_user", "int")); - $object->amount = $fuser->salary; + $object->salary = $fuser->salary; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 1f4d2920914..e6d7eb2a4a6 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -56,8 +56,9 @@ class Salary extends CommonObject public $datep; public $datev; - public $amount; + public $salary; + public $amount; /** * @var int ID */ From fddb6a08b4fe5c75153178b0186a05adfbec70e1 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 15 Jun 2022 09:19:14 +0000 Subject: [PATCH 141/183] Fixing style errors. --- htdocs/salaries/class/salary.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index e6d7eb2a4a6..a7e96741862 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -58,7 +58,7 @@ class Salary extends CommonObject public $datev; public $salary; - public $amount; + public $amount; /** * @var int ID */ From eb7b0824eeef6621ce063a1508da64b1cb53321c Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 15 Jun 2022 13:59:17 +0200 Subject: [PATCH 142/183] Commented dead code --- htdocs/emailcollector/class/emailcollectoraction.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index cb0a38975e1..5c7681a3782 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -271,9 +271,9 @@ class EmailCollectorAction extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLinesCommon(); - } + // if ($result > 0 && !empty($this->table_element_line)) { + // $this->fetchLinesCommon(); + // } return $result; } From b713592c25a0b2a35bc463116ed89600bce363b7 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 14:00:24 +0200 Subject: [PATCH 143/183] adding abstract function to Stats class --- htdocs/core/class/stats.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ca6310aae9a..188ecf1b429 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -123,6 +123,13 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getAmountByMonth($year, $format = 0); + /** * Return amount of elements by month for several years. * Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php @@ -180,7 +187,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->_getAmountByMonth($year, $format); + $datay[$year] = $this->getAmountByMonth($year, $format); $year++; } @@ -460,7 +467,6 @@ abstract class Stats return $data; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Return the amount per month for a given year From e5ec06ab53252af12011635421c24dd3457f260c Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 15 Jun 2022 14:09:00 +0200 Subject: [PATCH 144/183] Added deprecated attribute datee in class Task --- htdocs/projet/class/task.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 9ee0c978133..1437425a119 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -84,6 +84,11 @@ class Task extends CommonObjectLine public $date_start; public $date_end; public $progress; + + /** + * @deprecated use $date_end instead + */ + public $datee; /** * @var int ID @@ -2304,7 +2309,7 @@ class Task extends CommonObjectLine $now = dol_now(); - $datetouse = ($this->date_end > 0) ? $this->date_end : 0; + $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } From 73977f8a846ac86d0f06685a35bc3d46b3d9e8be Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 15 Jun 2022 12:09:40 +0000 Subject: [PATCH 145/183] Fixing style errors. --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1437425a119..60ef13fea28 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -84,7 +84,7 @@ class Task extends CommonObjectLine public $date_start; public $date_end; public $progress; - + /** * @deprecated use $date_end instead */ From aa2b96fb48055e33834eeed10d332af3d1fe6119 Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 15 Jun 2022 14:10:15 +0200 Subject: [PATCH 146/183] Added deprecated attribute datee in class Task --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60ef13fea28..877a095d75b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -86,7 +86,7 @@ class Task extends CommonObjectLine public $progress; /** - * @deprecated use $date_end instead + * @deprecated Use date_end instead */ public $datee; From 63dd080dead6c56d4c6cf3812abf129583a364b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jun 2022 14:19:26 +0200 Subject: [PATCH 147/183] Fix phpcs --- htdocs/societe/card.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ca4a8a54775..72979028ed8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2242,19 +2242,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Phone / Fax print ''.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).''; - print ''.img_picto('', 'object_phoning').' '; + print ''.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; if ($conf->browser->layout == 'phone') { print ''; } print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''; - print ''.img_picto('', 'object_phoning_fax').' '; + 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').' '; + print ''.img_picto('', 'object_email', 'class="pictofixedwidth"').' '; print ''.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''; - print ''.img_picto('', 'globe').' '; + print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' '; + // Social network if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { @@ -2262,9 +2263,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; if (!empty($value['icon'])) { - print ''; + print ''; } - print ''; + print ''; print ''; print ''; } elseif (!empty($object->socialnetworks[$key])) { From 8da6d4b6370c91bf845e9e02f164796770d9ba25 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 15 Jun 2022 14:53:44 +0200 Subject: [PATCH 148/183] Fix modulebuilder for object sharing. --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 2e9292aa161..a350fc4a8d6 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -434,7 +434,7 @@ class MyObject extends CommonObject $sql .= $this->getFieldList('t'); $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($this->table_element).")"; + $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; } else { $sql .= " WHERE 1 = 1"; } From 7157df4fad6ea4aeee9e8d07073e4bf8bd9f236c Mon Sep 17 00:00:00 2001 From: bagtaib Date: Wed, 15 Jun 2022 14:53:51 +0200 Subject: [PATCH 149/183] ingnore external libraries in precommit --- dev/setup/git/hooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/setup/git/hooks/pre-commit b/dev/setup/git/hooks/pre-commit index 51b7c5cf4e9..55295b4d656 100644 --- a/dev/setup/git/hooks/pre-commit +++ b/dev/setup/git/hooks/pre-commit @@ -7,7 +7,7 @@ # To run the fix manually: cd ~/git/dolibarr; phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true "fileordir" PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` -STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` +STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep -v '/includes/'| grep \\\\.php` DIRPHPCS="" AUTOFIX=1 From 5b93c103a351996424c2c29cc5edf071a7b401a6 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 15:18:37 +0200 Subject: [PATCH 150/183] evaluate function checks if is empty + unit test --- htdocs/core/class/evalmath.class.php | 8 +- test/phpunit/EvalMathTest.php | 151 +++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 test/phpunit/EvalMathTest.php diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index 78221de5c98..f30cdaeb777 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -144,6 +144,10 @@ class EvalMath */ public function evaluate($expr) { + if (empty($expr)) { + return false; + } + $this->last_error = null; $this->last_error_code = null; $expr = trim($expr); @@ -374,10 +378,6 @@ class EvalMath */ private function pfx($tokens, $vars = array()) { - if (empty($tokens)) { - return false; - } - $stack = new EvalMathStack(); foreach ($tokens as $token) { // nice and easy diff --git a/test/phpunit/EvalMathTest.php b/test/phpunit/EvalMathTest.php new file mode 100644 index 00000000000..18b9edb3fff --- /dev/null +++ b/test/phpunit/EvalMathTest.php @@ -0,0 +1,151 @@ + + * Copyright (C) 2022 Quatadah Nasdami + * + * 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 . + * or see https://www.gnu.org/ + */ + +/** + * \file test/phpunit/InventoryTest.php + * \ingroup test + * \brief PHPUnit test + * \remarks To run this script as CLI: phpunit filename.php + */ + +global $conf,$user,$langs,$db; +require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/core/class/evalmath.class.php'; + +if (empty($user->id)) { + print "Load permissions for admin user nb 1\n"; + $user->fetch(1); + $user->getrights(); +} +$conf->global->MAIN_DISABLE_ALL_MAILS=1; + + +/** + * Class for PHPUnit tests + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. + */ +class InventoryTest extends PHPUnit\Framework\TestCase +{ + protected $savconf; + protected $savuser; + protected $savlangs; + protected $savdb; + + /** + * Constructor + * We save global variables into local variables + * + * @return InventoryTest + */ + public function __construct() + { + parent::__construct(); + + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $this->savlangs=$langs; + $this->savdb=$db; + + print __METHOD__." db->type=".$db->type." user->id=".$user->id; + //print " - db ".$db->db; + print "\n"; + } + + /** + * setUpBeforeClass + * + * @return void + */ + public static function setUpBeforeClass() + { + global $conf,$user,$langs,$db; + + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. + + print __METHOD__."\n"; + } + + /** + * tearDownAfterClass + * + * @return void + */ + public static function tearDownAfterClass() + { + global $conf,$user,$langs,$db; + $db->rollback(); + + print __METHOD__."\n"; + } + + /** + * Init phpunit tests + * + * @return void + */ + protected function setUp() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + print __METHOD__."\n"; + } + + /** + * End phpunit tests + * + * @return void + */ + protected function tearDown() + { + print __METHOD__."\n"; + } + + /** + * test postfix evaluation function + * @return void + */ + public function testEvaluate() + { + $localobject = new EvalMath(); + $result = $localobject->evaluate('1+1'); + $this->assertEquals($result, 2); + print __METHOD__." result=".$result."\n"; + + $result = $localobject->evaluate('10-4/4'); + $this->assertEquals($result, 9); + print __METHOD__." result=".$result."\n"; + + $result = $localobject->evaluate('3^3'); + $this->assertEquals($result, 27); + print __METHOD__." result=".$result."\n"; + + $result = $localobject->evaluate(''); + $this->assertEquals($result, ''); + print __METHOD__." result=". 'void' ."\n"; + } +} From 80af6c8fdc8993bab3bd342ad9a7e0bc75099218 Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 15 Jun 2022 15:54:28 +0200 Subject: [PATCH 151/183] BUG FIX aray implicitly converted to boolean --- htdocs/opensurvey/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index fdb138eaf76..20985a52647 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -404,7 +404,7 @@ print load_fiche_titre($langs->trans("CommentsOfVoters"), '', ''); // Comment list $comments = $object->getComments(); -if ($comments) { +if (!empty($comments)) { foreach ($comments as $comment) { if ($user->rights->opensurvey->write) { print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' '; From ce80c647821e1dd56e7d9dc78cd153b9cdd8fc70 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 15 Jun 2022 16:17:34 +0200 Subject: [PATCH 152/183] adding an unexisting variable of old usage --- htdocs/core/class/extrafields.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4f9b0d06f16..625e473e7e6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -60,6 +60,11 @@ class ExtraFields */ public $attribute_choice; + /** + * @var array array to store extrafields definition + * @deprecated + */ + public $attribute_list; /** * @var array New array to store extrafields definition From 8bd95ae93da15075da1ded3e28e92340cdafce16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jun 2022 16:20:27 +0200 Subject: [PATCH 153/183] Fix char _ not alloed into SEPA --- .../class/bonprelevement.class.php | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d60002f479d..8cfdcf7e02b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1488,7 +1488,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$i.''.$CrLf); fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf); + fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); @@ -1604,7 +1604,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$i.''.$CrLf); fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf); + fputs($this->file, ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); @@ -1854,16 +1854,16 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; - $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ''))).''.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$row_country_code.''.$CrLf; $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")); if (trim($addressline1)) { - $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if (trim($addressline2)) { - $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; @@ -1929,10 +1929,10 @@ class BonPrelevement extends CommonObject $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => "")); if (trim($addressline1)) { - $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if (trim($addressline2)) { - $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; @@ -2096,16 +2096,16 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$dateTime_ETAD.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); if ($addressline1) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if ($addressline2) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -2123,8 +2123,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), '')).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), '')).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf;*/ $XML_SEPA_INFO .= ' SLEV'.$CrLf; // Field "Responsible of fees". Must be SLEV @@ -2162,16 +2162,16 @@ class BonPrelevement extends CommonObject } $XML_SEPA_INFO .= ' '.dol_print_date($dateTime_ETAD, 'dayrfc').''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); if ($addressline1) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } if ($addressline2) { - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).''.$CrLf; } $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -2189,8 +2189,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).''.$CrLf; - $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), '')).''.$CrLf; + $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), '')).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf;*/ $XML_SEPA_INFO .= ' SLEV'.$CrLf; // Field "Responsible of fees". Must be SLEV From 08fe80e5f2954056ce4da92c50350c5f014da9ca Mon Sep 17 00:00:00 2001 From: bagtaib Date: Wed, 15 Jun 2022 16:41:40 +0200 Subject: [PATCH 154/183] valuie is the id --- 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 8b6d7490eaf..ca52dcc6c91 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1058,7 +1058,7 @@ class Contrat extends CommonObject if (count($exp->linkedObjectsIds['commande']) > 0) { foreach ($exp->linkedObjectsIds['commande'] as $key => $value) { $originforcontact = 'commande'; - $originidforcontact = $value->id; + $originidforcontact = $value; break; // We take first one } } From a4fe40027ad4e774dca029801687cce1cc2365cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jun 2022 08:53:31 +0200 Subject: [PATCH 155/183] Fix missing var --- .../modulebuilder/template/class/actions_mymodule.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php index 24be0243b8d..25e440d50c8 100644 --- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php @@ -54,6 +54,11 @@ class ActionsMyModule */ public $resprints; + /** + * @var int Priority of hook (50 is used if value is not defined) + */ + public $priority; + /** * Constructor From 2033b75c335b119fc6f5ded5745dac029c920b99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jun 2022 09:17:00 +0200 Subject: [PATCH 156/183] Add option MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE --- htdocs/main.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 076ab0dbc6a..de14cae280b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -480,10 +480,13 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare); $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION); $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade); - if ($rescomp > 0) { // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades - dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); - exit; + if ($rescomp > 0) { // Programs have a version higher than database. + if (empty($conf->global->MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE) || $rescomp < 3) { + // We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades + dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install/upgrade page.", LOG_WARNING); + header("Location: ".DOL_URL_ROOT."/install/index.php"); + exit; + } } } From 7917775989c191e1a8ba69947a9bdea51bc5b8c5 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 16 Jun 2022 10:05:05 +0200 Subject: [PATCH 157/183] Add $noback for action update --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 969d590be34..f0e43d47041 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -266,7 +266,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { $action = 'view'; $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if ($urltogo) { + if ($urltogo && !$noback) { { header("Location: " . $urltogo); exit; } From b5b86a9458ca438234190c2360957f90d65adff4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 16 Jun 2022 08:12:13 +0000 Subject: [PATCH 158/183] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 172 ++++++++++---------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f0e43d47041..83de40ac4b5 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -165,110 +165,110 @@ if ($action == 'add' && !empty($permissiontoadd)) { // Action to update record if ($action == 'update' && !empty($permissiontoadd)) { - foreach ($object->fields as $key => $val) { - // Check if field was submited to be edited - if ($object->fields[$key]['type'] == 'duration') { - if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { - continue; // The field was not submited to be saved - } - } elseif ($object->fields[$key]['type'] == 'boolean') { - if (!GETPOSTISSET($key)) { - $object->$key = 0; // use 0 instead null if the field is defined as not null - continue; - } - } else { - if (!GETPOSTISSET($key)) { - continue; // The field was not submited to be saved - } +foreach ($object->fields as $key => $val) { + // Check if field was submited to be edited + if ($object->fields[$key]['type'] == 'duration') { + if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { + continue; // The field was not submited to be saved } - // Ignore special fields - if (in_array($key, array('rowid', 'entity', 'import_key'))) { + } elseif ($object->fields[$key]['type'] == 'boolean') { + if (!GETPOSTISSET($key)) { + $object->$key = 0; // use 0 instead null if the field is defined as not null continue; } - if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) { - if (!in_array(abs($val['visible']), array(1, 3, 4))) { - continue; // Only 1 and 3 and 4, that are cases to update - } + } else { + if (!GETPOSTISSET($key)) { + continue; // The field was not submited to be saved } + } + // Ignore special fields + if (in_array($key, array('rowid', 'entity', 'import_key'))) { + continue; + } + if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) { + if (!in_array(abs($val['visible']), array(1, 3, 4))) { + continue; // Only 1 and 3 and 4, that are cases to update + } + } - // Set value to update - if (preg_match('/^(text|html)/', $object->fields[$key]['type'])) { - $tmparray = explode(':', $object->fields[$key]['type']); - if (!empty($tmparray[1])) { - $value = GETPOST($key, $tmparray[1]); - } else { - $value = GETPOST($key, 'restricthtml'); - } - } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt - } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); - } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); - } else { - $value = ''; - } - } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { - $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup - } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); - } elseif ($object->fields[$key]['type'] == 'reference') { - $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); + // Set value to update + if (preg_match('/^(text|html)/', $object->fields[$key]['type'])) { + $tmparray = explode(':', $object->fields[$key]['type']); + if (!empty($tmparray[1])) { + $value = GETPOST($key, $tmparray[1]); } else { - if ($key == 'lang') { - $value = GETPOST($key, 'aZ09'); - } else { - $value = GETPOST($key, 'alphanohtml'); - } + $value = GETPOST($key, 'restricthtml'); } - if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') { - $value = ''; // This is an implicit foreign key field + } elseif ($object->fields[$key]['type'] == 'date') { + $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + } elseif ($object->fields[$key]['type'] == 'datetime') { + $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + } elseif ($object->fields[$key]['type'] == 'duration') { + if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { + $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); + } else { + $value = ''; } - if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') { - $value = ''; // This is an explicit foreign key field + } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { + $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup + } elseif ($object->fields[$key]['type'] == 'boolean') { + $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); + } else { + if ($key == 'lang') { + $value = GETPOST($key, 'aZ09'); + } else { + $value = GETPOST($key, 'alphanohtml'); } + } + if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') { + $value = ''; // This is an implicit foreign key field + } + if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') { + $value = ''; // This is an explicit foreign key field + } - $object->$key = $value; - if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); - } + $object->$key = $value; + if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + } - // Validation of fields values - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { - if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { - if (!$object->validateField($object->fields, $key, $value)) { - $error++; - } - } - } - - if (isModEnabled('categorie')) { - $categories = GETPOST('categories', 'array'); - if (method_exists($object, 'setCategories')) { - $object->setCategories($categories); + // Validation of fields values + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { + if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { + if (!$object->validateField($object->fields, $key, $value)) { + $error++; } } } + if (isModEnabled('categorie')) { + $categories = GETPOST('categories', 'array'); + if (method_exists($object, 'setCategories')) { + $object->setCategories($categories); + } + } +} + // Fill array 'array_options' with data from add form - if (!$error) { - $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); - if ($ret < 0) { - $error++; - } +if (!$error) { + $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); + if ($ret < 0) { + $error++; } +} - if (!$error) { - $result = $object->update($user); - if ($result > 0) { - $action = 'view'; - $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; - $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if ($urltogo && !$noback) { { - header("Location: " . $urltogo); - exit; +if (!$error) { + $result = $object->update($user); + if ($result > 0) { + $action = 'view'; + $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation + if ($urltogo && !$noback) { { + header("Location: " . $urltogo); + exit; } } else { $error++; From 05aae267b17690bc25ab85e2ca7f4ec36bfbeaa0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 16 Jun 2022 11:32:21 +0200 Subject: [PATCH 159/183] FIX error syntax --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 83de40ac4b5..4ee22f41b65 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -266,7 +266,7 @@ if (!$error) { $action = 'view'; $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if ($urltogo && !$noback) { { + if ($urltogo && !$noback) { header("Location: " . $urltogo); exit; } From a9e48a6aac002932fded1d028014df60916cf786 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 16 Jun 2022 09:37:28 +0000 Subject: [PATCH 160/183] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 172 ++++++++++---------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 4ee22f41b65..506a1465fdc 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -165,110 +165,110 @@ if ($action == 'add' && !empty($permissiontoadd)) { // Action to update record if ($action == 'update' && !empty($permissiontoadd)) { -foreach ($object->fields as $key => $val) { - // Check if field was submited to be edited - if ($object->fields[$key]['type'] == 'duration') { - if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { - continue; // The field was not submited to be saved + foreach ($object->fields as $key => $val) { + // Check if field was submited to be edited + if ($object->fields[$key]['type'] == 'duration') { + if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { + continue; // The field was not submited to be saved + } + } elseif ($object->fields[$key]['type'] == 'boolean') { + if (!GETPOSTISSET($key)) { + $object->$key = 0; // use 0 instead null if the field is defined as not null + continue; + } + } else { + if (!GETPOSTISSET($key)) { + continue; // The field was not submited to be saved + } } - } elseif ($object->fields[$key]['type'] == 'boolean') { - if (!GETPOSTISSET($key)) { - $object->$key = 0; // use 0 instead null if the field is defined as not null + // Ignore special fields + if (in_array($key, array('rowid', 'entity', 'import_key'))) { continue; } - } else { - if (!GETPOSTISSET($key)) { - continue; // The field was not submited to be saved + if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) { + if (!in_array(abs($val['visible']), array(1, 3, 4))) { + continue; // Only 1 and 3 and 4, that are cases to update + } } - } - // Ignore special fields - if (in_array($key, array('rowid', 'entity', 'import_key'))) { - continue; - } - if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) { - if (!in_array(abs($val['visible']), array(1, 3, 4))) { - continue; // Only 1 and 3 and 4, that are cases to update - } - } - // Set value to update - if (preg_match('/^(text|html)/', $object->fields[$key]['type'])) { - $tmparray = explode(':', $object->fields[$key]['type']); - if (!empty($tmparray[1])) { - $value = GETPOST($key, $tmparray[1]); + // Set value to update + if (preg_match('/^(text|html)/', $object->fields[$key]['type'])) { + $tmparray = explode(':', $object->fields[$key]['type']); + if (!empty($tmparray[1])) { + $value = GETPOST($key, $tmparray[1]); + } else { + $value = GETPOST($key, 'restricthtml'); + } + } elseif ($object->fields[$key]['type'] == 'date') { + $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + } elseif ($object->fields[$key]['type'] == 'datetime') { + $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + } elseif ($object->fields[$key]['type'] == 'duration') { + if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { + $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); + } else { + $value = ''; + } + } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { + $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup + } elseif ($object->fields[$key]['type'] == 'boolean') { + $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); } else { - $value = GETPOST($key, 'restricthtml'); + if ($key == 'lang') { + $value = GETPOST($key, 'aZ09'); + } else { + $value = GETPOST($key, 'alphanohtml'); + } } - } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt - } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); - } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); - } else { - $value = ''; + if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') { + $value = ''; // This is an implicit foreign key field } - } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { - $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup - } elseif ($object->fields[$key]['type'] == 'boolean') { - $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); - } elseif ($object->fields[$key]['type'] == 'reference') { - $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); - } else { - if ($key == 'lang') { - $value = GETPOST($key, 'aZ09'); - } else { - $value = GETPOST($key, 'alphanohtml'); + if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') { + $value = ''; // This is an explicit foreign key field } - } - if (preg_match('/^integer:/i', $object->fields[$key]['type']) && $value == '-1') { - $value = ''; // This is an implicit foreign key field - } - if (!empty($object->fields[$key]['foreignkey']) && $value == '-1') { - $value = ''; // This is an explicit foreign key field - } - $object->$key = $value; - if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); - } + $object->$key = $value; + if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + } - // Validation of fields values - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { - if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { - if (!$object->validateField($object->fields, $key, $value)) { - $error++; + // Validation of fields values + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { + if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { + if (!$object->validateField($object->fields, $key, $value)) { + $error++; + } + } + } + + if (isModEnabled('categorie')) { + $categories = GETPOST('categories', 'array'); + if (method_exists($object, 'setCategories')) { + $object->setCategories($categories); } } } - if (isModEnabled('categorie')) { - $categories = GETPOST('categories', 'array'); - if (method_exists($object, 'setCategories')) { - $object->setCategories($categories); + // Fill array 'array_options' with data from add form + if (!$error) { + $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); + if ($ret < 0) { + $error++; } } -} - // Fill array 'array_options' with data from add form -if (!$error) { - $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); - if ($ret < 0) { - $error++; - } -} - -if (!$error) { - $result = $object->update($user); - if ($result > 0) { - $action = 'view'; - $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; - $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if ($urltogo && !$noback) { - header("Location: " . $urltogo); - exit; + if (!$error) { + $result = $object->update($user); + if ($result > 0) { + $action = 'view'; + $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation + if ($urltogo && !$noback) { + header("Location: " . $urltogo); + exit; } } else { $error++; From 77d129f79ce34a4f57947b92aa0a10373e2481b1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 16 Jun 2022 15:05:45 +0200 Subject: [PATCH 161/183] fix: bad url param search for facrec filter on facture list --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index cac6229f86b..166f38040c2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1091,7 +1091,7 @@ if ($resql) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if (!empty($search_fac_rec_source_title)) { - $param .= '&$search_fac_rec_source_title='.urlencode($search_fac_rec_source_title); + $param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title); } // Add $param from extra fields From df009a6365a443356be8b819a3421a08a4f26b83 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 16 Jun 2022 15:13:56 +0200 Subject: [PATCH 162/183] FIX: trash icon on crontask list to do not work --- htdocs/cron/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 686bb8a52a9..152b947430c 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -353,6 +353,10 @@ if ($action == 'execute') { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1); } +if ($action == 'delete') { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1); +} + // List of mass actions available $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), From 3fcaae5ae35227d9e4dc400484c9e0149a94cce2 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 16 Jun 2022 15:31:07 +0200 Subject: [PATCH 163/183] fix private notes not being registered on credit/replacement invoices --- 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 6f9d7398324..81112e3c22e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -996,7 +996,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alphanohtml'); $object->model_pdf = GETPOST('model', 'alphanohtml'); $object->fk_project = GETPOST('projectid', 'int'); @@ -1049,7 +1049,7 @@ if (empty($reshook)) { $object->date = $dateinvoice; $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'restricthtml')); - // We do not copy the private note + $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); From 54a5967a711a2b641dd690dc05a2d00cabc442f4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 17 Jun 2022 04:37:56 +0200 Subject: [PATCH 164/183] FIX Accountancy - Partitioning of the entity on an automatic binding --- htdocs/accountancy/customer/index.php | 3 ++- htdocs/accountancy/supplier/index.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index c233134f562..af8aedd758c 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -158,6 +158,7 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 9ea8fd0a307..037f2cfbb38 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -166,6 +166,7 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; } From a49062338f51b0c03f437ecedaa6888ec440fe71 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 17 Jun 2022 04:41:15 +0200 Subject: [PATCH 165/183] Copyright --- htdocs/accountancy/customer/index.php | 10 +++++----- htdocs/accountancy/supplier/index.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index af8aedd758c..33d94a34636 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2022 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 037f2cfbb38..48462c38365 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,8 +1,8 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2022 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent * * 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 From 354b4a7417a0cdccefadc52b268079d84087dcc2 Mon Sep 17 00:00:00 2001 From: Faustin Date: Fri, 17 Jun 2022 06:03:48 +0200 Subject: [PATCH 166/183] BUG FIX Deprecated attribute fk_projet wasn't declared on class CommonObject --- htdocs/core/class/commonobject.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9b8fea19e5f..71ecd3f75d1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -186,6 +186,12 @@ abstract class CommonObject */ public $projet; + /** + * @deprecated + * @see fk_project + */ + public $fk_projet; + /** * @var Contact a related contact * @see fetch_contact() From 14c932e06b5890aea9dcd95f4e1a44169d547031 Mon Sep 17 00:00:00 2001 From: Faustin Date: Fri, 17 Jun 2022 07:53:07 +0200 Subject: [PATCH 167/183] BUG FIX attribute commande_id wasn't declared on class Delivery --- htdocs/delivery/class/delivery.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 2c43cd715a3..9edc080701b 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -106,6 +106,8 @@ class Delivery extends CommonObject */ public $model_pdf; + public $commande_id; + public $lines = array(); From 806dd8f8e029170e5823460a38522b4b451878dd Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Fri, 17 Jun 2022 10:35:01 +0200 Subject: [PATCH 168/183] Fix comment doc --- htdocs/core/class/validate.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index ac4c14f7937..9d8832c36ce 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -300,13 +300,13 @@ class Validate /** * Check for all values in db * - * @param array $values Boolean to validate + * @param integer $id of element * @param string $classname the class name * @param string $classpath the class path * @return boolean Validity is ok or not * @throws Exception */ - public function isFetchable($values, $classname, $classpath) + public function isFetchable($id, $classname, $classpath) { if (!empty($classpath)) { if (dol_include_once($classpath)) { @@ -319,7 +319,7 @@ class Validate return false; } - if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $values)) { + if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) { return true; } else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); } } else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); } From 99f21246c7af38311ecf0c648f86c42aabb5af7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 12:20:36 +0200 Subject: [PATCH 169/183] Missing trans --- htdocs/langs/en_US/compta.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 0e61076345b..82ef7f0be9a 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -300,3 +300,4 @@ InvoiceToPay15Days=To pay (15 to 30 days) InvoiceToPay30Days=To pay (> 30 days) ConfirmPreselectAccount=Preselect accountancy code ConfirmPreselectAccountQuestion=Are you sure you want to preselect the %s selected lines with this accountancy code ? +AmountPaidMustMatchAmountOfDownPayment=Amount paid must match amount of down payment \ No newline at end of file From 603c7f0c395d508feb551cc779c7e533c24d28b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 12:30:34 +0200 Subject: [PATCH 170/183] Debug v16 --- htdocs/fourn/class/fournisseur.facture-rec.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index fe9c00c75f3..31bc37b6e1a 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -564,7 +564,7 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', f.vat_src_code, f.localtax1, f.localtax2'; $sql .= ', f.total_tva, f.total_ht, f.total_ttc'; $sql .= ', f.fk_user_author, f.fk_user_modif'; - $sql .= ', f.fk_projet, f.fk_account'; + $sql .= ', f.fk_projet as fk_project, f.fk_account'; $sql .= ', f.fk_mode_reglement, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql .= ', f.date_lim_reglement'; @@ -610,7 +610,7 @@ class FactureFournisseurRec extends CommonInvoice $this->total_ttc = $obj->total_ttc; $this->user_author = $obj->fk_user_author; $this->user_modif = $obj->fk_user_modif; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_project; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 48c5e88c2c5..df10ed07632 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -443,7 +443,8 @@ class FactureFournisseur extends CommonInvoice $this->entity = $_facrec->entity; // Invoice created in same entity than template // Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI - $this->fk_projet = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet; + $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_projet; + $this->fk_projet = $this->fk_project; $this->note_public = GETPOST('note_public', 'restricthtml') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public; $this->note_private = GETPOST('note_private', 'restricthtml') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private; $this->model_pdf = GETPOST('model', 'alpha') ? GETPOST('model', 'alpha') : $_facrec->model_pdf; From e5172b550df2b7fbe696203dec86588f60d85652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 12:37:50 +0200 Subject: [PATCH 171/183] FIX #21305 Better fix --- htdocs/langs/en_US/admin.lang | 3 +- htdocs/ticket/class/cticketcategory.class.php | 152 ------------------ 2 files changed, 2 insertions(+), 153 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e4725704dd5..341789af7bf 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2266,4 +2266,5 @@ IconOnlyTextOnHover=Icon only - Text of icon appears under icon on mouse hover t IconOnly=Icon only - Text on tooltip only INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices -UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID. \ No newline at end of file +UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID. +IfThisCategoryIsChildOfAnother=If this category is a child of another one \ No newline at end of file diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 5de60a48d85..558faf1775a 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -274,9 +274,6 @@ class CTicketCategory extends CommonObject if (property_exists($object, 'label')) { $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; } - if (property_exists($object, 'status')) { - $object->status = self::STATUS_DRAFT; - } if (property_exists($object, 'date_creation')) { $object->date_creation = dol_now(); } @@ -488,155 +485,6 @@ class CTicketCategory extends CommonObject } - /** - * Validate object - * - * @param User $user User making status change - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int <=0 if OK, 0=Nothing done, >0 if KO - */ - public function validate($user, $notrigger = 0) - { - global $conf, $langs; - - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $error = 0; - - // Protection - if ($this->status == self::STATUS_VALIDATED) { - dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); - 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)))) - { - $this->error='NotEnoughPermissions'; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); - return -1; - }*/ - - $now = dol_now(); - - $this->db->begin(); - - // Define new ref - if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life - $num = $this->getNextNumRef(); - } else { - $num = $this->ref; - } - $this->newref = $num; - - if (!empty($num)) { - // Validate - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET ref = '".$this->db->escape($num)."',"; - $sql .= " status = ".self::STATUS_VALIDATED; - if (!empty($this->fields['date_validation'])) { - $sql .= ", date_validation = '".$this->db->idate($now)."'"; - } - if (!empty($this->fields['fk_user_valid'])) { - $sql .= ", fk_user_valid = ".((int) $user->id); - } - $sql .= " WHERE rowid = ".((int) $this->id); - - dol_syslog(get_class($this)."::validate()", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - dol_print_error($this->db); - $this->error = $this->db->lasterror(); - $error++; - } - - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('CTICKETCATEGORY_VALIDATE', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - } - - if (!$error) { - $this->oldref = $this->ref; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'myobject/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; - $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->error = $this->db->lasterror(); - } - - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($num); - $dirsource = $conf->mymodule->dir_output.'/myobject/'.$oldref; - $dirdest = $conf->mymodule->dir_output.'/myobject/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->mymodule->dir_output.'/myobject/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); - } - } - } - } - } - - // Set new ref and current status - if (!$error) { - $this->ref = $num; - $this->status = self::STATUS_VALIDATED; - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - return -1; - } - } - - - /** - * Set cancel status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function cancel($user, $notrigger = 0) - { - // Protection - if ($this->status != self::STATUS_VALIDATED) { - 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)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_DISABLED, $notrigger, 'CTICKETCATEGORY_CANCEL'); - } - /** * Return a link to the object card (with optionaly the picto) * From 36760d7a58d4836db0955d81007a9af22781a016 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 14:03:55 +0200 Subject: [PATCH 172/183] Try a Better FIX #21296 --- htdocs/categories/class/categorie.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 14cdfe84783..27330f45ffe 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -175,11 +175,10 @@ class Categorie extends CommonObject ); /** - * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. - * - * @note Move to const array when PHP 5.6 will be our minimum target + * @var array Object table mapping from type string (table llx_...) when value of key does not match table name. + * This array may be completed by external modules with hook "constructCategory" */ - public static $MAP_OBJ_TABLE = array( + public $MAP_OBJ_TABLE = array( 'customer' => 'societe', 'supplier' => 'societe', 'member' => 'adherent', From deb21396c199e335f02e65c4fdd2fb8b27a9e572 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 14:31:51 +0200 Subject: [PATCH 173/183] Fix getEntity for invoice_supplier --- htdocs/core/lib/functions.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 13d44e1ec8a..e1fe08c7f18 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -132,6 +132,9 @@ function getEntity($element, $shared = 1, $currentobject = null) case 'order_supplier': $element = 'supplier_order'; break; // "/fourn/class/fournisseur.commande.class.php" + case 'invoice_supplier': + $element = 'supplier_invoice'; + break; // "/fourn/class/fournisseur.facture.class.php" } if (is_object($mc)) { From 7ce47ce786aa2f03f42e452c6ab69ed2a6cd6b30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 15:06:24 +0200 Subject: [PATCH 174/183] Fix signature of getNbByMonth --- htdocs/reception/class/receptionstats.class.php | 11 ++++++----- htdocs/ticket/class/ticketstats.class.php | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index 872d6845a96..a27f458d01a 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -82,12 +82,13 @@ class ReceptionStats extends Stats } /** - * Return reception number by month for a year + * Return reception number by month for a year * - * @param int $year Year to scan - * @return array Array with number by month + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array with number by month */ - public function getNbByMonth($year) + public function getNbByMonth($year, $format = 0) { global $user; @@ -101,7 +102,7 @@ class ReceptionStats extends Stats $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getNbByMonth($year, $sql); + $res = $this->_getNbByMonth($year, $sql, $format); return $res; } diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index 2af0b789c3d..0dd69ac9f15 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.php @@ -89,12 +89,13 @@ class TicketStats extends Stats } /** - * Renvoie le nombre de facture par mois pour une annee donnee + * Return the number of tickets per month for a given year * - * @param string $year Year to scan - * @return array Array of values + * @param string $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array of values */ - public function getNbByMonth($year) + public function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(datec) as dm, count(*)"; $sql .= " FROM ".$this->from; @@ -103,7 +104,7 @@ class TicketStats extends Stats $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getNbByMonth($year, $sql); + $res = $this->_getNbByMonth($year, $sql, $format); //var_dump($res);print '
    '; return $res; } From da3d7466a1a281175d6471a48c1594fab6707763 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 15:15:37 +0200 Subject: [PATCH 175/183] Fix signature of method --- htdocs/ticket/class/ticketstats.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index 0dd69ac9f15..41fc4b0f69a 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.php @@ -110,12 +110,13 @@ class TicketStats extends Stats } /** - * Renvoie le montant de facture par mois pour une annee donnee + * Return th eamount of tickets for a month and a given year * - * @param int $year Year to scan - * @return array Array of values + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array of values */ - public function getAmountByMonth($year) + public function getAmountByMonth($year, $format = 0) { $sql = "SELECT date_format(datec,'%m') as dm, sum(".$this->field.")"; $sql .= " FROM ".$this->from; @@ -124,7 +125,7 @@ class TicketStats extends Stats $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getAmountByMonth($year, $sql); + $res = $this->_getAmountByMonth($year, $sql, $format); //var_dump($res);print '
    '; return $res; } From 5f0e419e469fd0696381bcaba424190e34ba9285 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 15:28:36 +0200 Subject: [PATCH 176/183] Update EvalMathTest.php --- test/phpunit/EvalMathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/EvalMathTest.php b/test/phpunit/EvalMathTest.php index 18b9edb3fff..1346538668c 100644 --- a/test/phpunit/EvalMathTest.php +++ b/test/phpunit/EvalMathTest.php @@ -146,6 +146,6 @@ class InventoryTest extends PHPUnit\Framework\TestCase $result = $localobject->evaluate(''); $this->assertEquals($result, ''); - print __METHOD__." result=". 'void' ."\n"; + print __METHOD__." result=".$result."\n"; } } From dd96f6d8d224c6fa7d8d02c47c681310d6e3dfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 17:17:29 +0200 Subject: [PATCH 177/183] Update index.php --- htdocs/accountancy/supplier/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3d5a5e99f8d..008316e7cf4 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -299,7 +299,7 @@ $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND aa.account_number IS NULL"; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.")"; } else { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.")"; @@ -382,7 +382,7 @@ if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; } else { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; @@ -467,7 +467,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange $sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy $sql .= " AND ff.fk_statut > 0"; $sql .= " AND ffd.product_type <= 2"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")"; } else { $sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")"; From 75b50023bf7a27d3a3b53156cd32364cd255d263 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 17:18:05 +0200 Subject: [PATCH 178/183] Update index.php --- htdocs/accountancy/supplier/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 008316e7cf4..cf21ac86c0b 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -306,7 +306,8 @@ if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { } $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; -dol_syslog('htdocs/accountancy/supplier/index.php sql='.$sql, LOG_DEBUG); +dol_syslog('htdocs/accountancy/supplier/index.php', LOG_DEBUG); + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); From 614ebfeadc8ab7f5c8f32e0b05e8f92f2b3659ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 17:20:12 +0200 Subject: [PATCH 179/183] Update index.php --- htdocs/accountancy/supplier/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index cf21ac86c0b..e8c832a97e2 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -307,7 +307,6 @@ if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; dol_syslog('htdocs/accountancy/supplier/index.php', LOG_DEBUG); - $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); From 18cf0c7a189b89da333cedbc4d4eccaa7064ef88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2022 18:57:09 +0200 Subject: [PATCH 180/183] Debug v16 --- htdocs/accountancy/admin/defaultaccounts.php | 30 ++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 583b12368dc..e3de399538a 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -98,7 +98,6 @@ if (!empty($conf->loan->enabled)) { $list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE'; if (!empty($conf->societe->enabled)) { $list_account[] = '---Deposits---'; - $list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; } /* @@ -106,7 +105,7 @@ if (!empty($conf->societe->enabled)) { */ if ($action == 'update') { $error = 0; - + // Process $list_account_main foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); @@ -114,7 +113,7 @@ if ($action == 'update') { $error++; } } - + // Process $list_account foreach ($list_account as $constname) { $reg = array(); if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator @@ -128,6 +127,13 @@ if ($action == 'update') { } } + $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; + $constvalue = GETPOST($constname, 'int'); + if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -246,10 +252,24 @@ foreach ($list_account as $key) { } } + +// Customer deposit account +print ''; +// Param +print ''; +print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'); +print ''; +// Value +print ''; // Do not force class=right, or it align also the content of the select box +print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts'); +print ''; +print ''; + + if (!empty($conf->societe->enabled)) { print ''; print '' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . ''; - if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) { + if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { print ''; print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning'); print ''; @@ -264,7 +284,7 @@ if (!empty($conf->societe->enabled)) { print "\n"; print "
    \n"; -print '
    '; +print '
    '; print ''; From a2843bafdc3b499cefa9ce30fd0434fa52805d11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Jun 2022 14:10:45 +0200 Subject: [PATCH 181/183] Debug v16 --- htdocs/hrm/class/skill.class.php | 8 ++++---- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_card.php | 4 ++-- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/lib/hrm_job.lib.php | 2 +- htdocs/hrm/lib/hrm_position.lib.php | 4 ++-- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_card.php | 10 +++++----- htdocs/hrm/position_contact.php | 2 +- htdocs/hrm/position_document.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/position_note.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/langs/en_US/hrm.lang | 6 +++--- htdocs/langs/fr_FR/hrm.lang | 6 +++--- htdocs/theme/md/style.css.php | 11 +++++++++++ 16 files changed, 39 insertions(+), 28 deletions(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index ececc70b4f1..ddf5fe989f2 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -119,7 +119,7 @@ class Skill extends CommonObject 'required_level' => array('type'=>'integer', 'label'=>'requiredLevel', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>0,), 'date_validite' => array('type'=>'integer', 'label'=>'date_validite', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>0,), 'temps_theorique' => array('type'=>'double(24,8)', 'label'=>'temps_theorique', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0,), - 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'knowHow', '1'=>'HowToBe', '9'=>'knowledge'), 'default'=>0), + 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'css'=>'minwidth200', 'arrayofkeyval'=>array('0'=>'TypeKnowHow', '1'=>'TypeHowToBe', '9'=>'TypeKnowledge'), 'default'=>0), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), ); @@ -1123,9 +1123,9 @@ class Skill extends CommonObject global $langs; $result = ''; switch ($code) { - case 0 : $result = $langs->trans("knowHow"); break; //"Savoir Faire" - case 1 : $result = $langs->trans("HowToBe"); break; // "Savoir être" - case 9 : $result = $langs->trans("knowledge"); break; //"Savoir" + case 0 : $result = $langs->trans("TypeKnowHow"); break; //"Savoir Faire" + case 1 : $result = $langs->trans("TypeHowToBe"); break; // "Savoir être" + case 9 : $result = $langs->trans("TypeKnowledge"); break; //"Savoir" } return $result; } diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 466741153c4..cc584b2e8d4 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Evaluation|FR:Module_Evaluation_FR|ES:Módulo_Evaluation"; $help_url = ''; -$title = $langs->trans("List").' '.$langs->trans('Evaluations'); +$title = $langs->trans('Evaluations'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 29493aa9cbd..a9ec4f77121 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -21,8 +21,8 @@ /** * \file job_card.php - * \ingroup hrm - * \brief Page to create/edit/view job + * \ingroup hrm + * \brief Page to create/edit/view job */ diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 33f4ea46305..53cb43ad080 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->transnoentities('Jobs')); +$title = $langs->trans("JobsPosition"); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index 723aaf14af5..6a948b00439 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -40,7 +40,7 @@ function jobPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("JobCard"); + $head[$h][1] = $langs->trans("JobPosition"); $head[$h][2] = 'job_card'; $h++; diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php index da9a7b3123a..37eaa3c5684 100644 --- a/htdocs/hrm/lib/hrm_position.lib.php +++ b/htdocs/hrm/lib/hrm_position.lib.php @@ -31,7 +31,7 @@ * @param Position $object Position * @return array Array of tabs */ -function PositionCardPrepareHead($object) +function positionCardPrepareHead($object) { global $db, $langs, $conf; @@ -41,7 +41,7 @@ function PositionCardPrepareHead($object) $head = array(); $head[$h][0] = dol_buildpath("/hrm/position_card.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("PositionCard"); + $head[$h][1] = $langs->trans("EmployeePosition"); $head[$h][2] = 'position'; $h++; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 24f2d9e32ef..ccbfabb985b 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -141,7 +141,7 @@ if ($object->id > 0) { if (!empty($conf->notification->enabled)) { $langs->load("mails"); } - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 6e751a9005a..746e1265a0b 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -171,18 +171,18 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; } -DisplayPositionCard($object); + +displayPositionCard($object); + /** * Show the card of a position * * @param Position $object Position object - * * @return void */ -function DisplayPositionCard(&$object) +function displayPositionCard(&$object) { - global $user, $langs, $db, $conf, $extrafields, $hookmanager, $action, $permissiontoadd, $permissiontodelete; $id = $object->id; @@ -245,7 +245,7 @@ function DisplayPositionCard(&$object) $res = $object->fetch_optionals(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'position', $langs->trans("Workstation"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index d26ea1bf575..56029f790a7 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -125,7 +125,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 845f846a212..eb4ac0e68ce 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -113,7 +113,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'document', $langs->trans("Document"), -1, $object->picto); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index f193783cb42..e9eb83e12e4 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->trans('Positions')); +$title = $langs->trans('EmployeePositions'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 1eea4b82676..99d6581247f 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -96,7 +96,7 @@ llxHeader('', $langs->trans('Position'), $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 9c5a4740c15..65a3cac0ecf 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Skill|FR:Module_Skill_FR|ES:Módulo_Skill"; $help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Skills")); +$title = $langs->trans("Skills"); $morejs = array(); $morecss = array(); diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index ff917913eee..2142327a646 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Required skills for this job UserRank=User Rank SkillList=Skill list SaveRank=Save rank -knowHow=Know how -HowToBe=How to be -knowledge=Knowledge +TypeKnowHow=Know how +TypeHowToBe=How to be +TypeKnowledge=Knowledge AbandonmentComment=Abandonment comment DateLastEval=Date last evaluation NoEval=No evaluation done for this employee diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index 4a640a2e639..c812afa1fc9 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Compétences requises pour cet emploi UserRank=Niveau employé SkillList=Liste compétence SaveRank=Sauvegarder niveau -knowHow=Savoir comment -HowToBe=Comment être -knowledge=Connaissances +TypeKnowHow=Savoir comment +TypeHowToBe=Comment être +TypeKnowledge=Connaissances AbandonmentComment=Commentaire sur l'abandon DateLastEval=Date dernière évaluation NoEval=Aucune évaluation effectuée pour cet employé diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3c05847a79c..c99482d6415 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6118,6 +6118,17 @@ ul.select2-results__options li { font-size: 0.95em; } +@media only screen and (min-width: 767px) +{ + .select2-container.select2-container--open .select2-dropdown.ui-dialog { + min-width: 200px !important; + } + .select2-container--open .select2-dropdown--below { + border-top: 1px solid var(--inputbordercolor); + /* border-top: 1px solid #aaaaaa; */ + } +} + /* ============================================================================== */ /* For categories */ From da042c7f57c5a0c2dee3dc32bfb2ebee16772eaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Jun 2022 14:10:45 +0200 Subject: [PATCH 182/183] Debug v16 to prepare stable status of module HRM #21136 --- htdocs/hrm/class/skill.class.php | 8 ++++---- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_card.php | 4 ++-- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/lib/hrm_job.lib.php | 2 +- htdocs/hrm/lib/hrm_position.lib.php | 4 ++-- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_card.php | 10 +++++----- htdocs/hrm/position_contact.php | 2 +- htdocs/hrm/position_document.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/position_note.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/langs/en_US/hrm.lang | 6 +++--- htdocs/langs/fr_FR/hrm.lang | 6 +++--- htdocs/theme/md/style.css.php | 11 +++++++++++ 16 files changed, 39 insertions(+), 28 deletions(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index ececc70b4f1..ddf5fe989f2 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -119,7 +119,7 @@ class Skill extends CommonObject 'required_level' => array('type'=>'integer', 'label'=>'requiredLevel', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>0,), 'date_validite' => array('type'=>'integer', 'label'=>'date_validite', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>0,), 'temps_theorique' => array('type'=>'double(24,8)', 'label'=>'temps_theorique', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0,), - 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'knowHow', '1'=>'HowToBe', '9'=>'knowledge'), 'default'=>0), + 'skill_type' => array('type'=>'integer', 'label'=>'SkillType', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'css'=>'minwidth200', 'arrayofkeyval'=>array('0'=>'TypeKnowHow', '1'=>'TypeHowToBe', '9'=>'TypeKnowledge'), 'default'=>0), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), ); @@ -1123,9 +1123,9 @@ class Skill extends CommonObject global $langs; $result = ''; switch ($code) { - case 0 : $result = $langs->trans("knowHow"); break; //"Savoir Faire" - case 1 : $result = $langs->trans("HowToBe"); break; // "Savoir être" - case 9 : $result = $langs->trans("knowledge"); break; //"Savoir" + case 0 : $result = $langs->trans("TypeKnowHow"); break; //"Savoir Faire" + case 1 : $result = $langs->trans("TypeHowToBe"); break; // "Savoir être" + case 9 : $result = $langs->trans("TypeKnowledge"); break; //"Savoir" } return $result; } diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 466741153c4..cc584b2e8d4 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Evaluation|FR:Module_Evaluation_FR|ES:Módulo_Evaluation"; $help_url = ''; -$title = $langs->trans("List").' '.$langs->trans('Evaluations'); +$title = $langs->trans('Evaluations'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 29493aa9cbd..a9ec4f77121 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -21,8 +21,8 @@ /** * \file job_card.php - * \ingroup hrm - * \brief Page to create/edit/view job + * \ingroup hrm + * \brief Page to create/edit/view job */ diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 33f4ea46305..53cb43ad080 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->transnoentities('Jobs')); +$title = $langs->trans("JobsPosition"); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index 723aaf14af5..6a948b00439 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -40,7 +40,7 @@ function jobPrepareHead($object) $head = array(); $head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id; - $head[$h][1] = $langs->trans("JobCard"); + $head[$h][1] = $langs->trans("JobPosition"); $head[$h][2] = 'job_card'; $h++; diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php index da9a7b3123a..37eaa3c5684 100644 --- a/htdocs/hrm/lib/hrm_position.lib.php +++ b/htdocs/hrm/lib/hrm_position.lib.php @@ -31,7 +31,7 @@ * @param Position $object Position * @return array Array of tabs */ -function PositionCardPrepareHead($object) +function positionCardPrepareHead($object) { global $db, $langs, $conf; @@ -41,7 +41,7 @@ function PositionCardPrepareHead($object) $head = array(); $head[$h][0] = dol_buildpath("/hrm/position_card.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("PositionCard"); + $head[$h][1] = $langs->trans("EmployeePosition"); $head[$h][2] = 'position'; $h++; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 24f2d9e32ef..ccbfabb985b 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -141,7 +141,7 @@ if ($object->id > 0) { if (!empty($conf->notification->enabled)) { $langs->load("mails"); } - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 6e751a9005a..746e1265a0b 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -171,18 +171,18 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; } -DisplayPositionCard($object); + +displayPositionCard($object); + /** * Show the card of a position * * @param Position $object Position object - * * @return void */ -function DisplayPositionCard(&$object) +function displayPositionCard(&$object) { - global $user, $langs, $db, $conf, $extrafields, $hookmanager, $action, $permissiontoadd, $permissiontodelete; $id = $object->id; @@ -245,7 +245,7 @@ function DisplayPositionCard(&$object) $res = $object->fetch_optionals(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'position', $langs->trans("Workstation"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index d26ea1bf575..56029f790a7 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -125,7 +125,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 845f846a212..eb4ac0e68ce 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -113,7 +113,7 @@ if ($object->id) { /* * Show tabs */ - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'document', $langs->trans("Document"), -1, $object->picto); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index f193783cb42..e9eb83e12e4 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; $help_url = ''; -$title = $langs->trans("ListOf", $langs->trans('Positions')); +$title = $langs->trans('EmployeePositions'); $morejs = array(); $morecss = array(); diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 1eea4b82676..99d6581247f 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -96,7 +96,7 @@ llxHeader('', $langs->trans('Position'), $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); - $head = PositionCardPrepareHead($object); + $head = positionCardPrepareHead($object); print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 9c5a4740c15..65a3cac0ecf 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -208,7 +208,7 @@ $now = dol_now(); //$help_url="EN:Module_Skill|FR:Module_Skill_FR|ES:Módulo_Skill"; $help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Skills")); +$title = $langs->trans("Skills"); $morejs = array(); $morecss = array(); diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index ff917913eee..2142327a646 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Required skills for this job UserRank=User Rank SkillList=Skill list SaveRank=Save rank -knowHow=Know how -HowToBe=How to be -knowledge=Knowledge +TypeKnowHow=Know how +TypeHowToBe=How to be +TypeKnowledge=Knowledge AbandonmentComment=Abandonment comment DateLastEval=Date last evaluation NoEval=No evaluation done for this employee diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index 4a640a2e639..c812afa1fc9 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -70,9 +70,9 @@ RequiredSkills=Compétences requises pour cet emploi UserRank=Niveau employé SkillList=Liste compétence SaveRank=Sauvegarder niveau -knowHow=Savoir comment -HowToBe=Comment être -knowledge=Connaissances +TypeKnowHow=Savoir comment +TypeHowToBe=Comment être +TypeKnowledge=Connaissances AbandonmentComment=Commentaire sur l'abandon DateLastEval=Date dernière évaluation NoEval=Aucune évaluation effectuée pour cet employé diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3c05847a79c..c99482d6415 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6118,6 +6118,17 @@ ul.select2-results__options li { font-size: 0.95em; } +@media only screen and (min-width: 767px) +{ + .select2-container.select2-container--open .select2-dropdown.ui-dialog { + min-width: 200px !important; + } + .select2-container--open .select2-dropdown--below { + border-top: 1px solid var(--inputbordercolor); + /* border-top: 1px solid #aaaaaa; */ + } +} + /* ============================================================================== */ /* For categories */ From 3e34c2cab2bd4cf395aa44d793f345abbaa4e08c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Jun 2022 21:20:50 +0200 Subject: [PATCH 183/183] Doc --- htdocs/core/modules/modFacture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 80a6ff1a805..2cdc8229e51 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -134,7 +134,7 @@ class modFacture extends DolibarrModules 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", - 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', + 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. The version in the language of the thirdparty will be used in priority to update the PDF of the sent invoice).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50,