From 60eb3340d11ebb31bfe3286452fb17d3e2410c89 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Fri, 4 Nov 2022 17:32:48 +0100 Subject: [PATCH 01/67] FIX: Fix the prospecting level colomn on contact list by normalize the field namein the table with the name defined in the fields list of the contact class --- htdocs/contact/class/contact.class.php | 12 ++++++------ htdocs/contact/list.php | 16 ++++++++-------- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_socpeople.sql | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 89d84df9426..c7640cca61c 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -339,9 +339,9 @@ class Contact extends CommonObject $this->fields['fk_soc']['searchall'] = 0; } - if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour - $this->field['fk_stcommcontact']['enabled'] = 0; - $this->field['fk_prospectcontactlevel']['enabled'] = 0; + if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour + $this->fields['fk_stcommcontact']['enabled'] = 0; + $this->fields['fk_prospectlevel']['enabled'] = 0; } // Unset fields that are disabled @@ -588,7 +588,7 @@ class Contact extends CommonObject $sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL"); $sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL"); $sql .= ", priv = '".$this->db->escape($this->priv)."'"; - $sql .= ", fk_prospectcontactlevel = '".$this->db->escape($this->fk_prospectlevel)."'"; + $sql .= ", fk_prospectlevel = '".$this->db->escape($this->fk_prospectlevel)."'"; if (isset($this->stcomm_id)) { $sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0"); } @@ -967,7 +967,7 @@ class Contact extends CommonObject $sql .= " c.socialnetworks,"; $sql .= " c.photo,"; $sql .= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,"; - $sql .= " c.fk_prospectcontactlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,"; + $sql .= " c.fk_prospectlevel, c.fk_stcommcontact, st.libelle as stcomm, st.picto as stcomm_picto,"; $sql .= " c.import_key,"; $sql .= " c.datec as date_creation, c.tms as date_modification,"; $sql .= " co.label as country, co.code as country_code,"; @@ -1034,7 +1034,7 @@ class Contact extends CommonObject $this->poste = $obj->poste; $this->statut = $obj->statut; - $this->fk_prospectlevel = $obj->fk_prospectcontactlevel; + $this->fk_prospectlevel = $obj->fk_prospectlevel; $transcode = $langs->trans('StatusProspect'.$obj->fk_stcommcontact); $libelle = ($transcode != 'StatusProspect'.$obj->fk_stcommcontact ? $transcode : $obj->stcomm); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index fd61f16dd0c..1b1d95b60ab 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -369,7 +369,7 @@ $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email,"; $sql .= " p.socialnetworks, p.photo,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; -$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,"; +$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,"; $sql .= " co.label as country, co.code as country_code"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -411,7 +411,7 @@ if (!empty($userid)) { // propre au commercial $sql .= " AND p.fk_user_creat=".((int) $userid); } if ($search_level) { - $sql .= natural_search("p.fk_prospectcontactlevel", join(',', $search_level), 3); + $sql .= natural_search("p.fk_prospectlevel", join(',', $search_level), 3); } if ($search_stcomm != '' && $search_stcomm != -2) { $sql .= natural_search("p.fk_stcommcontact", $search_stcomm, 2); @@ -877,7 +877,7 @@ if (!empty($arrayfields['p.priv']['checked'])) { print ''; } // Prospect level -if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) { +if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) { print ''; print $form->multiselectarray('search_level', $tab_level, $search_level, 0, 0, 'width75', 0, 0, '', '', '', 2); print ''; @@ -987,8 +987,8 @@ if (!empty($arrayfields['s.nom']['checked'])) { if (!empty($arrayfields['p.priv']['checked'])) { print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center '); } -if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) { - print_liste_field_titre($arrayfields['p.fk_prospectcontactlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectcontactlevel", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) { + print_liste_field_titre($arrayfields['p.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) { print_liste_field_titre($arrayfields['p.fk_stcommcontact']['label'], $_SERVER["PHP_SELF"], "p.fk_stcommcontact", "", $param, '', $sortfield, $sortorder, 'center '); @@ -1042,9 +1042,9 @@ while ($i < min($num, $limit)) { $contactstatic->country_code = $obj->country_code; $contactstatic->photo = $obj->photo; - $contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel; + $contactstatic->fk_prospectlevel = $obj->fk_prospectlevel; - print ''; + print ''; // ID if (!empty($arrayfields['p.rowid']['checked'])) { @@ -1196,7 +1196,7 @@ while ($i < min($num, $limit)) { } } - if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) { + if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) { // Prospect level print ''; print $contactstatic->getLibProspLevel(); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a1b6a210a5b..142d5de32fe 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -655,3 +655,6 @@ ALTER TABLE llx_c_socialnetworks DROP INDEX idx_c_socialnetworks_code; ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity); ALTER TABLE llx_propaldet ADD COLUMN import_key varchar(14); + +-- Rename prospect level on contact +ALTER TABLE llx_socpeople CHANGE fk_prospectcontactlevel fk_prospectlevel varchar(12); diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql index 1f28534d5d3..b7a1496354f 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.sql @@ -58,7 +58,7 @@ create table llx_socpeople photo varchar(255), no_email smallint NOT NULL DEFAULT 0, -- deprecated. Use table llx_mailing_unsubscribe instead priv smallint NOT NULL DEFAULT 0, - fk_prospectcontactlevel varchar(12), -- prospect level (in llx_c_prospectcontactlevel) + fk_prospectlevel varchar(12), -- prospect level (in llx_c_prospectcontactlevel) fk_stcommcontact integer DEFAULT 0 NOT NULL, -- commercial statut fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement fk_user_modif integer, From 8ce49001a751d3c0a83429864b639288b4372134 Mon Sep 17 00:00:00 2001 From: Artem Chernitsov Date: Mon, 14 Nov 2022 18:10:31 +0200 Subject: [PATCH 02/67] Add abbility of ODT support to supplier invoices --- htdocs/admin/supplier_invoice.php | 2 + htdocs/core/actions_setmoduleoptions.inc.php | 4 + htdocs/core/lib/files.lib.php | 1 + htdocs/core/modules/modFournisseur.class.php | 46 +- ...c_generic_supplier_invoice_odt.modules.php | 503 ++++++++++++++++++ .../doctemplates/supplier_invoices/index.html | 0 .../template_supplier_invoices.odt | Bin 0 -> 25866 bytes 7 files changed, 552 insertions(+), 4 deletions(-) create mode 100644 htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php create mode 100644 htdocs/install/doctemplates/supplier_invoices/index.html create mode 100644 htdocs/install/doctemplates/supplier_invoices/template_supplier_invoices.odt diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index bc587845cda..c095b778e8b 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -56,6 +56,8 @@ $specimenthirdparty->initAsSpecimen(); * Actions */ +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + if ($action == 'updateMask') { $maskconstinvoice = GETPOST('maskconstinvoice', 'alpha'); $maskconstcredit = GETPOST('maskconstcredit', 'alpha'); diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 797bb8e4cb7..e45365bceb1 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -90,6 +90,7 @@ if ($action == 'setModuleOptions') { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $keyforuploaddir = GETPOST('keyforuploaddir', 'aZ09'); $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->$keyforuploaddir))); + foreach ($listofdir as $key => $tmpdir) { $tmpdir = trim($tmpdir); $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); @@ -105,7 +106,10 @@ if ($action == 'setModuleOptions') { $upload_dir = $tmpdir; } } + + if ($upload_dir) { + $result = dol_add_file_process($upload_dir, 1, 1, 'uploadfile', ''); if ($result <= 0) { $error++; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 21c290b595d..391801c4e7c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1568,6 +1568,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '') */ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null) { + global $db, $user, $conf, $langs; $res = 0; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index d65d9674f59..63134340891 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -96,14 +96,25 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; - /* For supplier invoice, we must not have default pdf template on. In most cases, we need to join PDF from supplier, not have a document generated. + /* OLD For supplier invoice, we must not have default pdf template on. In most cases, we need to join PDF from supplier, not have a document generated. + NEW Uncomment to add ability to generate PDF for Supplier Invoices which generated not from Order. + */ + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; $this->const[$r][3] = 'Nom du gestionnaire de generation des factures fournisseur en PDF'; $this->const[$r][4] = 0; $r++; - */ + + // Add abbility ODT for Supplier Invoices + $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_invoices"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; @@ -840,7 +851,7 @@ class modFournisseur extends DolibarrModules $this->remove($options); - //ODT template + //ODT template for Supplier Orders $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt'; $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_orders'; $dest = $dirodt.'/template_supplier_order.odt'; @@ -856,11 +867,38 @@ class modFournisseur extends DolibarrModules } } - $sql = array( + $sql_order = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','order_supplier',".$conf->entity.")", ); + + + //ODT template for Supplier Invoice + $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; + $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; + $dest = $dirodt.'/template_supplier_invoices.odt'; + + if (file_exists($src) && !file_exists($dest)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + dol_mkdir($dirodt); + $result = dol_copy($src, $dest, 0, 0); + if ($result < 0) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); + return 0; + } + } + + $sql_invoice = array( + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[2][2])."' AND type = 'invoice_supplier' AND entity = ".$conf->entity, + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[2][2])."','invoice_supplier',".$conf->entity.")", + ); + + $sql = array_merge($sql_order, $sql_invoice); + //var_dump($sql); + //die; + return $this->_init($sql, $options); } } diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php new file mode 100644 index 00000000000..8d1f9713c00 --- /dev/null +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -0,0 +1,503 @@ + + * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2019 Tim Otte + * + * 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 htdocs/core/modules/supplier_invoce/doc/doc_generic_supplier_invoice_odt.modules.php + * \ingroup facture + * \brief File of class to build ODT documents for supplier invoices + */ + +require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php'; + + +/** + * Class to build documents using ODF templates generator + */ +class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices +{ + /** + * Issuer + * @var Societe + */ + public $issuer; + + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.6 = array(5, 6) + */ + public $phpmin = array(5, 6); + + /** + * @var string Dolibarr version of the loaded document + */ + public $version = 'dolibarr'; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $conf, $langs, $mysoc; + + // Load translation files required by the page + $langs->loadLangs(array("main", "companies")); + + $this->db = $db; + $this->name = "ODT templates"; + $this->description = $langs->trans("DocumentModelOdt"); + $this->scandir = 'SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan + // Page size for A4 format + $this->type = 'odt'; + $this->page_largeur = 0; + $this->page_hauteur = 0; + $this->format = array($this->page_largeur, $this->page_hauteur); + $this->marge_gauche = 0; + $this->marge_droite = 0; + $this->marge_haute = 0; + $this->marge_basse = 0; + + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount + $this->option_credit_note = 0; // Support credit notes + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 0; // Support add of a watermark on drafts + + // Recupere issuer + $this->issuer = $mysoc; + if (!$this->issuer->country_code) { + $this->issuer->country_code = substr($langs->defaultlang, -2); // By default if not defined + } + } + + + /** + * Return description of a module + * + * @param Translate $langs Lang object to use for output + * @return string Description + */ + public function info($langs) + { + global $conf, $langs; + + // Load translation files required by the page + $langs->loadLangs(array("errors", "companies")); + + $form = new Form($this->db); + + $texte = $this->description.".
\n"; + $texte .= '
'; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + + // List of directories area + $texte .= ''; + + + $texte .= ''; + $texte .= ''; + + $texte .= '
'; + $texttitle = $langs->trans("ListOfDirectories"); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH))); + + + $listoffiles = array(); + foreach ($listofdir as $key => $tmpdir) { + $tmpdir = trim($tmpdir); + $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); + if (!$tmpdir) { + unset($listofdir[$key]); + continue; + } + if (!is_dir($tmpdir)) { + $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); + } else { + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); + if (count($tmpfiles)) { + $listoffiles = array_merge($listoffiles, $tmpfiles); + } + } + } + + $texthelp = $langs->trans("ListOfDirectoriesForModelGenODT"); + // Add list of substitution keys + $texthelp .= '
'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'
'; + $texthelp .= $langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it + + $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1); + $texte .= '
'; + $texte .= ''; + $texte .= '
'; + $texte .= ''; + $texte .= '
'; + + // Scan directories + $nbofiles = count($listoffiles); + if (!empty($conf->global->SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH)) { + $texte .= $langs->trans("NumberOfModelFilesFound").': '; + //$texte.=$nbofiles?'':''; + $texte .= count($listoffiles); + //$texte.=$nbofiles?'':''; + $texte .= ''; + } + + if ($nbofiles) { + $texte .= '
'; + // Show list of found files + foreach ($listoffiles as $file) { + $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
'; + } + $texte .= '
'; + } + // Add input to upload a new template file. + $texte .= '
'.$langs->trans("UploadNewTemplate").' '; + $texte .= ''; + $texte .= ''; + $texte .= '
'; + $texte .= '
'; + $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); + $texte .= '
'; + $texte .= '
'; + + return $texte; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to build a document on disk using the generic odt module. + * + * @param Commande $object Object source to build document + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1 if OK, <=0 if KO + */ + public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0) + { + // phpcs:enable + global $user, $langs, $conf, $mysoc, $hookmanager; + + if (empty($srctemplatepath)) { + dol_syslog("doc_generic_odt::write_file parameter srctemplatepath empty", LOG_WARNING); + return -1; + } + + // Add odtgeneration hook + if (!is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + global $action; + + if (!is_object($outputlangs)) { + $outputlangs = $langs; + } + $sav_charset_output = $outputlangs->charset_output; + $outputlangs->charset_output = 'UTF-8'; + + $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); + + if ($conf->fournisseur->facture->dir_output) { + $object->fetch_thirdparty(); + + if ($object->specimen) { + $dir = $conf->fournisseur->facture->dir_output; + $file = $dir."/SPECIMEN.pdf"; + } else { + $objectref = dol_sanitizeFileName($object->ref); + $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); + //$dir = $conf->fournisseur->facture->dir_output.'/'.$objectref; + $dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$objectref; + $file = $dir."/".$objectref.".pdf"; + if (!empty($conf->global->SUPPLIER_REF_IN_NAME)) { + $file = $dir."/".$objectref.($objectrefsupplier ? "_".$objectrefsupplier : "").".pdf"; + } + } + + if (!file_exists($dir)) { + if (dol_mkdir($dir) < 0) { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + } + + if (file_exists($dir)) { + //print "srctemplatepath=".$srctemplatepath; // Src filename + $newfile = basename($srctemplatepath); + $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile); + $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); + $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); + $newfiletmp = $objectref.'_'.$newfiletmp; + //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + // Get extension (ods or odt) + $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); + if (!empty($conf->global->MAIN_DOC_USE_TIMING)) { + $format = $conf->global->MAIN_DOC_USE_TIMING; + if ($format == '1') { + $format = '%Y%m%d%H%M%S'; + } + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; + } else { + $filename = $newfiletmp.'.'.$newfileformat; + } + $file = $dir.'/'.$filename; + //print "newdir=".$dir; + //print "newfile=".$newfile; + //print "file=".$file; + //print "conf->societe->dir_temp=".$conf->societe->dir_temp; + + dol_mkdir($conf->fournisseur->facture->dir_temp); + if (!is_writable($conf->fournisseur->facture->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->fournisseur->facture->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } + + // If CUSTOMER contact defined on invoice, we use it + $usecontact = false; + $arrayidcontact = $object->getIdContact('external', 'CUSTOMER'); + if (count($arrayidcontact) > 0) { + $usecontact = true; + $result = $object->fetch_contact($arrayidcontact[0]); + } + + // Recipient name + $contactobject = null; + if (!empty($usecontact)) { + // We can use the company of contact instead of thirdparty company + if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + $object->contact->fetch_thirdparty(); + $socobject = $object->contact->thirdparty; + $contactobject = $object->contact; + } else { + $socobject = $object->thirdparty; + // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + $contactobject = $object->contact; + } + } else { + $socobject = $object->thirdparty; + } + + // Make substitution + $substitutionarray = array( + '__FROM_NAME__' => $this->issuer->name, + '__FROM_EMAIL__' => $this->issuer->email, + '__TOTAL_TTC__' => $object->total_ttc, + '__TOTAL_HT__' => $object->total_ht, + '__TOTAL_VAT__' => $object->total_tva + ); + complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray); + $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Line of free text + $newfreetext = ''; + $paramfreetext = 'INVOICE_FREE_TEXT'; + if (!empty($conf->global->$paramfreetext)) { + $newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray); + } + + // Open and load template + require_once ODTPHP_PATH.'odf.php'; + try { + $odfHandler = new odf( + $srctemplatepath, + array( + 'PATH_TO_TMP' => $conf->fournisseur->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' + ) + ); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + // After construction $odfHandler->contentXml contains content and + // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by + // [!-- BEGIN lines --]*[!-- END lines --] + //print html_entity_decode($odfHandler->__toString()); + //print exit; + + + // Make substitutions into odt of freetext + try { + $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } + + // Define substitution array + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs); + $array_objet = $this->get_substitutionarray_object($object, $outputlangs); + $array_user = $this->get_substitutionarray_user($user, $outputlangs); + $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs); + $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); + $array_other = $this->get_substitutionarray_other($outputlangs); + // retrieve contact information for use in object as contact_xxx tags + $array_thirdparty_contact = array(); + if ($usecontact && is_object($contactobject)) { + $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact'); + } + + $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact); + complete_substitutions_array($tmparray, $outputlangs, $object); + + // Call the ODTSubstitution hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + foreach ($tmparray as $key => $value) { + try { + if (preg_match('/logo$/', $key)) { // Image + if (file_exists($value)) { + $odfHandler->setImage($key, $value); + } else { + $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); + } + } else // Text + { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + // Replace tags of lines + try { + $foundtagforlines = 1; + try { + $listlines = $odfHandler->setSegment('lines'); + } catch (OdfException $e) { + // We may arrive here if tags for lines not present into template + $foundtagforlines = 0; + dol_syslog($e->getMessage(), LOG_INFO); + } + if ($foundtagforlines) { + $linenumber = 0; + foreach ($object->lines as $line) { + $linenumber++; + $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); + complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); + $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + foreach ($tmparray as $key => $val) { + try { + $listlines->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + $listlines->merge(); + } + $odfHandler->mergeSegment($listlines); + } + } catch (OdfException $e) { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + return -1; + } + + // Replace labels translated + $tmparray = $outputlangs->get_translations_for_substitutions(); + foreach ($tmparray as $key => $value) { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + + // Call the beforeODTSave hook + + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Write new file + if (!empty($conf->global->MAIN_ODT_AS_PDF)) { + try { + $odfHandler->exportAsAttachedPDF($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } else { + try { + $odfHandler->saveToDisk($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } + + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + if (!empty($conf->global->MAIN_UMASK)) { + @chmod($file, octdec($conf->global->MAIN_UMASK)); + } + + $odfHandler = null; // Destroy object + + $this->result = array('fullpath'=>$file); + + return 1; // Success + } else { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + } + + return -1; + } +} diff --git a/htdocs/install/doctemplates/supplier_invoices/index.html b/htdocs/install/doctemplates/supplier_invoices/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/supplier_invoices/template_supplier_invoices.odt b/htdocs/install/doctemplates/supplier_invoices/template_supplier_invoices.odt new file mode 100644 index 0000000000000000000000000000000000000000..8ece83c989c9ff688337dbb0edf6febd47eb0dcf GIT binary patch literal 25866 zcmbTc1yo$i@-K|LLvVL@cXx-NfdIqcFu1#0aF^f?!QCOaLxKl)cbCUG_n!Oi`(&-} z|IJ!^rgzn^OS)@U@9r8^1xP3?FfceUurKab;)a9lNHkzzV1Hd7Brsb`TcERtJ}(0LV{x@JWd<2LSvoO;?16TsAb^W4(9W6J8R+h;`hN(EwSNsVhXMop>-t+5 z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Nj7;)VJI7!1U)Hp$6`J-j|vZR7#2Ygu)08^e2g^{6^Ta%(kKaqJ|DBCfM zv2>_~q+?lS-!`Nmfcz!QY%|m$JO;L@hU=MDWyS1vmxg|>5KDw*OePw?44=jS?uKd@N9M%v|c#c!9FeuZMWmxxo zH7cX%mqF}!?P{K^K zq4fRv12T-jK|@L|j8|Oi9n8;JP5vx1^%K}f_Sd3QKfL@1{8!5P$G}J7f>gg!);}YEWm|tl z-qD07>KB6g1NkHJpOGRVA&AjW(|PjmrTwqm?2iZdCk_b-!OnhK(r^6y8&~^lXMYT8 z^f%6a-??A8++X`au(_Wm@*6*Yu3;xr~k1s7^4}K6j1RMNmci`7!{zGo~<6HT|>90dKf(!mMXSma!%<#{+ jUx%REKSA)Nd85A==G7F@&=G4A!~e?R literal 0 HcmV?d00001 From 578c8cf2c462b2f3d52f0946c571af0aa6d29a1f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 14 Nov 2022 16:41:54 +0000 Subject: [PATCH 03/67] Fixing style errors. --- htdocs/core/actions_setmoduleoptions.inc.php | 1 - htdocs/core/modules/modFournisseur.class.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index e45365bceb1..237dd86b270 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -109,7 +109,6 @@ if ($action == 'setModuleOptions') { if ($upload_dir) { - $result = dol_add_file_process($upload_dir, 1, 1, 'uploadfile', ''); if ($result <= 0) { $error++; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 63134340891..d36b0f157c8 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -107,7 +107,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; - // Add abbility ODT for Supplier Invoices + // Add abbility ODT for Supplier Invoices $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_invoices"; From 46a7cfd8d29a4e8722a4944aae1b843f01df76d3 Mon Sep 17 00:00:00 2001 From: Artem Chernitsov Date: Mon, 14 Nov 2022 21:18:36 +0200 Subject: [PATCH 04/67] Update modFournisseur.class.php Fix error after conflicts --- htdocs/core/modules/modFournisseur.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index c218f31efe2..20bae3a9ee4 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -902,8 +902,8 @@ class modFournisseur extends DolibarrModules $sql_order = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','order_supplier',".$conf->entity.")", - - //ODT template for Supplier Invoice + ); +//ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; $dest = $dirodt.'/template_supplier_invoices.odt'; From 1a350d036ab2686bac2a61319f79701308f39f0e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 14 Nov 2022 19:40:58 +0000 Subject: [PATCH 05/67] Fixing style errors. --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 20bae3a9ee4..a9ee19c5541 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -903,7 +903,7 @@ class modFournisseur extends DolibarrModules "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".$conf->entity, "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','order_supplier',".$conf->entity.")", ); -//ODT template for Supplier Invoice + //ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; $dest = $dirodt.'/template_supplier_invoices.odt'; From c185d133a2c3a261b99ff9859da010ee1b658ccb Mon Sep 17 00:00:00 2001 From: Artem Chernitsov Date: Tue, 15 Nov 2022 13:23:19 +0200 Subject: [PATCH 06/67] Set constant empty by default Set SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH constant empty by default --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index a9ee19c5541..1be5312fd64 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -109,7 +109,7 @@ class modFournisseur extends DolibarrModules // Add abbility ODT for Supplier Invoices $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_invoices"; + $this->const[$r][2] = ""; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; From 3b3ebfa1c21f1407328a366cc344b76a5ee6199b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 16 Nov 2022 11:45:42 +0100 Subject: [PATCH 07/67] NEW triggers on mailing --- htdocs/comm/mailing/class/mailing.class.php | 120 ++++++++++++++------ 1 file changed, 83 insertions(+), 37 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 4ea794bfbd4..2d2a5e833d6 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -217,9 +217,10 @@ class Mailing extends CommonObject * Create an EMailing * * @param User $user Object of user making creation - * @return int -1 if error, Id of created object if OK + * @param int $notrigger Disable triggers + * @return int <0 if KO, Id of created object if OK */ - public function create($user) + public function create($user, $notrigger = 0) { global $conf, $langs; @@ -229,8 +230,6 @@ class Mailing extends CommonObject return -1; } - $this->db->begin(); - $this->title = trim($this->title); $this->email_from = trim($this->email_from); @@ -239,7 +238,9 @@ class Mailing extends CommonObject return -1; } + $error = 0; $now = dol_now(); + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing"; $sql .= " (date_creat, fk_user_creat, entity)"; @@ -250,19 +251,32 @@ class Mailing extends CommonObject } dol_syslog("Mailing::Create", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { + $resql = $this->db->query($sql); + if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing"); - if ($this->update($user) > 0) { - $this->db->commit(); - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return -1; + $result = $this->update($user, 1); + if ($result < 0) { + $error++; } - return $this->id; + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('MAILING_CREATE', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + + if (!$error) { + $this->db->commit(); + return $this->id; + } else { + $this->db->rollback(); + dol_syslog(__METHOD__ . ' ' . $this->error, LOG_ERR); + return -2; + } } else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -274,9 +288,10 @@ class Mailing extends CommonObject * Update emailing record * * @param User $user Object of user making change + * @param int $notrigger Disable triggers * @return int < 0 if KO, > 0 if OK */ - public function update($user) + public function update($user, $notrigger = 0) { // Check properties if ($this->body === 'InvalidHTMLString') { @@ -284,6 +299,9 @@ class Mailing extends CommonObject return -1; } + $error = 0; + $this->db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; $sql .= " SET titre = '".$this->db->escape($this->title)."'"; $sql .= ", sujet = '".$this->db->escape($this->sujet)."'"; @@ -295,12 +313,30 @@ class Mailing extends CommonObject $sql .= ", bgimage = '".($this->bgimage ? $this->db->escape($this->bgimage) : null)."'"; $sql .= " WHERE rowid = ".(int) $this->id; - dol_syslog("Mailing::Update", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { - return 1; + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('MAILING_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + + if (!$error) { + dol_syslog(__METHOD__ . ' success'); + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + dol_syslog(__METHOD__ . ' ' . $this->error, LOG_ERR); + return -2; + } } else { $this->error = $this->db->lasterror(); + $this->db->rollback(); return -1; } } @@ -528,36 +564,46 @@ class Mailing extends CommonObject { global $user; + $error = 0; $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing"; - $sql .= " WHERE rowid = ".((int) $rowid); + if (!$notrigger) { + $result = $this->call_trigger('MAILING_DELETE', $user); + if ($result < 0) { + $error++; + } + } - dol_syslog("Mailing::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $res = $this->delete_targets(); - if ($res <= 0) { + if (!$error) { + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "mailing"; + $sql .= " WHERE rowid = " . ((int)$rowid); + + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $res = $this->delete_targets(); + if ($res <= 0) { + $error++; + } + + if (!$error) { + dol_syslog(__METHOD__ . ' success'); + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + dol_syslog(__METHOD__ . ' ' . $this->error, LOG_ERR); + return -2; + } + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } else { $this->db->rollback(); - $this->error = $this->db->lasterror(); return -1; } - - if (!$notrigger) { - $result = $this->call_trigger('MAILING_DELETE', $user); - if ($result < 0) { - $this->db->rollback(); - return -1; - } - } - - $this->db->commit(); - return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 90191d6ce8092288c4c04ddfef23d9b396e4a069 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 16 Nov 2022 12:23:17 +0100 Subject: [PATCH 08/67] FIX stickler-ci --- htdocs/comm/mailing/class/mailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 2d2a5e833d6..75cf669d3c8 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -250,7 +250,7 @@ class Mailing extends CommonObject $this->title = $langs->trans("NoTitle"); } - dol_syslog("Mailing::Create", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing"); @@ -576,7 +576,7 @@ class Mailing extends CommonObject if (!$error) { $sql = "DELETE FROM " . MAIN_DB_PREFIX . "mailing"; - $sql .= " WHERE rowid = " . ((int)$rowid); + $sql .= " WHERE rowid = " . ((int) $rowid); dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); From 53df25a9667b47f0fabfa22d22d21e4cc41bac97 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 16 Nov 2022 15:58:00 +0100 Subject: [PATCH 09/67] NEW presend mass action in contact list --- htdocs/contact/list.php | 2 +- htdocs/core/actions_massactions.inc.php | 50 ++++++++++++------------- htdocs/core/tpl/massactions_pre.tpl.php | 33 ++++++++++------ 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2bfdf9d1f66..c383cf82e3b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -758,7 +758,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( -// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b83c30d15b6..2006c4ded5c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -92,11 +92,11 @@ if (!$error && $massaction == 'confirm_presend') { $objecttmp = new $objectclass($db); if ($objecttmp->element == 'expensereport') { $thirdparty = new User($db); - } - if ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { + } elseif ($objecttmp->element == 'contact') { + $thirdparty = new Contact($db); + } elseif ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { $thirdparty = new Adherent($db); - } - if ($objecttmp->element == 'holiday') { + } elseif ($objecttmp->element == 'holiday') { $thirdparty = new User($db); } @@ -109,14 +109,13 @@ if (!$error && $massaction == 'confirm_presend') { $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); if ($objecttmp->element == 'societe') { $thirdpartyid = $objecttmp->id; - } - if ($objecttmp->element == 'expensereport') { + } elseif ($objecttmp->element == 'contact') { + $thirdpartyid = $objecttmp->id; + } elseif ($objecttmp->element == 'expensereport') { $thirdpartyid = $objecttmp->fk_user_author; - } - if ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { + } elseif ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { $thirdpartyid = $objecttmp->fk_member; - } - if ($objecttmp->element == 'holiday') { + } elseif ($objecttmp->element == 'holiday') { $thirdpartyid = $objecttmp->fk_user; } if (empty($thirdpartyid)) { @@ -267,6 +266,10 @@ if (!$error && $massaction == 'confirm_presend') { $fuser = new User($db); $fuser->fetch($objectobj->fk_user_author); $sendto = $fuser->email; + } elseif ($objectobj->element == 'contact') { + $fcontact = new Contact($db); + $fcontact->fetch($objectobj->id); + $sendto = $fcontact->email; } elseif ($objectobj->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { $fadherent = new Adherent($db); $fadherent->fetch($objectobj->fk_member); @@ -509,31 +512,28 @@ if (!$error && $massaction == 'confirm_presend') { $trackid = 'thi'.$thirdparty->id; if ($objecttmp->element == 'expensereport') { $trackid = 'use'.$thirdparty->id; - } - if ($objecttmp->element == 'holiday') { + } elseif ($objecttmp->element == 'contact') { + $trackid = 'ctc'.$thirdparty->id; + } elseif ($objecttmp->element == 'holiday') { $trackid = 'use'.$thirdparty->id; } } else { $trackid = strtolower(get_class($objecttmp)); - if (get_class($objecttmp) == 'Contrat') { + if (get_class($objecttmp) == 'Contact') { + $trackid = 'ctc'; + } elseif (get_class($objecttmp) == 'Contrat') { $trackid = 'con'; - } - if (get_class($objecttmp) == 'Propal') { + } elseif (get_class($objecttmp) == 'Propal') { $trackid = 'pro'; - } - if (get_class($objecttmp) == 'Commande') { + } elseif (get_class($objecttmp) == 'Commande') { $trackid = 'ord'; - } - if (get_class($objecttmp) == 'Facture') { + } elseif (get_class($objecttmp) == 'Facture') { $trackid = 'inv'; - } - if (get_class($objecttmp) == 'Supplier_Proposal') { + } elseif (get_class($objecttmp) == 'Supplier_Proposal') { $trackid = 'spr'; - } - if (get_class($objecttmp) == 'CommandeFournisseur') { + } elseif (get_class($objecttmp) == 'CommandeFournisseur') { $trackid = 'sor'; - } - if (get_class($objecttmp) == 'FactureFournisseur') { + } elseif (get_class($objecttmp) == 'FactureFournisseur') { $trackid = 'sin'; } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 7657fe21e96..07fd80c8595 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -167,8 +167,9 @@ if ($massaction == 'presend') { $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ... if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) { $thirdpartyid = $objecttmp->id; - } - if ($objecttmp->element == 'expensereport') { + } elseif ($objecttmp->element == 'contact') { + $thirdpartyid = $objecttmp->id; + } elseif ($objecttmp->element == 'expensereport') { $thirdpartyid = $objecttmp->fk_user_author; } if (empty($thirdpartyid)) { @@ -205,6 +206,10 @@ if ($massaction == 'presend') { $fuser = new User($db); $fuser->fetch($thirdpartyid); $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; + } elseif ($objecttmp->element == 'contact') { + $fcontact = new Contact($db); + $fcontact->fetch($thirdpartyid); + $liste['contact'] = $fcontact->getFullName($langs)." <".$fcontact->email.">"; } elseif ($objecttmp->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { $fadherent = new Adherent($db); $fadherent->fetch($objecttmp->fk_member); @@ -236,17 +241,23 @@ if ($massaction == 'presend') { } else { $formmail->withtopic = 1; } - $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action - // Add a checkbox "Attach also main document" - if (isset($withmaindocfilemail)) { - $formmail->withmaindocfile = $withmaindocfilemail; - } else { // Do an automatic definition of $formmail->withmaindocfile - $formmail->withmaindocfile = 1; - if ($objecttmp->element != 'societe') { - $formmail->withfile = ''.$langs->trans("OnlyPDFattachmentSupported").''; - $formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default + if ($objecttmp->element == 'contact') { + $formmail->withfile = 0; + $formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document" + } else { + $formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action + // Add a checkbox "Attach also main document" + if (isset($withmaindocfilemail)) { + $formmail->withmaindocfile = $withmaindocfilemail; + } else { // Do an automatic definition of $formmail->withmaindocfile + $formmail->withmaindocfile = 1; + if ($objecttmp->element != 'societe') { + $formmail->withfile = '' . $langs->trans("OnlyPDFattachmentSupported") . ''; + $formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default + } } } + $formmail->withbody = 1; $formmail->withdeliveryreceipt = 1; $formmail->withcancel = 1; From 9ed824a484681f965ca3ff9c36e544247529b7b5 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 16 Nov 2022 16:25:58 +0100 Subject: [PATCH 10/67] FIX reload travis From fb5c3ee02edf1bdae84e203e87356f81146c8a4e Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 16 Nov 2022 18:09:18 +0100 Subject: [PATCH 11/67] FIX stickler ci --- htdocs/contact/list.php | 2 +- htdocs/core/actions_massactions.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c383cf82e3b..9a5822e8406 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -758,7 +758,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 2006c4ded5c..a5e63aab9e3 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -519,7 +519,7 @@ if (!$error && $massaction == 'confirm_presend') { } } else { $trackid = strtolower(get_class($objecttmp)); - if (get_class($objecttmp) == 'Contact') { + if (get_class($objecttmp) == 'Contact') { $trackid = 'ctc'; } elseif (get_class($objecttmp) == 'Contrat') { $trackid = 'con'; From 97d2d4a17be4510050f32a1a80663d886e493821 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Fri, 18 Nov 2022 11:03:05 +0100 Subject: [PATCH 12/67] Deplacement requete de migration --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 3 --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 742b7e315d0..b335cf7f3f6 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -656,6 +656,3 @@ ALTER TABLE llx_c_socialnetworks DROP INDEX idx_c_socialnetworks_code; ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity); ALTER TABLE llx_propaldet ADD COLUMN import_key varchar(14); - --- Rename prospect level on contact -ALTER TABLE llx_socpeople CHANGE fk_prospectcontactlevel fk_prospectlevel varchar(12); diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 0b4b773be40..cc375456056 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -376,3 +376,6 @@ ALTER TABLE llx_prelevement_demande ADD COLUMN fk_salary INTEGER NULL AFTER fk_f ALTER TABLE llx_user ADD COLUMN birth_place varchar(64); + +-- Rename prospect level on contact +ALTER TABLE llx_socpeople CHANGE fk_prospectcontactlevel fk_prospectlevel varchar(12); From a5f4a8481e586b58765a90053b871010992d933b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2022 22:14:01 +0100 Subject: [PATCH 13/67] Update modFournisseur.class.php --- htdocs/core/modules/modFournisseur.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 1be5312fd64..09435e2c02b 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -900,8 +900,8 @@ class modFournisseur extends DolibarrModules } $sql_order = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','order_supplier',".$conf->entity.")", + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."', 'order_supplier', ".((int) $conf->entity).")", ); //ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; @@ -920,8 +920,8 @@ class modFournisseur extends DolibarrModules } $sql_invoice = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[2][2])."' AND type = 'invoice_supplier' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[2][2])."','invoice_supplier',".$conf->entity.")", + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[2][2])."' AND type = 'invoice_supplier' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[2][2])."', 'invoice_supplier', ".((int) $conf->entity).")", ); $sql = array_merge($sql_order, $sql_invoice); From 8cc31725ee74f3fded34b039324d32d17452df56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Nov 2022 22:26:53 +0100 Subject: [PATCH 14/67] Update modFournisseur.class.php --- htdocs/core/modules/modFournisseur.class.php | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 09435e2c02b..5f61b5faf52 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -95,26 +95,15 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; - /* OLD For supplier invoice, we must not have default pdf template on. In most cases, we need to join PDF from supplier, not have a document generated. - NEW Uncomment to add ability to generate PDF for Supplier Invoices which generated not from Order. - */ - + /* For supplier invoice, we must not have default pdf template on. In most cases, we need to join PDF from supplier, not have a document generated. $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; $this->const[$r][3] = 'Nom du gestionnaire de generation des factures fournisseur en PDF'; $this->const[$r][4] = 0; $r++; - - // Add abbility ODT for Supplier Invoices - $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; - $this->const[$r][3] = ""; - $this->const[$r][4] = 0; - $r++; - - + */ + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_facture_fournisseur_cactus"; @@ -122,6 +111,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; + // Add ability ODT for Supplier orders $this->const[$r][0] = "SUPPLIER_ORDER_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_orders"; @@ -129,6 +119,14 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; + // Add ability ODT for Supplier Invoices + $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = ""; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + // Boxes $this->boxes = array( 0=>array('file'=>'box_graph_invoices_supplier_permonth.php', 'enabledbydefaulton'=>'Home'), @@ -919,12 +917,14 @@ class modFournisseur extends DolibarrModules } } + /* $sql_invoice = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[2][2])."' AND type = 'invoice_supplier' AND entity = ".((int) $conf->entity), "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[2][2])."', 'invoice_supplier', ".((int) $conf->entity).")", ); $sql = array_merge($sql_order, $sql_invoice); + */ //var_dump($sql); //die; From 1a7a5e89bab872a3811de18af3c2e31647ba8d51 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 22 Nov 2022 21:53:41 +0000 Subject: [PATCH 15/67] Fixing style errors. --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 5f61b5faf52..a8512795942 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -103,7 +103,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][4] = 0; $r++; */ - + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_facture_fournisseur_cactus"; From 9663cddcedbf75a075aadcc2487640ba8d43d774 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Nov 2022 15:39:35 +0100 Subject: [PATCH 16/67] Update modFournisseur.class.php --- htdocs/core/modules/modFournisseur.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index a8512795942..64d965cdcf0 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -901,6 +901,7 @@ class modFournisseur extends DolibarrModules "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".((int) $conf->entity), "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."', 'order_supplier', ".((int) $conf->entity).")", ); + //ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; @@ -925,8 +926,8 @@ class modFournisseur extends DolibarrModules $sql = array_merge($sql_order, $sql_invoice); */ - //var_dump($sql); - //die; + + $sql = $sql_order; return $this->_init($sql, $options); } From 15367cbe5f8f52435b6131a578e7780954416ce9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 25 Nov 2022 14:44:27 +0000 Subject: [PATCH 17/67] Fixing style errors. --- htdocs/core/modules/modFournisseur.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 64d965cdcf0..7bd10fcaf9b 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -901,7 +901,7 @@ class modFournisseur extends DolibarrModules "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'order_supplier' AND entity = ".((int) $conf->entity), "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."', 'order_supplier', ".((int) $conf->entity).")", ); - + //ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; @@ -926,7 +926,7 @@ class modFournisseur extends DolibarrModules $sql = array_merge($sql_order, $sql_invoice); */ - + $sql = $sql_order; return $this->_init($sql, $options); From ad07fdfd79a9bc7510eb958b71b9b6dc250d841d Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Sun, 27 Nov 2022 01:06:40 +0100 Subject: [PATCH 18/67] FIX #22837 --- htdocs/core/class/html.formticket.class.php | 12 +++++++----- htdocs/ticket/card.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 7d116fd692a..cea007f8e61 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -127,12 +127,14 @@ class FormTicket /** * Show the form to input ticket * - * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() - * @param string $mode Mode ('create' or 'edit') - * @param int $public 1=If we show the form for the public interface + * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() + * @param string $mode Mode ('create' or 'edit') + * @param int $public 1=If we show the form for the public interface + * @param Contact|null $with_contact [=NULL] Contact to link to this ticket if exists + * @param string $action [=''] Action in card * @return void */ - public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0) + public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0, Contact $with_contact = null, $action = '') { global $conf, $langs, $user, $hookmanager; @@ -441,7 +443,7 @@ class FormTicket // Other attributes $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $this->action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { print $ticketstat->showOptionals($extrafields, 'create'); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9c1a7c709b7..1b3dd4c8e37 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -700,7 +700,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->withextrafields = 1; $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); - $formticket->showForm(1, 'create', 0); + $formticket->showForm(1, 'create', 0, null, $action); /*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) { $formticket = new FormTicket($db); From 3b45f894c59719ef3ede31600706a32a3ce42bae Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 2 Dec 2022 15:10:54 +0100 Subject: [PATCH 19/67] add mode Kanban to list of userGroup --- htdocs/user/class/usergroup.class.php | 28 ++++++++++ htdocs/user/group/list.php | 74 ++++++++++++++++++--------- 2 files changed, 79 insertions(+), 23 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index bb8fa374eea..849b08bc7f6 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -917,4 +917,32 @@ class UserGroup extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } + + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '') + { + global $langs; + $return = '
'; + $return .= '
'; + $return .= ''; + $return .= img_picto('', $this->picto); + $return .= ''; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; + if (property_exists($this, 'members')) { + $return .= '
'.(!empty($this->members)? $this->members : 0).' '.$langs->trans('Users').''; + } + if (property_exists($this, 'nb_rights')) { + $return .= '
'.$langs->trans('NbOfPermissions').' : '.$this->nb_rights.'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 4c91bd041dd..209be95e043 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -37,6 +37,8 @@ $search_group = GETPOST('search_group'); $optioncss = GETPOST('optioncss', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $contextpage = GETPOST('optioncss', 'aZ09'); +$mode = GETPOST('mode', 'aZ'); + // Defini si peux lire/modifier utilisateurs et permisssions $caneditperms = ($user->admin || $user->hasRight("user", "user", "write")); @@ -152,6 +154,10 @@ if ($resql) { $i = 0; $param = "&search_group=".urlencode($search_group)."&sall=".urlencode($sall); + if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); + } + if ($optioncss != '') { $param .= '&optioncss='.$optioncss; } @@ -159,6 +165,9 @@ if ($resql) { $text = $langs->trans("ListOfGroups"); $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + if ($caneditperms) { $newcardbutton .= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu='); } @@ -172,6 +181,8 @@ if ($resql) { print ''; print ''; print ''; + print ''; + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -205,33 +216,50 @@ if ($resql) { $grouptemp = new UserGroup($db); - while ($i < $num) { + $imaxinloop = ($limit ? min($num, $limit) : $num); + + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + $grouptemp->setVarsFromFetchObj($obj); - $grouptemp->id = $obj->rowid; - $grouptemp->name = $obj->name; - $grouptemp->note = $obj->note; + $grouptemp->name = $obj->name; + $grouptemp->note = $obj->note; + $grouptemp->members = $obj->nb; + $grouptemp->nb_rights = $obj->nbpermissions; - print ''; - print ''; - print $grouptemp->getNomUrl(1); - if (isModEnabled('multicompany') && !$obj->entity) { - print img_picto($langs->trans("GlobalGroup"), 'redstar'); + if ($mode == 'kanban') { + if ($i == 0) { + print ''; + print '
'; + } + // Output Kanban + print $grouptemp->getKanbanView(''); + if ($i == ($imaxinloop - 1)) { + print '
'; + print ''; + } + } else { + print ''; + print ''; + print $grouptemp->getNomUrl(1); + if (isModEnabled('multicompany') && !$obj->entity) { + print img_picto($langs->trans("GlobalGroup"), 'redstar'); + } + print ""; + //multicompany + if (isModEnabled('multicompany') && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) { + $mc->getInfo($obj->entity); + print ''.dol_escape_htmltag($mc->label).''; + } + print ''.$obj->nb.''; + print ''; + print ''.$obj->nbpermissions.''; + print ''; + print ''.dol_print_date($db->jdate($obj->datec), "dayhour").''; + print ''.dol_print_date($db->jdate($obj->datem), "dayhour").''; + print ''; + print "\n"; } - print ""; - //multicompany - if (isModEnabled('multicompany') && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) { - $mc->getInfo($obj->entity); - print ''.dol_escape_htmltag($mc->label).''; - } - print ''.$obj->nb.''; - print ''; - print ''.$obj->nbpermissions.''; - print ''; - print ''.dol_print_date($db->jdate($obj->datec), "dayhour").''; - print ''.dol_print_date($db->jdate($obj->datem), "dayhour").''; - print ''; - print "\n"; $i++; } print ""; From 6a658499e736432506d476ebb365bcbbbe4b536d Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 17 Dec 2022 21:16:03 +0100 Subject: [PATCH 20/67] Fix #23077 - Cannot update subscription note --- htdocs/adherents/subscription/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 5967d670856..37d0f2a9b5b 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -108,7 +108,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance $object->dateh = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $object->datef = dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']); $object->fk_type = $typeid; - $object->note = $note; + $object->note_public = $note; $object->amount = $amount; //print 'datef='.$object->datef.' '.$_POST['datesubendday']; From a08c468a5e7f247e80d0a145333704aa04c65e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ili=C3=A8s=20BENYAHIA?= Date: Tue, 20 Dec 2022 11:00:41 +0100 Subject: [PATCH 21/67] When no language selected, value is 0 so it enters in the condition filter_lang != '' anyway --- htdocs/core/modules/mailings/contacts1.modules.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index decbc81716b..38a82907124 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -408,7 +408,7 @@ class mailing_contacts1 extends MailingTargets } // Filter on language - if ($filter_lang != '') { + if (!empty($filter_lang)) { $sql .= " AND sp.default_lang = '".$this->db->escape($filter_lang)."'"; } @@ -439,7 +439,6 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY sp.email"; // print "wwwwwwx".$sql; - // Stocke destinataires dans cibles $result = $this->db->query($sql); if ($result) { From a4d5a7ed1f14ef383515c5f206436464f2f672ca Mon Sep 17 00:00:00 2001 From: Mathieu Date: Tue, 20 Dec 2022 12:36:50 +0100 Subject: [PATCH 22/67] FIX#23072 --- 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 2f6acb67ece..60e794ba7ca 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -70,7 +70,7 @@ if ($action == 'presend') { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($newlang); // Load traductions files required by page - $outputlangs->loadLangs(array('commercial', 'bills', 'orders', 'contracts', 'members', 'propal', 'products', 'supplier_proposal', 'interventions', 'receptions')); + $outputlangs->loadLangs(array('commercial', 'bills', 'orders', 'contracts', 'members', 'propal', 'products', 'supplier_proposal', 'interventions', 'receptions', 'sendings')); } $topicmail = ''; From 6288ef5261fb9558173d9b5180e2c6a6c83159f9 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 20 Dec 2022 13:35:53 +0100 Subject: [PATCH 23/67] Add View mode to Contact adress --- htdocs/contact/class/contact.class.php | 44 +++ htdocs/contact/list.php | 491 +++++++++++++------------ 2 files changed, 303 insertions(+), 232 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d535da76199..c028c80b07b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -2115,4 +2115,48 @@ class Contact extends CommonObject } return 0; } + + + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '') + { + global $langs; + $return = '
'; + $return .= '
'; + $return .= ''; + //var_dump($this->photo);exit; + if (property_exists($this, 'photo') && !is_null($this->photo)) { + $return.= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); + } else { + $return .= img_picto('', $this->picto); + } + $return .= ''; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).''; + if (property_exists($this, 'socid') && !is_null($this->socid)) { + $return .= '
'.$this->socid.''; + } else { + if (property_exists($this, 'phone_pro')) { + $return .= '
'.$langs->trans("Phone").''; + $return .= ' : '.$this->phone_pro.''; + } + } + + if (method_exists($this, 'LibPubPriv')) { + $return .= '
'.$langs->trans("Visibility").''; + $return .= ' : '.$this->LibPubPriv($this->priv).''; + } + if (method_exists($this, 'getLibStatut')) { + $return .= '
'.$this->getLibStatut(5).'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e8c4174af71..59f504ec886 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -53,6 +53,7 @@ $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contactlist'; +$mode = GETPOST('mode', 'alpha'); // Security check $id = GETPOST('id', 'int'); @@ -680,6 +681,9 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'; llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -789,7 +793,10 @@ if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$newcardbutton = dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $user->rights->societe->contact->creer); +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $user->rights->societe->contact->creer); print '
'; if ($optioncss != '') { @@ -802,6 +809,8 @@ print ''; //print ''; print ''; print ''; +print 'fk_prospectlevel = $obj->fk_prospectcontactlevel; - print ''; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; + print '
'; + } + $contactstatic->photo = $obj->photo; + $soc = new Societe($db); + $soc->fetch($obj->socid); + if ($obj->socid) { + $contactstatic->socid = $soc->getNomUrl(1); + } + print $contactstatic->getKanbanView(''); + if ($i == min($num, $limit) - 1) { + print '
'; + print ''; + } + } else { + print ''; - // Action column - if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; - if ($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($obj->rowid, $arrayofselected)) { - $selected = 1; + // Action column + if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + if ($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($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print ''; } - print ''; - } - // ID - if (!empty($arrayfields['p.rowid']['checked'])) { - print ''; - print dol_escape_htmltag($obj->rowid); - print "\n"; - if (!$i) { - $totalarray['nbfield']++; + // ID + if (!empty($arrayfields['p.rowid']['checked'])) { + print ''; + print dol_escape_htmltag($obj->rowid); + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Name - if (!empty($arrayfields['p.lastname']['checked'])) { - print ''; - print $contactstatic->getNomUrl(1); - print ''; - if (!$i) { - $totalarray['nbfield']++; + // Name + if (!empty($arrayfields['p.lastname']['checked'])) { + print ''; + print $contactstatic->getNomUrl(1); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Firstname - if (!empty($arrayfields['p.firstname']['checked'])) { - print ''.dol_escape_htmltag($obj->firstname).''; - if (!$i) { - $totalarray['nbfield']++; + // Firstname + if (!empty($arrayfields['p.firstname']['checked'])) { + print ''.dol_escape_htmltag($obj->firstname).''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Job position - if (!empty($arrayfields['p.poste']['checked'])) { - print ''.dol_escape_htmltag($obj->poste).''; - if (!$i) { - $totalarray['nbfield']++; + // Job position + if (!empty($arrayfields['p.poste']['checked'])) { + print ''.dol_escape_htmltag($obj->poste).''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Address - if (!empty($arrayfields['p.address']['checked'])) { - print ''.dol_escape_htmltag($obj->address).''; - if (!$i) { - $totalarray['nbfield']++; + // Address + if (!empty($arrayfields['p.address']['checked'])) { + print ''.dol_escape_htmltag($obj->address).''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Zip - if (!empty($arrayfields['p.zip']['checked'])) { - print ''.dol_escape_htmltag($obj->zip).''; - if (!$i) { - $totalarray['nbfield']++; + // Zip + if (!empty($arrayfields['p.zip']['checked'])) { + print ''.dol_escape_htmltag($obj->zip).''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Town - if (!empty($arrayfields['p.town']['checked'])) { - print ''.dol_escape_htmltag($obj->town).''; - if (!$i) { - $totalarray['nbfield']++; + // Town + if (!empty($arrayfields['p.town']['checked'])) { + print ''.dol_escape_htmltag($obj->town).''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // State - /*if (!empty($arrayfields['state.nom']['checked'])) - { - print "".$obj->state_name."\n"; - if (! $i) $totalarray['nbfield']++; - } - // Region - if (!empty($arrayfields['region.nom']['checked'])) - { - print "".$obj->region_name."\n"; - if (! $i) $totalarray['nbfield']++; - }*/ - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - $tmparray = getCountry($obj->fk_pays, 'all'); - print dol_escape_htmltag($tmparray['label']); - print ''; - if (!$i) { - $totalarray['nbfield']++; + // State + /*if (!empty($arrayfields['state.nom']['checked'])) + { + print "".$obj->state_name."\n"; + if (! $i) $totalarray['nbfield']++; } - } - // Phone - if (!empty($arrayfields['p.phone']['checked'])) { - print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; - if (!$i) { - $totalarray['nbfield']++; + // Region + if (!empty($arrayfields['region.nom']['checked'])) + { + print "".$obj->region_name."\n"; + if (! $i) $totalarray['nbfield']++; + }*/ + // Country + if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; + $tmparray = getCountry($obj->fk_pays, 'all'); + print dol_escape_htmltag($tmparray['label']); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Phone perso - if (!empty($arrayfields['p.phone_perso']['checked'])) { - print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; - if (!$i) { - $totalarray['nbfield']++; + // Phone + if (!empty($arrayfields['p.phone']['checked'])) { + print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Phone mobile - if (!empty($arrayfields['p.phone_mobile']['checked'])) { - print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; - if (!$i) { - $totalarray['nbfield']++; + // Phone perso + if (!empty($arrayfields['p.phone_perso']['checked'])) { + print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // Fax - if (!empty($arrayfields['p.fax']['checked'])) { - print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; - if (!$i) { - $totalarray['nbfield']++; + // Phone mobile + if (!empty($arrayfields['p.phone_mobile']['checked'])) { + print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // EMail - if (!empty($arrayfields['p.email']['checked'])) { - print ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).''; - if (!$i) { - $totalarray['nbfield']++; + // Fax + if (!empty($arrayfields['p.fax']['checked'])) { + print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - // No EMail - if (!empty($arrayfields['unsubscribed']['checked'])) { - print ''; - if (empty($obj->email)) { - //print ''.$langs->trans("NoEmail").''; - } else { - print yn(($obj->unsubscribed > 0) ? 1 : 0); + // EMail + if (!empty($arrayfields['p.email']['checked'])) { + print ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).''; + if (!$i) { + $totalarray['nbfield']++; + } } - print ''; - if (!$i) { - $totalarray['nbfield']++; + // No EMail + if (!empty($arrayfields['unsubscribed']['checked'])) { + print ''; + if (empty($obj->email)) { + //print ''.$langs->trans("NoEmail").''; + } else { + print yn(($obj->unsubscribed > 0) ? 1 : 0); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } - } - if (isModEnabled('socialnetworks')) { - foreach ($socialnetworks as $key => $value) { - if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { - print ''.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).''; - if (!$i) { - $totalarray['nbfield']++; + if (isModEnabled('socialnetworks')) { + foreach ($socialnetworks as $key => $value) { + if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { + print ''.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).''; + if (!$i) { + $totalarray['nbfield']++; + } } } } - } - // Company - if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { - print ''; - if ($obj->socid) { - $objsoc = new Societe($db); - $objsoc->fetch($obj->socid); - print $objsoc->getNomUrl(1); - } else { - print ' '; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Private/Public - if (!empty($arrayfields['p.priv']['checked'])) { - print ''.$contactstatic->LibPubPriv($obj->priv).''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) { - // Prospect level - print ''; - print $contactstatic->getLibProspLevel(); - print ""; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) { - // Prospect status - print '
'; - print '
'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto); - print '
-
'; - foreach ($contactstatic->cacheprospectstatus as $key => $val) { - $titlealt = 'default'; - if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) { - $titlealt = $val['label']; + // Company + if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { + print ''; + if ($obj->socid) { + $objsoc = new Societe($db); + $objsoc->fetch($obj->socid); + print $objsoc->getNomUrl(1); + } else { + print ' '; } - if ($obj->stcomm_id != $val['id']) { - print ''.img_action($titlealt, $val['code'], $val['picto']).''; + print ''; + if (!$i) { + $totalarray['nbfield']++; } } - print '
'; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['p.datec']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['p.tms']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['p.statut']['checked'])) { - print ''.$contactstatic->getLibStatut(5).''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Import key - if (!empty($arrayfields['p.import_key']['checked'])) { - print ''; - print dol_escape_htmltag($obj->import_key); - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Action column - if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; - if ($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($obj->rowid, $arrayofselected)) { - $selected = 1; + // Private/Public + if (!empty($arrayfields['p.priv']['checked'])) { + print ''.$contactstatic->LibPubPriv($obj->priv).''; + if (!$i) { + $totalarray['nbfield']++; } - print ''; } - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - print "\n"; + if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) { + // Prospect level + print ''; + print $contactstatic->getLibProspLevel(); + print ""; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) { + // Prospect status + print '
'; + print '
'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto); + print '
-
'; + foreach ($contactstatic->cacheprospectstatus as $key => $val) { + $titlealt = 'default'; + if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) { + $titlealt = $val['label']; + } + if ($obj->stcomm_id != $val['id']) { + print ''.img_action($titlealt, $val['code'], $val['picto']).''; + } + } + print '
'; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (!empty($arrayfields['p.datec']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date modification + if (!empty($arrayfields['p.tms']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Status + if (!empty($arrayfields['p.statut']['checked'])) { + print ''.$contactstatic->getLibStatut(5).''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Import key + if (!empty($arrayfields['p.import_key']['checked'])) { + print ''; + print dol_escape_htmltag($obj->import_key); + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + if ($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($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + + print "\n"; + } $i++; } From c142a79a46cba5ed8b121a63f702fff2048546c4 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 20 Dec 2022 15:00:54 +0100 Subject: [PATCH 24/67] close input field --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 59f504ec886..3a53fad67a8 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -809,7 +809,7 @@ print ''; //print ''; print ''; print ''; -print ''; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1); From 7367d77cb184da08c0f7ff1715fd695beb3b9465 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 20 Dec 2022 17:00:15 +0100 Subject: [PATCH 25/67] Add mode Kanban to expedition list --- htdocs/core/class/commonobjectline.class.php | 33 ++ htdocs/expedition/list.php | 422 ++++++++++--------- 2 files changed, 255 insertions(+), 200 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 972ab7e4476..58dd0566f8e 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -166,4 +166,37 @@ abstract class CommonObjectLine extends CommonObject { return 0; } + + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '') + { + global $db, $langs; + $return = '
'; + $return .= '
'; + $return .= ''; + $return .= img_picto('', $this->picto); + //$return .= ''; // Can be image + $return .= ''; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : '').''; + if (property_exists($this, 'date_delivery')) { + $return .= '
'.dol_print_date($db->jdate($this->date_delivery), "dayhour").''; + } + if (property_exists($this, 'town') && !empty($this->town)) { + $return .= '
'.$langs->trans("Town").''; + $return .= ' : '.$this->town.''; + } + if (method_exists($this, 'getLibStatut')) { + $return .= '
'.$this->getLibStatut(5).'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 14544087647..0d73dbd3438 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -78,6 +78,7 @@ $search_sale = GETPOST('search_sale', 'int'); $search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_product_category = GETPOST('search_product_category', 'int'); $optioncss = GETPOST('optioncss', 'alpha'); +$mode = GETPOST('mode', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -489,6 +490,9 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); $expedition = new Expedition($db); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -577,7 +581,10 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); // $url = DOL_URL_ROOT.'/expedition/card.php?action=create'; // if (!empty($socid)) $url .= '&socid='.$socid; // $newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url, '', $user->rights->expedition->creer); -$newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2', '', $user->rights->expedition->creer); +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2', '', $user->rights->expedition->creer); $i = 0; print ''."\n"; @@ -589,6 +596,7 @@ print ''; print ''; print ''; +print ''; print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -892,213 +900,227 @@ while ($i < min($num, $limit)) { $object = new Expedition($db); $object->fetch($obj->rowid); - print ''; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; + print '
'; + } + $object->socid = $companystatic->getNomUrl(1); + $object->date_delivery = $obj->delivery_date; + $object->town = $obj->town; + print $object->getKanbanView(''); + if ($i == min($num, $limit) - 1) { + print '
'; + print ''; + } + } else { + print ''; - // Action column - if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; - if ($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($obj->rowid, $arrayofselected)) { - $selected = 1; + // Action column + if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + if ($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($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; - } - print ''; - } - // Ref - if (!empty($arrayfields['e.ref']['checked'])) { - print ''; - print $shipment->getNomUrl(1); - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Ref customer - if (!empty($arrayfields['e.ref_customer']['checked'])) { - print ""; - print $obj->ref_customer; - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Third party - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - print $companystatic->getNomUrl(1); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - print $obj->town; - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - print $obj->zip; - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print ''.$obj->state_name."\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Type ent - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - if (isset($typenArray[$obj->typent_code])) { - print $typenArray[$obj->typent_code]; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Weight - if (!empty($arrayfields['e.weight']['checked'])) { - print ''; - if (empty($object->trueWeight)) { - $tmparray = $object->getTotalWeightVolume(); - print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no'); - print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1); - } else { - print $object->trueWeight; - print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date delivery planed - if (!empty($arrayfields['e.date_delivery']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->delivery_date), "dayhour"); - print "\n"; - } - if (!empty($arrayfields['e.fk_shipping_method']['checked'])) { - // Get code using getLabelFromKey - $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); - print ''; - if ($shipment->shipping_method_id > 0) print $langs->trans("SendingMethod".strtoupper($code)); - print ''; - } - // Tracking number - if (!empty($arrayfields['e.tracking_number']['checked'])) { - $shipment->getUrlTrackingStatus($obj->tracking_number); - print ''.$shipment->tracking_url."\n"; - //print $form->editfieldval("TrackingNumber", 'tracking_number', $obj->tracking_url, $obj, $user->rights->expedition->creer, 'string', $obj->tracking_number); - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) { - $shipment->fetchObjectLinked($shipment->id, $shipment->element); - $receiving = ''; - if (is_array($shipment->linkedObjects['delivery']) && count($shipment->linkedObjects['delivery']) > 0) { - $receiving = reset($shipment->linkedObjects['delivery']); - } - - if (!empty($arrayfields['l.ref']['checked'])) { - // Ref - print ''; - print !empty($receiving) ? $receiving->getNomUrl($db) : ''; print ''; } - - if (!empty($arrayfields['l.date_delivery']['checked'])) { - // Date received - print ''; - print dol_print_date($db->jdate($obj->date_reception), "day"); - print ''."\n"; - } - } - - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['e.datec']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['e.tms']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['e.fk_statut']['checked'])) { - print ''.$shipment->LibStatut($obj->fk_statut, 5).''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Billed - if (!empty($arrayfields['e.billed']['checked'])) { - print ''.yn($obj->billed).''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Action column - if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; - if ($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($obj->rowid, $arrayofselected)) { - $selected = 1; + // Ref + if (!empty($arrayfields['e.ref']['checked'])) { + print ''; + print $shipment->getNomUrl(1); + print "\n"; + if (!$i) { + $totalarray['nbfield']++; } - print ''; } - print ''; - } - if (!$i) { - $totalarray['nbfield']++; - } - print "\n"; + // Ref customer + if (!empty($arrayfields['e.ref_customer']['checked'])) { + print ""; + print $obj->ref_customer; + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Third party + if (!empty($arrayfields['s.nom']['checked'])) { + print ''; + print $companystatic->getNomUrl(1); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Town + if (!empty($arrayfields['s.town']['checked'])) { + print ''; + print $obj->town; + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Zip + if (!empty($arrayfields['s.zip']['checked'])) { + print ''; + print $obj->zip; + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // State + if (!empty($arrayfields['state.nom']['checked'])) { + print ''.$obj->state_name."\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Country + if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; + $tmparray = getCountry($obj->fk_pays, 'all'); + print $tmparray['label']; + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Type ent + if (!empty($arrayfields['typent.code']['checked'])) { + print ''; + if (isset($typenArray[$obj->typent_code])) { + print $typenArray[$obj->typent_code]; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Weight + if (!empty($arrayfields['e.weight']['checked'])) { + print ''; + if (empty($object->trueWeight)) { + $tmparray = $object->getTotalWeightVolume(); + print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no'); + print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1); + } else { + print $object->trueWeight; + print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date delivery planed + if (!empty($arrayfields['e.date_delivery']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->delivery_date), "dayhour"); + print "\n"; + } + if (!empty($arrayfields['e.fk_shipping_method']['checked'])) { + // Get code using getLabelFromKey + $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); + print ''; + if ($shipment->shipping_method_id > 0) print $langs->trans("SendingMethod".strtoupper($code)); + print ''; + } + // Tracking number + if (!empty($arrayfields['e.tracking_number']['checked'])) { + $shipment->getUrlTrackingStatus($obj->tracking_number); + print ''.$shipment->tracking_url."\n"; + //print $form->editfieldval("TrackingNumber", 'tracking_number', $obj->tracking_url, $obj, $user->rights->expedition->creer, 'string', $obj->tracking_number); + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked'])) { + $shipment->fetchObjectLinked($shipment->id, $shipment->element); + $receiving = ''; + if (is_array($shipment->linkedObjects['delivery']) && count($shipment->linkedObjects['delivery']) > 0) { + $receiving = reset($shipment->linkedObjects['delivery']); + } + + if (!empty($arrayfields['l.ref']['checked'])) { + // Ref + print ''; + print !empty($receiving) ? $receiving->getNomUrl($db) : ''; + print ''; + } + + if (!empty($arrayfields['l.date_delivery']['checked'])) { + // Date received + print ''; + print dol_print_date($db->jdate($obj->date_reception), "day"); + print ''."\n"; + } + } + + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (!empty($arrayfields['e.datec']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date modification + if (!empty($arrayfields['e.tms']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Status + if (!empty($arrayfields['e.fk_statut']['checked'])) { + print ''.$shipment->LibStatut($obj->fk_statut, 5).''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Billed + if (!empty($arrayfields['e.billed']['checked'])) { + print ''.yn($obj->billed).''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + if ($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($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + + print "\n"; + } $i++; } From 6e671ee44c6b8457c112bfe694f9b94962447aee Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 22 Dec 2022 14:04:22 +0100 Subject: [PATCH 26/67] modify variable db --- htdocs/core/class/commonobjectline.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 58dd0566f8e..e39087a4309 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -175,7 +175,7 @@ abstract class CommonObjectLine extends CommonObject */ public function getKanbanView($option = '') { - global $db, $langs; + global $langs; $return = '
'; $return .= '
'; $return .= ''; @@ -185,7 +185,7 @@ abstract class CommonObjectLine extends CommonObject $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : '').''; if (property_exists($this, 'date_delivery')) { - $return .= '
'.dol_print_date($db->jdate($this->date_delivery), "dayhour").''; + $return .= '
'.dol_print_date($this->db->jdate($this->date_delivery), "dayhour").''; } if (property_exists($this, 'town') && !empty($this->town)) { $return .= '
'.$langs->trans("Town").''; From 5c2425bd2bd45a29a0522c8f185ffc9e8cfbab6e Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 22 Dec 2022 14:36:55 +0100 Subject: [PATCH 27/67] fix --- htdocs/core/class/commonobjectline.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index e39087a4309..b116519ad53 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -167,7 +167,7 @@ abstract class CommonObjectLine extends CommonObject return 0; } - /** + /** * Return clicable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) From 4110669098b9507a3df30cfc6599d7cfe3c2d9b3 Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Thu, 22 Dec 2022 10:30:58 -0600 Subject: [PATCH 28/67] Update perf.php Check validate when BROTLI_COMPRESS is enable --- htdocs/admin/system/perf.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 6d7ef8f1863..a3c49ff6654 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -198,7 +198,7 @@ jQuery(document).ready(function() { compphpstring=getphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compphpstring);*/ - if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1)) + if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1 && compphpstring.indexOf("br") == -1)) { jQuery("#httpcompphpok").hide(); jQuery("#httpcompphpko").show(); @@ -238,7 +238,7 @@ jQuery(document).ready(function() { compcssstring=getcssurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getcssurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compcssstring);*/ - if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1)) + if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1 && compcssstring.indexOf("br") == -1)) { jQuery("#httpcompcssok").hide(); jQuery("#httpcompcssko").show(); @@ -278,7 +278,7 @@ jQuery(document).ready(function() { compcssphpstring=getcssphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getcssphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compcssphpstring);*/ - if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1)) + if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1 && compcssphpstring.indexOf("br") == -1)) { jQuery("#httpcompcssphpok").hide(); jQuery("#httpcompcssphpko").show(); @@ -318,7 +318,7 @@ jQuery(document).ready(function() { compimgstring=getimgurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getimgurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compimgstring);*/ - if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1)) + if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1 && compimgstring.indexOf("br") == -1)) { jQuery("#httpcompimgok").hide(); jQuery("#httpcompimgko").show(); @@ -358,7 +358,7 @@ jQuery(document).ready(function() { compjsstring=getjsurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'js:\'+getjsurl.getAllResponseHeaders()); */ /*alert(\'js:\'+compjsstring);*/ - if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1)) + if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1 && compjsstring.indexOf("br") == -1)) { jQuery("#httpcompjsok").hide(); jQuery("#httpcompjsko").show(); @@ -398,7 +398,7 @@ jQuery(document).ready(function() { compjsphpstring=getjsphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getjsphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compjsphpstring);*/ - if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1)) + if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1 && compjsphpstring.indexOf("br") == -1)) { jQuery("#httpcompjsphpok").hide(); jQuery("#httpcompjsphpko").show(); From d7dd584d62826bd20cf67c0c2e15436a2b413f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 21:59:24 +0100 Subject: [PATCH 29/67] clean code --- htdocs/bookcal/admin/about.php | 27 +-------- .../admin/availabilities_extrafields.php | 27 +-------- htdocs/bookcal/admin/booking_extrafields.php | 27 +-------- htdocs/bookcal/admin/setup.php | 27 +-------- htdocs/bookcal/availabilities_agenda.php | 55 +----------------- htdocs/bookcal/availabilities_card.php | 56 +------------------ htdocs/bookcal/availabilities_contact.php | 34 +---------- htdocs/bookcal/availabilities_document.php | 55 +----------------- htdocs/bookcal/availabilities_list.php | 52 +---------------- htdocs/bookcal/availabilities_note.php | 55 +----------------- htdocs/bookcal/bookcalindex.php | 30 +--------- htdocs/bookcal/booking_agenda.php | 55 +----------------- htdocs/bookcal/booking_card.php | 56 +------------------ htdocs/bookcal/booking_contact.php | 34 +---------- htdocs/bookcal/booking_document.php | 55 +----------------- htdocs/bookcal/booking_list.php | 52 +---------------- htdocs/bookcal/booking_note.php | 55 +----------------- htdocs/core/modules/modBookCal.class.php | 7 +-- 18 files changed, 39 insertions(+), 720 deletions(-) diff --git a/htdocs/bookcal/admin/about.php b/htdocs/bookcal/admin/about.php index 85f0efcdebb..2ff4e874450 100644 --- a/htdocs/bookcal/admin/about.php +++ b/htdocs/bookcal/admin/about.php @@ -23,32 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; // Libraries require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/bookcal/admin/availabilities_extrafields.php b/htdocs/bookcal/admin/availabilities_extrafields.php index 9d16d7b5395..ba7dca39570 100644 --- a/htdocs/bookcal/admin/availabilities_extrafields.php +++ b/htdocs/bookcal/admin/availabilities_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; diff --git a/htdocs/bookcal/admin/booking_extrafields.php b/htdocs/bookcal/admin/booking_extrafields.php index 30122d95048..2e9163af158 100644 --- a/htdocs/bookcal/admin/booking_extrafields.php +++ b/htdocs/bookcal/admin/booking_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; diff --git a/htdocs/bookcal/admin/setup.php b/htdocs/bookcal/admin/setup.php index c4fd74404eb..ca9d571ebfe 100644 --- a/htdocs/bookcal/admin/setup.php +++ b/htdocs/bookcal/admin/setup.php @@ -23,32 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; global $langs, $user; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..299acca7374 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index b9f5277d4ae..fd3c310958b 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -22,64 +22,14 @@ * \brief Page to create/edit/view availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index dd01e8bf046..41508aaa46a 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -23,40 +23,12 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 5bab9356ee1..e7335bff74c 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 6c5b4c2ed64..9af4b65a022 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -22,58 +22,8 @@ * \brief List page for availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index faae7a08834..44ced158e03 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -22,60 +22,11 @@ * \brief Tab for notes on Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies")); diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index 1b4e360e4ce..6ec6ae6fb3e 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -25,35 +25,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..10a75fc9f8a 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page diff --git a/htdocs/bookcal/booking_card.php b/htdocs/bookcal/booking_card.php index 0240ab2dccc..3f041f0d79d 100644 --- a/htdocs/bookcal/booking_card.php +++ b/htdocs/bookcal/booking_card.php @@ -22,64 +22,14 @@ * \brief Page to create/edit/view booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); diff --git a/htdocs/bookcal/booking_contact.php b/htdocs/bookcal/booking_contact.php index 923976adb47..bb73368b770 100644 --- a/htdocs/bookcal/booking_contact.php +++ b/htdocs/bookcal/booking_contact.php @@ -23,40 +23,12 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/booking_document.php b/htdocs/bookcal/booking_document.php index 81342e1a7b6..c102597e189 100644 --- a/htdocs/bookcal/booking_document.php +++ b/htdocs/bookcal/booking_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index f4aac1e5ed8..c7ebdd6f378 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -22,58 +22,8 @@ * \brief List page for booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/bookcal/booking_note.php b/htdocs/bookcal/booking_note.php index f68ffcbd72b..c8b2de4e6ff 100644 --- a/htdocs/bookcal/booking_note.php +++ b/htdocs/bookcal/booking_note.php @@ -22,60 +22,11 @@ * \brief Tab for notes on Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies")); diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index 2703099cf77..c3066dbd2e0 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ class modBookCal extends DolibarrModules // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' // It is used to group modules by family in module setup page - $this->family = "other"; + $this->family = "projects"; // Module position in the family on 2 digits ('01', '10', '20', ...) $this->module_position = '50'; @@ -68,8 +68,6 @@ class modBookCal extends DolibarrModules // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'development'; - // Url to the file with your last numberversion of this module - //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; // Key used in llx_const table to save module status enabled/disabled (where BOOKCAL is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); @@ -140,7 +138,6 @@ class modBookCal extends DolibarrModules // Prerequisites $this->phpmin = array(7, 0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(17, -3); // Minimum version of Dolibarr required by module // Messages at activation $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','MX'='textmx'...) From 637fc95265a5dd034b68f15f33bb9df4f7d0283a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 22:29:24 +0100 Subject: [PATCH 30/67] clean code --- htdocs/adherents/agenda.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/resource/agenda.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/messaging.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index e13211fb239..918eaa5d27e 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -64,7 +64,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index b40ed122ec6..f18b29089d5 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 17fb19fe565..42706752427 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index f133d1bbd4b..82f32e61783 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..f6d7d6551dd 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} +}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..5706849ecc9 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} +}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 29706f48b49..1445a9aa8fe 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -81,7 +81,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 3a3c5440b30..b05f68d7680 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -41,7 +41,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 641c53e0f70..3bfbe912279 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -42,7 +42,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index cc314bd9bce..97f4c5453dc 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 1da6b4948b1..6aee4d6ed21 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 846202e26a0..5e52e6a9f81 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index a24f3a4caa2..52b56b1507a 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index b293a2dbdd7..48f080b633e 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index d7b84707b95..b7e88450f82 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -95,7 +95,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index ac944acc066..4203c0f2a19 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -50,7 +50,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index dd886fc70d7..6f25e5fd921 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index c0ecdb2ad0f..3588fd38acc 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index b62dfa5b00d..0497520a099 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -45,7 +45,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index a3c120d0a23..a7cb672c0ab 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 7fe5b4a0b9d..d965d5e30a0 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 04118f55572..c99bd98afe0 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -48,7 +48,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index f2f4d37484b..abfad7bd7e6 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -47,7 +47,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 8fddadcce11..a9378cefe1d 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -51,7 +51,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 9e6c10a0ccd..fde1ab154a3 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index c73d6ffe0b1..3f9011cce3f 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9111faedcb7..fb92fd44f33 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index f00d4223878..47f793f71ae 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -71,7 +71,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index bd06bd32e94..ee919d99314 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 17b9842c238..74c895a813a 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); From 328b62eeb4dc4e35aa50209a2a3b4a6c0139c792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 22:31:03 +0100 Subject: [PATCH 31/67] clean code --- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index f6d7d6551dd..c3e66a17257 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') +} // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index 5706849ecc9..dec1ebee921 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') +} // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { From ddc7e769618da9189f590472531fa87e26b2c66f Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Thu, 22 Dec 2022 17:45:13 -0600 Subject: [PATCH 32/67] Update assets.lang additional translations --- htdocs/langs/es_ES/assets.lang | 183 +++++++++++++++++++++++++++------ 1 file changed, 151 insertions(+), 32 deletions(-) diff --git a/htdocs/langs/es_ES/assets.lang b/htdocs/langs/es_ES/assets.lang index 99b1a479095..a3eb7fd150d 100644 --- a/htdocs/langs/es_ES/assets.lang +++ b/htdocs/langs/es_ES/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018-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 @@ -16,52 +16,171 @@ # # Generic # -Assets = Activos -NewAsset = Nuevo activo -AccountancyCodeAsset = Código contable (activo) -AccountancyCodeDepreciationAsset = Código contable (cuenta depreciación activo) -AccountancyCodeDepreciationExpense = Código contable (cuenta depreciación gastos) -NewAssetType=Nuevo tipo de activo -AssetsTypeSetup=Configuración tipos de activos -AssetTypeModified=Tipo de activo modificado -AssetType=Tipo de activo +NewAsset=Nuevo activo +AccountancyCodeAsset=Código contable (activo) +AccountancyCodeDepreciationAsset=Código de contabilidad (cuenta de activo de depreciación) +AccountancyCodeDepreciationExpense=Código contable (cuenta de gastos de depreciación) AssetsLines=Activos DeleteType=Eliminar -DeleteAnAssetType=Eliminar un tipo de activo -ConfirmDeleteAssetType=¿Está seguro de querer eliminar este tipo de activo? -ShowTypeCard=Ver tipo '%s' +DeleteAnAssetType=Eliminar un modelo de activo +ConfirmDeleteAssetType=¿Está seguro de que desea eliminar este modelo de activos? +ShowTypeCard=Mostrar modelo '%s' # Module label 'ModuleAssetsName' -ModuleAssetsName = Activos +ModuleAssetsName=Activos # Module description 'ModuleAssetsDesc' -ModuleAssetsDesc = Descripción bien +ModuleAssetsDesc=Descripción de los activos # # Admin page # -AssetsSetup = Configuración activos -Settings = Configuraciones -AssetsSetupPage = Configuración activos -ExtraFieldsAssetsType = Campos adicionales (tipos de activos) -AssetsType=Tipo de activo -AssetsTypeId=Id tipo de activo -AssetsTypeLabel=Etiqueta tipo de activo -AssetsTypes=Tipos de activos +AssetSetup=Configuración de activos +AssetSetupPage=Página de configuración de activos +ExtraFieldsAssetModel=Atributos complementarios (Modelo de activos) + +AssetsType=Modelo de activos +AssetsTypeId=Id. de modelo de activo +AssetsTypeLabel=Etiqueta del modelo de activos +AssetsTypes=Modelos de activos +ASSET_ACCOUNTANCY_CATEGORY=Grupo de contabilidad de activos fijos # # Menu # -MenuAssets = Activos -MenuNewAsset = Nuevo bien -MenuTypeAssets = Tipo de activos -MenuListAssets = Listado -MenuNewTypeAssets = Nuevo -MenuListTypeAssets = Listado +MenuAssets=Activos +MenuNewAsset=Nuevo activo +MenuAssetModels=Activos del modelo +MenuListAssets=Lista +MenuNewAssetModel=Modelo del nuevo activo +MenuListAssetModels=Lista # # Module # +ConfirmDeleteAsset=¿Realmente desea eliminar este recurso? + +# +# Tab +# +AssetDepreciationOptions=Opciones de depreciación +AssetAccountancyCodes=Cuentas contables +AssetDepreciation=Depreciación + +# +# Asset +# Asset=Activo -NewAssetType=Nuevo tipo de activo -NewAsset=Nuevo activo -ConfirmDeleteAsset=¿Está seguro de que desea eliminar este activo? +Assets=Activos +AssetReversalAmountHT=Cantidad de inversión (sin impuestos) +AssetAcquisitionValueHT=Importe de la adquisición (sin impuestos) +AssetRecoveredVAT=IVA recuperado +AssetReversalDate=Fecha de reversión +AssetDateAcquisition=Fecha de adquisición +AssetDateStart=Fecha de puesta en marcha +AssetAcquisitionType=Tipo de adquisición +AssetAcquisitionTypeNew=Nuevo +AssetAcquisitionTypeOccasion=Usado +AssetType=Tipo de activo +AssetTypeIntangible=Intangible +AssetTypeTangible=Tangible +AssetTypeInProgress=En progreso +AssetTypeFinancial=Financiero +AssetNotDepreciated=No depreciado +AssetDisposal=Disposición +AssetConfirmDisposalAsk=¿Está seguro de que desea deshacerse del activo %s? +AssetConfirmReOpenAsk=¿Está seguro de que desea reabrir el recurso %s? + +# +# Asset status +# +AssetInProgress=En progreso +AssetDisposed=Disposed +AssetRecorded=Contabilizado + +# +# Asset disposal +# +AssetDisposalDate=Fecha de eliminación +AssetDisposalAmount=Valor de enajenación +AssetDisposalType=Tipo de eliminación +AssetDisposalDepreciated=Depreciar el año de la transferencia +AssetDisposalSubjectToVat=Enajenación sujeta a IVA + +# +# Asset model +# +AssetModel=Modelo del activo +AssetModels=Modelos de activos + +# +# Asset depreciation options +# +AssetDepreciationOptionEconomic=Depreciación económica +AssetDepreciationOptionAcceleratedDepreciation=Depreciación acelerada (impuestos) +AssetDepreciationOptionDepreciationType=Tipo de depreciación +AssetDepreciationOptionDepreciationTypeLinear=Lineal +AssetDepreciationOptionDepreciationTypeDegressive=Degresivo +AssetDepreciationOptionDepreciationTypeExceptional=Excepcional +AssetDepreciationOptionDegressiveRate=Tasa decreciente +AssetDepreciationOptionAcceleratedDepreciation=Acelerado (impuesto) +AssetDepreciationOptionDuration=Duración +AssetDepreciationOptionDurationType=Tipo de duración +AssetDepreciationOptionDurationTypeAnnual=Anual +AssetDepreciationOptionDurationTypeMonthly=Mensual +AssetDepreciationOptionDurationTypeDaily=Diario +AssetDepreciationOptionRate=Tasa (%%) +AssetDepreciationOptionAmountBaseDepreciationHT=Base de amortización (sin IVA) +AssetDepreciationOptionAmountBaseDeductibleHT=Base deducible (sin IVA) +AssetDepreciationOptionTotalAmountLastDepreciationHT=Cantidad total de la última depreciación (sin IVA) + +# +# Asset accountancy codes +# +AssetAccountancyCodeDepreciationEconomic=Depreciación económica +AssetAccountancyCodeAsset=Activo +AssetAccountancyCodeDepreciationAsset=Depreciación +AssetAccountancyCodeDepreciationExpense=Gastos de depreciación +AssetAccountancyCodeValueAssetSold=Valor del activo enajenado +AssetAccountancyCodeReceivableOnAssignment=Cuenta por cobrar por enajenación +AssetAccountancyCodeProceedsFromSales=Productos de la eliminación +AssetAccountancyCodeVatCollected=IVA cobrado +AssetAccountancyCodeVatDeductible=IVA recuperado en activos +AssetAccountancyCodeDepreciationAcceleratedDepreciation=Depreciación acelerada (impuestos) +AssetAccountancyCodeAcceleratedDepreciation=Cuenta +AssetAccountancyCodeEndowmentAcceleratedDepreciation=Gastos de depreciación +AssetAccountancyCodeProvisionAcceleratedDepreciation=Reposesión/Provisión + +# +# Asset depreciation +# +AssetBaseDepreciationHT=Deprbase de liquidación (excl. IVA) +AssetDepreciationBeginDate=Inicio de depreciación el +AssetDepreciationDuration=Duración +AssetDepreciationRate=Tasa (%%) +AssetDepreciationDate=Fecha de depreciación +AssetDepreciationHT=Depreciación (sin IVA) +AssetCumulativeDepreciationHT=Depreciación acumulada (sin IVA) +AssetResidualHT=Valor residual (sin IVA) +AssetDispatchedInBookkeeping=Depreciación registrada +AssetFutureDepreciationLine=Depreciación futura +AssetDepreciationReversal=Reversión + +# +# Errors +# +AssetErrorAssetOrAssetModelIDNotProvide=No se proporcionó la identificación del recurso o el sonido del modelo +AssetErrorFetchAccountancyCodesForMode=Error al recuperar las cuentas contables para el modo de depreciación '%s' +AssetErrorDeleteAccountancyCodesForMode=Error al eliminar cuentas contables del modo de depreciación '%s' +AssetErrorInsertAccountancyCodesForMode=Error al insertar las cuentas contables del modo de depreciación '%s' +AssetErrorFetchDepreciationOptionsForMode=Error al recuperar opciones para el modo de depreciación '%s' +AssetErrorDeleteDepreciationOptionsForMode=Error al eliminar las opciones del modo de depreciación '%s' +AssetErrorInsertDepreciationOptionsForMode=Error al insertar las opciones del modo de depreciación '%s' +AssetErrorFetchDepreciationLines=Error al recuperar líneas de depreciación registradas +AssetErrorClearDepreciationLines=Error al purgar líneas de depreciación registradas (reversión y futuro) +AssetErrorAddDepreciationLine=Error al agregar una línea de depreciación +AssetErrorCalculationDepreciationLines=Error al calcular las líneas de depreciación (recuperación y futuro) +AssetErrorReversalDateNotProvidedForMode=No se proporciona la fecha de reversión para el método de depreciación '%s' +AssetErrorReversalDateNotGreaterThanCurrentBeginFiscalDateForMode=La fecha de reversión debe ser mayor o igual que el comienzo del año fiscal actual para el método de depreciación '%s' +AssetErrorReversalAmountNotProvidedForMode=No se proporciona el importe de reversión para el modo de depreciación '%s'. +AssetErrorFetchCumulativeDepreciation=Error al recuperar la cantidad de depreciación acumulada de la línea de depreciación +AssetErrorSetLastCumulativeDepreciation=Error al registrar el último monto de depreciación acumulada From 0d56ef8c1d330569d7814419374552352dab2329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:02:23 +0100 Subject: [PATCH 33/67] fix code --- htdocs/admin/stock.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/booking.class.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/core/lib/propal.lib.php | 2 +- htdocs/delivery/card.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 1d73f5238ad..7a7e49a3129 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -247,7 +247,7 @@ if (isModEnabled('commande')) { print "\n\n"; $found++; -//if (!empty($conf->expedition->enabled)) +//if (isModEnabled('expedition')) //{ print ''; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index cfbfc8eed88..3ccc4542670 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -74,7 +74,7 @@ class Availabilities extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled('multicurrency')' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) diff --git a/htdocs/bookcal/class/booking.class.php b/htdocs/bookcal/class/booking.class.php index a74cb87a43d..98cb5077844 100644 --- a/htdocs/bookcal/class/booking.class.php +++ b/htdocs/bookcal/class/booking.class.php @@ -74,7 +74,7 @@ class Booking extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled('multicurrency')' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 36c98a495ec..9d221411d9c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3066,7 +3066,7 @@ if ($action == 'create') { $remise_percent = (!empty($expesrc->remise_percent) ? $expesrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { $currency_code = (!empty($expesrc->currency_code) ? $expesrc->currency_code : (!empty($soc->currency_code) ? $soc->currency_code : $objectsrc->multicurrency_code)); $currency_tx = (!empty($expesrc->currency_tx) ? $expesrc->currency_tx : (!empty($soc->currency_tx) ? $soc->currency_tx : $objectsrc->currency_tx)); } diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 9d1401ea47a..3d380a3904a 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -42,7 +42,7 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) + if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && isModEnabled('expedition_bon') && $user->rights->expedition->lire) || (isModEnabled("expedition") && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) { $langs->load("sendings"); $text = ''; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index b98b75015ab..3a269cc89bb 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled("product") || isModEnabled("service")) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (!empty($conf->expedition_bon->enabled)) { +if (isModEnabled('expedition_bon')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('stock')) { From 669c8d10f43a7f5fb0482b109a7b2d0788a3a6d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 23 Dec 2022 14:10:39 +0100 Subject: [PATCH 34/67] fix path and traduction --- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9918616714d..693cf8eac67 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php + * \file htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php * \ingroup propale - * \brief File of the class allowing to generate the supplier propals to the Aurore model + * \brief File of the class allowing to generate the supplier proposals to the Aurore model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; From a08d84b995fa0291f1f220bd14d213b7ea8cd550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:11:13 +0100 Subject: [PATCH 35/67] fix code --- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- htdocs/comm/action/card.php | 10 +++++----- htdocs/comm/action/class/api_agendaevents.class.php | 4 ++-- htdocs/comm/action/document.php | 4 ++-- htdocs/comm/action/index.php | 8 ++++---- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/list.php | 2 +- .../stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- 37 files changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index f18b29089d5..f955594a5b0 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -181,7 +181,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print '' . $langs->trans("AddAction") . ''; } else { print '' . $langs->trans("AddAction") . ''; diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 42706752427..dfc69dc3fa5 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -183,7 +183,7 @@ if ($object->id > 0) { print '
'; // if (isModEnabled('agenda')) { - // if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + // if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { // print '' . $langs->trans("AddAction") . ''; // } else { // print '' . $langs->trans("AddAction") . ''; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 82f32e61783..3e06526f60f 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -225,7 +225,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..4bea892ae7e 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..7b65b510103 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 11b8330b64c..f0399fa6350 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -159,7 +159,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); /* @@ -218,7 +218,7 @@ if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedt } // Link to a project -if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create || +if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) { //$object->fetch($id); $object->setProject(GETPOST('projectid', 'int')); @@ -1093,7 +1093,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); -$permissiontoadd = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); +$permissiontoadd = ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -2466,14 +2466,14 @@ if ($id > 0) { $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($action != 'edit') { - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { print ''; } else { print ''; } - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { print ''; } else { diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 8c13709b250..c0accf82866 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -210,7 +210,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insufficient rights to create your Agenda Event"); } - if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { + if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) { throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } @@ -249,7 +249,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insufficient rights to create your Agenda Event"); } - if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { + if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) { throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 82cc7584c07..c37920f0d99 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -92,7 +92,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); $permissiontoadd = $usercancreate; @@ -305,7 +305,7 @@ if ($object->id > 0) { $modulepart = 'actions'; - $permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; + $permissiontoadd = $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create'); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ab814957e5b..5b51d48392b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -540,7 +540,7 @@ $viewmode .= ''; // To add a space before t $newcardbutton = ''; $newparam = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode); @@ -1703,7 +1703,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $curtime = dol_mktime(0, 0, 0, $month, $day, $year); $urltoshow = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam; $urltocreate = ''; - if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; $hourminsec = '100000'; $urltocreate = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); @@ -1722,7 +1722,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } print ''; print '
'; - if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { print ''; // Explicit link, usefull for nojs interfaces print img_picto($langs->trans("NewAction"), 'edit_add.png'); print ''; @@ -1849,7 +1849,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cssclass .= ' movable cursormove'; } } else { - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { $cssclass .= " movable cursormove"; } else { diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index d4588223b26..21651bb7446 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -53,7 +53,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); /* diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 5eb538d4e62..4be3195561e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -700,7 +700,7 @@ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec; $url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); -$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create); +$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')); $param .= '&mode='.$mode; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 61092df5665..ce33d0f40b2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -479,7 +479,7 @@ if (empty($reshook)) { $newcardbutton = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 5c5ef948c30..bd35fc16e7d 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -475,7 +475,7 @@ if (empty($reshook)) { $newparam = ''; $newcardbutton = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 1445a9aa8fe..2f5dea5535a 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -266,7 +266,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')); } - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index b05f68d7680..c3fa3756655 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -234,7 +234,7 @@ if ($id > 0) { $newcardbutton = ''; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage); $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 00defaf909c..d1d408656af 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12061,7 +12061,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n $out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' '; } - if (!empty($user->rights->agenda->allactions->create) || + if ($user->hasRight('agenda', 'allactions', 'create') || (($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && !empty($user->rights->agenda->myactions->create))) { $out .= ''; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index d9858a017e0..a7b3e0b09b1 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', 'langs'=>'commercial', 'position'=>101, - 'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)', + 'perms'=>'($user->rights->agenda->myactions->create||$user->hasRight('agenda', 'allactions', 'create'))', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', 'user'=>2 diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index fc3918a32f3..2ec9450bcfa 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -196,7 +196,7 @@ if ($permok) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 97f4c5453dc..76d48597c00 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -200,7 +200,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 6aee4d6ed21..9809aea6ec1 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -191,7 +191,7 @@ if ($object->id > 0) { if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 5e52e6a9f81..12d10825fad 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -200,7 +200,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 52b56b1507a..73d3ad17610 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -194,7 +194,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 48f080b633e..f5a71f0ccc2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -221,7 +221,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index b7e88450f82..fab00847eab 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 4203c0f2a19..75db1a21476 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -219,7 +219,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 6f25e5fd921..cfe8985349a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -220,7 +220,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 3588fd38acc..e21089730b8 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -197,7 +197,7 @@ if ($id > 0 || $ref) { $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1'; } - $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create'); $morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 14d43e038f1..411ab569a0b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -210,7 +210,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? $arrayfields = array( 'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), 'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10), - //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), + //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))), 'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10), 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10), 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11), diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 0497520a099..2f06badf2cc 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -201,7 +201,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index a7cb672c0ab..65d73751423 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -196,7 +196,7 @@ if (!empty($object->id)) { // Show link to add event if (isModEnabled('agenda')) { - $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('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/projet/messaging.php b/htdocs/projet/messaging.php index d965d5e30a0..b266b87700d 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -196,7 +196,7 @@ if (!empty($object->id)) { // Show link to add event if (isModEnabled('agenda')) { - $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('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 c99bd98afe0..0cb1e3a4f1f 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -221,7 +221,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index abfad7bd7e6..9a3a0e2fe7d 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -218,7 +218,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index fde1ab154a3..9df581a6999 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -178,7 +178,7 @@ if ($socid > 0) { // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index 3f9011cce3f..10a34c48dec 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -178,7 +178,7 @@ if ($socid > 0) { // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 74c895a813a..bf9cee2ec72 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -233,7 +233,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 777da58f92c..7739cec620e 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -223,7 +223,7 @@ if ($object->id > 0) { print '
'; if (!empty($conf->agenda->enabled)) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; From 1e9ab45947222a1f3941f8ba0aac66228e4bf941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:24:28 +0100 Subject: [PATCH 36/67] fix code --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index a7b3e0b09b1..38debb8633a 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', 'langs'=>'commercial', 'position'=>101, - 'perms'=>'($user->rights->agenda->myactions->create||$user->hasRight('agenda', 'allactions', 'create'))', + 'perms'=>'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', 'user'=>2 From 40f55e8f8e0c71ee87abf1a49d9bd21a61038761 Mon Sep 17 00:00:00 2001 From: Mo Date: Sat, 24 Dec 2022 03:19:12 +0100 Subject: [PATCH 37/67] correct to the right apostrophe in tow occurrences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no more message after this correction in Luxembourg plan comptable normalisé 2020 (PCN 2020) "Erreur lors du chargement du tableau de compte. Si certains comptes n’ont pas été chargés, vous pouvez toujours les entrer manuellement." --- htdocs/install/mysql/data/llx_accounting_account_lu.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_lu.sql b/htdocs/install/mysql/data/llx_accounting_account_lu.sql index 831ac6b8f08..06d4def6b51 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_lu.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_lu.sql @@ -207,7 +207,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17201, 'PCN2020-LUXEMBURG', 'ASSETS', '41229', 0, 'Corrections de valeur', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17202, 'PCN2020-LUXEMBURG', 'ASSETS', '42111', 0, 'Avances et acomptes', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17203, 'PCN2020-LUXEMBURG', 'ASSETS', '42119', 0, 'Corrections de valeur', '1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17204, 'PCN2020-LUXEMBURG', 'ASSETS', '4212', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17204, 'PCN2020-LUXEMBURG', 'ASSETS', '4212', 0, 'Cr./assoc. ou act.(aut. qu’ent. liées)', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17205, 'PCN2020-LUXEMBURG', 'ASSETS', '42121', 0, 'De Franco Vincent', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17206, 'PCN2020-LUXEMBURG', 'ASSETS', '42131', 0, 'Subventions d’investissement', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17207, 'PCN2020-LUXEMBURG', 'ASSETS', '42132', 0, 'Subventions d’exploitation', '1'); @@ -237,7 +237,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17231, 'PCN2020-LUXEMBURG', 'ASSETS', '42188', 0, 'Autres créances diverses', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17232, 'PCN2020-LUXEMBURG', 'ASSETS', '42189', 0, 'Corrections de valeur', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17233, 'PCN2020-LUXEMBURG', 'ASSETS', '4221', 0, 'Personnel - Avances et acomptes', '1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17234, 'PCN2020-LUXEMBURG', 'ASSETS', '4222', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17234, 'PCN2020-LUXEMBURG', 'ASSETS', '4222', 0, 'Cr./assoc. ou act.(aut. qu’ent. liées)', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17235, 'PCN2020-LUXEMBURG', 'ASSETS', '42231', 0, 'Subventions d’investissement', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17236, 'PCN2020-LUXEMBURG', 'ASSETS', '42232', 0, 'Subventions d’exploitation', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17237, 'PCN2020-LUXEMBURG', 'ASSETS', '42238', 0, 'Autres subventions', '1'); From d3a0ad068705328a6957621a5569ce10617690fa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:29:23 +0100 Subject: [PATCH 38/67] Warning: count(): Parameter must be an array or an object --- htdocs/core/boxes/box_actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index fb0f93086d2..ac0df03184a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -220,7 +220,9 @@ class box_actions extends ModeleBoxes if (!empty($conf->global->SHOW_DIALOG_HOMEPAGE)) { $actioncejour = false; $contents = $this->info_box_contents; - $nblines = count($contents); + if (is_countable($contents) && count($contents) > 0) { + $nblines = count($contents); + } if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) { $out .= '
trans("ActionsToDo").'">'; $out .= ''; From 344c241970a7f0d5012e383750bed8b3cb30a472 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:37:36 +0100 Subject: [PATCH 39/67] Warning: count(): Parameter must be an array or an object --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ae4afc695e6..77375200bc4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1567,7 +1567,9 @@ function dol_meta_create($object) } if (is_dir($dir)) { + if (is_countable($object->lines) && count($object->lines) > 0) { $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\" From 6df6f786df35cb6ab5c94faa739eea2c183f5f8c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 24 Dec 2022 14:38:11 +0000 Subject: [PATCH 40/67] Fixing style errors. --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 77375200bc4..452d0ca4bb5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1568,8 +1568,8 @@ function dol_meta_create($object) if (is_dir($dir)) { if (is_countable($object->lines) && count($object->lines) > 0) { - $nblines = count($object->lines); - } + $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\" From e1747f342f7ae5aa2c5206e1c752b6285208dee8 Mon Sep 17 00:00:00 2001 From: Mo Date: Sun, 25 Dec 2022 03:19:14 +0100 Subject: [PATCH 41/67] Add SARL-S for Luxembourg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The simplified limited liability company (Société à responsabilité limitée simplifiée – SARL-S) is a form of commercial company that is subject to rules that are somewhat different to those that apply to a conventional private limited liability company (Société à responsabilité limitée – SARL). La société à responsabilité limitée simplifiée (SARL-S) est une forme de société commerciale qui déroge à certaines règles propres à la société à responsabilité limitée (SARL) classique. https://guichet.public.lu/fr/entreprises/creation-developpement/forme-juridique/societe-capitaux/sarl-s.html --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index c35824fa235..af625035804 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -332,6 +332,7 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14006', 'Société anonyme (SA)', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14007', 'Société coopérative (SC)', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14008', 'Société européenne (SE)', 1); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14009', 'Société à responsabilité limitée simplifiée (SARL-S)', 1); -- Romania INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (188, '18801', 'AFJ - Alte forme juridice', 1); From b2a7894f724858113f1d27d6cdd6b1436789c881 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 25 Dec 2022 16:05:46 +0100 Subject: [PATCH 42/67] FIX: Show supplier product reference input field The title of ref_fournis is displayed but not the input field Here you have disabled the show of the title but not of the input field /* jQuery("#title_fourn_ref").hide(); */ --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 110b379c22f..f008aacc10e 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -1148,7 +1148,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery("#multicurrency_price_ttc").val('').hide(); jQuery("#title_up_ttc, #title_up_ttc_currency").hide(); - jQuery("#fourn_ref, #tva_tx, #title_vat").hide(); + jQuery("#tva_tx, #title_vat").hide(); /* jQuery("#title_fourn_ref").hide(); */ jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide(); jQuery("#buying_price").show(); From 2c940c5bf85a4759b67b90708c88c917f8665766 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 25 Dec 2022 22:20:27 +0100 Subject: [PATCH 43/67] Take the correct value of the product supplier ref --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6bc9ae679bb..bc9ab3cf2fd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1627,7 +1627,7 @@ if (empty($reshook)) { $productsupplier->fk_unit, 0, $pu_devise, - $ref_supplier, + GETPOST('fourn_ref', 'alpha'), '' ); } From 44c05ebca58d3e70cdb3e2108938067c2996d97d Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 26 Dec 2022 04:47:20 +0200 Subject: [PATCH 44/67] ADD Greek public holidays --- .../mysql/data/llx_c_hrm_public_holiday.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index a8e9ac3be80..772a9ad612f 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -7,6 +7,8 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2019 Markus Welters -- Copyright (C) 2022 Joachim Kueter +-- Copyright (C) 2022 Nick Fragoulis + -- -- 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 @@ -104,6 +106,20 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); +-- Greece (102) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΠΡΩΤΟΧΡΟΝΙΑ', 0, 102, '', 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΘΕΟΦΑΝΕΙΑ', 0, 102, '', 0, 1, 6, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-25Η ΜΑΡΤΙΟΥ', 0, 102, '', 0, 3, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΠΡΩΤΟΜΑΓΙΑ', 0, 102, '', 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΚΑΘΑΡΑ ΔΕΥΤΕΡΑ', 0, 102, 'ΚΑΘΑΡΑ_ΔΕΥΤΕΡΑ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΜΕΓΑΛΗ ΠΑΡΑΣΚΕΥΗ', 0, 102, 'ΜΕΓΑΛΗ_ΠΑΡΑΣΚΕΥΗ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΔΕΥΤΕΡΑ ΤΟΥ ΠΑΣΧΑ', 0, 102, 'ΔΕΥΤΕΡΑ_ΤΟΥ_ΠΑΣΧΑ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΤΟΥ ΑΓΙΟΥ ΠΝΕΥΜΑΤΟΣ', 0, 102, 'ΤΟΥ_ΑΓΙΟΥ_ΠΝΕΥΜΑΤΟΣ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΚΟΙΜΗΣΗ ΤΗΣ ΘΕΟΤΟΚΟΥ', 0, 102, '', 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-28Η ΟΚΤΩΒΡΙΟΥ', 0, 102, '', 0, 10, 28, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΧΡΙΣΤΟΥΓΕΝΝΑ', 0, 102, '', 0, 12, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΣΥΝΑΞΗ ΘΕΟΤΟΚΟΥ', 0, 102, '', 0, 12, 26, 1); + -- India (117) INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1); From f0a862712f4889afee5edfeb06db8e0bc0477cc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 12:44:16 +0100 Subject: [PATCH 45/67] Debug v17 --- htdocs/langs/en_US/mrp.lang | 6 +- .../modulebuilder/template/myobject_card.php | 66 +++++++++---------- htdocs/mrp/mo_agenda.php | 31 ++++----- htdocs/mrp/mo_card.php | 35 ++++------ htdocs/mrp/mo_document.php | 31 ++++----- htdocs/mrp/mo_movements.php | 33 ++++------ htdocs/mrp/mo_note.php | 31 ++++----- htdocs/mrp/mo_production.php | 33 ++++------ 8 files changed, 116 insertions(+), 150 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 442c5c92b1c..6bdea0cc951 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -11,8 +11,8 @@ Bom=Bills of Material BillOfMaterials=Bill of Materials BillOfMaterialsLines=Bill of Materials lines BOMsSetup=Setup of module BOM -ListOfBOMs=List of bills of material - BOM -ListOfManufacturingOrders=List of Manufacturing Orders +ListOfBOMs=Bills of material - BOM +ListOfManufacturingOrders=Manufacturing Orders NewBOM=New bill of materials ProductBOMHelp=Product to create (or disassemble) with this BOM.
Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. BOMsNumberingModules=BOM numbering templates @@ -116,3 +116,5 @@ ParentMo=MO Parent MOChild=MO Child BomCantAddChildBom=The nomenclature %s is already present in the tree leading to the nomenclature %s BOMNetNeeds = BOM Net Needs +BOMProductsList=BOM's products +BOMServicesList=BOM's services diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 4e80c81a4df..a91e93e6b51 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -321,9 +321,8 @@ if (($id || $ref) && $action == 'edit') { // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals(); - $head = myobjectPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("MyObject"), -1, $object->picto); $formconfirm = ''; @@ -389,39 +388,36 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref = '
'; /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - // Project - if (!empty($conf->project->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project') . ' '; - if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; - $morehtmlref .= ' : '; - if ($action == 'classify') { - //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $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)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; - } - } - }*/ + // Ref customer + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); + // Thirdparty + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + */ $morehtmlref .= '
'; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index ac944acc066..dbba6ed912a 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -151,33 +151,28 @@ if ($object->id > 0) { //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($permissiontoadd) { + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index aa3381c1242..026267a2243 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -135,7 +135,7 @@ if (empty($reshook)) { if ($cancel && !empty($backtopageforcancel)) { $backtopage = $backtopageforcancel; } - $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'MO_MODIFY'; // Name of trigger action code to execute when we modify record // Create MO with Childs if ($action == 'add' && empty($id) && !empty($TBomLineId)) { @@ -183,7 +183,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOST('projectid', 'int')); @@ -399,7 +399,6 @@ if (($id || $ref) && $action == 'edit') { // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_thirdparty(); - $res = $object->fetch_optionals(); $head = moPrepareHead($object); @@ -485,34 +484,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' '; - $morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 4e8808012e1..57998132a84 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -129,33 +129,28 @@ if ($object->id) { //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($permissiontoadd) { + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 086ccbf1978..96891186b3f 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -211,7 +211,7 @@ if (empty($reshook)) { $backtopage = DOL_URL_ROOT.'/mrp/mo_production.php?id='.($id > 0 ? $id : '__ID__'); } } - $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'MO_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -232,7 +232,7 @@ if (empty($reshook)) { //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOST('projectid', 'int')); @@ -326,33 +326,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= $proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 031018d0daa..47a01f388a6 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -105,33 +105,28 @@ if ($id > 0 || !empty($ref)) { //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($permissiontoadd) { + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 7bff43bfc7b..cf94710ce5d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -120,7 +120,7 @@ if (empty($reshook)) { $backtopage = DOL_URL_ROOT.'/mrp/mo_production.php?id='.($id > 0 ? $id : '__ID__'); } } - $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'MO_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -141,7 +141,7 @@ if (empty($reshook)) { //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { $object->setProject(GETPOST('projectid', 'int')); @@ -523,33 +523,28 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_soc, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= $proj->getNomUrl(); - } else { - $morehtmlref .= ''; + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } From 1368128743db85229e4376192370c28cc6602c43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 13:00:22 +0100 Subject: [PATCH 46/67] Debug v17 --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/mrp/mo_production.php | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 24e4a332e10..fe8397b8816 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4085,7 +4085,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'help', 'holiday', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'knowledgemanagement', - 'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', + 'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lock', 'lot', 'long-arrow-alt-right', 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next', 'off', 'on', 'order', 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce', @@ -4244,7 +4244,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'dynamicprice'=>'#a69944', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999', 'language'=>'#555', //'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', - 'lot'=>'#a69944', + 'lock'=>'#ddd', 'lot'=>'#a69944', 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'inventory'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944', 'other'=>'#ddd', 'world'=>'#986c6a', 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index cf94710ce5d..b5856b81a99 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -804,6 +804,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontodelete) { print '
'; } + // Split + print ''; + // SplitAll + print ''; print ''; } @@ -864,18 +868,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Qty print ''; // Cost price if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { From 08b81203f07036651be5855959decb7a97af6551 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 13:55:29 +0100 Subject: [PATCH 47/67] Debug v17 --- htdocs/core/lib/functions.lib.php | 7 +++++-- htdocs/societe/card.php | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fe8397b8816..be5a1283d73 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1718,7 +1718,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = * @param string $name A name for the html component * @param string $label Label shown in Popup title top bar * @param string $buttonstring button string - * @param string $url Relative Url to open + * @param string $url Relative Url to open. For example '/project/card.php' * @param string $disabled Disabled text * @param string $morecss More CSS * @param string $backtopagejsfields The back to page must be managed using javascript instead of a redirect. @@ -1752,13 +1752,16 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di } //print ''; - $out .= ''; + $out .= ''; $out .= 'use_javascript_ajax)) { $out .= ' href="'.DOL_URL_ROOT.$url.'" target="_blank"'; } $out .= '>'.$buttonstring.''; + if (!empty($conf->use_javascript_ajax)) { + // Add code to open url using the popup. Add also hidden field to retreive the returned variables + $out .= ''; $out .= ''; $out .= ''; $out .= ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e18f6987a33..b8443a065ff 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1341,6 +1341,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print ''; + print ''; print ''; print ''; print ''; From 144a7e01b44b9ad50a81dccd3f3c9789051e544d Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 26 Dec 2022 14:33:30 +0100 Subject: [PATCH 48/67] NEW remove default percentage for event creation url --- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index b40ed122ec6..b092be9ab06 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -171,7 +171,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid=' . urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid=' . urlencode($objcon->id) : '') . '&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid=' . urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 17fb19fe565..f157a0a2d33 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -173,7 +173,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid=' . urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid=' . urlencode($objcon->id) : '') . '&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid=' . urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index f133d1bbd4b..8adc1f07e21 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -215,7 +215,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.$objthirdparty->id; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1'; //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..bd2dc63d186 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -270,7 +270,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..99e2763d80a 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -270,7 +270,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 29706f48b49..d5f189636b5 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -262,7 +262,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') { $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : ''); } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&percentage=-1&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : '')); + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : '')); $out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')); } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 3a3c5440b30..70340a4a851 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -221,7 +221,7 @@ if ($id > 0) { { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index cc314bd9bce..2140a4356b3 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -190,7 +190,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 1da6b4948b1..11af9c609e3 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -183,7 +183,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 846202e26a0..12fb3ee5575 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -190,7 +190,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index a24f3a4caa2..d8159d39704 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -184,7 +184,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index b293a2dbdd7..aade7b9a5fd 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -211,7 +211,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index d7b84707b95..2476e08f83b 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -270,7 +270,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index ac944acc066..1b606487132 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -209,7 +209,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.$objthirdparty->id; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 20b3d5a8a2c..72f2a603b09 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -217,7 +217,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index c0ecdb2ad0f..ce080a17ccd 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -194,7 +194,7 @@ if ($id > 0 || $ref) { if (get_class($objproduct) == 'Product') { $out .= '&prodid='.$objproduct->id.'&origin=product&originid='.$id; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id; } $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index b62dfa5b00d..1bb62e06de1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -191,7 +191,7 @@ if ($object->id > 0) { if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 04118f55572..94a42a9a276 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -211,7 +211,7 @@ if ($object->id > 0) { $out .= '&socid='.$objthirdparty->id; } $backtopageurl = urlencode($_SERVER['PHP_SELF'].'?id='.$objthirdparty->id); - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$backtopageurl.'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$backtopageurl; //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index f2f4d37484b..aeaf23ba9f6 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -208,7 +208,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.$objthirdparty->id; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1'; //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 9e6c10a0ccd..e8fd2157cf7 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -156,7 +156,7 @@ if ($socid > 0) { if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') { $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '').'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objthirdparty->id > 0 ? '?socid='.$objthirdparty->id : '')); } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : ''); $out .= '&datep='.dol_print_date(dol_now(), 'dayhourlog'); } diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index c73d6ffe0b1..609218034e6 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -156,7 +156,7 @@ if ($socid > 0) { if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') { $out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '').'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objthirdparty->id > 0 ? '?socid='.$objthirdparty->id : '')); } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : ''); $out .= '&datep='.dol_print_date(dol_now(), 'dayhourlog'); } diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 17b9842c238..b8f2b4c8167 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -223,7 +223,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 777da58f92c..eebcafaa939 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -213,7 +213,7 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.urlencode($objthirdparty->id); } - $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1'; + $out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : ''); //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; From f6149903dc2d93bd3b9225414a1a3a275300b9c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 15:08:51 +0100 Subject: [PATCH 49/67] FIX bad selection of barcode numbering module --- htdocs/barcode/codeinit.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index f35547523c9..2293f7d9c27 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -64,14 +64,16 @@ if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) { if (preg_match('/^mod_barcode_product_.*php$/', $file)) { $file = substr($file, 0, dol_strlen($file) - 4); - try { - dol_include_once($dirroot.$file.'.php'); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - } + if ($file == $conf->global->BARCODE_PRODUCT_ADDON_NUM) { + try { + dol_include_once($dirroot.$file.'.php'); + } catch (Exception $e) { + dol_syslog($e->getMessage(), LOG_ERR); + } - $modBarCodeProduct = new $file(); - break; + $modBarCodeProduct = new $file(); + break; + } } } closedir($handle); From 9b22d1a8a13af7d3e3f094ab8130fab22e8b0f2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2022 15:14:55 +0100 Subject: [PATCH 50/67] WIP Work on dol_openinpopup --- htdocs/main.inc.php | 4 ++-- .../modulebuilder/template/myobject_card.php | 18 ++++++++++++++---- htdocs/projet/card.php | 7 ++++++- htdocs/societe/card.php | 10 ++++++---- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1188dd023ab..caed0fc2a7f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3081,7 +3081,7 @@ function main_area($title = '') { global $conf, $langs, $hookmanager; - if (empty($conf->dol_hide_leftmenu)) { + if (empty($conf->dol_hide_leftmenu) && !GETPOST('dol_openinpopup')) { print '
'; } @@ -3317,7 +3317,7 @@ if (!function_exists("llxFooter")) { print '
'."\n"; // End div fiche - if (empty($conf->dol_hide_leftmenu)) { + if (empty($conf->dol_hide_leftmenu) && !GETPOST('dol_openinpopup')) { print ' '."\n"; // End div id-right } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 4e80c81a4df..5d3f9dd4275 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -91,10 +91,16 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used +$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); +if (!empty($backtopagejsfields)) { + $tmpbacktopagejsfields = explode(':', $backtopagejsfields); + $dol_openinpopup = $tmpbacktopagejsfields[0]; +} + // Initialize technical objects $object = new MyObject($db); $extrafields = new ExtraFields($db); @@ -215,8 +221,6 @@ if (empty($reshook)) { /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -260,6 +264,12 @@ if ($action == 'create') { if ($backtopageforcancel) { print ''; } + if ($backtopagejsfields) { + print ''; + } + if ($dol_openinpopup) { + print ''; + } print dol_get_fiche_head(array(), ''); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 936633508fa..e7467176c10 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -51,7 +51,11 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'aZ09'); -$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); + +if (!empty($backtopagejsfields)) { + $tmpbacktopagejsfields = explode(':', $backtopagejsfields); + $dol_openinpopup = $tmpbacktopagejsfields[0]; +} $status = GETPOST('status', 'int'); $opp_status = GETPOST('opp_status', 'int'); @@ -527,6 +531,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; print ''; + print ''; print dol_get_fiche_head(); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e18f6987a33..9e4c3eff260 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -93,9 +93,13 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); -$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); +if (!empty($backtopagejsfields)) { + $tmpbacktopagejsfields = explode(':', $backtopagejsfields); + $dol_openinpopup = $tmpbacktopagejsfields[0]; +} + $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); if ($user->socid) { $socid = $user->socid; @@ -713,9 +717,6 @@ if (empty($reshook)) { if ($backtopagejsfields) { llxHeader('', '', ''); - $tmpbacktopagejsfields = explode(':', $backtopagejsfields); - $dol_openinpopup = $tmpbacktopagejsfields[0]; - $retstring = '
'; - $help = ''; + $help = ''; $picto = 'help'; if ($line->qty_frozen) { - $help .= ($help ? '
' : '').''.$langs->trans("QuantityFrozen").': '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; + $help = ($help ? '
' : '').''.$langs->trans("QuantityFrozen").': '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; + print $form->textwithpicto('', $help, -1, 'lock').' '; } if ($line->disable_stock_change) { - $help .= ($help ? '
' : '').''.$langs->trans("DisableStockChange").': '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; - } - if ($help) { - print $form->textwithpicto($line->qty, $help, -1); - } else { - print price2num($line->qty, 'MS'); + $help = ($help ? '
' : '').''.$langs->trans("DisableStockChange").': '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; + print $form->textwithpicto('', $help, -1, 'help').' '; } + print price2num($line->qty, 'MS'); print '