From ea8759e627cef4cc15b50c9a2d7d9128e5c5f911 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 21 May 2022 07:02:15 +0200 Subject: [PATCH 0001/1289] NEW Add trigger to record the event of sending an email from a project #20912 --- htdocs/core/actions_massactions.inc.php | 3 ++ ...terface_50_modAgenda_ActionsAuto.class.php | 13 +++++++ .../mysql/data/llx_c_action_trigger.sql | 1 + .../install/mysql/migration/16.0.0-17.0.0.sql | 38 +++++++++++++++++++ htdocs/langs/en_US/agenda.lang | 1 + 5 files changed, 56 insertions(+) create mode 100644 htdocs/install/mysql/migration/16.0.0-17.0.0.sql diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5acc6b22ee2..7951ce726dc 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -614,6 +614,9 @@ if (!$error && $massaction == 'confirm_presend') { if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') { $triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; } + if ($triggername == 'PROJET_SENTBYMAIL') { + $triggername = 'PROJECT_SENTBYMAIL'; + } if (!empty($triggername)) { // Call trigger diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 0e018514353..369751d3ac4 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -836,6 +836,19 @@ class InterfaceActionsAuto extends DolibarrTriggers } $object->sendtoid = 0; + } elseif ($action == 'PROJECT_SENTBYMAIL') { + // Load translation files required by the page + $langs->loadLangs(array("agenda", "other", "projects")); + + if (empty($object->actionmsg2)) { + $object->actionmsg2 = $langs->transnoentities("ProjectSentByEMail", $object->ref); + } + if (empty($object->actionmsg)) { + $object->actionmsg = $langs->transnoentities("ProjectSentByEMail", $object->ref); + } + + // Parameters $object->sendtoid defined by caller + //$object->sendtoid=0; } elseif ($action == 'TASK_CREATE') { // Project tasks // Load translation files required by the page diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index e4936c53ba3..83d4bb6e775 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -126,6 +126,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is modified','ticket',164); 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 new file mode 100644 index 00000000000..1277520b384 --- /dev/null +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -0,0 +1,38 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 16.0.0 or higher. +-- +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table; +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex; +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. +-- To rebuild sequence for postgresql after insert by forcing id autoincrement fields: +-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences(); + + +-- Missing in v16 or lower + + + +-- v17 +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 272ec22df5c..7c63886b0f7 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -86,6 +86,7 @@ SupplierInvoiceSentByEMail=Vendor invoice %s sent by email ShippingSentByEMail=Shipment %s sent by email ShippingValidated= Shipment %s validated InterventionSentByEMail=Intervention %s sent by email +ProjectSentByEMail=Project %s sent by email ProposalDeleted=Proposal deleted OrderDeleted=Order deleted InvoiceDeleted=Invoice deleted From 4e1dc2792cefa577b274fcadda5ab966ab6a2635 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 5 Jul 2022 13:58:35 +0200 Subject: [PATCH 0002/1289] Add default workstation in service card --- .../install/mysql/migration/15.0.0-16.0.0.sql | 3 + htdocs/install/mysql/tables/llx_product.sql | 1 + htdocs/langs/fr_FR/mrp.lang | 1 + htdocs/product/card.php | 21 +++ .../product/class/html.formproduct.class.php | 157 ++++++++++++++++++ htdocs/product/class/product.class.php | 11 +- 6 files changed, 192 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index b57cab5b4eb..c2cb299a63c 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -648,4 +648,7 @@ ALTER TABLE llx_paiement MODIFY COLUMN ext_payment_id varchar(255); ALTER TABLE llx_payment_donation MODIFY COLUMN ext_payment_id varchar(255); ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN ext_payment_id varchar(255); +ALTER TABLE llx_product ADD COLUMN fk_default_workstation integer DEFAULT NULL; + + diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 83e8882caa7..9b124c8fede 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -107,4 +107,5 @@ create table llx_product mandatory_period tinyint DEFAULT 0, -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action) fk_default_bom integer DEFAULT NULL + fk_default_workstation integer DEFAULT NULL )ENGINE=innodb; diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index e65244b584f..6211db86e72 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -91,6 +91,7 @@ WorkstationSetup = Configuration du module Poste de travail WorkstationSetupPage = Configuration du module Poste de travail WorkstationList=Liste des postes de travail WorkstationCreate=Ajouter un nouveau poste de travail +DefaultWorkstation=Poste de travail par défaut ConfirmEnableWorkstation=Voulez-vous vraiment activer le poste de travail %s? EnableAWorkstation=Activer le module Poste de travail ConfirmDisableWorkstation=Voulez-vous vraiment désactiver la station de travail %s? diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d0b7e4ece73..087c7bc11ce 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -52,6 +52,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; @@ -552,6 +553,7 @@ if (empty($reshook)) { $object->duration_value = $duration_value; $object->duration_unit = $duration_unit; $object->fk_default_warehouse = GETPOST('fk_default_warehouse'); + $object->fk_default_workstation = GETPOST('fk_default_workstation'); $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ?GETPOST('seuil_stock_alerte') : 0; $object->desiredstock = GETPOST('desiredstock') ?GETPOST('desiredstock') : 0; $object->canvas = GETPOST('canvas'); @@ -704,6 +706,7 @@ if (empty($reshook)) { $object->status_batch = GETPOST('status_batch', 'aZ09'); $object->batch_mask = GETPOST('batch_mask', 'alpha'); $object->fk_default_warehouse = GETPOST('fk_default_warehouse'); + $object->fk_default_workstation = GETPOST('fk_default_workstation'); // removed from update view so GETPOST always empty /* $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); @@ -1996,6 +1999,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; */ } + + if($object->isService() && $conf->workstation->enabled) { + // Default workstation + print ''.$langs->trans("DefaultWorkstation").''; + print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"'); + print $formproduct->selectWorkstations($object->fk_default_workstation, 'fk_default_workstation', 1); + print ''; + } + /* else { @@ -2475,6 +2487,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } + if($object->isService() && $conf->workstation->enabled) { + $workstation = new Workstation($db); + $workstation->fetch($object->fk_default_workstation); + + print ''.$langs->trans("DefaultWorkstation").''; + print (!empty($workstation->id) ? $workstation->getNomUrl(1) : ''); + print ''; + } + // Parent product. if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { $combination = new ProductCombination($db); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 4ede9e1e297..d6017877375 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -42,6 +42,7 @@ class FormProduct // Cache arrays public $cache_warehouses = array(); public $cache_lot = array(); + public $cache_workstations = array(); /** @@ -172,6 +173,63 @@ class FormProduct } } + /** + * Load in cache array list of workstations + * If fk_product is not 0, we do not use cache + * + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param array $exclude warehouses ids to exclude + * @param string $orderBy [='e.ref'] Order by + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + * @throws Exception + */ + public function loadWorkstations($fk_product = 0, $exclude = array(), $orderBy = 'w.ref') + { + global $conf, $langs; + + if (empty($fk_product) && count($this->cache_workstations)) { + return 0; // Cache already loaded and we do not want a list with information specific to a product + } + + $sql = "SELECT w.rowid, w.ref as label, w.type, w.nb_operators_required,w.thm_operator_estimated,w.thm_machine_estimated"; + $sql .= " FROM ".$this->db->prefix()."workstation_workstation as w"; + $sql .= " WHERE 1 = 1"; + if (!empty($fk_product) && $fk_product > 0) { + $sql .= " AND w.fk_product = ".((int) $fk_product); + } + $sql .= " AND w.entity IN (".getEntity('workstation').")"; + + if (is_array($exclude) && !empty($exclude)) { + $sql .= ' AND w.rowid NOT IN('.$this->db->sanitize(implode(',', $exclude)).')'; + } + + $sql .= " ORDER BY ".$orderBy; + + dol_syslog(get_class($this).'::loadWorkstations', LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + + $this->cache_workstations[$obj->rowid]['id'] = $obj->rowid; + $this->cache_workstations[$obj->rowid]['ref'] = $obj->ref; + $this->cache_workstations[$obj->rowid]['label'] = $obj->label; + $this->cache_workstations[$obj->rowid]['type'] = $obj->type; + $this->cache_workstations[$obj->rowid]['nb_operators_required'] = $obj->nb_operators_required; + $this->cache_workstations[$obj->rowid]['thm_operator_estimated'] = $obj->thm_operator_estimated; + $this->cache_workstations[$obj->rowid]['thm_machine_estimated'] = $obj->thm_machine_estimated; + $i++; + } + + return $num; + } else { + dol_print_error($this->db); + return -1; + } + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return full path to current warehouse in $tab (recursive function) @@ -320,6 +378,105 @@ class FormProduct return $out; } + /** + * Return list of workstations + * + * @param string|int $selected Id of preselected warehouse ('' or '-1' for no value, 'ifone' and 'ifonenodefault' = select value if one value otherwise no value, '-2' to use the default value from setup) + * @param string $htmlname Name of html select html + * @param int $empty 1=Can be empty, 0 if not + * @param int $disabled 1=Select is disabled + * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. + * @param string $empty_label Empty label if needed (only if $empty=1) + * @param int $forcecombo 1=Force combo iso ajax select2 + * @param array $events Events to add to select2 + * @param string $morecss Add more css classes to HTML select + * @param array $exclude Warehouses ids to exclude + * @param int $showfullpath 1=Show full path of name (parent ref into label), 0=Show only ref of current warehouse + * @param string $orderBy [='e.ref'] Order by + * @return string HTML select + * + * @throws Exception + */ + public function selectWorkstations($selected = '', $htmlname = 'idworkstations', $empty = 0, $disabled = 0, $fk_product = 0, $empty_label = '', $forcecombo = 0, $events = array(), $morecss = 'minwidth200', $exclude = array(), $showfullpath = 1, $orderBy = 'e.ref') + { + global $conf, $langs, $user, $hookmanager; + + dol_syslog(get_class($this)."::selectWorkstations $selected, $htmlname, $empty, $disabled, $fk_product, $empty_label, $forcecombo, $morecss", LOG_DEBUG); + + $out = ''; + if (!empty($fk_product) && $fk_product > 0) { + $this->cache_workstations = array(); + } + + $this->loadWorkstations($fk_product); + $nbofworkstations = count($this->cache_workstations); + + if ($conf->use_javascript_ajax && !$forcecombo) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $comboenhancement = ajax_combobox($htmlname, $events); + $out .= $comboenhancement; + } + + if (strpos($htmlname, 'search_') !== 0) { + if (empty($user->fk_workstation) || $user->fk_workstation == -1) { + if (($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WORKSTATION)) { + $selected = $conf->global->MAIN_DEFAULT_WORKSTATION; + } + } else { + if (($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WORKSTATION)) { + $selected = $user->fk_workstation; + } + } + } + + $out .= ' - + + print load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); + + $res = $object->fetchLinesbytype(0); + $object->calculateCosts(); + + if($res > 0) { + + print '
+ + - + '; - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print '
'; - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add products/services form - - - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } + + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; + + print "
\n"; + + mrpCollapseBomManagement(); + } - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; + $filtertype = 1; + + + $res = $object->fetchLinesbytype(1); + $object->calculateCosts(); + + if($res > 0) { + print load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); + + + print '
+ + + + + + '; + + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + } + + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; } - print ''; print "
\n"; - - mrpCollapseBomManagement(); } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 598c4c73945..f1c5803311b 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -23,6 +23,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -399,6 +400,56 @@ class BOM extends CommonObject return $result; } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLinesbytype($type = 0) + { + $this->lines = array(); + + $objectlineclassname = get_class($this).'Line'; + if (!class_exists($objectlineclassname)) { + $this->error = 'Error, class '.$objectlineclassname.' not found during call of fetchLinesCommon'; + return -1; + } + + $objectline = new $objectlineclassname($this->db); + + $sql = "SELECT ".$objectline->getFieldList('l'); + $sql .= " FROM ".$this->db->prefix().$objectline->table_element." as l"; + $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = l.fk_product"; + $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id); + $sql .= " AND p.fk_product_type = ". $type; + if (isset($objectline->fields['position'])) { + $sql .= $this->db->order('position', 'ASC'); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num_rows = $this->db->num_rows($resql); + $i = 0; + while ($i < $num_rows) { + $obj = $this->db->fetch_object($resql); + if ($obj) { + $newline = new $objectlineclassname($this->db); + $newline->setVarsFromFetchObj($obj); + + $this->lines[] = $newline; + } + $i++; + } + + return 1; + } else { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; + return -1; + } + } + + /** * Load list of objects in memory from the database. * @@ -1044,6 +1095,8 @@ class BOM extends CommonObject */ public function calculateCosts() { + global $conf; + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $this->unit_cost = 0; $this->total_cost = 0; @@ -1056,38 +1109,54 @@ class BOM extends CommonObject foreach ($this->lines as &$line) { $tmpproduct->cost_price = 0; $tmpproduct->pmp = 0; + $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading - if (empty($line->fk_bom_child)) { - $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading - if ($result < 0) { - $this->error = $tmpproduct->error; - return -1; - } - $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); - if (empty($line->unit_cost)) { - if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { - $line->unit_cost = $productFournisseur->fourn_unitprice; + if($tmpproduct->type == $tmpproduct::TYPE_PRODUCT) { + if (empty($line->fk_bom_child)) { + if ($result < 0) { + $this->error = $tmpproduct->error; + return -1; + } + $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); + if (empty($line->unit_cost)) { + if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { + $line->unit_cost = $productFournisseur->fourn_unitprice; + } + } + + $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); + + $this->total_cost += $line->total_cost; + } else { + $bom_child = new BOM($this->db); + $res = $bom_child->fetch($line->fk_bom_child); + if ($res > 0) { + $bom_child->calculateCosts(); + $line->childBom[] = $bom_child; + $this->total_cost += $bom_child->total_cost * $line->qty; + } else { + $this->error = $bom_child->error; + return -2; } } - - $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); - - $this->total_cost += $line->total_cost; } else { - $bom_child= new BOM($this->db); - $res = $bom_child->fetch($line->fk_bom_child); - if ($res>0) { - $bom_child->calculateCosts(); - $line->childBom[] = $bom_child; - $this->total_cost += $bom_child->total_cost * $line->qty; + if(!($conf->workstation->enabled)) { + $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); } else { - $this->error = $bom_child->error; - return -2; + + if($tmpproduct->fk_default_workstation){ + $workstation = new Workstation($this->db); + $workstation->fetch($tmpproduct->fk_default_workstation); + + $line->total_cost = price2num($line->qty * $workstation->thm_operator_estimated, 'MT'); + } } + $this->total_cost += $line->total_cost; } } $this->total_cost = price2num($this->total_cost, 'MT'); + if ($this->qty > 0) { $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); } elseif ($this->qty < 0) { diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 0a3a3b34e7a..82154dcb078 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -36,12 +36,17 @@ if (empty($object) || !is_object($object)) { } -global $forceall, $forcetoshowtitlelines; +global $forceall, $forcetoshowtitlelines, $filtertype; if (empty($forceall)) { $forceall = 0; } +if(empty($filtertype)) $filtertype = 0; +if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) { + $filtertype = -1; +} + // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete @@ -53,6 +58,7 @@ $objectline = new BOMLine($this->db); print "\n"; $nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines); + if ($nolinesbefore) { print ''; if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { @@ -62,16 +68,25 @@ if ($nolinesbefore) { print '
'.$langs->trans('AddNewLine').''; print ''; print ''.$langs->trans('Qty').''; - if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print ''; - print ''; - print $langs->trans('Unit'); - print ''; + + if($filtertype != 1) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + print ''; + print ''; + print $langs->trans('Unit'); + print ''; + } + print '' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . ''; + print '' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . ''; + print '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . ''; } - print ''.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).''; - print ''.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).''; - print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; - print ' '; + else { + print '' . $form->textwithpicto($langs->trans('Unit'), '').''; + if($conf->workstation->enabled) print '' . $form->textwithpicto($langs->trans('Workstation'), '') . ''; + print '' . $form->textwithpicto($langs->trans('TotalCost'), '') . ''; + } + + print ' '; print ''; } print ''; @@ -88,14 +103,14 @@ print ''; // Predefined product/service if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - if (!empty($conf->global->BOM_SUB_BOM)) { + if($filtertype == 1){ + print $langs->trans("Service"); + } + elseif (!empty($conf->global->BOM_SUB_BOM)) { print $langs->trans("Product"); } echo ''; - $filtertype = 0; - if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) { - $filtertype = -1; - } + $statustoshow = -1; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer @@ -106,7 +121,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { echo ''; } -if (!empty($conf->global->BOM_SUB_BOM)) { +if (!empty($conf->global->BOM_SUB_BOM) && $filtertype!=1) { print '
'.$langs->trans("or").'
'.$langs->trans("BOM"); // TODO Add component to select a BOM $form->select_bom(); @@ -118,35 +133,53 @@ $coldisplay++; print ''; print ''; -if (!empty($conf->global->PRODUCT_USE_UNITS)) { +if($filtertype != 1) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + $coldisplay++; + print ''; + print ''; + } + $coldisplay++; - print ''; + print ''; + print ''; + + $coldisplay++; + print ''; + print ''; + + $coldisplay++; + print ''; + print ''; + print ''; + + $coldisplay++; + print ''; + print ' '; + print ''; +} else { + $coldisplay++; + print ''; + print ' '; + print ''; + + $coldisplay++; + print ''; + print ' '; + print ''; + + $coldisplay++; + print ''; + print ' '; print ''; } -$coldisplay++; -print ''; -print ''; + $coldisplay += $colspan; + print ''; + print ''; + print ''; + print ''; -$coldisplay++; -print ''; -print ''; - -$coldisplay++; -print ''; -print ''; -print ''; - -$coldisplay++; -print ''; -print ' '; -print ''; - -$coldisplay += $colspan; -print ''; -print ''; -print ''; -print ''; if (is_object($objectline)) { print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', 1, 'line'); diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index e5f24fa994f..7812c2fcc16 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -38,12 +38,14 @@ if (empty($object) || !is_object($object)) { } -global $forceall; +global $forceall, $filtertype; if (empty($forceall)) { $forceall = 0; } +if(empty($filtertype)) $filtertype = 0; + // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete @@ -108,28 +110,47 @@ if (($line->info_bits & 2) != 2) { } print ''; -if (!empty($conf->global->PRODUCT_USE_UNITS)) { +if($filtertype != 1) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + $coldisplay++; + print ''; + print ''; + } + $coldisplay++; - print ''; + print 'qty_frozen ? ' checked="checked"' : '')) . '>'; + print ''; + + $coldisplay++; + print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; + print ''; + + $coldisplay++; + print ''; + print ''; + + $coldisplay++; + print ''; + print ''; +} else { + + $coldisplay++; + print ''; + print ''; + + $coldisplay++; + print ''; + print ''; + + $coldisplay++; + print ''; + print ''; + + $coldisplay++; + print ''; print ''; } -$coldisplay++; -print 'qty_frozen ? ' checked="checked"' : '')).'>'; -print ''; - -$coldisplay++; -print 'disable_stock_change ? ' checked="checked"' : '')).'">'; -print ''; - -$coldisplay++; -print ''; -print ''; - -$coldisplay++; -print ''; -print ''; - $coldisplay += $colspan; print ''; $coldisplay += $colspan; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index dff3a38ccd2..498002cc50c 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -38,6 +38,10 @@ if (empty($object) || !is_object($object)) { print "Error, template page can't be called as URL"; exit; } + +global $filtertype; +if(empty($filtertype)) $filtertype = 0; + print "\n"; @@ -62,22 +66,31 @@ print ''; // Qty print ''.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).''; -if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print ''.$langs->trans('Unit').''; -} +if($filtertype != 1) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + print '' . $langs->trans('Unit') . ''; + } // Qty frozen -print ''.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).''; + print '' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . ''; // Disable stock change -print ''.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).''; + print '' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . ''; // Efficiency -print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; + print '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . ''; + +} else { + + print '' . $form->textwithpicto($langs->trans('Unit'), '').''; + + if($conf->workstation->enabled) print '' . $form->textwithpicto($langs->trans('Workstation'), '') . ''; +} // Cost print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; + print ''; // No width to allow autodim print ''; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 61b394a3b0f..dee6bdbde60 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -34,12 +34,17 @@ * $type, $text, $description, $line */ +require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; + // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error, template page can't be called as URL"; exit; } +global $filtertype; +if(empty($filtertype)) $filtertype = 0; + global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax, $langs; @@ -100,29 +105,50 @@ $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price print ''; -if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print ''; - $label = $tmpproduct->getLabelOfUnit('long'); - if ($label !== '') { - print $langs->trans($label); +if($filtertype != 1) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + print ''; + $label = $tmpproduct->getLabelOfUnit('long'); + if ($label !== '') { + print $langs->trans($label); + } + print ''; } + + print ''; + $coldisplay++; + echo $line->qty_frozen ? yn($line->qty_frozen) : ''; print ''; + print ''; + $coldisplay++; + echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formating role of function price + print ''; + + print ''; + $coldisplay++; + echo $line->efficiency; + print ''; +} else { + $product = new Product($object->db); + $res = $product->fetch($line->fk_product); + + //Unité + print ''; + $coldisplay++; + echo $product->duration_unit; + print ''; + + //Poste de travail + if($conf->workstation->enabled) { + $workstation = new Workstation($object->db); + $workstation->fetch($product->fk_default_workstation); + + print ''; + $coldisplay++; + echo $workstation->getNomUrl(); + print ''; + } } - -print ''; -$coldisplay++; -echo $line->qty_frozen ? yn($line->qty_frozen) : ''; -print ''; -print ''; -$coldisplay++; -echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formating role of function price -print ''; - -print ''; -$coldisplay++; -echo $line->efficiency; -print ''; - $total_cost = 0; print ''; $coldisplay++; diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 6211db86e72..f952be1100a 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,6 +82,8 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) +BOMProductsList=Liste des composants +BOMServicesList=Liste des services GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. ErrorAVirtualProductCantBeUsedIntoABomOrMo=Un kit ne peut pas être utilisé dans une Nomenclature ou un Ordre de fabrication. Workstation=Poste de travail From 6925dc2ae13430d3c7f5308a53d74cbe4f3c0df8 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 6 Jul 2022 15:00:07 +0200 Subject: [PATCH 0005/1289] Edit unit bom line service --- htdocs/bom/bom_card.php | 16 ++++++++-------- htdocs/bom/class/bom.class.php | 1 + htdocs/bom/tpl/objectline_create.tpl.php | 9 ++++++--- htdocs/bom/tpl/objectline_edit.tpl.php | 19 +++++++++++-------- htdocs/bom/tpl/objectline_view.tpl.php | 11 ++++++++++- .../install/mysql/migration/15.0.0-16.0.0.sql | 2 ++ .../install/mysql/tables/llx_bom_bomline.sql | 1 + 7 files changed, 39 insertions(+), 20 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 759c313cd3c..d448551c95e 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -167,7 +167,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - + $duration_unit = GETPOST('duration_unit','alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; @@ -191,6 +191,7 @@ if (empty($reshook)) { $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; + $bomline->duration_unit = $duration_unit; // Rang to use $rangmax = $object->line_max(0); @@ -225,6 +226,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); + $duration_unit = GETPOST('duration_unit','alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); @@ -237,6 +239,7 @@ if (empty($reshook)) { $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; + $bomline->duration_unit = $duration_unit; $result = $bomline->update($user); if ($result <= 0) { @@ -577,7 +580,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Form to add new line if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { if ($action != 'editline') { - // Add products/services form + // Add products form $parameters = array(); @@ -601,7 +604,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $filtertype = 1; - $res = $object->fetchLinesbytype(1); $object->calculateCosts(); @@ -609,7 +611,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); - print '
+ print ' @@ -633,11 +635,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Form to add new line if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { if ($action != 'editline') { - // Add products/services form - - + // Add services form $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index f1c5803311b..ae75c518990 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1299,6 +1299,7 @@ class BOMLine extends CommonObjectLine 'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'), 'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'), 'efficiency' => array('type'=>'double(24,8)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfEfficiencyConsumedMeans'), + 'duration_unit' => array('type'=>'varchar(6)', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), ); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 82154dcb078..4a0fe79e4a1 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -29,6 +29,8 @@ * $forceall (0 by default, 1 for supplier invoices/orders) */ +require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; + // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error: this template page cannot be called directly as an URL"; @@ -47,6 +49,7 @@ if (!empty($object->element) && $object->element == 'contrat' && empty($conf->gl $filtertype = -1; } +$formproduct = new FormProduct($object->db); // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete @@ -159,12 +162,12 @@ if($filtertype != 1) { print ''; } else { $coldisplay++; - print ''; - print ' '; + print ''; + print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1); print ''; $coldisplay++; - print ''; + print ''; print ' '; print ''; diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 7812c2fcc16..0790329c346 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -31,6 +31,9 @@ * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ +require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; + + // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error, template page can't be called as URL"; @@ -46,6 +49,8 @@ if (empty($forceall)) { if(empty($filtertype)) $filtertype = 0; +$formproduct = new FormProduct($object->db); + // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete @@ -135,20 +140,18 @@ if($filtertype != 1) { } else { $coldisplay++; - print ''; + print ''; + print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1); + print ''; + + $coldisplay++; + print ''; print ''; $coldisplay++; print ''; print ''; - $coldisplay++; - print ''; - print ''; - - $coldisplay++; - print ''; - print ''; } $coldisplay += $colspan; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index dee6bdbde60..c16360e429d 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -135,7 +135,16 @@ if($filtertype != 1) { //Unité print ''; $coldisplay++; - echo $product->duration_unit; + if ($line->qty > 1) { + $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + } elseif ($product->duration_value > 0) { + $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + } + if(!empty($line->duration_unit)){ + print (isset($dur[$line->duration_unit]) ? " ".$langs->trans($dur[$line->duration_unit])." " : ''); + } else { + print (!empty($product->duration_unit) && isset($dur[$product->duration_unit]) ? " " . $langs->trans($dur[$product->duration_unit]) . " " : ''); + } print ''; //Poste de travail diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index c2cb299a63c..3c31af497e9 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -650,5 +650,7 @@ ALTER TABLE llx_prelevement_facture_demande MODIFY COLUMN ext_payment_id varchar ALTER TABLE llx_product ADD COLUMN fk_default_workstation integer DEFAULT NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN duration_unit varchar(6) DEFAULT NULL; + diff --git a/htdocs/install/mysql/tables/llx_bom_bomline.sql b/htdocs/install/mysql/tables/llx_bom_bomline.sql index e7eae15fc15..c93484db92a 100644 --- a/htdocs/install/mysql/tables/llx_bom_bomline.sql +++ b/htdocs/install/mysql/tables/llx_bom_bomline.sql @@ -25,6 +25,7 @@ CREATE TABLE llx_bom_bomline( qty_frozen smallint DEFAULT 0, disable_stock_change smallint DEFAULT 0, efficiency double(24,8) NOT NULL DEFAULT 1, + duration_unit varchar(6) NULL, position integer NOT NULL DEFAULT 0 -- END MODULEBUILDER FIELDS ) ENGINE=innodb; From dadff083a414012c8ffd04f5029c0ab5cb8cb959 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 6 Jul 2022 16:17:22 +0200 Subject: [PATCH 0006/1289] Change unit dynamic --- htdocs/bom/ajax/ajax.php | 79 ++++++++++++++++++++++++ htdocs/bom/class/bom.class.php | 10 +-- htdocs/bom/tpl/objectline_create.tpl.php | 19 ++++++ htdocs/bom/tpl/objectline_view.tpl.php | 4 +- 4 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 htdocs/bom/ajax/ajax.php diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php new file mode 100644 index 00000000000..d8ea9650b09 --- /dev/null +++ b/htdocs/bom/ajax/ajax.php @@ -0,0 +1,79 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/ticket/ajax/ajax.php + * \brief Ajax component for Ticket. + */ + +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', '1'); // Disables token renewal +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', '1'); +} +// Do not check anti CSRF attack test +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +// If there is no need to load and show top and left menu +if (!defined("NOLOGIN")) { + define("NOLOGIN", '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +include_once '../../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + + +$action = GETPOST('action', 'aZ09'); +$idproduct = GETPOST('idproduct', 'int'); + + +/* + * View + */ + +top_httphead(); + +if ($action == 'getDurationUnitByProduct') { + + $product = new Product($db); + $res = $product->fetch($idproduct); + + if($res > 0){ + $return = $product->duration_unit; + } + + echo json_encode($return); + exit(); +} diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index ae75c518990..9638778db43 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1140,17 +1140,17 @@ class BOM extends CommonObject } } } else { - if(!($conf->workstation->enabled)) { - $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); - } else { - - if($tmpproduct->fk_default_workstation){ + if($conf->workstation->enabled){ + if($tmpproduct->fk_default_workstation) { $workstation = new Workstation($this->db); $workstation->fetch($tmpproduct->fk_default_workstation); $line->total_cost = price2num($line->qty * $workstation->thm_operator_estimated, 'MT'); } + } else { + $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); } + $this->total_cost += $line->total_cost; } } diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 4a0fe79e4a1..7a022c1172c 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -210,7 +210,26 @@ jQuery(document).ready(function() { if (editor) { editor.focus(); } } } + }); + + $('#idprod:nth-child(2)').change(function(){ + var idproduct = $(this).val(); + + console.log(idproduct); + $.ajax({ + url : "" + ,type: 'POST' + ,data: { + 'action': 'getDurationUnitByProduct' + ,'idproduct' : idproduct + } + }).done(function(data) { + var data = JSON.parse(data); + $('#duration_unit').val(data).change();; + }); + }); + }); diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index c16360e429d..540146b14fa 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -136,9 +136,9 @@ if($filtertype != 1) { print ''; $coldisplay++; if ($line->qty > 1) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("s"=>$langs->trans("Seconds"), "i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($product->duration_value > 0) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + $dur = array("s"=>$langs->trans("Second"), "i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } if(!empty($line->duration_unit)){ print (isset($dur[$line->duration_unit]) ? " ".$langs->trans($dur[$line->duration_unit])." " : ''); From 503e2310ea6e74e6d95ae562c76c98af33656866 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 6 Jul 2022 16:51:50 +0200 Subject: [PATCH 0007/1289] WIP --- htdocs/bom/class/bom.class.php | 12 ++++++++++-- htdocs/bom/tpl/objectline_edit.tpl.php | 2 +- htdocs/bom/tpl/objectline_title.tpl.php | 11 ++++++++--- htdocs/langs/fr_FR/mrp.lang | 1 + 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 9638778db43..3366ae1dda1 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1140,15 +1140,23 @@ class BOM extends CommonObject } } } else { + + if($line->duration_unit == 's') $qty = $line->qty / 3600; + if($line->duration_unit == 'i') $qty = $line->qty / 60; + if($line->duration_unit == 'd') $qty = $line->qty * 24; + if($line->duration_unit == 'w') $qty = $line->qty * 24 * 7; + if($line->duration_unit == 'm') $qty = $line->qty * 730.484; + if($line->duration_unit == 'y') $qty = $line->qty * 365 * 24; + if($conf->workstation->enabled){ if($tmpproduct->fk_default_workstation) { $workstation = new Workstation($this->db); $workstation->fetch($tmpproduct->fk_default_workstation); - $line->total_cost = price2num($line->qty * $workstation->thm_operator_estimated, 'MT'); + $line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT'); } } else { - $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); + $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); } $this->total_cost += $line->total_cost; diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 0790329c346..b669c936412 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -141,7 +141,7 @@ if($filtertype != 1) { $coldisplay++; print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1); + print $formproduct->selectMeasuringUnits("duration_unit", "time", ($line->duration_unit) ? $line->duration_unit : '', 0, 1); print ''; $coldisplay++; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 498002cc50c..d4cab0cb8e7 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -57,7 +57,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { // Product or sub-bom print ''.$langs->trans('Description'); -if (!empty($conf->global->BOM_SUB_BOM)) { +if (!empty($conf->global->BOM_SUB_BOM) && $filtertype != 1) { print '   '.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; } @@ -80,15 +80,20 @@ if($filtertype != 1) { // Efficiency print '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . ''; + // Cost + print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; + } else { print '' . $form->textwithpicto($langs->trans('Unit'), '').''; if($conf->workstation->enabled) print '' . $form->textwithpicto($langs->trans('Workstation'), '') . ''; + + // Cost + print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).''; } -// Cost -print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; + print ''; // No width to allow autodim diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index f952be1100a..845657408d8 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,6 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) +BOMTotalService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" BOMProductsList=Liste des composants BOMServicesList=Liste des services GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. From 16415a1c92ec249c3ace39c28075aab00310feeb Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 6 Jul 2022 17:28:29 +0200 Subject: [PATCH 0008/1289] Clean Code --- htdocs/bom/ajax/ajax.php | 4 ++-- htdocs/bom/bom_card.php | 12 ++++++------ htdocs/bom/class/bom.class.php | 17 ++++++++++++----- htdocs/bom/tpl/objectline_create.tpl.php | 8 +++----- htdocs/bom/tpl/objectline_view.tpl.php | 11 ++++------- htdocs/product/card.php | 2 +- 6 files changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index d8ea9650b09..ef99ab214d1 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/public/ticket/ajax/ajax.php - * \brief Ajax component for Ticket. + * \file htdocs/bom/ajax/ajax.php + * \brief Ajax component for BOM. */ if (!defined('NOTOKENRENEWAL')) { diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index d448551c95e..0700bad4c2a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -546,16 +546,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Lines */ - if (!empty($object->table_element_line)) { - print load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); - - $res = $object->fetchLinesbytype(0); + //Products + $res = $object->fetchLinesbytypeproduct(0); $object->calculateCosts(); if($res > 0) { + print load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); + print ' @@ -602,9 +602,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } + //Services $filtertype = 1; - - $res = $object->fetchLinesbytype(1); + $res = $object->fetchLinesbytypeproduct(1); $object->calculateCosts(); if($res > 0) { diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 3366ae1dda1..15d16c4c9fa 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -401,11 +401,13 @@ class BOM extends CommonObject } /** - * Load object lines in memory from the database + * Load object lines in memory from the database by type of product * + * @param int $typeproduct 0 type product, 1 type service + * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetchLinesbytype($type = 0) + public function fetchLinesbytypeproduct($typeproduct = 0) { $this->lines = array(); @@ -421,7 +423,7 @@ class BOM extends CommonObject $sql .= " FROM ".$this->db->prefix().$objectline->table_element." as l"; $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = l.fk_product"; $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id); - $sql .= " AND p.fk_product_type = ". $type; + $sql .= " AND p.fk_product_type = ". $typeproduct; if (isset($objectline->fields['position'])) { $sql .= $this->db->order('position', 'ASC'); } @@ -1141,6 +1143,7 @@ class BOM extends CommonObject } } else { + //Convert qty to hour if($line->duration_unit == 's') $qty = $line->qty / 3600; if($line->duration_unit == 'i') $qty = $line->qty / 60; if($line->duration_unit == 'd') $qty = $line->qty * 24; @@ -1151,9 +1154,13 @@ class BOM extends CommonObject if($conf->workstation->enabled){ if($tmpproduct->fk_default_workstation) { $workstation = new Workstation($this->db); - $workstation->fetch($tmpproduct->fk_default_workstation); + $res = $workstation->fetch($tmpproduct->fk_default_workstation); - $line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT'); + if($res > 0) $line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT'); + else { + $this->error = $workstation->error; + return -3; + } } } else { $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 7a022c1172c..f2f660bc711 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -163,7 +163,7 @@ if($filtertype != 1) { } else { $coldisplay++; print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1); + print $formproduct->selectMeasuringUnits("duration_unit", "time", 'h', 0, 1); print ''; $coldisplay++; @@ -196,8 +196,6 @@ jQuery(document).ready(function() { /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod").change(function() { - console.log("#idprod change triggered"); - /* To set focus */ if (jQuery('#idprod').val() > 0) { @@ -212,11 +210,11 @@ jQuery(document).ready(function() { } }); + + //change unit selected if we change service selected $('#idprod:nth-child(2)').change(function(){ var idproduct = $(this).val(); - - console.log(idproduct); $.ajax({ url : "" ,type: 'POST' diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 540146b14fa..1699c968794 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -129,32 +129,29 @@ if($filtertype != 1) { echo $line->efficiency; print ''; } else { - $product = new Product($object->db); - $res = $product->fetch($line->fk_product); - //Unité print ''; $coldisplay++; if ($line->qty > 1) { $dur = array("s"=>$langs->trans("Seconds"), "i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); - } elseif ($product->duration_value > 0) { + } elseif ($tmpproduct->duration_value > 0) { $dur = array("s"=>$langs->trans("Second"), "i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } if(!empty($line->duration_unit)){ print (isset($dur[$line->duration_unit]) ? " ".$langs->trans($dur[$line->duration_unit])." " : ''); } else { - print (!empty($product->duration_unit) && isset($dur[$product->duration_unit]) ? " " . $langs->trans($dur[$product->duration_unit]) . " " : ''); + print (!empty($tmpproduct->duration_unit) && isset($dur[$tmpproduct->duration_unit]) ? " " . $langs->trans($dur[$tmpproduct->duration_unit]) . " " : ''); } print ''; //Poste de travail if($conf->workstation->enabled) { $workstation = new Workstation($object->db); - $workstation->fetch($product->fk_default_workstation); + $res = $workstation->fetch($tmpproduct->fk_default_workstation); print ''; $coldisplay++; - echo $workstation->getNomUrl(); + if($res > 0) echo $workstation->getNomUrl(); print ''; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f9ac8da8d05..eb215839fb1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2496,7 +2496,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if($object->isService() && $conf->workstation->enabled) { $workstation = new Workstation($db); - $workstation->fetch($object->fk_default_workstation); + $res = $workstation->fetch($object->fk_default_workstation); print ''.$langs->trans("DefaultWorkstation").''; print (!empty($workstation->id) ? $workstation->getNomUrl(1) : ''); From 7c82fc5da6e1079c5c24372a719d525749cf4bf0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 8 Jul 2022 10:04:16 +0200 Subject: [PATCH 0009/1289] WIP --- htdocs/bom/bom_card.php | 3 ++- htdocs/bom/class/bom.class.php | 3 ++- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- htdocs/langs/fr_FR/mrp.lang | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 0700bad4c2a..46105f2b2cb 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -620,12 +620,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea '; if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + $tagidfortablednd = 'tablelinesservice'; include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } print '
'; if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; + print '
'; } if (!empty($object->lines)) { diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 15d16c4c9fa..cb520579d74 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1144,8 +1144,9 @@ class BOM extends CommonObject } else { //Convert qty to hour - if($line->duration_unit == 's') $qty = $line->qty / 3600; + if($line->duration_unit == 's') $qty = $line->qty / 3600; if($line->duration_unit == 'i') $qty = $line->qty / 60; + if($line->duration_unit == 'h') $qty = $line->qty; if($line->duration_unit == 'd') $qty = $line->qty * 24; if($line->duration_unit == 'w') $qty = $line->qty * 24 * 7; if($line->duration_unit == 'm') $qty = $line->qty * 730.484; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index d4cab0cb8e7..317908a749e 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -64,7 +64,7 @@ if (!empty($conf->global->BOM_SUB_BOM) && $filtertype != 1) { print ''; // Qty -print ''; +print ''; if($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 1699c968794..cef6b520264 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -65,7 +65,7 @@ if (empty($outputalsopricetotalwithtax)) { } // add html5 elements -$domData = ' data-element="'.$line->element.'"'; +$domData = ' data-element="'.$line->element.'service"'; $domData .= ' data-id="'.$line->id.'"'; $domData .= ' data-qty="'.$line->qty.'"'; $domData .= ' data-product_type="'.$line->product_type.'"'; diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 845657408d8..fc2563b8518 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,7 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) -BOMTotalService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" +BOMTotalCostService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" BOMProductsList=Liste des composants BOMServicesList=Liste des services GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. From d42d910c0820cc477d12ac5ec792936ae57bc5d1 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 8 Jul 2022 16:02:31 +0200 Subject: [PATCH 0010/1289] FIX Retours --- htdocs/bom/bom_card.php | 4 +++- htdocs/bom/class/bom.class.php | 2 +- htdocs/bom/tpl/objectline_create.tpl.php | 7 ++++--- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 46105f2b2cb..d4dd367e95e 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -160,7 +160,7 @@ if (empty($reshook)) { $idprod = $bom_child->fk_product; } } else { - $idprod = (int) GETPOST('idprod', 'int'); + $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); } $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); @@ -205,6 +205,7 @@ if (empty($reshook)) { $action = ''; } else { unset($_POST['idprod']); + unset($_POST['idprodservice']); unset($_POST['qty']); unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); @@ -247,6 +248,7 @@ if (empty($reshook)) { $action = ''; } else { unset($_POST['idprod']); + unset($_POST['idprodservice']); unset($_POST['qty']); unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index cb520579d74..3f3d88aad36 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1157,7 +1157,7 @@ class BOM extends CommonObject $workstation = new Workstation($this->db); $res = $workstation->fetch($tmpproduct->fk_default_workstation); - if($res > 0) $line->total_cost = price2num($qty * $workstation->thm_operator_estimated, 'MT'); + if($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); else { $this->error = $workstation->error; return -3; diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index f2f660bc711..3eea9235043 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -117,9 +117,10 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $statustoshow = -1; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); - } else { - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + } + else { + $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } echo ''; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 317908a749e..9ed44d8f503 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -87,7 +87,7 @@ if($filtertype != 1) { print ''; - if($conf->workstation->enabled) print ''; + if($conf->workstation->enabled) print ''; // Cost print ''; From 6564333e55ca335fec5ec58cbede492d93fed52b Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 12 Jul 2022 09:16:52 +0200 Subject: [PATCH 0011/1289] Change sjquery on select2 --- htdocs/bom/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 3eea9235043..55b14a0f650 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -214,7 +214,7 @@ jQuery(document).ready(function() { //change unit selected if we change service selected - $('#idprod:nth-child(2)').change(function(){ + $('#idprodservice').change(function(){ var idproduct = $(this).val(); $.ajax({ url : "" From 8a36e2e9d8a21c9499279d0ade31282f90c4583c Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 12 Jul 2022 09:21:51 +0200 Subject: [PATCH 0012/1289] =?UTF-8?q?M=C3=A0j=20column=20fk=5Ffedault=5Fwo?= =?UTF-8?q?rkstatio=20and=20duration=5Funit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index fa61ba725de..fb1ba0a8da2 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 @@ -55,3 +55,6 @@ ALTER TABLE llx_facture_fourn ADD COLUMN close_missing_amount double(24, 8) afte -- Allow users to make subscriptions of any amount during membership subscription ALTER TABLE llx_adherent_type ADD COLUMN caneditamount integer DEFAULT 0 AFTER amount; + +ALTER TABLE llx_product ADD COLUMN fk_default_workstation integer DEFAULT NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN duration_unit varchar(6) DEFAULT NULL; From c068eebc4361de2920005f2488c9512f235d36ce Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 12 Jul 2022 10:03:31 +0200 Subject: [PATCH 0013/1289] Add function "convertDurationtoHour" --- htdocs/bom/class/bom.class.php | 9 ++------- htdocs/core/lib/date.lib.php | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 1f3dd041aad..16c780a5751 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -24,6 +24,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -1128,13 +1129,7 @@ class BOM extends CommonObject } else { //Convert qty to hour - if($line->duration_unit == 's') $qty = $line->qty / 3600; - if($line->duration_unit == 'i') $qty = $line->qty / 60; - if($line->duration_unit == 'h') $qty = $line->qty; - if($line->duration_unit == 'd') $qty = $line->qty * 24; - if($line->duration_unit == 'w') $qty = $line->qty * 24 * 7; - if($line->duration_unit == 'm') $qty = $line->qty * 730.484; - if($line->duration_unit == 'y') $qty = $line->qty * 365 * 24; + $qty = convertDurationtoHour($line->qty, $line->duration_unit); if($conf->workstation->enabled){ if($tmpproduct->fk_default_workstation) { diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 558ba2aa322..98a17e062ee 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -318,6 +318,27 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l } +/** Convert duration to hour + * + * @param int $duration_value Duration value + * @param int $duration_unit Duration unit + * @return int $result + */ +function convertDurationtoHour($duration_value, $duration_unit) +{ + $result = 0; + + if($duration_unit == 's') $result = $duration_value / 3600; + if($duration_unit == 'i') $result = $duration_value / 60; + if($duration_unit == 'h') $result = $duration_value; + if($duration_unit == 'd') $result = $duration_value * 24; + if($duration_unit == 'w') $result = $duration_value * 24 * 7; + if($duration_unit == 'm') $result = $duration_value * 730.484; + if($duration_unit == 'y') $result = $duration_value * 365 * 24; + + return $result; +} + /** * Generate a SQL string to make a filter into a range (for second of date until last second of date). * This method allows to maje SQL request that will deal correctly the timezone of server. From a41dee9e06b3d2b74f27dc5e669c7eb90e46b1de Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 12 Jul 2022 08:09:45 +0000 Subject: [PATCH 0014/1289] Fixing style errors. --- htdocs/bom/ajax/ajax.php | 3 +-- htdocs/bom/bom_card.php | 11 ++++----- htdocs/bom/class/bom.class.php | 9 ++++---- htdocs/bom/tpl/objectline_create.tpl.php | 23 ++++++++----------- htdocs/bom/tpl/objectline_edit.tpl.php | 5 ++-- htdocs/bom/tpl/objectline_title.tpl.php | 14 +++++------ htdocs/bom/tpl/objectline_view.tpl.php | 10 ++++---- htdocs/core/lib/date.lib.php | 14 +++++------ htdocs/product/card.php | 6 ++--- .../product/class/html.formproduct.class.php | 1 - 10 files changed, 42 insertions(+), 54 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index ef99ab214d1..2ad12cc60a3 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -66,11 +66,10 @@ $idproduct = GETPOST('idproduct', 'int'); top_httphead(); if ($action == 'getDurationUnitByProduct') { - $product = new Product($db); $res = $product->fetch($idproduct); - if($res > 0){ + if ($res > 0) { $return = $product->duration_unit; } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index d4dd367e95e..1abc33f9bce 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -167,7 +167,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $duration_unit = GETPOST('duration_unit','alphanohtml'); + $duration_unit = GETPOST('duration_unit', 'alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; @@ -227,7 +227,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $duration_unit = GETPOST('duration_unit','alphanohtml'); + $duration_unit = GETPOST('duration_unit', 'alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); @@ -549,13 +549,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ if (!empty($object->table_element_line)) { - //Products $res = $object->fetchLinesbytypeproduct(0); $object->calculateCosts(); - if($res > 0) { - + if ($res > 0) { print load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); print ' @@ -601,7 +599,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print "\n"; mrpCollapseBomManagement(); - } //Services @@ -609,7 +606,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetchLinesbytypeproduct(1); $object->calculateCosts(); - if($res > 0) { + if ($res > 0) { print load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 16c780a5751..c0eb5e802ea 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1098,7 +1098,7 @@ class BOM extends CommonObject $tmpproduct->pmp = 0; $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading - if($tmpproduct->type == $tmpproduct::TYPE_PRODUCT) { + if ($tmpproduct->type == $tmpproduct::TYPE_PRODUCT) { if (empty($line->fk_bom_child)) { if ($result < 0) { $this->error = $tmpproduct->error; @@ -1127,16 +1127,15 @@ class BOM extends CommonObject } } } else { - //Convert qty to hour $qty = convertDurationtoHour($line->qty, $line->duration_unit); - if($conf->workstation->enabled){ - if($tmpproduct->fk_default_workstation) { + if ($conf->workstation->enabled) { + if ($tmpproduct->fk_default_workstation) { $workstation = new Workstation($this->db); $res = $workstation->fetch($tmpproduct->fk_default_workstation); - if($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); else { $this->error = $workstation->error; return -3; diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 55b14a0f650..ff257d6ab72 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -44,7 +44,7 @@ if (empty($forceall)) { $forceall = 0; } -if(empty($filtertype)) $filtertype = 0; +if (empty($filtertype)) $filtertype = 0; if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) { $filtertype = -1; } @@ -72,7 +72,7 @@ if ($nolinesbefore) { print ''; print ''; - if($filtertype != 1) { + if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; print ''; print ''; - } - else { + } else { print ''; - if($conf->workstation->enabled) print ''; + if ($conf->workstation->enabled) print ''; print ''; } @@ -106,10 +105,9 @@ print ''; -if($filtertype != 1) { +if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; -if($filtertype != 1) { +if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; - } $coldisplay += $colspan; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 9ed44d8f503..f93fb59fe0d 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -40,7 +40,7 @@ if (empty($object) || !is_object($object)) { } global $filtertype; -if(empty($filtertype)) $filtertype = 0; +if (empty($filtertype)) $filtertype = 0; print "\n"; @@ -66,28 +66,26 @@ print ''; // Qty print ''; -if($filtertype != 1) { +if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; } -// Qty frozen + // Qty frozen print ''; -// Disable stock change + // Disable stock change print ''; -// Efficiency + // Efficiency print ''; // Cost print ''; - } else { - print ''; - if($conf->workstation->enabled) print ''; + if ($conf->workstation->enabled) print ''; // Cost print ''; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index cef6b520264..2c9758f2176 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -43,7 +43,7 @@ if (empty($object) || !is_object($object)) { } global $filtertype; -if(empty($filtertype)) $filtertype = 0; +if (empty($filtertype)) $filtertype = 0; global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax, $langs; @@ -105,7 +105,7 @@ $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price print ''; -if($filtertype != 1) { +if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; //Poste de travail - if($conf->workstation->enabled) { + if ($conf->workstation->enabled) { $workstation = new Workstation($object->db); $res = $workstation->fetch($tmpproduct->fk_default_workstation); print ''; } } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 98a17e062ee..3e52099a41b 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -328,13 +328,13 @@ function convertDurationtoHour($duration_value, $duration_unit) { $result = 0; - if($duration_unit == 's') $result = $duration_value / 3600; - if($duration_unit == 'i') $result = $duration_value / 60; - if($duration_unit == 'h') $result = $duration_value; - if($duration_unit == 'd') $result = $duration_value * 24; - if($duration_unit == 'w') $result = $duration_value * 24 * 7; - if($duration_unit == 'm') $result = $duration_value * 730.484; - if($duration_unit == 'y') $result = $duration_value * 365 * 24; + if ($duration_unit == 's') $result = $duration_value / 3600; + if ($duration_unit == 'i') $result = $duration_value / 60; + if ($duration_unit == 'h') $result = $duration_value; + if ($duration_unit == 'd') $result = $duration_value * 24; + if ($duration_unit == 'w') $result = $duration_value * 24 * 7; + if ($duration_unit == 'm') $result = $duration_value * 730.484; + if ($duration_unit == 'y') $result = $duration_value * 365 * 24; return $result; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 23fdd431696..b8796391e81 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1468,7 +1468,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - if($type == 1 && $conf->workstation->enabled){ + if ($type == 1 && $conf->workstation->enabled) { // Default workstation print ''; } - if($object->isService() && $conf->workstation->enabled) { + if ($object->isService() && $conf->workstation->enabled) { $workstation = new Workstation($db); $res = $workstation->fetch($object->fk_default_workstation); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index d6017877375..0ac039b55ec 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -434,7 +434,6 @@ class FormProduct $out .= ''; } foreach ($this->cache_workstations as $id => $arraytypes) { - $label = $arraytypes['label']; $out .= '
'.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).''.$form->textwithpicto($langs->trans('Qty'), ($filtertype != 1) ? $langs->trans("QtyRequiredIfNoLoss") : '').'' . $form->textwithpicto($langs->trans('Unit'), '').'' . $form->textwithpicto($langs->trans('Workstation'), '') . '' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).''.$langs->trans('Qty').''; print ''; @@ -82,10 +82,9 @@ if ($nolinesbefore) { print '' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '' . $form->textwithpicto($langs->trans('Unit'), '').'' . $form->textwithpicto($langs->trans('Workstation'), '') . '' . $form->textwithpicto($langs->trans('Workstation'), '') . '' . $form->textwithpicto($langs->trans('TotalCost'), '') . ''; // Predefined product/service if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - if($filtertype == 1){ + if ($filtertype == 1) { print $langs->trans("Service"); - } - elseif (!empty($conf->global->BOM_SUB_BOM)) { + } elseif (!empty($conf->global->BOM_SUB_BOM)) { print $langs->trans("Product"); } echo ''; @@ -118,8 +116,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); - } - else { + } else { $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } @@ -137,7 +134,7 @@ $coldisplay++; print ''; print ''; @@ -213,11 +210,11 @@ jQuery(document).ready(function() { }); //change unit selected if we change service selected - + $('#idprodservice').change(function(){ var idproduct = $(this).val(); $.ajax({ - url : "" + url : "" ,type: 'POST' ,data: { 'action': 'getDurationUnitByProduct' diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index b669c936412..b803277f359 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -47,7 +47,7 @@ if (empty($forceall)) { $forceall = 0; } -if(empty($filtertype)) $filtertype = 0; +if (empty($filtertype)) $filtertype = 0; $formproduct = new FormProduct($object->db); @@ -115,7 +115,7 @@ if (($line->info_bits & 2) != 2) { } print ''; @@ -151,7 +151,6 @@ if($filtertype != 1) { $coldisplay++; print ''; print ''.$form->textwithpicto($langs->trans('Qty'), ($filtertype != 1) ? $langs->trans("QtyRequiredIfNoLoss") : '').'' . $langs->trans('Unit') . '' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'' . $form->textwithpicto($langs->trans('Unit'), '').'' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).''; $label = $tmpproduct->getLabelOfUnit('long'); @@ -137,7 +137,7 @@ if($filtertype != 1) { } elseif ($tmpproduct->duration_value > 0) { $dur = array("s"=>$langs->trans("Second"), "i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } - if(!empty($line->duration_unit)){ + if (!empty($line->duration_unit)) { print (isset($dur[$line->duration_unit]) ? " ".$langs->trans($dur[$line->duration_unit])." " : ''); } else { print (!empty($tmpproduct->duration_unit) && isset($dur[$tmpproduct->duration_unit]) ? " " . $langs->trans($dur[$tmpproduct->duration_unit]) . " " : ''); @@ -145,13 +145,13 @@ if($filtertype != 1) { print ''; $coldisplay++; - if($res > 0) echo $workstation->getNomUrl(); + if ($res > 0) echo $workstation->getNomUrl(); print '
'.$langs->trans("DefaultWorkstation").''; print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"'); @@ -2016,7 +2016,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ } - if($object->isService() && $conf->workstation->enabled) { + if ($object->isService() && $conf->workstation->enabled) { // Default workstation print '
'.$langs->trans("DefaultWorkstation").''; print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"'); @@ -2505,7 +2505,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add products form - - - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); - } - } - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
'; - } - print '
'; - - print "\n"; - - mrpCollapseBomManagement(); + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products form + + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; + + print "\n"; + + mrpCollapseBomManagement(); + + //Services $filtertype = 1; $res = $object->fetchLinesbytypeproduct(1); $object->calculateCosts(); - if ($res > 0) { - print load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); + print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); + print '
+ + + + + '; - print ' - - - - - - '; - - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - $tagidfortablednd = 'tablelinesservice'; - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; - } - - print '
'; - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add services form - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); - } - } - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
'; - } - print '
'; + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + $tagidfortablednd = 'tablelinesservice'; + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add services form + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; + print "
\n"; } + $res = $object->fetchLines(); // Buttons for actions diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index db03f6bf0bd..e3aa0180cf5 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -444,7 +444,7 @@ class BOM extends CommonObject $i++; } - return 1; + return $num_rows; } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; From 62cf3cdab4cd1c926a9e243024eadbdc5144fe6c Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Wed, 13 Jul 2022 16:43:24 +0200 Subject: [PATCH 0017/1289] initializing public interface for user to book --- htdocs/public/bookcal/booking.php | 602 ++++++++++++++++++++++++++++++ htdocs/public/bookcal/index.php | 26 ++ 2 files changed, 628 insertions(+) create mode 100644 htdocs/public/bookcal/booking.php create mode 100644 htdocs/public/bookcal/index.php diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php new file mode 100644 index 00000000000..3020799c91e --- /dev/null +++ b/htdocs/public/bookcal/booking.php @@ -0,0 +1,602 @@ + + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2021 Waël Almoman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/partnership/new.php + * \ingroup member + * \brief Example of form to add a new member + */ + +use Stripe\Event; + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +// Load translation files +$langs->loadLangs(array("main", "members", "companies", "install", "other")); + + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$object = new Partnership($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new partnership + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + + if (!empty($conf->global->PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION)) { + print '
'; + print ''; + print '
'; + } + + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + $urlback = ''; + + $db->begin(); + + /*if (GETPOST('typeid') <= 0) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n"; + }*/ + if (!GETPOST('lastname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; + } + if (!GETPOST('firstname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; + } + if (empty(GETPOST('email'))) { + $error++; + $errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."
\n"; + } elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $langs->load('errors'); + $error++; + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + + $public = GETPOSTISSET('public') ? 1 : 0; + + if (!$error) { + //$partnership = new Partnership($db); + $event = new Event($db); + + + // We try to find the thirdparty or the member + if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { + $partnership->fk_member = 0; + } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'member') { + $partnership->fk_soc = 0; + } + + $partnership->statut = -1; + $partnership->firstname = GETPOST('firstname'); + $partnership->lastname = GETPOST('lastname'); + $partnership->address = GETPOST('address'); + $partnership->zip = GETPOST('zipcode'); + $partnership->town = GETPOST('town'); + $partnership->email = GETPOST('email'); + $partnership->country_id = GETPOST('country_id', 'int'); + $partnership->state_id = GETPOST('state_id', 'int'); + //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); + $partnership->note_private = GETPOST('note_private'); + + // Fill array 'array_options' with data from add form + $extrafields->fetch_name_optionals_label($partnership->table_element); + $ret = $extrafields->setOptionalsFromPost(null, $partnership); + if ($ret < 0) { + $error++; + } + + $result = $partnership->create($user); + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $object = $partnership; + + /* + $partnershipt = new PartnershipType($db); + $partnershipt->fetch($object->typeid); + + if ($object->email) { + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->PARTNERSHIP_EMAIL_TEMPLATE_AUTOREGISTER; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $partnershipt->getMailOnValid()), $substitutionarray, $outputlangs); + + if ($subjecttosend && $texttosend) { + $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; + + $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + } + } + */ + + // Send email to the foundation to say a new member subscribed with autosubscribe form + if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') && !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && + !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL)) { + // Define link to login card + $appli = constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) { + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + } else { + $appli .= " ".DOL_VERSION; + } + } else { + $appli .= " ".DOL_VERSION; + } + + $to = $partnership->makeSubstitution(getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')); + $from = getDolGlobalString('PARTNERSHIP_MAIL_FROM'); + $mailfile = new CMailFile( + '['.$appli.'] '.getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT', 'Partnership request'), + $to, + $from, + $partnership->makeSubstitution(getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL')), + array(), + array(), + array(), + "", + "", + 0, + -1 + ); + + if (!$mailfile->sendfile()) { + dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); + } + } + + if (!empty($backtopage)) { + $urlback = $backtopage; + } elseif (!empty($conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION)) { + $urlback = $conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION; + // TODO Make replacement of __AMOUNT__, etc... + } else { + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); + } + + if (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) && $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE != '-1') { + if ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'all') { + $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paybox') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paypal') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'stripe') { + $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.$partnership->ref; + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } else { + dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); + exit; + } + } + + if (!empty($entity)) { + $urlback .= '&entity='.$entity; + } + dol_syslog("partnership ".$partnership->ref." was created, we redirect to ".$urlback); + } else { + $error++; + $errmsg .= join('
', $partnership->errors); + } + } + + if (!$error) { + $db->commit(); + + Header("Location: ".$urlback); + exit; + } else { + $db->rollback(); + } +} + +// Action called after a submitted was send and member created successfully +// If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. +// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. +if (empty($reshook) && $action == 'added') { + llxHeaderVierge($langs->trans("NewPartnershipForm")); + + // Si on a pas ete redirige + print '

'; + print '
'; + print $langs->trans("NewPartnershipbyWeb"); + print '
'; + + llxFooterVierge(); + + exit; +} + + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels + + +llxHeaderVierge($langs->trans("NewPartnershipRequest")); + + +print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; + +print '
'; +if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) { + print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."
\n"; +} else { + print $langs->trans("NewPartnershipRequestDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; +} +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + + +print ''."\n"; + +// Type +/* +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { + $listoftype = $partnershipt->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; + } + print ''."\n"; +} else { + $partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE); + print ''; +} +*/ + +$partnershiptype = new PartnershipType($db); +$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000); +$listofpartnership = array(); +foreach ($listofpartnershipobj as $partnershipobj) { + $listofpartnership[$partnershipobj->id] = $partnershipobj->label; +} + +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { + print ''."\n"; +} else { + print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE]; + print ''; +} + +// Company +print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// EMail +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Logo +//print ''."\n"; +// Other attributes +$tpl_context = 'public'; // define template context to public +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; +// Comments +print ''; +print ''; +print ''; +print ''."\n"; + +print "
'.$langs->trans("Type").' *'; + print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print '
'.$langs->trans('PartnershipType').' *'."\n"; + print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1); + print '
'.$langs->trans("Company").' *'; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").' *'; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print '
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').''; +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); +if (!$country_id && !empty($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } + print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Comments").'
\n"; + +print dol_get_fiche_end(); + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php new file mode 100644 index 00000000000..4071c62de1f --- /dev/null +++ b/htdocs/public/bookcal/index.php @@ -0,0 +1,26 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/index.php + * \ingroup core + * \brief A redirect page to an error + */ + +require '../../master.inc.php'; + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); From 7f1a17bcc97a14b47c48ddfcf4677614b34332f7 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 20 Jul 2022 15:38:37 +0200 Subject: [PATCH 0018/1289] Change fk_unit service lines management --- htdocs/bom/ajax/ajax.php | 8 ++++---- htdocs/bom/bom_card.php | 10 ++++++---- htdocs/bom/class/bom.class.php | 5 +++-- htdocs/bom/tpl/objectline_create.tpl.php | 12 +++++++++--- htdocs/bom/tpl/objectline_edit.tpl.php | 2 +- htdocs/bom/tpl/objectline_view.tpl.php | 16 +++++++--------- htdocs/core/class/cunits.class.php | 7 ++++--- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_bom_bomline.sql | 2 +- 10 files changed, 41 insertions(+), 29 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index 2ad12cc60a3..fac4fee6ef4 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -53,6 +53,7 @@ if (!defined('NOBROWSERNOTIF')) { include_once '../../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $action = GETPOST('action', 'aZ09'); @@ -69,10 +70,9 @@ if ($action == 'getDurationUnitByProduct') { $product = new Product($db); $res = $product->fetch($idproduct); - if ($res > 0) { - $return = $product->duration_unit; - } + $cUnit = new CUnits($db); + $fk_unit = $cUnit->getUnitFromCode($product->duration_unit, 'short_label','time'); - echo json_encode($return); + echo json_encode($fk_unit); exit(); } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index ce9a284200b..026f055fb8c 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -167,7 +167,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $duration_unit = GETPOST('duration_unit', 'alphanohtml'); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; @@ -191,7 +191,7 @@ if (empty($reshook)) { $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; - $bomline->duration_unit = $duration_unit; + $bomline->fk_unit = $fk_unit; // Rang to use $rangmax = $object->line_max(0); @@ -227,7 +227,7 @@ if (empty($reshook)) { $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $duration_unit = GETPOST('duration_unit', 'alphanohtml'); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); @@ -240,7 +240,9 @@ if (empty($reshook)) { $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; - $bomline->duration_unit = $duration_unit; + + require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; + $bomline->fk_unit = $fk_unit; $result = $bomline->update($user); if ($result <= 0) { diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e3aa0180cf5..f74a1d69263 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1128,7 +1128,8 @@ class BOM extends CommonObject } } else { //Convert qty to hour - $qty = convertDurationtoHour($line->qty, $line->duration_unit); + $unit = measuringUnitString($line->fk_unit); + $qty = convertDurationtoHour($line->qty, $unit); if ($conf->workstation->enabled) { if ($tmpproduct->fk_default_workstation) { @@ -1293,7 +1294,7 @@ class BOMLine extends CommonObjectLine 'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'), 'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'), 'efficiency' => array('type'=>'double(24,8)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfEfficiencyConsumedMeans'), - 'duration_unit' => array('type'=>'varchar(6)', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), + 'fk_unit' => array('type'=>'integer', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), ); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index ff257d6ab72..f8fa20e1db4 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -160,8 +160,11 @@ if ($filtertype != 1) { print ''; } else { $coldisplay++; + require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; + $cUnit = new CUnits($this->db); + $fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label','time'); print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", 'h', 0, 1); + print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 0, 0); print ''; $coldisplay++; @@ -212,7 +215,8 @@ jQuery(document).ready(function() { //change unit selected if we change service selected $('#idprodservice').change(function(){ - var idproduct = $(this).val(); + var idproduct = $(this).val(); + $.ajax({ url : "" ,type: 'POST' @@ -221,8 +225,10 @@ jQuery(document).ready(function() { ,'idproduct' : idproduct } }).done(function(data) { + + console.log(data); var data = JSON.parse(data); - $('#duration_unit').val(data).change();; + $("#fk_unit").val(data).change(); }); }); diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index b803277f359..d7505207f4c 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -141,7 +141,7 @@ if ($filtertype != 1) { $coldisplay++; print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", ($line->duration_unit) ? $line->duration_unit : '', 0, 1); + print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0); print ''; $coldisplay++; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 2c9758f2176..7c436d5721e 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -132,16 +132,14 @@ if ($filtertype != 1) { //Unité print ''; $coldisplay++; - if ($line->qty > 1) { - $dur = array("s"=>$langs->trans("Seconds"), "i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); - } elseif ($tmpproduct->duration_value > 0) { - $dur = array("s"=>$langs->trans("Second"), "i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); - } - if (!empty($line->duration_unit)) { - print (isset($dur[$line->duration_unit]) ? " ".$langs->trans($dur[$line->duration_unit])." " : ''); - } else { - print (!empty($tmpproduct->duration_unit) && isset($dur[$tmpproduct->duration_unit]) ? " " . $langs->trans($dur[$tmpproduct->duration_unit]) . " " : ''); + + if (!empty($line->fk_unit)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; + $unit = new CUnits($this->db); + $unit->fetch($line->fk_unit); + print (isset($unit->label) ? " ".$langs->trans(ucwords($unit->label))." " : ''); } + print ''; //Poste de travail diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index dfc22fd37ec..9ad1f77e84a 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -420,15 +420,16 @@ class CUnits // extends CommonObject * Get unit from code * @param string $code code of unit * @param string $mode 0= id , short_label=Use short label as value, code=use code + * @param string $unit_type weight,size,surface,volume,qty,time... * @return int <0 if KO, Id of code if OK */ - public function getUnitFromCode($code, $mode = 'code') + public function getUnitFromCode($code, $mode = 'code', $unit_type='') { if ($mode == 'short_label') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid',0, ' AND unit_type = "'.$unit_type.'"'); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, ' AND unit_type = "'. $unit_type .'"'); } return $code; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 381280289ee..8f08d77c6fb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8504,10 +8504,11 @@ function dol_osencode($str) * @param string $fieldkey Field to search the key into * @param string $fieldid Field to get * @param int $entityfilter Filter by entity + * @param string $filters Filter on other fields * @return int <0 if KO, Id of code if OK * @see $langs->getLabelFromKey */ -function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0) +function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = array()) { global $cache_codes; @@ -8529,6 +8530,9 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = if (!empty($entityfilter)) { $sql .= " AND entity IN (".getEntity($tablename).")"; } + if ($filters) { + $sql .= $filters; + } $resql = $db->query($sql); if ($resql) { 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 fb1ba0a8da2..051889a3dde 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 @@ -57,4 +57,4 @@ ALTER TABLE llx_facture_fourn ADD COLUMN close_missing_amount double(24, 8) afte ALTER TABLE llx_adherent_type ADD COLUMN caneditamount integer DEFAULT 0 AFTER amount; ALTER TABLE llx_product ADD COLUMN fk_default_workstation integer DEFAULT NULL; -ALTER TABLE llx_bom_bomline ADD COLUMN duration_unit varchar(6) DEFAULT NULL; +ALTER TABLE llx_bom_bomline ADD COLUMN fk_unit integer DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_bom_bomline.sql b/htdocs/install/mysql/tables/llx_bom_bomline.sql index c93484db92a..eae1f6c6662 100644 --- a/htdocs/install/mysql/tables/llx_bom_bomline.sql +++ b/htdocs/install/mysql/tables/llx_bom_bomline.sql @@ -25,7 +25,7 @@ CREATE TABLE llx_bom_bomline( qty_frozen smallint DEFAULT 0, disable_stock_change smallint DEFAULT 0, efficiency double(24,8) NOT NULL DEFAULT 1, - duration_unit varchar(6) NULL, + fk_unit integer NULL, position integer NOT NULL DEFAULT 0 -- END MODULEBUILDER FIELDS ) ENGINE=innodb; From 9ef883e7b007d9073868a64d32a7f14278f068f1 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 20 Jul 2022 13:42:33 +0000 Subject: [PATCH 0019/1289] Fixing style errors. --- htdocs/bom/ajax/ajax.php | 2 +- htdocs/bom/tpl/objectline_create.tpl.php | 2 +- htdocs/core/class/cunits.class.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index fac4fee6ef4..2a57752edde 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -71,7 +71,7 @@ if ($action == 'getDurationUnitByProduct') { $res = $product->fetch($idproduct); $cUnit = new CUnits($db); - $fk_unit = $cUnit->getUnitFromCode($product->duration_unit, 'short_label','time'); + $fk_unit = $cUnit->getUnitFromCode($product->duration_unit, 'short_label', 'time'); echo json_encode($fk_unit); exit(); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index f8fa20e1db4..43982ed9a7d 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -162,7 +162,7 @@ if ($filtertype != 1) { $coldisplay++; require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $cUnit = new CUnits($this->db); - $fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label','time'); + $fk_unit_default = $cUnit->getUnitFromCode('h', 'short_label', 'time'); print ''; print $formproduct->selectMeasuringUnits("fk_unit", "time", $fk_unit_default, 0, 0); print ''; diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 9ad1f77e84a..3104ccd347d 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -423,13 +423,13 @@ class CUnits // extends CommonObject * @param string $unit_type weight,size,surface,volume,qty,time... * @return int <0 if KO, Id of code if OK */ - public function getUnitFromCode($code, $mode = 'code', $unit_type='') + public function getUnitFromCode($code, $mode = 'code', $unit_type = '') { if ($mode == 'short_label') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid',0, ' AND unit_type = "'.$unit_type.'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$unit_type.'"'); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, ' AND unit_type = "'. $unit_type .'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $unit_type .'"'); } return $code; From a8e6725bca50d1869d2f9f52fb908141626d2e08 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 21 Jul 2022 14:21:22 +0200 Subject: [PATCH 0020/1289] bookcal loading ... --- htdocs/public/bookcal/booking.php | 847 ++++++++++++++++++------------ 1 file changed, 516 insertions(+), 331 deletions(-) diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php index 3020799c91e..0d39ebb13ed 100644 --- a/htdocs/public/bookcal/booking.php +++ b/htdocs/public/bookcal/booking.php @@ -60,6 +60,22 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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/lib/agenda.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Init vars $errmsg = ''; @@ -75,9 +91,15 @@ $langs->loadLangs(array("main", "members", "companies", "install", "other")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); + +$object = new ActionComm($db); +$cactioncomm = new CActionComm($db); +$contact = new Contact($db); +$formfile = new FormFile($db); +$formactions = new FormActions($db); $extrafields = new ExtraFields($db); -$object = new Partnership($db); + $user->loadDefaultValues(); @@ -153,7 +175,6 @@ function llxFooterVierge() } - /* * Actions */ @@ -196,27 +217,27 @@ if (empty($reshook) && $action == 'add') { if (!$error) { //$partnership = new Partnership($db); - $event = new Event($db); + $events = new Events($db); // We try to find the thirdparty or the member if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { - $partnership->fk_member = 0; + $event->fk_member = 0; } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'member') { - $partnership->fk_soc = 0; + $event->fk_soc = 0; } - $partnership->statut = -1; - $partnership->firstname = GETPOST('firstname'); - $partnership->lastname = GETPOST('lastname'); - $partnership->address = GETPOST('address'); - $partnership->zip = GETPOST('zipcode'); - $partnership->town = GETPOST('town'); - $partnership->email = GETPOST('email'); - $partnership->country_id = GETPOST('country_id', 'int'); - $partnership->state_id = GETPOST('state_id', 'int'); + $events->statut = -1; + $events->firstname = GETPOST('firstname'); + $events->lastname = GETPOST('lastname'); + $events->address = GETPOST('address'); + $events->zip = GETPOST('zipcode'); + $events->town = GETPOST('town'); + $events->email = GETPOST('email'); + $events->country_id = GETPOST('country_id', 'int'); + $events->state_id = GETPOST('state_id', 'int'); //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); - $partnership->note_private = GETPOST('note_private'); + $event->note_private = GETPOST('note_private'); // Fill array 'array_options' with data from add form $extrafields->fetch_name_optionals_label($partnership->table_element); @@ -225,186 +246,23 @@ if (empty($reshook) && $action == 'add') { $error++; } - $result = $partnership->create($user); - if ($result > 0) { - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $object = $partnership; - - /* - $partnershipt = new PartnershipType($db); - $partnershipt->fetch($object->typeid); - - if ($object->email) { - $subject = ''; - $msg = ''; - - // Send subscription email - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - $labeltouse = $conf->global->PARTNERSHIP_EMAIL_TEMPLATE_AUTOREGISTER; - - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions(dol_concatdesc($msg, $partnershipt->getMailOnValid()), $substitutionarray, $outputlangs); - - if ($subjecttosend && $texttosend) { - $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; - - $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - } - } - */ - - // Send email to the foundation to say a new member subscribed with autosubscribe form - if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') && !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && - !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL)) { - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - - $to = $partnership->makeSubstitution(getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')); - $from = getDolGlobalString('PARTNERSHIP_MAIL_FROM'); - $mailfile = new CMailFile( - '['.$appli.'] '.getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT', 'Partnership request'), - $to, - $from, - $partnership->makeSubstitution(getDolGlobalString('PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL')), - array(), - array(), - array(), - "", - "", - 0, - -1 - ); - - if (!$mailfile->sendfile()) { - dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); - } - } - - if (!empty($backtopage)) { - $urlback = $backtopage; - } elseif (!empty($conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION)) { - $urlback = $conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION; - // TODO Make replacement of __AMOUNT__, etc... + if (!$error) { + $result = $event->create($user); + if ($result > 0) { + $db->commit(); + $urlback = DOL_URL_ROOT.'/public/partnership/new.php?action=confirm&id='.$event->id; + header('Location: '.$urlback); + exit; } else { - $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); + $db->rollback(); + $errmsg = $event->error; + $error++; } - - if (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) && $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE != '-1') { - if ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'all') { - $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paybox') { - $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paypal') { - $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'stripe') { - $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.$partnership->ref; - if (price2num(GETPOST('amount', 'alpha'))) { - $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); - } - if (GETPOST('email')) { - $urlback .= '&email='.urlencode(GETPOST('email')); - } - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); - } else { - $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); - } - } - } else { - dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); - exit; - } - } - - if (!empty($entity)) { - $urlback .= '&entity='.$entity; - } - dol_syslog("partnership ".$partnership->ref." was created, we redirect to ".$urlback); } else { $error++; - $errmsg .= join('
', $partnership->errors); + $errmsg .= join('
', $event->errors); } } - - if (!$error) { - $db->commit(); - - Header("Location: ".$urlback); - exit; - } else { - $db->rollback(); - } } // Action called after a submitted was send and member created successfully @@ -436,165 +294,492 @@ $formcompany = new FormCompany($db); $extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels -llxHeaderVierge($langs->trans("NewPartnershipRequest")); +llxHeaderVierge($langs->trans("NewBookingRequest")); -print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center'); +print load_fiche_titre($langs->trans("NewBookingRequest"), '', '', 0, 0, 'center'); -print '
'; -print '
'; -print '
'; -if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) { - print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."
\n"; -} else { - print $langs->trans("NewPartnershipRequestDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
\n"; -} -print '
'; +// View -dol_htmloutput_errors($errmsg); +// Add new Events form +$contact = new Contact($db); -// Print form -print '
'."\n"; -print ''; -print ''; -print ''; - -print '
'; - -print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; -//print $langs->trans("FieldsWithIsForPublic",'**').'
'; - -print dol_get_fiche_head(''); - -print ''; - - -print ''."\n"; - -// Type -/* -if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { - $listoftype = $partnershipt->liste_array(); - $tmp = array_keys($listoftype); - $defaulttype = ''; - $isempty = 1; - if (count($listoftype) == 1) { - $defaulttype = $tmp[0]; - $isempty = 0; - } - print ''."\n"; -} else { - $partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE); - print ''; -} -*/ - -$partnershiptype = new PartnershipType($db); -$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000); -$listofpartnership = array(); -foreach ($listofpartnershipobj as $partnershipobj) { - $listofpartnership[$partnershipobj->id] = $partnershipobj->label; -} - -if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { - print ''."\n"; -} else { - print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE]; - print ''; -} - -// Company -print ''."\n"; -// Lastname -print ''."\n"; -// Firstname -print ''."\n"; -// EMail -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; -print dol_get_fiche_end(); + // Full day + print ''; } -print ''; + + print ''; + + $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); +if (GETPOST('datep', 'int', 1)) { + $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); +} + $datef = ($datef ? $datef : $object->datef); +if (GETPOST('datef', 'int', 1)) { + $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); +} +if (empty($datef) && !empty($datep)) { + if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { + $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); + } +} + + // Date start + print ''; + + print ''; + + // Assigned to + print ''; + + // Done by +if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { + print ''; +} + + // Location +if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { + print ''; +} + + // Status + print ''; + print ''; + +if (!empty($conf->categorie->enabled)) { + // Categories + print '"; +} + + print '
'.$langs->trans("Type").' *'; - print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); - print '
'.$langs->trans('PartnershipType').' *'."\n"; - print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1); - print '
'.$langs->trans("Company").' *'; -print img_picto('', 'company', 'class="pictofixedwidth"'); -print '
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Email").' *'; -//print img_picto('', 'email', 'class="pictofixedwidth"'); -print '
'.$langs->trans("Address").''."\n"; -print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print '
'.$langs->trans('Country').''; -print img_picto('', 'country', 'class="pictofixedwidth"'); -$country_id = GETPOST('country_id', 'int'); -if (!$country_id && !empty($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; - } + $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); +if (!empty($socpeopleassigned[0])) { + $result = $contact->fetch($socpeopleassigned[0]); + if ($result < 0) { + dol_print_error($db, $contact->error); } } -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } + + dol_set_focus("#label"); + +if (!empty($conf->use_javascript_ajax)) { + print "\n".''."\n"; +} + print ''; + print ''; + print ''; + print ''; + print ''; +if ($backtopage) { + print ''; +} +if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + print ''; +} + +if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') { + print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); +} else { + print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); +} + + print dol_get_fiche_head(); + + print ''; + + // Type of event +if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + print ''; } -// Logo -//print ''."\n"; -// Other attributes -$tpl_context = 'public'; // define template context to public -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; -// Comments -print ''; -print ''; -print ''; -print ''."\n"; -print "
'.$langs->trans("Type").''; + $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); + print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); + print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Comments").'
\n"; + // Title + print '
'.$langs->trans("Date").''; -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; + // Recurring event + $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); +if ($userepeatevent) { + // Repeat + //print '
'; + print '        
'; + print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); + print ''; + $selectedrecurrulefreq = 'no'; + $selectedrecurrulebymonthday = ''; + $selectedrecurrulebyday = ''; + if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { + $selectedrecurrulefreq = $reg[1]; + } + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { + $selectedrecurrulebymonthday = $reg[1]; + } + if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { + $selectedrecurrulebyday = $reg[1]; + } + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); + // If recurrulefreq is MONTHLY + print ''; + // If recurrulefreq is WEEKLY + print ''; + print ''; + print '
'; + //print '
'; + /* + print ''.$langs->trans("DateActionStart").''; + print ' - '; + print ''.$langs->trans("DateActionEnd").''; + */ + print ''; +if (GETPOST("afaire") == 1) { + print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" +} else { + print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); +} + print '     -     '; +if (GETPOST("afaire") == 1) { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); +} else { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); +} + print '
 
'.$langs->trans("ActionAffectedTo").''; + $listofuserid = array(); + $listofcontactid = array(); + $listofotherid = array(); + +if (empty($donotclearsession)) { + $assignedtouser = GETPOST("assignedtouser") ?GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id); + if ($assignedtouser) { + $listofuserid[$assignedtouser] = array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first + } + //$listofuserid[$user->id] = array('id'=>$user->id, 'mandatory'=>0, 'transparency'=>(GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1)); // 1 by default at first init + $listofuserid[$assignedtouser]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1); // 1 by default at first init + $_SESSION['assignedtouser'] = json_encode($listofuserid); +} else { + if (!empty($_SESSION['assignedtouser'])) { + $listofuserid = json_decode($_SESSION['assignedtouser'], true); + } + $firstelem = reset($listofuserid); + if (isset($listofuserid[$firstelem['id']])) { + $listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing + } +} + print '
'; + print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); + print '
'; + print '
'.$langs->trans("ActionDoneBy").''; + print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); + print '
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + $percent = $complete !=='' ? $complete : -1; +if (GETPOSTISSET('status')) { + $percent = GETPOST('status'); +} elseif (GETPOSTISSET('percentage')) { + $percent = GETPOST('percentage', 'int'); +} else { + if ($complete == '0' || GETPOST("afaire") == 1) { + $percent = '0'; + } elseif ($complete == 100 || GETPOST("afaire") == 2) { + $percent = 100; + } +} + $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); + print '
'.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0); + print "
'; -print "
\n"; -print "
"; -print '
'; + print '


'; + + + print ''; + +if (!empty($conf->societe->enabled)) { + // Related company + print ''; + + // Related contact + print ''; +} + + // Project +if (!empty($conf->project->enabled)) { + $langs->load("projects"); + + $projectid = GETPOST('projectid', 'int'); + + print ''; + + print ''; +} + + // Object linked +if (!empty($origin) && !empty($originid)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + $hasPermissionOnLinkedObject = 0; + if ($user->hasRight($origin, 'read')) { + $hasPermissionOnLinkedObject = 1; + } + //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); + + if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { + // We do not use link for object that already contains a hard coded field to make links with agenda events + print ''; + print ''; + } +} + + $reg = array(); +if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { + $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); +} + + // Priority +if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { + print ''; +} + + // Description + print ''; + + // Other attributes + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; +if (empty($reshook)) { + print $object->showOptionals($extrafields, 'create', $parameters); +} + + print '
'.$langs->trans("ActionOnCompany").''; + if (GETPOST('socid', 'int') > 0) { + $societe = new Societe($db); + $societe->fetch(GETPOST('socid', 'int')); + print $societe->getNomUrl(1); + print ''; + } else { + $events = array(); + $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + //For external user force the company to user company + if (!empty($user->socid)) { + print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); + } else { + print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); + } + } + print '
'.$langs->trans("ActionOnContact").''; + $preselectedids = GETPOST('socpeopleassigned', 'array'); + if (GETPOST('contactid', 'int')) { + $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); + } + if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); + print img_picto('', 'contact', 'class="paddingrightonly"'); + print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); + print '
'.$langs->trans("Project").''; + print img_picto('', 'project', 'class="pictofixedwidth"'); + print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + + print ' '; + print ''; + $urloption = '?action=create&donotclearsession=1'; + $url = dol_buildpath('comm/action/card.php', 2).$urloption; + + // update task list + print "\n".''."\n"; + + print '
'.$langs->trans("Task").''; + print img_picto('', 'projecttask', 'class="paddingrightonly"'); + $projectsListId = false; + if (!empty($projectid)) { + $projectsListId = $projectid; + } + + $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); + + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId); + print '
'.$langs->trans("LinkedObject").''; + if ($hasPermissionOnLinkedObject) { + print dolGetElementUrl($originid, $origin, 1); + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } + print '
'.$langs->trans("Priority").''; + print ''; + print '
'.$langs->trans("Description").''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor->Create(); + print '
'; + + +if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { + //checkbox create reminder + print '
'; + print '
'; + print '

'; + + print ''; + + print "\n".''."\n"; +} + + print dol_get_fiche_end(); + + print $form->buttonsSaveCancel("Add"); + + print ""; llxFooterVierge(); From e4ec999b455457098403cd19b2ca16d3fed88ac0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Jul 2022 14:33:50 +0200 Subject: [PATCH 0021/1289] Retour stickler --- htdocs/bom/tpl/objectline_edit.tpl.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index d7505207f4c..0ce88fa359c 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -138,7 +138,6 @@ if ($filtertype != 1) { print ''; print ''; } else { - $coldisplay++; print ''; print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0); From bcd5aacb4c6863a5e5ba6b06e7f64ca382ffd509 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 4 Aug 2022 16:53:58 +0200 Subject: [PATCH 0022/1289] Fix : Spam db public page --- htdocs/admin/security_other.php | 15 ++++++++++-- htdocs/langs/en_US/admin.lang | 2 ++ htdocs/public/ticket/create_ticket.php | 33 ++++++++++++++++++++++---- htdocs/ticket/class/ticket.class.php | 4 +++- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 090e2254541..beffa8d4ea8 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -61,7 +61,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { dol_print_error($db); } } elseif ($action == 'updateform') { - $res1 = 1; $res2 = 1; $res3 = 1; + $res1 = 1; $res2 = 1; $res3 = 1; $res4 = 1; if (GETPOSTISSET('MAIN_APPLICATION_TITLE')) { $res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } @@ -71,7 +71,10 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { if (GETPOSTISSET('MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT')) { $res3 = dolibarr_set_const($db, "MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", GETPOST("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 'alphanohtml'), 'int', 0, '', $conf->entity); } - if ($res1 && $res2 && $res3) { + if (GETPOSTISSET('MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS')) { + $res4 = dolibarr_set_const($db, "MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", GETPOST("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 'alphanohtml'), 'int', 0, '', $conf->entity); + } + if ($res1 && $res2 && $res3 && $res4) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } } @@ -185,6 +188,14 @@ print ''; +print ''.$langs->trans("MaxNumberOfPostOnPublicPagesByIP").''; +print ''; +print ''; +print ' '.strtolower($langs->trans("Posts")); +print ''; +print ''; + /* if (empty($conf->global->MAIN_APPLICATION_TITLE)) { $conf->global->MAIN_APPLICATION_TITLE = ""; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 149668e34a7..d20b8d139d9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2288,5 +2288,7 @@ NoName=No name ShowAdvancedOptions= Show advanced options HideAdvancedoptions= Hide advanced options Images=Images +Posts=Posts MaxNumberOfImagesInGetPost=Max number of images allowed in GETPOST check +MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with an IP Address CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 1c302c33b2e..dbda57d348f 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -138,6 +138,7 @@ if (empty($reshook) && GETPOST('removedfile', 'alpha') && !GETPOST('save', 'alph if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $error = 0; + $nb_post_ip = 0; $origin_email = GETPOST('email', 'alpha'); if (empty($origin_email)) { $error++; @@ -231,6 +232,21 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $object->type_code = GETPOST("type_code", 'aZ09'); $object->category_code = GETPOST("category_code", 'aZ09'); $object->severity_code = GETPOST("severity_code", 'aZ09'); + $object->ip = (empty($_SERVER['REMOTE_ADDR']) ? 'unknown' : $_SERVER['REMOTE_ADDR']); + + $sql = "SELECT COUNT(ref) as nb_tickets"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; + $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $i++; + $obj = $db->fetch_object($resql); + $nb_post_ip = $obj->nb_tickets; + } + } if (!is_object($user)) { $user = new User($db); @@ -289,14 +305,23 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $object->context['disableticketemail'] = 1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later - $id = $object->create($user); - if ($id <= 0) { + if ($nb_post_ip >= getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000)) { $error++; - $errors = ($object->error ? array($object->error) : $object->errors); - array_push($object->errors, $object->error ? array($object->error) : $object->errors); + $errors = array($langs->trans("AlreadyTooMuchPostOnThisIPAdress")); + array_push($object->errors, array($langs->trans("AlreadyTooMuchPostOnThisIPAdress"))); $action = 'create_ticket'; } + if (!$error) { + $id = $object->create($user); + if ($id <= 0) { + $error++; + $errors = ($object->error ? array($object->error) : $object->errors); + array_push($object->errors, $object->error ? array($object->error) : $object->errors); + $action = 'create_ticket'; + } + } + if (!$error && $id > 0) { if ($usertoassign > 0) { $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 82c2142d786..5c1ba2e5dde 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -459,7 +459,8 @@ class Ticket extends CommonObject $sql .= "date_read,"; $sql .= "date_close,"; $sql .= "entity,"; - $sql .= "notify_tiers_at_create"; + $sql .= "notify_tiers_at_create,"; + $sql .= "ip"; $sql .= ") VALUES ("; $sql .= " ".(!isset($this->ref) ? '' : "'".$this->db->escape($this->ref)."'").","; $sql .= " ".(!isset($this->track_id) ? 'NULL' : "'".$this->db->escape($this->track_id)."'").","; @@ -484,6 +485,7 @@ class Ticket extends CommonObject $sql .= " ".(!isset($this->date_close) || dol_strlen($this->date_close) == 0 ? 'NULL' : "'".$this->db->idate($this->date_close)."'").""; $sql .= ", ".((int) $conf->entity); $sql .= ", ".(!isset($this->notify_tiers_at_create) ? '1' : "'".$this->db->escape($this->notify_tiers_at_create)."'"); + $sql .= ", ".(!isset($this->ip) ? 'unknown' : "'".$this->db->escape($this->ip)."'"); $sql .= ")"; $this->db->begin(); From 872602594e472df69c731cbde02da1cc619400f7 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 5 Aug 2022 12:34:16 +0200 Subject: [PATCH 0023/1289] fix CI error --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5c1ba2e5dde..edda0dd4ee5 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -485,7 +485,7 @@ class Ticket extends CommonObject $sql .= " ".(!isset($this->date_close) || dol_strlen($this->date_close) == 0 ? 'NULL' : "'".$this->db->idate($this->date_close)."'").""; $sql .= ", ".((int) $conf->entity); $sql .= ", ".(!isset($this->notify_tiers_at_create) ? '1' : "'".$this->db->escape($this->notify_tiers_at_create)."'"); - $sql .= ", ".(!isset($this->ip) ? 'unknown' : "'".$this->db->escape($this->ip)."'"); + $sql .= ", ".(!isset($this->ip) ? 'NULL' : "'".$this->db->escape($this->ip)."'"); $sql .= ")"; $this->db->begin(); From 420b2c1651283811f7665e4577ad5794c5adb6d2 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 17 Aug 2022 09:44:20 +0200 Subject: [PATCH 0024/1289] FIX : display labl in workstation select, no ref --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0ac039b55ec..a21ff6348e6 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -191,7 +191,7 @@ class FormProduct return 0; // Cache already loaded and we do not want a list with information specific to a product } - $sql = "SELECT w.rowid, w.ref as label, w.type, w.nb_operators_required,w.thm_operator_estimated,w.thm_machine_estimated"; + $sql = "SELECT w.rowid, w.ref as ref, w.label as label, w.type, w.nb_operators_required,w.thm_operator_estimated,w.thm_machine_estimated"; $sql .= " FROM ".$this->db->prefix()."workstation_workstation as w"; $sql .= " WHERE 1 = 1"; if (!empty($fk_product) && $fk_product > 0) { From 9ec0c9963ac90f3404a8df0de0352a16119eb10e Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 17 Aug 2022 10:26:25 +0200 Subject: [PATCH 0025/1289] FIX : total cost line => bad convert --- htdocs/bom/class/bom.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index ac73ab58475..c57a5816517 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1128,7 +1128,7 @@ class BOM extends CommonObject } } else { //Convert qty to hour - $unit = measuringUnitString($line->fk_unit); + $unit = measuringUnitString($line->fk_unit, '', '', 1); $qty = convertDurationtoHour($line->qty, $unit); if ($conf->workstation->enabled) { From 1f864f5dd4782f9e5dee744a4886f24ad89ae414 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:38:54 +0200 Subject: [PATCH 0026/1289] template 01 corrected and re-exported --- .../websites/website_template-style01.jpg | Bin 0 -> 20970 bytes .../websites/website_template-style01.zip | Bin 0 -> 12929 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/install/doctemplates/websites/website_template-style01.jpg create mode 100644 htdocs/install/doctemplates/websites/website_template-style01.zip diff --git a/htdocs/install/doctemplates/websites/website_template-style01.jpg b/htdocs/install/doctemplates/websites/website_template-style01.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5464bf5dd5d84809f8a943fa1f528290e1297537 GIT binary patch literal 20970 zcmeFZ1#o0bvKZQ895M5VS!&UUVZ=OQW@ct)W@e@lGcz+YGiyc+BkzW@FF z?eB1eU8kcfsWPi7@|;symE9jJA3Fdf2@!D-00;;G0P_0+e7pk)1#PTs?Ts89j0}nN z-H6O>jZEn5jST)Ieyjrm0pR~uAbuApC`c$MSQuz%7+6GDxZf8d1_Bbo?+*qV7AguV z78(g278V`}6)_Pp6_Az|$jikmCuarnKdRuP4}c5}Y6$TK41^c}iVOmV4DvAm!2dl0 zP*AWx2J`m<1q}fS1`Y!X^05Yh{u`rM_wUUAW({Kl#I(pYV#BL2{|{snTAEq}!^Q_| zZBRUoQvE*wZtTAQD%PO-iQZ^urleHI!q14(+vJD6i91%?;?IAS1T#B6Z)=AvOZ>6( z!o&RmIJQVg09(Csxr?=$>sC;W19p-hgFgaMbRb2`a!y3m|FJayayDf2nAaZbDrLOD zcf~_ZrsR0Y2I}_v>p#i;U-W<189-cxGVVXc(ggrexE-FG*CfJ1{<*7|e4b;{->P}s z%69-Djz5}X?3VUVgq5oPSq^0MREXr8ccpd)C;%ksjyGLsouW320qcpNa27i8pQY(E z8;`eHt}RO=T>%Kkh2Nw_-A!`G-qq^58r6kfeon25k_ke9KMp|r_IULuHnsm2$3yOPH7 ze{q^V7)t%e!5|Em@ao$(F-U#Kpg-xGf5YfV)L)UfFDS2;QQDeXa2?`m^kG#$FrnO> zimk!DXv+a8d1H%eE4j%vy#Vt^%n!@A+$1 zFkBq{xwwQKYwfOnX{&HHjKz9x<2*EHADEDw$F_Etqvt(f(6cSiribhr(ZxM7bC3`4JJ0(-p{lX~Iv_a(N zAa*%r|7(!Hflnm`fqzuP4~22Z|T|KVbY{(tp$!ytjw+OLjp1Av2JMQKB@+Su&b#tkh(?FK{ILjnQM!jXb@Xr>f zc3DTg4w!68ga7oZ_>=#is>mfPs#um<{1g+4Gk*kVeYJbN;`hAY8@v+6I|_qEe&CdVjJ0F7p3pjrb*_q@5p1Mp^&wR*v_6 z?A`V3Rp*_%X($l=NrejP^4iG4Iz99t@X;w*$MZ5jFLJxz`;*IbxIDccRE0CgQ?+iB zong>vR?Ua?Hy+4n^rq{i602&z;1q~euLy71!kVV(l z$(fjhk?9M&fFmX||5r9S`P>>(K}9>?KjS(O6u<}ISt2G{XC0KPSj(hLkD7cERL#wM zB>=0MV4d9_ZP0a#MU9S4tT@U;UW|!{N9`?$j;<1L858<|ra5m}@$9@_~4 z^YU{uhMTAHqE)n?-y=YUs){{P2SyI!DH`L6E3AK!61WzGixYcbQ&SK9z?Nzpn!1xv z59R3#bvZqmcUY_G89x}(i}xdL`SmV&K4w3?Av56h9Afn3>?N4maJ#i_{Tieq^8zp&PSfZ5g+mw~lN^;nD~# zYd3NYkk%kjq((k|k6Ey?8&tBa{Jf|tNyIOW7M!zu)1;wt09VB;%sYp*UovV~cgN~d zWL#!ZdKp!LAC~oo8~)5|)q9uM|mc!DC!p1!iWddUnPc?#>y`vD4K) z+2?indd`DjQm*M2YgKGRC6Dzb1Oo0}VW*z)>@FZ!^8>)30Y;z|$MMG8rsF(1b;1)q zdjT2VK$nJsSu=~w@OaorcXh3nNZIkEYC5V5Y()70sC#z1;7&EDpts_-_;;ve+PhfA-_VN90S2tm67*1Eqdvjs}7n_?*ync50-(6Jo@VpD)!RTt{2MIb-J|00X2&>%9w65OQ!dHU`w*6D?~q&wlL z;(Rphg>$l-4-vaK4_^iYI}E$R(u<$d+S|1eLG12}eCYsvvrZd~IRs3h?A#hoM-jCb^(Iw0sQJv8=`jJk_nk(zvJ+b?pj+ml3I( znnmX+D=C?=zduFekqZrWv1@l{)txyin}lE6C)%;Qf4lWU$)U4x9~&1f3jwHe2|E

By7XsB!O#Bi^UI-t&$S8{7`?MY(j*kjg# zTVxx1ueoQSTxik^;JJokMWjz+mGqcVg2yzZKI!mWg08}$8Hwd}1)SE&G%2y%IrJH3_rDoup1t$AzFU`)Ha?~$sF&Ej*ZG`A3{hFzpB0vi@+VdMJz)Qk3lLVxrv)6Mr5` z-|Bp56`%7_?ZXm5YHUiH?C4M%c^KkF*)_bokylceJ#%y*4u0rSOBd5CM);yRYHGWT zlo;lKU^_ZhN3i)`-+EIcae6jBHLk37i6BA{SbNjNHuf-d?}0oPDlQtU{bxg@Bz3pK|j;YuV^*E-<#&jEz*(X3<&rDlvNyP zkstZ30hom+)uU7jzlVpHmYtM6=-aOG1~`tnBgd<~LwLr>lBdw9o~o!bOc(eZ=*+4e zS<4hR1nDtyBvYyV3f#kZ^&yP&-9=Dpl2WVD26+ zxf-73sjk|uplTI)>5z}+M&S-}^d(8Pq(|T&H0A>!ev`>u+~}>8gc^T$|MbF;+#Y#{ zs%A_PKS4RGd7XrgE~hZ-bLxtiQhKS6s!@%*AnGm#;h{QGAOb91YUDxYyhxh6+cYRI zuz-BYJPF&!>|D70g$>>37jl zk_#doT?NdHvP|oUh(_HUcg(eMROCzOF5h*fFi){7fe%Y_efCH@1!nQN@d+)V+MgsN z&xS$Qd;qL;w5`et{NWKZ(+qISM=L1LlsF*g6$Dox~l}k)ESXW0ocYHJG@2axhFH*I~cho6&v)gY`;Og3#Gi zQ4HT!nj78 z$3eDV-K9Fq*B8Nh-=NeSKNr?U3!rPVT{7FDOgl zT}AxRoxs!(zQ$7sTDE#TX&)}QZF^f#L51*LCfn1Skkv2W$jkK_7#Xt=Z}ptYW01cp z9U9J9f9**}`8J&Ffmh|ao@=wulQ&Q=jTmjz$D(nPrmq>H@vVC^`^Q)mSh?06SAVMe zms{7}4U;Pt#J0|$=#G@d3KP#u8ne$Fw7Yz7sOYM0J|-!=29H0qlSTWl6&A{kGKN!m z+oqgyB-&cz7%B`D1BO%5OSJFLD5TGc5uPLBJa^S9u;Jg#8P3^cQZ8?b!ZkX}aEOWT zF|rv>7&5e82u%?fsl4>zW)eE&X0*&I@+yl#4d7FL#hG|!o6CMm*fIsL@JLwveD;bd zJGK+~93I?Pc|)qhx{n{zv8fXwF2y+}HU7Lg;fA4+ss!}!8?8{vE>d+`OSi6HFsM3O zj3g=+s;H&$Ijq<5n-I^g~uL+l7T1|&^b5I(3SDTd`BKrW2%|?!ZRm&+)kyI;;4`9KAODLFf@DdEzrd$7{ z)wC|+bzhi+OeR)!cjJ#D-QG&4@GdOT$n7?sjIn z`$Kk)q3GzTH5r;j=vS}Bl*5W8ta$u1kc`$fjWw_nlihl$i0QhuKhPn)iA+C*L3!AO zNpB!&(c%)B!Q{$uqemDZq}P1Qy!5$FEy~1hTl`1tGX=G9cF)DT1J^`7vWf!WE|~On zcHEAP&AD$~o8Lb=(lLIJUQoaiqAUG-Y*8*=7`pgd6OvjqHHfZ$n_8izrPXNO4S{?) zV*jDmE|GA@9y;p!j^20aKVJ7UZ}3>cRzJ~Q*}Zz;BetI~f{Mh!^GXDN0Gii( zD^~?COoZJlwUi44g{SMu*Awt;BboW~5DdPQ|M=xkcd7k!o<{6Bv7DU9y^PI~J+4<> zfsG4~t(jcXWhK?oVBZHi7OuzYk~)JJf$tm0S}XJrkvd;qN?pvjCyz7`q(i%)!uEEq zM3XrR(Z47aUho`nK2;Phwt*~z+ zN(i|Dy&oSyqg{@+-1X9FMrwVl~#}(2u$Wg6iPsgx$k*!I8HS)_?YRmcnEWc$-ALyIiU4H;J z8n3BcZxg}8TTy2**JU&ORECqI<%c@mF`~ktiGkDAGP83r=k36rQgK3M?rk~^DBj`Y zmJ(i%$awZmcvz*pWKzr52}d7O5nh}Xl{wOa!b$rHby&XK#l`?$wIU!JuQ8|O7A25EzWA(WPv9BF(>rj$m5Oet6KQ&lC^HW!UIX3nfjkNr&0apnu5kA!DvyyQg9 zwXXdP7->0A;8@{GO5N!)KC^b_aSmFoz*(7%L-*4069WgHc?(uTp*gGWMtl0nFYAVK zE_sS?C_c^;FB0xjgX}#@QGnb}n1z-n*@lc*LlW#lMUx3$as|hwFJIEQOs`mtxZy+R z$}-A|C((OM0^K5)PSRcgCQGv4B1ge7JLilM-Bm_QgJ&=~iF%KFcn)8P{WaNtGgcS6SRyo4=S6<-adRO9*`@)ATG) z?J$p1^!NYd4XM|%qqdaLep)27C#P5?>qdRyXjnb>~3aeR32E7=SuJM?dZN!kctfG zPr6z*52{z+3o^HR4rqsdDR*s zMM?xeQe$}doMlVlI{fFQi?c*Mp69eb3|F%eW}3WbDuQA2QLVQ+A59BPRSZ{wcIN=n z>7lO7Eyv3CSK_@Bab*H2?UKnuL0SlHh{utomT`H*r|tG*_xH_ZxM*c54E;29V$4~0 zXOr~0g7kf!7M#)D@R1l`{F&i#)b~jhEW?K&5th-3*V-X)@%&R%A;#D*TQ5EqKPEb{ zpJ^pti{Pamj7c8Wvo3Y~7Ct%87yv5__C1N*5)PLLCX&&M;keN8!gVZmRp8K?D5ALI z@(Z{bQh9k)P-;jFl|KL{jkj7!et1ca%4A$`m;y%u9>&YV%Ir#(Iy1jIKV8K(((jEV zn0x?4-!d~MaQ42d345X)fk0J{OD=I)bqo89Kn@3p4c-e}Yj9=a-(j*c*mMji|5l%l z&$=ntQ}#XlyP0Z5VwJ;ejGR`B?u+5f=Du+}&@r(O1#Zplnz~g?*={_8 z5fzUa_y>{-vS>Z>)vrr$tq7xI4Vs0PGAI6i4-lbd+^P*2D;U0Sk4S4`5CF(r%db6jRA?L7x5~*E*75KRI7=YUu4;pZ<*)R#wZiQQuB*F=O^wx z>vr0&9<%1?=;Q;~#g5y^O&e4=+x@TT;oQjMe+M|?j9q$7uJ9T4Nqv5_v}$N(6%{hg z+!h3VQHn^n&m2ap2q-pMAfHn;_D_32x+{6hdS#I)=LT+(=HlEb(w&lvmG zsj=s*(`WTk3v5b?elX-XF1M90ow##c;}yHnPF;Z(hE2AK@nvyo%c+z zh#f0l+aqIpja&|fh&)Qbd65OjY}OY1U>sB8Sw$(7sqk99Aq|q;wbe>3Xj8c`)S`z6 zENN}%-hkQV*USUKA3_@;^qV%|nH`t%nD9)$XHN^5k}0W95zQ5f?S`MFPxF{+ zDdkS#%^Ip6h1}e?}lHz=Wk*XLKr{vyZo%Z|*Z7&;WP zCt-4jVY)d}C#>W)%8jPDVSdI(DCXjz273-x4!s%I8J|34xF1BLqx4~B>>E*>e2csJ zrRa6#Qo6X@f0e3*A_(rO6MqL!HxxcCDB}7CI{2J%~?DA&g@tW_l3iYf@^W56SQNru|FtI@Tu)LrgzIPFYndzXl!Zz!$ z9#PazbMgx~cT?-C{oQm~4hsbfP5C>2+*w1fiM{>mxCWJUcpaoJ`-VE(Ug+Ew z=bH)tQokg>v-0~?vhHAI^jdoOS3zTVrNsmPyJp* zBDO(u_cWm%mfkndiKdV+-=lW-^VFZoDPeZXc)^~{WJiizFIHj6$q9gly?z#j({tBz zN{S4iiw9W)s>rm-6(P^i!u)i1U7H4toVq5FV+Ee72hK6TJxA6Y6`_h|$mVK!ap%`q zGMviE2f$<4dU{!&p40u@qrRUvnn_f~ZJPP9)e5p%NGX0vaU4w+RYzrFRh};S>)GT@ zms7a;Hdq}tMOcDFtn5C!+a`2`V|q{fn2TrIYc-@OF{GDjAbcjWQjX zdM_3OO>Pn3q)UeN&jg9eHrC13&+=;U2)Ec@m{QCN#OFoYoQ1fsI%2t%qGK7WC1xV@ z1^R_mMP@{0s*!;*RVLKSrY55xk-*o|Sc}#rGrNiPJ=zJT zw7}frsOXHOh<;Z2p|;fX14hb96$vlHqZSD!I($*EB!Q4&t{6hLSkp!r^McOn1|I?g z@+0|6mN338viZ8tE7MqG-z{|Llf|7(8}Db#<;{*(cYqUp5Y24LZZYzLjZaK)oAv1ME}jB8?B*PF$L z0{#}a=kr8S^#P!Fy;=PIy1DBfJAOKJ@5GOxcGf}nfv_%xqnO6pl)73YFlKyg-uEDj zUwF|0J@W7snO%$fb_8LUOiV=9d7Oc__=JYBC_^yu!{#tIBIeF;r_fkA>;s_c90e!P ziq@wz-F2LfqW_)ggaQoj^%&J+z|xA%!%PSknLnEdGVYvY>;41KI@WD$^4enE9Sydh zZaOe(!@O)vT$+zHEWP)x!#KQ!VXdHz?Phl5*thDnwQ<*3S+hq&f8|X@O6+|+@kMmr z5CJD^njnP^UYTL{>66!cU4WpPa{c1+M$D~{izQ@VjDb%HZ>3%-=avvwc2H#F6{-9M zP#)G?QUmZnY;oU+t%XT3wY<{jaAOm5JYE}})k)wj`-50TT^XP2RUO*;N7Fe)*=&@I z>!D2JJQC!XWtX3amXqkHfClxlnjuq@hZPnYdbD3r>M`3Fb7p5ZxZ9IToS{^_u8kZM zx(@(~-3MSO;M(ThIO}yAF`Uk{0l&F)aoh@D{0kg6U}YQg$UHlLX8n!dZ)p&0k^F#g zH$?v(g<;j8?5y2g>av8UJM5aN35(X;ef8JqRRENcCs|%!)LGa*Yij3;hOnFnPNHL_ zM;fNvu?IujQ#)Z1!`SRm2*H?)Z07a^2xjUhqMw^0qK#y-+AwO<12i^j-ypA-C|B0^ zv*EJ8*zog4i_{eh8hp)U(MoQ2r=@h#_CdWDVN|@@&Zx5R*?LP$pMEMC3K&s9;WRzD zG$JRmVG7*$Y*k-K7rRko76vcwH7GsHaM!#qq5j=bwtwp=&ZTt|T4F|)mK%5@i9y(; zoU<(~M)lW*Hg0B8p~Q_(50E+eHq12yGq)*wDeA~eygE&Z1=(I@iMxw2@bN-EM6VnD zwLUPI7dMyF&cI~F#kKNg8jdSm63m=gC@ywU; zQTpMc%kOtuk()%4*M8Xh9yS-R?SduCn^xsvm71&mLz>FmvWR7K7iE>-EfRgrF9Tv% zJs!SD3v{-2)K;rnR9qC>Dmc;_RofA#=!M5B$g8hF)uNm&Wok9!3@qos+#JK=2Pc`m z8!tb15#ndODy@6~&~q-P1Gh?s%I)qB5jOGB6YB>)jlhgPZ7#`Q#4U^Fal+t1{^{Kh zbJ+M^lV-mcc((TWNn2ce^fRaTj~eEC7AkDIwJGSK-G`AMfTIUju-7{E55O1Eyb%*b;rF0Zd|OCKaO4+r+YWiQW5Tj((s7WUwdU z0&O`8-;I3BA`Xf?x@vKpLDXOlHY;24zHRR;I=?|eZJmODZeD&(J&TZ{p}m7|+}@u#7N~r`b1e2!8hHxv z+edLDgQ442z?9$TL+uuvVxsy#$>+fl;mbYPo$&#&Mh#v88wua|kYUB8t#2ZN!dY5_*m`unVbt*LuHkVkK(-Bk-WQH9nz=?dZK=mo9dWt~&(luI? z6*c62GCbdoX7h&uk>k~+A#}1lf9}#A5=iMu66RMaA+B6q=KfGd@T-9!^guSbDgMDW za@a{WNMj#x$23XP-Lx>ZV|?OM9F=+jjHMAYFf*u$$b>YSLJa49&FZ`T_?L77I15RV zD$4W4B7JjNh(rN9@J~l4A)LG(Dh+7eO$=8?5W)ir7r`VUl#rRA)SA>}8>53UVOeP; zPsqZH_H=OXY-j6QxBf<=YB(4~k{_3-IITVe;whyJ9rg2z~cf}hRw zzS$1k0D{g7GZjX93+csRMr9DodP?ZAxD67rC^r|mqRtga*@tAKlsehU?I+j+vi-4W z!2UziAAl4OzTSbjWiC?KClB*Z?Y)GH0Y2r_s}D3YTg7pJE1 zj{>UzdadYW4UyY0iKPl?G$~>vQlazZx{aoj(+yT6<1I|^74niqI4{(Sa&@8?)5Zcj zO}^Px;-m|)EVk;KeBOIU$EpK$?H2`9Dq$7tKXYdx>PUq{{WQU7;OiImF$rc{NE29c zT~$a=Vu~=85_aT5lKephbmt%z!*M%wcNg5_R4_7eEwGEoMiW~n)?mhnuu9|7eJn(A zz|iolVqwJHuuJ=t*VZ0Xj=7GB6@_3w%XZ7_Rb3fn3(!p?rX5U9931|nEN*C+N!QO7 z(wefJR2bMjdHe-L zX|BsA>ZZcsN&p>!n2{~#sS#Qnw_WHyN3R)xGbXnHwVc^D1B_GktEeAFU|W zeTN_^FO>rAOqm+eP6QIzZ@bPLj7@~lQlbW~&pvY_NCbsl>^JfK${{bK*H<@hv%FI;{@Y@Fo+^w|O!8z6TZYy5pmUBgh$DhW&ZN z-EZwOpS=JIVzYdwviJQ_%bJNZU;)4Pt#1Nu8XBHobq17wP}tf}_Axp*k`Y2+apSs` zvS=v3mP#K|47)r-h3~F^F){*TBd5q@3VZt*>^Xln`M0{~?`vd|8^0Vs`347dwX z+vDu*#Mm?PjWxK4DOkS5+xzea&|Yl#qR*ji2ZrQ_3kGLQe!h{J@4)y~=p(-Qow;3N z*Y)@FKfBv#1(bK^@~sSuj-U<#S%~sV{7Ci+Gyl`-bbhpP<|%xS^#Rx(_h>1x+v5rA z&ogm$pw~)`#cGpZ#%a>Cu6u1+Odt6R|ABw8{R)8uo7@Qv_O4I>{USMtZ9&Gwu{)R; zay_1|EnzkBVj0=)ha4)U0o@L-;wn!BLT~yEYPc+xE z%gJ_A>9N=!E2n7`AAmK9_E}PTp9LivH3T|?J3gK=#PPTeF>e#IHM8buYTR|<+SCt# zzub`n4hrH{wb<|T$j9}W4Jp`gd}F%}*-}Nx(l?3`gu;by8BGL{P9oGu--eF$hza_4 z!XR%rPV$T724nBxZc*|;xm0YoDK+Nx?;&euA=yWkAcZB9`~jZR3J3XxjgZ9NzW2yu zoNXb>n)|kB)c1!7GO0MLepR z1HS%VQx-)octcBNND{{5fRQH5DCXpb-op6B&#|htK^v015py1^mRCab8qs2_fi7|L z)nr?nbK^#|LS7xesxGjF@!?e+u4x+y8|-<4Q-!sa2Tu}$1EV&lV~Yu~xpO$WeRDUc z7#tmdG#;@rUM~w~c`S}Z1RMla!Yux& z;mw`E%(tH!zYlYA!L5%=bHPT-I>>ilm_5q0`FBn18i&ty3j?w!x>t=0BO z&hh4Yo56Hp@6e4X=h;UF3$MrKc>B!}g+|jHc=xy5zLkWSI2Z>!c5#{B?a>v-02Oh1 zoi@a!WAfC4df+HUgR6md)p35fcL$a&P9tP0I{}d3aB7_Yh=#^ypG4jv+2uxVF~i5>*^^Q5XryQeHoGq}8>P*U;?ceQYvw|A<>>&7ZV&aJ(sj zJ53rQo*46`;KvB0>_R(H!4wUy=F|3+Xz?{ZiNeUcrD^rxsye6`y?gt&Z?}+omB$@U ztEdCY#UN>FuMTmw-rw7eyOdQATej51ucyg?w2zof4lcCj46|P|3z5>fM(K}4KLD64 zTU1!LyQ0606F|^K<=qon$t&@&W9?cD!Fy1vZ{X%n89am~Z6Va=Ds2Uw)hu zdaC4rL+IQtm}|u>P@ljl5pM0I*S@NhVNu1#WL{3LWukjjID!>=`5J{&k|8Nx_7A{J zGnw>csa`EW25_Cj3=9j&jS5piYK(3ep5TKj*QjS&?Sw9WB2@&LV8*u)O9KbI?xMi(ha-#Rkhh z1yP?fj&=AA%ZcSc1;8ws80;3}KrBVYL5T?yRO6YTx!9J#z?=QRA!P}}LByL}5{Ci6 z@&$m2`r;*EU(Bpa(Qp)U@Ay5$%x<++ zC|?*TmSBA<$;=0MTB{fEJ(#KuBRe^z4TmmPNYl__(Qke78=@Qo0GwLm^YKXRBd$bv zMtrn3PRCjvHK0DpYmoM0IVpdY*7RUAQ)51m5~;i>jCmbPVivV7`2ZA<5n~_ynzJuE zV2BZh(p!gwp9Q-@I)Fsaem$_9N0woVA6hS%Nu4AjT(#FiyY%Bk&3a)xG1t#mf^v)y z;PZ}AXSSd$)C=SX(UuA!TC5cfT0gZfGADMVD9`aald+q`=Ad3gD;B4?GwFMzf=224 zg%O?U$1`1+E)L?wN6da`$Fv@6Ksggq#*d)C;D|A-X|wKy+L4R67B$amosY%aNI*Y1 zTuM?(5{Ev-lzT50S~ltv2*YhbQJ{E8K;xrYyU$93;bP1|J8&hf^;NS^Cv8S9KI5$i zq%PXOScCxz?cjo+<(T$rm^7U(Z_lB9!2Fy)nNLg!&g;b>e&CigL8X>!B$N%Oz_AoF z0Kog5Tjz3A5N@nS^!9)nTIrtE3T|Q?=jwonl=93&c(aBZi4|kU@RJ%`*~TdtoiC-9 z#^knFFtIaVe5xY9GyT=qN|ZWL@-K7O$qFk*(FA+e4m6ZiEDGjQ`y64Ja;^S&yv&hO zCl>NuAzDMZzK>)!E5anWh82`oo+L>ak`)w7i0cu>iNaXoz zHm%*y+!&XqATR#spZxWD@Mw}Hb?h?FQE?Y00 z&H~~z60@IpH8Cx%Tyb&&hVJ%rUzsW zM6{IpgDWXiD$;J?zb>>HXSN1PT@RoUQDk{&Lu=7%aoG9>K;XTLu7%eH^ZBcDze69J zakS%5Y8m*i?6g(OZ$fy;vpZ@FBF6aZ{Y(e9{l;5&Nl7gUK-E*35vtXqan0r>WC2_1 zjE_B9+mZ#Fy1mjEk&{OFIXb&sP;F8_p?_>pB8uDIb$@9Ql&wl^18$ZJ$W^J^7pLDC z{c$8C=HFQY3l|752`3F{QK_Ntgq3BEZYiV7m4r%rW*GD=l{a(N55Wn^yQmSeXm9l$ zH)VQMQm&enKZ1fq8l;aFTCOt)VOzR!C2+~H-}+jpjiKMd{xmyNuf#kjbAkt0NH1C$>Kwbv(JXbx}cn*DYLmVa{wi#3EwTKAsiI6_+#QJHBItbprr z-?pc%!_Q6c(cnUU!O8emC2aK4ny~Mtd>ohMcJmknEwt)i$ z_Jr9amS2LVtGzC=U$t_F;uW}^wgv|17duG@yt(a3${ys<(W~Y8)%zllcoOS#Bp#4F z*7#m<1bgtdpE%`TAlynB@BEJqvTWMxQ&a@}9~%LvwAgf zFXcTnQk(VZdHR)qp!u&ybjau_;SB3KN(JJ?e4(a^z#Nchf$&sgp+})Q41^DZl@4?& z2SdvCkaF-S@=dyMo=fLWy_0ugwff28?_oer5>2K#@`KE$l#47$?~AQ$X6pEkA?i1Y zdN>tZK-4M|t9<8oSqleD@;@w!lggs|X0@LKgZSaw(;osKmNE90E5b;!DTx&D3OT2c zl6eosJ+Q-%#l|WG><2o%?49lO2j*G<^vrR>vp)$_j{?IjMiSM75)^Ak0?!Z4s*9kL1@6$V?$sSqcAzUgV*e zy>vvk5)os&*giJ1p+dR1dX=({) z36;Czqa6tLS?MG%JUkJwOJ?802>v^GsFM(JtQU(rJ_U)U`HfDsOuwH0C+jn1CNt9l zGqkG8Xq89ShwBGJ*Pbb0_aP{Prej4wz`eKV3g4B*<^F|s0DtKwav#VDTaA4Zst^X* z`)nwO4iP2DCKlH>ukF5P$8ec%JD3fVG z5qv2q=1o)wf}(2De$qr)PDZazUm-%E023M9p_1i?ye zkgu^s@$4Q-%dSYF4L&H1g0#+OFXr|rjRhrjgazE*_9YIJzRAORW z`V@LHvKue?jV?ym;@-t`VTfRTN*;U*b{bm`S*(rKtfJ5)fz>7^t%+wKGmGm*F+mpD z$JMX-Lu=F;-0vjQ?@H^#`~hBV>F`$S3JxkHddgR=ExR$$-#oiE8uF@$xKL%J$Cq(C zU^Of~l;+BfD(Q>LKDTV|G=Vd?%WLm2Tw{OsKEa!Im&@AN?t(jdRe4at|Lg(t&lYtrOo zu!RwntlS%mMb~h(b8D|!zhDLSj@^bqFE~(NlmZ5-oZ21x5PWZ03Yab~!vo5W%oGMf zHLbutyVag~Z(yqN@gDNUtTcyDIRGs+`$a=)765uw*d) z0ce?Z0ub_zU_BBa^e8otDmDd{nH?72$L=47A9%LS=z%}_ZDc1_V9C1j>SykuKBiNp z(&)R)&zZsyDGL&{oddThPYSbwjD~G3LB3JA5nFr?Tzg z32yvSL+FUpG;S9Q6TIMZQ%<)R7Vt91rW`lDG~>b=JMYH9e@xR!1Np6ApDOh;(G3y7 z{8Cy>_&577UVSqWDG0bUHIq=H>f}oF*yVZy{Kq2QK9Am8wBJXG&d|88lgtpN$AHt> z^7EiGT>=G3J9XBXGBYmzt@;-!(Tz{fId!TMoNtH3X@VaB{pyFb^nU-n(;;Z!OlYzE zQcc!K!hxXz4NF?Eg)8u~5d;8>qh)fA;|5*WgcRKerQXc8I;~81CY3HUv_|^+iQ0>} zb|ry=-1tYziA6sz%6e8Z>HQhy2oA^oz5ki&v&=TbBVo>lp4W;%%LQ$*$q8R=-eZ`xszzLnzaixHX{ZC zdVqO*u_*W@aERbNXbf5QeDYoI@8xd|tX%}U5JOxrZdr`Ej_qy=@N~Hn$X(r(7hK7ai&r^b6 zvqUZ+_o}KpJxh6L6xBjK5E4$K=h@r5^}1YUnfb@GY!+P&-TGHUYNqUG z(Nh5p?$H-NAClLM@VSOc8i~1vSG@lcR0pg0H=raM7UY3Es31J~51k^0nWB-ord(rP z>yZ2!H>foRpwv_vgGXWgG5-Mn!~i@I00II50tEsA2?YlQ000000RjUN01_bt6EQ(i zB4KeOGBZ+Ofsvu`1rS0|(G(RhfRM4_Bw}*G@&DQY2mu2D0Y3oyECOhJ7^NwN>`q#3bwhkCr0zyD27h6ftqq;^S-@9MQPTq; z0c=(?B^`&4hx66zmNJ(J7n@ni6@#u&@1C0(LpHPitx|D(OEU;~azHg_5A6;uBna^? zqf{_{&}8~(9ewgCW0`d$SpNVIhvCe=rrA4rIVy7Gbi1Qj2Q0W(1eR(ZGl+~uD=PH< zqW;10Gp`Q|IqTSYIlyqNPxhI&cHM9N@>$`CT#N>AUcMq(Q8YwWtI6~J2N}hV9cg!w zx(wi8oi$4{lF$4;F%hM3i{G!X$k`G>5a@~ve@td9#g9^NI7HXP4+<~w$(%_mw_biyWPYcpAM=Sj z!NT)6lj`g{7eExq<(|OaJS0hWIcBu zmK}xS-w(rC`bm3ttXLHSnNID|260G{mD8~!agabG9NBvIAFlbz5;Msl-o9w<{{T4; z42la#LG$2Z#3q%wb|VL=$>2qe3InK;JQXJ8379pE=J{SqsEpoL1=RhB5y6uK34pCvuzU9(w_cCp(F0 zc#etDJ^Lum9VI2Dl=_%ZUdl2U`Lo8IuFt?^@^fS-u-JSvgQkjT`;vb#iNonS=GheV z`o|$|bh1q1^lYj!B>6{{UEFpZhk=Jsloq2iorh!@Gw9HXyp6K^d*in(rw)hK-CMXF zPu_BIV5iN7A#8k~109(JX%bl@?inPUtMzJ>iY?hkf&B7*4jJ21ST$A-e|ACL+>aND z!0@r|5EJjd005zrK^*E8#nG{xn7Lf7BSlqU;h+&1f(-|#$f1rX^div6;EE{uXtcQx z2?PvT7k?)?5Se+p2ERDGEDJH1C#?SH-J@{p)B-V%rY5S+D-<@Sjx)QPVooExWR)~d zB+?@@1G{y=&8uDdyymyo9{pZ$vliE9RoJfH?U4%j7;S4d-D=Uo745lNuT26CH7 z*y=7+4`43wWBFKvZmz&=e45DBT3rU{hOf92i5ovpG%vaFoijqLB1Su#tZ3a-lh}(L z#!3}55DgSouZYPb(=(#3%CpxyYJIEZE6J_ zO{9Etme*T!v%gBlQihL!aTivtd{i3q!4* zm}Ao(qCq;y+t`08M$sZS)nIWXDO+!>pTt&k2QoI?gdl)VaBmgWW!FZi(7z(FT~>ix zRefqN2`ouHPBFOAKCS*{@<~j9-Ps_W_Q@F>AfrJ-o%;b;@`jPxwsA~8`_64$3K~=| zwwx0VYd)T>b$z@X8cMl6Y-#@h-Y~F68Htid19o*`?WZ~3xZ8hAYNBx*qZ8y&$8Ak} z{pRvER4hm)*G@*^1y^J6H-uQMX@e_@twbMTUNIP>hV~$jAd0~#K%rKEQoo73=6cEX zbO0ONR&!LA48D@(fE!UctK`)@Gattb4o-?Ut5y5$le)2(FY%qvu*qFzHp6rCvE>aT zww;}6hu?VbsT}~ILILa&@<--7Jyo1ZbcC^G0SbOM{cyFSFV(-y-VtDrIA*yPLcXdu z?`v3+6bb<7rBB{=`}sNOdfTKzo_oc_?&s35DMzqRC&x~ddgE!*zI;#t7-Zfhfy$nK?UP7j{n0roZi jY0Yc;8LfXqHLvJqwfzj%zoDAf^f67dABXy5{{a8l8{Ci* literal 0 HcmV?d00001 diff --git a/htdocs/install/doctemplates/websites/website_template-style01.zip b/htdocs/install/doctemplates/websites/website_template-style01.zip new file mode 100644 index 0000000000000000000000000000000000000000..52a4501cb7aef1048b70a0f95a29cdb8380a89c8 GIT binary patch literal 12929 zcma)jb9kN0*LHSnyGi3VwryLDZQE?rpmEaJb{gBZ)7WNXf9VgWr#bKYUf=9%_Ot(3 z>mEI`X5DMnmX!bjg$DXn@&%BU{`KQOUofvveQPTRT~jMVJ9`@0{|G|(MXqfZ_kvvcssgzT|0B8?-J5)%yn+@hw$c8 zWbW#X9!?JnHeh2nNa`B~!m%}JvbdBh>k%7G76?+u@ua4utxD#%ury6*+<4+-%$zPJ2G&l%FXA8SQ>0XyEqpVB_(2Z>Lvn>#Do>)5Z^|&8dsU;&;ZP zd0rIwE=4iCP}Z~>;xS#5q)_u}Cdf7q0r8m?0>B|Ca1p(U(d**fnDXn?=-onlTf9@3 zmj_#259iy*mpcasPHS)=sfD^YBY_k0D`X7qGWoi7#nHS$a&{2j?w7#W<%Zzp0_jK% z=$T%UqDT*eM@|@%YuzFn%eU9}W_E|}kDY#p+dS7VTOE9whuw-suJ&3_wM?ocuCe7w zD97)TP)XQQ?wk($efPlG6K@cXfpYdK8$*$?WbO>iGjZKcj)KF(rUG*Gk9wt2ZHMw$ z)r6@Q?}T!lyQEP0SYigOSQzpeU?Zd&P+1rQWW2i+tFyB+?V+Lkln}71a@h zqtqK{KL*_AqmInZ2iF86_P9!Ht<~l{Z_W}zKOzPxe40?;bjhdcm&8YkqsozN*nSZX zA0(@Vv@e*bQgnV`{z1N4dGxBbx0IE4{Vi+uBik*X{nG9DJ{bX(jy3r^v^@`dwWrW* zHQeWIv#S)WrNMVC^tUeH1gXv%v{uu8#rb~dv=AAD8$Cn~;D>MNk%pwil}a8Z!TrRjT@nD%uU>hzK(z%{C3aBmaKo3p-127TEUTwF?^F+ z)x9`r3F(YLy5ZWw$KgYII^RBsVKb^ms#+zQUbW9>G*zLJ=cP_YT#!$i@Au=5P|+fG zQ78!@>hBDzLV^cpA)c$ye`K{x#b&2-N`)$>ZA|!2~3Y|=% z$GC%P(SUq~I31!uq$!t{Wh;Sx(Q*0EPSd=TJPEOaEjVwi+fWazmvA1pWnIBFih4qr1Dx_e$bs!#Tu!!DJH#P}`i$=pQ>n%x2fmmW*1O zRK^UJcs#rvyr4oD+1Oh#WyZ>^qBP`=e>zqzZV3uZmEP&-47a$b$45 zjd%&D<;c^0s*f5e41QC6OJf4WR+Im)#SfE&z-?fkc`KGi{i@NfsP{ z2^{GJm@J@Q-IThLafmi%=LV|tIM83&3*tE;5>QWB5#XkGY~ z|C6@@fio1o4jz|0n@`<@VS7pN#+4nH$nGh{CU@W*K=62zR0q!b&KdnwQJOeZG)OgD zes&kNES_5lY5N?60v@0)$Z)eS6>I^TL>0gYsgT#Op?FB0R1AL~w2er4&mKiCfh3W) zq>wD}I@{w*E7YZ~%Wj{`p72#RvGit@56&ybKb?kEfz(#;o;=u|SqbVL z3~&+$pIH%CPcQOR+R|c}>GK=J>in`=)3rkCGjNIO`C593fR{x{ zW6`-3O}jaR8^#&b<}DMl>t&ONg97oxtTLwA35W-3LPMmy#5@POBSvT<&rGv-gI_@g`AZ8^$mK>6XKGAlQcma&p znOhuYw-!kCLdDkg`ueI{Z4+KjklwdMjC_DZQvmhPY8&eFJI!vzuX%`8`;tb*T2-Q( zDeee#UIFen*UHgDi8GOKos*K_{^FC|JU>+%4CAdE%(WjD8}KJ0oQEbsInQeD*$KJv z7>;-*1v*U(5=By^iY)QZJE8NdX_Bt%n{M^`&+#C`)z&h)dT`C&;}TJQ#*-lTeNWIF zWz$ZVB0qc@TGM_Ar$H%zJU9jv`{C&FD8R~XGOFf)xk{uMYBY0}kzZj`_L(^*7@+#MKx@mf$>GHHpcsjU(fRkEavyX+X;H8yj9^=w@!acK&H=HqW-z>yTY7_kdcO})9cGGF8IjfaoL3gjT z_S5;WlT5PBU~%$_DgTtPB$v8-{MTxX;@zv7F-gjI+Fk4DOb+@{d>6YRY8tUToS8db zvnjoefn1iRV^WqX(=I$e?F@brn2nL1V`DBJb$Hiv9lq?%)Kyh36_yXOa!j`Mi~}^| zd#8QdsIl?Sgh62vb)B;hjFh@yVU-}FnC8lsvThmaGwzUF&od@UU8nFB;J(wIv8O5M z(EZ%|G{5HNv_>kN)7b9=C5)jfJhv;I65)Cf-+6T(AYW5iRKja%XfBd&NUTi}*`j;` z4!?QA$-9mYlf+vo^z##F><=41c`phsb3OX)TE~O}kMq>zU7YoWn59^YOxo8*(O{i3 zEhN4(P99g-XCAk(1L2@}KG@jH(bs(kjNKJlDTS{s633Q{a(jd|24>6OF&UrKH2ELR z*ObxKgmMhU9cDQ1!Dti@+>B`lTKi5dJksM>?VmNg2N}!S=(!8kQBI!xko-U)R7;|R zE7%g!(YR)m4g)<(sJ8*L-3mPKRI|oNdi*Ixk`5PYn#BR4)_$G3&O5*MW|Otn)3Crd zZ>hhUGbWE>u0d=x}KsI7NuIil5v1i2>O#`@3%M$MTxa2T4omvCVQ98Yv>p zojTSL2YBxRj*NT)d?hSO#zhB9?Mlsa3G;f(ZbP@$gxcf~nxlFq+op{g)9cV#bW05f zPG~Zd6rO3D$NFJ&o}z}7MRxowL*koFev*@HSeccobW{9U&uqG+R-PZvZtCDrp6A5% zt2^Y=MG8YQ7)#Bz=a3Q|3g1L)c%g|5gkLy(rB4R+8gi@WZd2B9RROeC=mDAEO{@6> zms5dM66L0XqZZ2Dl+9XJ>wB6EvAkzUa|)#^aOa%Vv+lfk6}1QIQq|&6%*{1gPZ*fi zsKM;NQz4VXLN7a((U~qP?^V;tfqw^-e2+yW*)St4Iy!anU1oQ-E2PcV-^e|q8D!8! zZ{#gxSNQUNTv{LelI%pQFt*hKIh({LySW9F8j3^;wR|b+CwxhY<@M~lqpP&1&kjX# z4byiCxj0`OOEg14@A=!%_3zW(5tQjF5??QF6X{xM89+Jl4cVniW4NZt3t!x+B(=Ha+kM?ccqN}FoVRh2uXgFM2Ho-?mM)CuN@rjR1e!fu$$`Krd z7iwr|Y(e5E6h&;BuQSG=ZC`$36puR1o@+@Dmzj8|J5`V9Gr%t-{A4hRt0RVt6C>T` z?clL;T7HbrE{KbqZ#GHBp64PM7#mf?#JD;Dh<7Jw|x;*ov%=j{wn@Ha`<8ghsr~IqsP1Isi;=&MF3@}a!#h|5}u%Mi& z>qVJ~%~r$PvFo1oyYq*k=lzZ*t%p_KqpXqCS?AA>NpgJmoKTPlvGvD9g@W3Vu{txR z?rFNro-Kh|natItuE&@XLjEE#?I4FW&T4I@FllxHv?!oKDBY~^V)I3?V1t(tqwqYf zhpAfEV`HP#Ewy+yd>+COUREp!C-!M0CNPbOlpf>XpkZcI7fpQ?Tc(JPm8#q37QQMD zBX$iG97c9ez~NIqk``h9$QBc|a`Jo_U-%l_N&2NCQqVC~5^njM^aKuBT%%g+VHwJq zV3c5kSu`@lwv47o)Vu9NfODQCCBhblhJ%hHZU=idK@g>g)Tj)WR&YJA?nLniuT4Y)iz9|{{B71Ebv3k~{wZq|Ob1J9As9&%`jeKeUfsa)dn zJml@oy6e9&th66usdE_5RA7X~L?|oy@PUcbEb}o*0s@a_RfTlyhSWIFyB-f=N#MNz zbgmzCbhx`Fa(KTctk=iEVjL;Rc}NOgG=HdiHsUZX7#e~>naO!P8&N*-wM*+opl&H1 z(6;@Iq?R+iB$p4vRzkEHL1CauC??@&vqQ#Kr&B%KK~q$C-eNs6?;ymQuhvaspFQkw zUR*-%?rF4{TMO2@wr{^mc9jlHTpY`AhD=g&aE8jjQ*+~ep8YH_0ERn}bGYXJF($!y zl5F4TG|YU}CwROgLG*nxZ3>G|6e}92WMZUFNJA%~0RFcX$dJG+UkCzCEH7U+d%aPS zu(eomsdB2i2A*y@!Rjh;ScFl6LG1vJ!%@90&;l+;rBN*J#Z%bmt~mTzSqwy5yA?WWCDe4i`ShMlAZ# zq5>K4jr$vS0&|H(1i^PA>JoQ6$>xtIbUHwMq{Wwa0d>A+IW67p1X2+#BLpGCPX~xF z_97ZZ%4B-sqal59{}NP)E^wQ#ZvVa?e8Y+^OPMNdOXl6^r@$fu5Dh5qcNipANVlG5 z1jc3g`>AV(8(d4DAtIk_bsHhcn`~7W{Z%yh(Ax+yi(T9>s>r4yr4!9?c|{2iAYqY4 ziNgaZC!=7^I@>jDG>BZouj)Bp!;?qnq45fS@=eYqjDH1M4ZfE?u)I+Ck1?ZiMvT zL#z_sz@`s`U?4qrS zbXa>yj1i|Jmz7T3&zc)o4HaUFm>5J-~;o)k7C}`8o#4$!+Cb~8%#(moNx~NnoG<-)lSEu8=_PyeK^!8N zSdKirX1+Nh=49Lv3Qf0kgIm2oJrO*#0x*p&c!i_ziH7&xm~Ykyv}Kx)JwrBJ#f6cA zvS}Pjy+`7KSLO@zPjg{E3PCGc%AMd~?3OfKgV+E_-f>bY^l$ONSf0Z_*?K>L8WySo zBhWj|u#Uvv)oeR-tT@P5k^*GhrBTl18A{9u%XZdCc9n;6CiibgRV}8tM-6_Oy z!>qp0oq6g!T9uutuh(^+KHgG1&T1osu9l*CQ9LT&rs8=Atll5$oXz`eD>Co8~x(fOGDT2E57_3#!tE~2X!WdOuEVh`S=ZFbHP|3Ue4YlI8` z5^*Sm;PgQ9f!9s!jrwt^q!RTh_1H8^WoS|f=qHFjrW7iD+7GJZ>VHZ(pc$XvD0@zZF@vVl{3`@2njK0;@lR3-Db8} zX&+061>+;a+&k2b{1R3`*6POe8w3V13vu-7ZZ<`|t7KEkO}QtTjIcyq_%0_M3Q5N? zWPrgbw#)pmkcy^i(_^!2{dGHVSzZYs}cp7TWU*gY~rF(0f7btnb zA>2n0?YN_(Rc+YU9`tpPOUq%L^LYy@@@O9qjV^>+0T*9`2-{?(3yeNnwW+cVp$Zy{ z#Bd9R-%%fvxixqlK1{y=|LH{%{wx8IzIu-zUhA8y2zensK`9|>O9L1gDe_TDF(px% z5eX`BN--%p(IQ2gfw2L}S4Jyu0|zZ@1OIay_|1jHPu5unFaQvc6fh7F_MiT#iG!tu ziJ`8+>z%}}pQ(`&R$cgrfj3ch5Z{DYsMZ*x2$cxf_%XNuJ)4-{K4HloEY9_M7Rad! zY5F8goO$w4VsKKvBx<=K{HA^**=j!BKP7s<)=pT>kv&C(XKG?#E!Cl}?LC#G>A-?4H}DYGGkg z{vSi1tS(XFITh0eg<5shm1Rs@YZ7O|(Tv1=$qypQ!w!HwUZM%$Jw{IE4_Zj;-w$~8 z8Bg5aDs(QOCkOZAXrdyFadp`Wgq>m+CZ>LV&Z)r{zqqdOMFC}dXo6I-J7Fq6s|eM zKAZTohz~ZNwzw88vbqh~AJyQYtBEV~zEm2-GR(5U-f{`PlbzuDrYN*N!YK9qeD8>H zEZ@{Cc}Ewbwr>42oDpk;es#i^h4ymEMnG~PT8C;CVH3NQXlnQSk-PCaL37@$v2 zvFNhh_#}9snrk5TGK0r2Fx9#13pGz(MEk_1*1ltbbg5Nira>cfQJP;E1S+@2?Jh(~eti-m_RxZ>@_hQ28+3x%e{~~rFZ=HW# z8m8A}dc(ggb?qHq-)&PX{a@>2898FrNsH)z>J_pdfLN$=C8-1&5=AIS8Bm?|ajQ4E zx74;^Gg4s2xqN@D@W`-+AzLP?B^583XcLD*ABtwHznB+0Gl1#jxLH7ewSYQO#1mdB zQq002*gbK(INxO#kk@6t3PuXCNxo>Vm)Cm>on*Et8W9sz+P}rFO&y{~5h5Z-OeRdE zA^nAt#!xcnR_Dt_I*C&*DRbx*9>tR*P2ya=nDHu(%xTMcwY8>@=&hJ5H!O&CXNTRg z+C@q8syVxmP@Phrx0{T9uIZx!y?(ldS6}O!?M^LmGYts>1e5{(kLj>?aJ4YBr`EUs z*XtUmWNE!1iumji{}XRVTwTE5GFoFHgt4>?P$OzuAUe6iV&3w8Q)#xTb(zUu`R)|g zPe6dcnM%~;iI!oEfri8DsdiZ63!w{(2T!Aq3?8?u%x;3p`WZMzK2%kKitjP&`>+qT zOKj(Y;Kw`!J(8r7i_cfvHniM$Ef4PW4LH)=2p_#5(s+WF(YreK%p}oqZ^6M|O8q-j zD8k465uOTkW;3AzHVDWrWY)@*oy%0A3ygS=#5r^(@g*?uq57s5zX%ze>v%Xl*}B-G z$@Feggbdbnh=vfG*}?2LhrEQg-gud7rb+7^CfFW3O4&vG_x38%^ON=QWO<54Rt*vw z@DoD9pz!qRfH8nk{ zB4Bu0um`$6b=I8X8%IBpZwCPjlH#PnLr!LV?pjZ9D5=y**nD2&PgrbA{Nc5cZMBh` zR9j#kix)oJScOpZ%8(6velMBy!Zvy1r@-Z5XbhY`E>3D=Yf@~c1B2*FZpH8LF5R|| z2Mwn(RaCa5O&lv?TyhF1l_hpCa)!6cj|`?AXl6URqxjA);|T zg?_&iMKI*(t2y7Ep`?x1ySzz{M}AMHmsj&3*CdZ3it-~r)h=|u@#E-z7DCI8s-AEv zryOsK8n5l>zE-r?`nNmoJSue z$x|jM19PJtU1ZMz3z))4p5UT4EHLF{fx#55fr~u>#V>d@s9t{#z2B}jt>(2G?_Le* zo1vRp85p|!vZ0RQl|{gGh(Zq@JyiZPom+9AvqlJ2n(MxPouMBJHz!VF#frMQ5k`XP zIMLck>!MWNj|{U{d1%MH9p)e8V%+!;n*jk1CW93W-izw!*Jc#DnzvHooNJBBz3DOn z?M4{9%?G34LT?0FN#Q!(x5j~NDzi0aDI;FmU0}a?gLy%=|8l!%L{HW_Gy{|U{X{qQ zNkyt7ez%y7)xZm(mCa(?YRRzth@8W%XJ6h$n>t;*N-c@w&tY;V^?cHJ9U{v=k9132 zD^nvw`(FpTwbj3mbQzgWUc{c$CsZQ3YQcr11edi4L6dA^Q856QRqZlBd2zXMIjj42 zc^RA*o6Ti0b@;S}g`tJ7lC1qk7jxxnK5bLF>aKM{ti~qH$vqU6+&B&{|7TlC(PHy+ zG*;twn;tOwKCRI%{G_m;I$KVJ%|6;%^>K^N{cu`L8p5fG&j_-&YPJD_A*k#4r$4-; zCB6=B5?)EtH^HPkHU{Uw%35^P!xZ`&L6a@=86EVOXsh*xflip*AxdKqhi3)IN#*kM zYzBKLj4+(GJoEe@x=9_1h9YB9TA<_jkw9C3<1RP_*GNQG9jyvscYiX;bX{IXL$fHW zDAqg0yropA8K9nIE6lXO<0_CfUbccZ4^Tq|&q$Kcoh7`5mhe2+5SJq|B3oxHKmhl9 zH*}C%pFIk*=Qq$GEH&BUV7f6&f*O{CB`^1qIGlEUArwbVemrgR4qIfZ7q9J2Dh@9` zk9#X55YYB(6cy?9C3H5_vp01x)czGhwWqeXwK!J4dySr=KXZBaEIJscN`h%}Z?Jw> zm{VpxVU?C2GUeFBf)nH?)Qi*sjDP<*cM4Ll$jt3>J){q!OAnae zdx?asz<_bA_CnNVfw<2LRdzKRB#JpmVEh?crE_AA>C@Mljn1;(Ub2h6#j{W=Zs(BJ zZP{Gl#`zW6V0NH2P7i%7eQk9C_2xIKBKBPiWbr0-zU`H3iVSd^P(MYHtTed%lm)aNm?(PG5gQo~KAeCdojLfmQ(S`r6JxFy*^ZxK2;zn;}*X%IS1v zJ)c3NR3MQ7$AtA9IDhMufjJ_Ptg_fysF?RPKw?~>dP-Nfsn{T_4uUK`J~$KSO8Ikt zH=!P5^~s98pv)C4mj?%A8pIN$F)B* zTQr3)9K%#Eo|$wH%R&+sF){?rMU<}mX>yFCpNCyw}GJA&Qd^JG){5-h_Z8e+3D_-6U65eb) zq3PPPs!y8=$1zYVb@$~C*j5PAH%>hLq~cXaTb3SP9(U*6;7Q10DJKR!Y|Y}7H4M}IQ=fl*a%Dr zNI6GP!U|^IN~WdQXKEdJehLHbc@irc6FT|)2Iqk?uZ3q zS&A)1Wc(E1?q!+(Y{9YQd7Y94qruY}RH3-eKoWr+r}0?>E~dQFCpVtXK4e6HzJ=(~`&vT_LyF{lnUACCOU|*g1cRq8oAdQ2%Kn7l)X+LvN zj__NNg1;BHRy5N8>P+?FlFTh2D$*4EgWg_+2_txIv*LJ9L<_s1Z{;eZaKttNf3M%V zsU>piO&TlSqQi=&9g6g(unAr$X~C=udjwrs?D(QB!DECb<`$3ta&7?>a!@u5ffCF3 zwlgKMaNZDNUq3-QeuSyFCe^2yaGaN*24z^VeNtmWCu32aneBjs$n1rQv9h0F^hAx4 zBLYd#SESPeVNt=~5beLxeGghMK^Gj&>T=3bVew8e#y!d-+uvJ{Nn!HOC^Ql}RG6{% zoI_~X!?>J9@gq3?H=4>yYVTu9EheO^xQn2>81jmAq+(M{7EwNKjSW=Ru<&*GtiZf zc6UC^I6;1vAwnER(%&=tt`6D_kb)#rq8|p%HWmw>Us+Jloa&osBEX53%p3%Zl|_0y zEE=|LllXFCUV>S`C2d!&*Lf>@n^RHVi5(|-3(C;DmsDow7$ppbR*S7`yUM)`(p3)= zNDZ$d+U-I^ADJ{$o7&Niw7md*Lr%~o={#fQvmXa0SVJewj^8wX921V3InqYCS^qfJ zw3)7Jj4HN}(vb_?nqz^G%;bW(L{Tc*w;{OLI^r^7!wakVu-vy^Ib_w)E9qo54gcNz zLYjv2o2V-zDOGH>6zk*^tE)B3tVkF&IBv{50@lJHf(gHtW>Ka@aJWIz&m0k8v!J$l z5cl3|wrp}=7Wq4}@4OK$;i0q99g~X^R+)agAbt;Zvtb124o=L--@-}IjUHXknkoe> zx>zH&p}^4e($fU+%|VRNK+rzm2^>T^%Q|E*b+4oA)+>EXX7|06UvxV|9qg`q7{3iFIk*>-SE_nNiwSLs$3c zov(DS5G1B>s~{(P3GH37$_+YU9t-UE=@yYagN;1MIvD{i>;3bl2;ksIh~o$tnY}if zB36+X`(bTPAezSLhw;T@%|{GJ)@XAgD60m1w(2I2@G6E^$Q* zfiGI*JLIz{eF5NAHmD;DQ5~?YKv0jZ`N(!>Y2c=J$SQya0stNxGx1q!O#8}T>fS(5 z9@o_qNrhPtF^>odWOfPy=exrQXbC&23_=FqLg41GdE>_}ZdG*o@wx^GzckNEQ>JBD z^~Q#-gI)m`wesYkDZdaua=bUeiX<|EX&-VdtNftVRxy1_m`EFKU>j7Z)R|wqWDNC^ zYdrSBEkUc2b|Tnb8n35WNwhfrPO6o$nnLMuj%g|j!{&NjuxPHx&plWG?qQMBd;TJA zHNCgudvsd#j|H$C21F~sD(U;5C@+JYVpVz+fq_Gmnl5M>ue#&wNqwIY3o`(r|2(PQdOl%#O=gzLUZpYM&zuolgShyO>A9pyQe~#Ux+&Vd09Ij(kE>A-FDD(B<`IRpp@J5 zeD7d+-?o^oB_EwSnW`xOeMX8wcfrXR8K-Qa;$iV{r(DXW$)=$Uwm$NKE{yLFaqk|8+tCnV<~u>g-q=8kp+-PEP)( z&}%;Ne}zmfUp=C~oTq<^V!jpqk0)hr==y(X{YswxPcO{=ua5kpDZl0ZfCd1g0{!nf z*spr81@YgHzcU?KiT^4>{*O7?|Iv7TkiFKwQKY{zwBI7U&A|SR;Q1%Q-}15FV!XZ7 z|BYb<|3@$WyyAZg^ERsc8>aeoo&GkMzhb;^5#B~`eO&{{yZ1t^Q9_^2;>+yZqX>nUsHR{r^kpm#O-9`K8qRTj{@s>%ZImpY8oJUH>k> zRL|e4{(oAVf7_s6IKNOnQvKEIe;Ky_z4c$F?ce2>p3EP5e>4sD8d(JbLV5k{g8~74 JeiZ})`hSTB(vScE literal 0 HcmV?d00001 From 864367de16b923e4ffeeba55c074db3ba8014b9d Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:41:53 +0200 Subject: [PATCH 0027/1289] removing useless push --- htdocs/public/bookcal/index.php | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 htdocs/public/bookcal/index.php diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php deleted file mode 100644 index 4071c62de1f..00000000000 --- a/htdocs/public/bookcal/index.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/public/members/index.php - * \ingroup core - * \brief A redirect page to an error - */ - -require '../../master.inc.php'; - -header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); From 2b4278ded2e0f01c15ac98495203198eac7dbac5 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 18 Aug 2022 08:42:47 +0200 Subject: [PATCH 0028/1289] moving useless files --- htdocs/public/bookcal/booking.php | 787 ------------------------------ 1 file changed, 787 deletions(-) delete mode 100644 htdocs/public/bookcal/booking.php diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php deleted file mode 100644 index 0d39ebb13ed..00000000000 --- a/htdocs/public/bookcal/booking.php +++ /dev/null @@ -1,787 +0,0 @@ - - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2021 Waël Almoman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/public/partnership/new.php - * \ingroup member - * \brief Example of form to add a new member - */ - -use Stripe\Event; - -if (!defined('NOLOGIN')) { - define("NOLOGIN", 1); // This means this output page does not require to be logged. -} -if (!defined('NOCSRFCHECK')) { - define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. -} -if (!defined('NOIPCHECK')) { - define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -} -if (!defined('NOBROWSERNOTIF')) { - define('NOBROWSERNOTIF', '1'); -} -if (!defined('NOIPCHECK')) { - define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -} - -// For MultiCompany module. -// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retrieve from object ref and not from url. -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; -require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership_type.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - -// Init vars -$errmsg = ''; -$num = 0; -$error = 0; -$backtopage = GETPOST('backtopage', 'alpha'); -$action = GETPOST('action', 'aZ09'); - -// Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other")); - - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); - - -$object = new ActionComm($db); -$cactioncomm = new CActionComm($db); -$contact = new Contact($db); -$formfile = new FormFile($db); -$formactions = new FormActions($db); -$extrafields = new ExtraFields($db); - - - -$user->loadDefaultValues(); - - -/** - * Show header for new partnership - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') -{ - global $user, $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - - print ''; - - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '

'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; - } - print '
'; - } - - if (!empty($conf->global->PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION)) { - print '
'; - print ''; - print '
'; - } - - print '
'; - - print '
'; -} - -/** - * Show footer for new member - * - * @return void - */ -function llxFooterVierge() -{ - print '
'; - - printCommonFooter('public'); - - print "\n"; - print "\n"; -} - - -/* - * Actions - */ -$parameters = array(); -// Note that $action and $object may have been modified by some hooks -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -// Action called when page is submitted -if (empty($reshook) && $action == 'add') { - $error = 0; - $urlback = ''; - - $db->begin(); - - /*if (GETPOST('typeid') <= 0) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n"; - }*/ - if (!GETPOST('lastname')) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; - } - if (!GETPOST('firstname')) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; - } - if (empty(GETPOST('email'))) { - $error++; - $errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."
\n"; - } elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) { - $langs->load('errors'); - $error++; - $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; - } - - $public = GETPOSTISSET('public') ? 1 : 0; - - if (!$error) { - //$partnership = new Partnership($db); - $events = new Events($db); - - - // We try to find the thirdparty or the member - if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty') { - $event->fk_member = 0; - } elseif (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'member') { - $event->fk_soc = 0; - } - - $events->statut = -1; - $events->firstname = GETPOST('firstname'); - $events->lastname = GETPOST('lastname'); - $events->address = GETPOST('address'); - $events->zip = GETPOST('zipcode'); - $events->town = GETPOST('town'); - $events->email = GETPOST('email'); - $events->country_id = GETPOST('country_id', 'int'); - $events->state_id = GETPOST('state_id', 'int'); - //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); - $event->note_private = GETPOST('note_private'); - - // Fill array 'array_options' with data from add form - $extrafields->fetch_name_optionals_label($partnership->table_element); - $ret = $extrafields->setOptionalsFromPost(null, $partnership); - if ($ret < 0) { - $error++; - } - - if (!$error) { - $result = $event->create($user); - if ($result > 0) { - $db->commit(); - $urlback = DOL_URL_ROOT.'/public/partnership/new.php?action=confirm&id='.$event->id; - header('Location: '.$urlback); - exit; - } else { - $db->rollback(); - $errmsg = $event->error; - $error++; - } - } else { - $error++; - $errmsg .= join('
', $event->errors); - } - } -} - -// Action called after a submitted was send and member created successfully -// If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. -// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. -if (empty($reshook) && $action == 'added') { - llxHeaderVierge($langs->trans("NewPartnershipForm")); - - // Si on a pas ete redirige - print '

'; - print '
'; - print $langs->trans("NewPartnershipbyWeb"); - print '
'; - - llxFooterVierge(); - - exit; -} - - - -/* - * View - */ - -$form = new Form($db); -$formcompany = new FormCompany($db); - -$extrafields->fetch_name_optionals_label($partnership->table_element); // fetch optionals attributes and labels - - -llxHeaderVierge($langs->trans("NewBookingRequest")); - - -print load_fiche_titre($langs->trans("NewBookingRequest"), '', '', 0, 0, 'center'); - - - -// View - -// Add new Events form -$contact = new Contact($db); - - $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); -if (!empty($socpeopleassigned[0])) { - $result = $contact->fetch($socpeopleassigned[0]); - if ($result < 0) { - dol_print_error($db, $contact->error); - } -} - - dol_set_focus("#label"); - -if (!empty($conf->use_javascript_ajax)) { - print "\n".''."\n"; -} - print '
'; - print ''; - print ''; - print ''; - print ''; -if ($backtopage) { - print ''; -} -if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; -} - -if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') { - print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); -} else { - print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); -} - - print dol_get_fiche_head(); - - print ''; - - // Type of event -if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; -} - - // Title - print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; - - // Full day - print ''; -} - - print ''; - - $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); -if (GETPOST('datep', 'int', 1)) { - $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); -} - $datef = ($datef ? $datef : $object->datef); -if (GETPOST('datef', 'int', 1)) { - $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); -} -if (empty($datef) && !empty($datep)) { - if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { - $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); - } -} - - // Date start - print ''; - - print ''; - - // Assigned to - print ''; - - // Done by -if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { - print ''; -} - - // Location -if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''; -} - - // Status - print ''; - print ''; - -if (!empty($conf->categorie->enabled)) { - // Categories - print '"; -} - - print '
'.$langs->trans("Type").''; - $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); - print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot - print '
'.$langs->trans("Date").''; - - // Recurring event - $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); -if ($userepeatevent) { - // Repeat - //print '
'; - print '        
'; - print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); - print ''; - $selectedrecurrulefreq = 'no'; - $selectedrecurrulebymonthday = ''; - $selectedrecurrulebyday = ''; - if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i', $object->recurrule, $reg)) { - $selectedrecurrulefreq = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebymonthday = $reg[1]; - } - if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i', $object->recurrule, $reg)) { - $selectedrecurrulebyday = $reg[1]; - } - print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); - // If recurrulefreq is MONTHLY - print ''; - // If recurrulefreq is WEEKLY - print ''; - print ''; - print '
'; - //print '
'; - /* - print ''.$langs->trans("DateActionStart").''; - print ' - '; - print ''.$langs->trans("DateActionEnd").''; - */ - print ''; -if (GETPOST("afaire") == 1) { - print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" -} else { - print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); -} - print '     -     '; -if (GETPOST("afaire") == 1) { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); -} else { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); -} - print '
 
'.$langs->trans("ActionAffectedTo").''; - $listofuserid = array(); - $listofcontactid = array(); - $listofotherid = array(); - -if (empty($donotclearsession)) { - $assignedtouser = GETPOST("assignedtouser") ?GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id); - if ($assignedtouser) { - $listofuserid[$assignedtouser] = array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>$object->transparency); // Owner first - } - //$listofuserid[$user->id] = array('id'=>$user->id, 'mandatory'=>0, 'transparency'=>(GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1)); // 1 by default at first init - $listofuserid[$assignedtouser]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 1); // 1 by default at first init - $_SESSION['assignedtouser'] = json_encode($listofuserid); -} else { - if (!empty($_SESSION['assignedtouser'])) { - $listofuserid = json_decode($_SESSION['assignedtouser'], true); - } - $firstelem = reset($listofuserid); - if (isset($listofuserid[$firstelem['id']])) { - $listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing - } -} - print '
'; - print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); - print '
'; - print '
'.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); - print '
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = $complete !=='' ? $complete : -1; -if (GETPOSTISSET('status')) { - $percent = GETPOST('status'); -} elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage', 'int'); -} else { - if ($complete == '0' || GETPOST("afaire") == 1) { - $percent = '0'; - } elseif ($complete == 100 || GETPOST("afaire") == 2) { - $percent = 100; - } -} - $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); - print '
'.$langs->trans("Categories").''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0); - print "
'; - - - print '


'; - - - print ''; - -if (!empty($conf->societe->enabled)) { - // Related company - print ''; - - // Related contact - print ''; -} - - // Project -if (!empty($conf->project->enabled)) { - $langs->load("projects"); - - $projectid = GETPOST('projectid', 'int'); - - print ''; - - print ''; -} - - // Object linked -if (!empty($origin) && !empty($originid)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - - $hasPermissionOnLinkedObject = 0; - if ($user->hasRight($origin, 'read')) { - $hasPermissionOnLinkedObject = 1; - } - //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); - - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { - // We do not use link for object that already contains a hard coded field to make links with agenda events - print ''; - print ''; - } -} - - $reg = array(); -if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { - $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); -} - - // Priority -if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { - print ''; -} - - // Description - print ''; - - // Other attributes - $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; -if (empty($reshook)) { - print $object->showOptionals($extrafields, 'create', $parameters); -} - - print '
'.$langs->trans("ActionOnCompany").''; - if (GETPOST('socid', 'int') > 0) { - $societe = new Societe($db); - $societe->fetch(GETPOST('socid', 'int')); - print $societe->getNomUrl(1); - print ''; - } else { - $events = array(); - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - //For external user force the company to user company - if (!empty($user->socid)) { - print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company($user->socid, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); - } else { - print img_picto('', 'company', 'class="paddingrightonly"').$form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); - } - } - print '
'.$langs->trans("ActionOnContact").''; - $preselectedids = GETPOST('socpeopleassigned', 'array'); - if (GETPOST('contactid', 'int')) { - $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); - } - if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); - print img_picto('', 'contact', 'class="paddingrightonly"'); - print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); - print '
'.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - - print ' '; - print ''; - $urloption = '?action=create&donotclearsession=1'; - $url = dol_buildpath('comm/action/card.php', 2).$urloption; - - // update task list - print "\n".''."\n"; - - print '
'.$langs->trans("Task").''; - print img_picto('', 'projecttask', 'class="paddingrightonly"'); - $projectsListId = false; - if (!empty($projectid)) { - $projectsListId = $projectid; - } - - $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); - - $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId); - print '
'.$langs->trans("LinkedObject").''; - if ($hasPermissionOnLinkedObject) { - print dolGetElementUrl($originid, $origin, 1); - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - } - print '
'.$langs->trans("Priority").''; - print ''; - print '
'.$langs->trans("Description").''; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); - $doleditor->Create(); - print '
'; - - -if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { - //checkbox create reminder - print '
'; - print '
'; - print '

'; - - print ''; - - print "\n".''."\n"; -} - - print dol_get_fiche_end(); - - print $form->buttonsSaveCancel("Add"); - - print "
"; - - -llxFooterVierge(); - -$db->close(); From 8da9d58b9f630aed68be98e771209bb2dc6db4e5 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Mon, 22 Aug 2022 15:48:12 +0200 Subject: [PATCH 0029/1289] sending mail is now managed in template 01 --- .../websites/website_template-style01.zip | Bin 12929 -> 13388 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/install/doctemplates/websites/website_template-style01.zip b/htdocs/install/doctemplates/websites/website_template-style01.zip index 52a4501cb7aef1048b70a0f95a29cdb8380a89c8..7bca0dd1e21ef3ae5e6a4a6c0ba02f2808c961e9 100644 GIT binary patch delta 7077 zcmZ8m1yG#LvR&L|(M5v0EKYC>K^KQb76=|RxCa&qPOyc9AVCw{Ex`%y?(Pl&0t86l zCER!4fA5>BsWV;E)7{@!)m7(I2U`!>;%Ta)pkf35uKobBL_8LhzaXsj7pkI9@QD7P z9{+FyDHsO;_$3VhPyi54U@G`AY~5{9nCSk=@YWMe)6YpSA^i0S!MEJI#xT1jWye{l z-|W|>aTz8i1{N$bKv`jC>m4^BiGevK|Mk}|nLySmCBi0yqmzavruMv9wpN1Z0q0cTq`EfaG8xY?yfAgKl z?t0lJj3RnTppr5%_5mJShr){n+l-sF-L6yXmCD;cI)FYpw}Sx+&R9{^Qv zuL#8BMQ)fsWyBgB0jD_OuKsV|Y%!`6g;-Y{iliC3`eU@nnbQ&7 zV)`VvmHB33Lh9hkh&e_+rEvy(N$zZKW}b`!J+`aFF^s8R7X=dsE}b-xKs`CfniXg4 zJ}w#^+0}=`OD=y^rmKGR9=bxU^kGh=wW)Qx${@*L!R;d52!oh7-N0jPRjJFn0B z$BU`rYNXwdd?)XF;U*L+4i<)$DW+0Dnu4f&u5wFZX1;X;e$xYwp7y0w_uA{X7gN6W zo4i=O2kghu`sL#3!_?A;8@y7>hEK$s?o`&_-ZIbdWTlNzu3-C#@*i*NCTP8}6r-0z z&er^9$E9`6mVd^*!E^+>F~LF0fZV=Ie=0(Y7L$_2zGKpR3-@+>lDk^x9ALe;Cvo*{ zidD%y2{&_PiH;O4!Rc8%8k~NY9*9IA1B4(pv2y0xM&2A#-9(Y|>SC)#@aBdkcUlLc zTiG-o=Ksv$dQ(OE&4R{X$%P>NKJv8EE_{E#{|W8a&*o8^i|cpZO6K7%g6mw!o{GR2 z)gv6wlFz^!d3YF!B;E>QJqoEj#d4-DV?@ zP?Yh^J&3?mss=-P85iCx;&N7j^$>W<6o(%uk(Od>gQFwOBZwArMM}|@y#Dyi-b=) zOuefh0Rwla2e%mQ;F{Yr=@Lc!jX|Ue)xZd;krN`a+7)9hkQy+Al~$8X74)*ubu8+X zF%~tI_MA9Pi_P5y7lk3Jz{Mu8W<>>zD-)JIpp$^S0dkQSznRr^m*-+lqC2uCD1#@)eR~JbMU&Vnn+M#mejiiH(y+y zVcW))#1Whks>mD$2&3gd7_~=350xpy-G8K{#J`mA3yTq6-yF$X1!8ra^WNquvH(l4 zwdZ;X$t=ff&@%+?(es(_6PAOT?ayZ{ypm+Qk7V{UMx)q5o^{{2V%!&frQXIbPJjbG z^XmK0(E8Xg+pVdT@>8_LWYsO9HID^jwzNC>@%Y@mp`0dKM#^Q zEVI!`Ed^xcuhW7XQ-X`| z0vED%h$Cv{9iRC{j>*rBE>1YmJYQ21Nd|ok%rO0~yA8uBOOD?xi3N6rUL`vf9EJao zt=;@!)m)r`_oawY^?)jJ45UXc3ESW4Q|nZqM*eo7tvmdikz7~jSrbdlJ0cnmej4q% z@F#>~cuXo=w2Nhsk@?d4Q#Uvq6Mefjath}|k1o~G_E!H=U>u8p|B&43L{3NZ^}L`( z2ng4$dZfM#`IDF~^cBCQ`-r+5MM$WyMH{nu-_1Xw*~d^h_AZr6?oLE zz#+>YG&GO}nFf=fCXt)_G;6rm=pTx z6AwTw`(_cy#-8voK5&s}9TqYn-^NE#uBVCaR(m8M|7WdkhPHp z!hV6{+q#{9pH==0sPA?TTP157+;l#J!6mo?v;N?EL-*2%w)y>z_ zmoMPhK~3z-mOVnG%iK;_Lmd<^b(cY+W90?4dBL74c?(QLLNP9CiK!F#Bli}8tQT7qrVfQ4m^$|!^?0B5t}2<}!V^w0onks1*(+V={lAXQg}!k* zcuQUeO;g=cnZHV|sr5oJ3o|;MAK`XV%HtQWl%z z$$eT^3-X1zRB1Aqj66&R0d%K!l9X!Crro{$Usn?s(=+^)bs||CG zbM~=Sjt*I_LLK6 zn$5(7t^*D5U-|X6`Jvr*NC1EeG5|pRC%>ihD-UzK8fVHVq`zXI=8g&%=}`@|n%MPY zp#T8s=#Oe(l!pqQqUYqiphS3Yta?M>zFi)Uxybajmeh{Y1f`MTQx1djqVtTOWKT({ zcR-T^rv7%@Du^14>Nb0hbc}y7bTKrDe>yVI{Dv)rpi^4${r8*Am#4F$EKrf=?rytp zTpUm{@i>e;WomDAiA32uawR@u?8$n#yAX9Oj{@y|Dx@49j^OExS`F5(Fl*>_;ccWr zC}OmRcC>Mr^Ug#w3a&qs=1BFlmCNx_8u&&0rDEE|_8oFD1!2Y{{mjT2A{|B$Rn^!_*@TapLj(P%q>awB_P zwCytJR%?9|FzD87?Tfd1Es?FEAQuu#DhIw@gO|nvGuVGLwR2i_<7!+r-$|ZgwQj%3 z!A5)lhNKw8|)Z<*BpwF=!cb+PIw~C7Fr;}tlp@DwVA}S&A zx~63F)3{xCW`NX2byodY!ziv{InL3ya6F?+_@MccB+o@vE-O%=Y`LwDQ;5Qj;jUKw zgxBP{OVs2?&g>Gi%~b#9cJj3M%hc)*!dul66MY*EUNZQZ7$dfAXi)v|O;+f;T8CFG z@DU`0t+PYNd| z^=x^LiI4Kxi;122CGm&#tzPlB4odp?y=QB8?b@~<1+K(C6mSm}WVKmyN*y<~xfZn^A*k^wL4#SX4> zJ~wLJ)$-ZQ<5~5VID7HCCZ21DigA-e)M$M8$7g4FC&V6s(WcIf1;O^2BRqffo(IVP z2v)P>NlE@$yhPg7u71NX0k=osbfdzgnlKuzW<{*u_0H5UrNKd^ z7g1=OjHP^hI@bAx7MdHteQZkhflhu4k)!uOJjk6tKefwxKYtQ-38+;P^tzW6m9-A8 zN9Va6i8CEMU_C|tWs%vmfYk@k-HB;`p=plo$I18tZHRSlvhC8ED1<}=DncJ@X>nm^XoP0s}!HD1t(cbAZ$#R7PcQh~6_|71eZ!J{sd*Tj z6kIPA zA}D|`C85wBgf2N$|B_EKvTX8 zDb4|ZKN~qTDY!YSzr43Eh?Z8|XjpIs9W_fID?T)e5Ud!RxBlMUU3j_O>WnvHwRMcE z@!}+4tChC|@JoI1m6ejG zAjs-Us;oibUR2uKPJ0Gf_1_3&N>lq|EpHhnyr z-)v(u$TtA(i9gLZrI5^^s<9vr+I2!L0`{ed7yaHw={~yVm?8^go`xyhTL! zLsyS)mvpbqL=0rvGS(a$r^$k*e9IMzYI7fQ;y!KOr?~f=H+jhuPWjosoUqUEpooj$ zy(tWH&mPwnn1n<*h<&VHTk;i~;zrwRmX1zVG_g_Qgg2rakBTjcCU122BrhbskPx9*1aG14(RYeD1OMe6*3)QT;E zCr9gjn?)EaxMUD@hxs?Wn@5wASRZYQ<$ZmPX$xf;?O%jW+Qqu&5lY8$b~yK?X`XK< z^kRmLVKtAV5ybdU<;8colf;wJ$0bUp(Z>tC)hmOjN^C4;!3z`;u_s8wpY-Lq8JB@M zbwiJ4DcjO|^m!>zVAEXrMHVqC%LeQ;Mp%48pzb?fM5JiGrsK5Av{T1m111o(GGWMCLA7qBvWZd{5^WH8*cGGHTKUfi2Nz+qnv7T#oY?nFUq z8}T^+!3GP08#KN{-6xxy$tgck)~L|z@7X50Gn#rs$GPRfI2mu@_xhgwUG!DBx{55m zX6C05yk(NA!cTIR!et|xor`tCn6W!R>eMgDQ-~2$AR$UJP@Cxsd6SBIQc@oAb5+mn z_#QQE3?`jIS0rX#ir@ZvJ1kgT#&1bcrWMoTNQisF;ooWo>aoR3dxlt2=@s-LDT5`{ zP+9Xq;Lhmr4F%|JfmuE=OD}8fDJMzMc70|$;p@uk4hW-J>MvcVk9G#uNP$kVK)g)J zDJl_@5sA!OhaSELni=8;RPj(H<6T@9(n@CQfW6X=Z);Gy=YnLtt5r{W#J_QVfxGLrRElnnXFeM zzSwMHufF)ZdzGO}j1%IF^7|a;T2fL^?cw2katjO~GV8i8qSwUZ(&7msSL+D&CmB|F zb?M&MW^u5>cpe#wdBQ0e8wi?y%YH%lCXpK$kIxM`|Gp{#!1*pI>uN<~?rG`u;?3ek z0{l3MTH1><0n>2o{)?N!LzqrC`)!uR{RX>*>4Ss~M(B zR5vwbVYgD{H4N6^_YOn`$X{8Is6_7xl;CSIFR03V^aSsc9mmzU~*R9pPv1#?M~zcK1VlR4bp zBbmzxeSG*8c1^Pn3Yz?lac_YsYO~uR{5vv|wxO=>v?iu(tLr3GiVhYY~XR_=NuBR<5FX}Th%r2O|YF`#qM0-gGc?>^fc z^H`WQDy}3y`lA9Y^CsmkjEYaKGJWAy-3~?jA16HI6!+7{LI{DK;4^xrC_uK2EIm|Y zcds%dO>Mfu=FZCS{HZ|8yFgI&lq--H>GEx7?C1wiHD}my zQ<~mHra*T9WRVI-+cCiHz$Q;padpYW>}nR1r>$@BehM}dO@MSltRQx0x&#MndPR*v z?xF;L+MVcU?v;l&>DoufS4|$J~Y?6~-0NTwkH-okyZ~it8Uz^4i_h z=q6c)>PD4@*y??an*EMtv1wzczyIOd&GPWRYsrUI{`gnv+%3;m7$vC%rpKGw$HuFF z|7>e>2()FW>8IgPKM|JpxnB}Eq9L1aL-Q#-zPGqK;@N{aBco;zVX1OvlLK77>=QF4 z>w!ieaQ-dc9_KcQaxR8PZaK-t_K5df0*@%j&HRYQ-29K2$SwSc1KiS&hzpi|q@e#y zcn~nKDBWKj%5Ywa#P&xAvi#X3fA&9Xk^(UXB0~&-aUUK35v%|Jd}r?mYig_^n(7fB8N9 mxi|+SsQE#UssA$@>Hisoe@>J<2nTKogcCnLx*E^loBsirOx+Ct delta 6758 zcmaJ`1yEhfvOTy5cReRSa1VNdy9WydcPBUm+c-gj9Uz1RcM>c(1lJ(J-8Hxc*H3u= zz5DO2UvH|q)}GqkYr3YYt5#3VMiZtDL%sP6yKHP8(qw^&+l#`RJSuXZ$*QL zhZ}^5;h&WF>F!(?lq1>uM5?Z?z7bcbP!^|Qs>YI-qh5 z+l;0V^2%(4(nt=E0;b#yxcV#{lbwG+l(*@=6Onn0tsV!w&P0CBL zD<~T3c0%pmQ=m}NFgC$x+}bZ zF|IRf9iY)T`gBjTvUzgmy+%Jy`;UU1*p6W=8kQS|A`)OaTTa%&-S>KE=6!e@!@IIr zNw-u*toaYh!xW5(^{<L_BEzO9b@WH z`&JjodbI%)gEHMlaR`E#y3|{>ZaYalNZCr(*w(wChH@OM)sUL~;)dj0Txm*s{mb6- z?$vVQ4Sgt^v~5lI&&8$@&uruH(>}M^=@wmyQqjDI4{{?hPU2ybOdtYzBqaiy1FjT3 zu$cBFZtCfCs)c6V z{^!8baSQw;Bgc-Af!s5zNvra?7rr~9U0Ihs=jP=ueS9^pLz(J4m?YRGU+L+eLv1o| zQWQ|A*%!4L2G1ERLxEaq>^TW43H00`^!R9ReZ1%%eN4Y+yWe3sX~q-_x*I)D&fw@nd06v;_`~!khiH|seS$8y<&UukKx~YD$s}#79nV) z$`dwW>cELWg&#2KV_np66BRiS!?PSkm3rr> z(OHW*iQE8|D+{bEE+f{^#;o2^3DYlCq;9Lz863>7j=qwBei{2__!=)fAIgHd50uJ#qTIOBiu+1=@ z9Oio~a){8brZuDLSNd{iCNLppHi&}&WF|HgY}p3?LMA5cNgIwaZR@RS{!nt8E6Ott z8Z}Quk2Ai5;`KI=wrmLmfsrO1PKKuo$0AlG(~pJ__nr5}MgJv3o*Vmb%h3tt4>e9~2i@89Q*jp##dQ_$cCvBc!Z9Orf zW^m>gPcPyM#?e^ik2aK|vXE_5Ox&L@e@jSh`WyyuoP`N)AkWZZOp_)JcP-dTc%q}> z!#kSBVG0|JnZ`19!a7Y~b-n_85T}TLnh5Ha?J;20hiMyo(ENt0tRrnNr0t6};T&1t zMq%DzY;q8dLh39zD_*iI+Q7@#@~5u`I9vv)HZ!R3YZdR@_%L&P!~ z8aLEb$ND`o`r1&xmFSLP;f(NyqNfvyeijCP=47>p>waaE#pC73`H2B2-HvxSl78YQ zzu^(f2U}E1?uze653APCDs5rKSg*(;jYYM5g;_w|UN{&f9#@?UTOwX&2$-uU8Z%zg zOmKeG9<_9M-}wU&QO;C)>V{SyvY#&cWO8&24^3BRuxI zva`Rx(ku?$diCQVPr!4|W>%h%W6lmtvI5C_mtsD$!{m(*;3TVefIjIFPwtN%ERL_t znQPAjR?%7^Vh6QWMrC=Y<-F!&LFfA(9#s+dKVMlNs1}RxMGee z7BsR+C&?;>Mmlt=`2BebZMmYK>OQ?ZN-ph7rs%4v?=i6bAvZKalB^@|eHp0Wn z8q+Av5<*Z#hZtCiJ|w}D`t~0SbiG0}FVum@=5inBA4s~aT6b+-a8)a3fK%~S#y?Wy z{%Qj$*;u0crPY@+vUM?_w*A!`Ha(SfsSXpySiI*v^fkJ107?#ZmuuP%ZZ4Q_CJeD7 z7mEq~m~XT$QmKKE#j73Tqieg6Mf7GuzhB*k%Qbgi+BXiR|A_eY$G`YcNaW5CxA}bD zqG0-U@?yHagJr87UB~&Hid8M2YC~=Y_UxK&J43}M1Pm-_h<8(+e^!Y1tOu|scxIxg z)3kGeo*2{Kh5rM=BWCl7RrAE88_l&=U{j2z_#AB{isaajPuqUy3Fo?d#fqA22W*35 zeC5?W$d=;icOlTPyVkW};v>FEIc|HB%FBi6Hs6)Y-tTaPKZ!Pfy|1=VSbHt#LF=jI zZBim`|3rXL%$}M|ZG?6pi9Z=I9!w#1WN{MD`>O2+Z-=&>u`Za_enG^7=!9l}nCwoo(Nt~kzQ#K$0w@E>PA~Dz20bL@p|5#CmF(p-3KUn@ zzWc#mh#i9m!UmX3(@w zqL-wQ!ldSWRTijF{ak7-Jo4OvRMu1MWW=?QVTf1-9+`Q)B#0EZXtX*#AK<}tP(+>;#D(2~iHxXgQic9r&cPo?fOX4Fj zKvF}*aIf#@Otb_1moqj5X~(Q|iJx~4%{l^o1d^6AFkz|aOSU~muR6b->#=+Ie``wA zKbjJ@MEVNvkBU6zpKwKj1A&y_K_D^^td)ZTNR3r+Xs5vmJ&$un`5?u|y2KL)(F6;K z6Tg7#TqXJNid1!bcCyR2;H9pVzJK!Yp|1!Fu~7EB3t=m2pf!g-r6?rP0a3sU;1Sh5 zz*7s6Eh>r}LT`J!RsL2K`Mu)XzV0{)=3?F;Pt+v`s@(Q#H~mG2uBu{NwWHf(_GQUj z;90o;LYv(UPEprscIU-hrL;7I_;lYZhZFoHs76|^RFko;mWp*#)yMH@LJPS7rtMg! zsBL(k`*`pZpMm|U?M8-LsvmycmSZBBI==~ZeVwc)M6ya5UJ&ybm}9V&4}}DsD)Hi& zDYl7c(;3vv_$T|dJ{c|letTZ|q2)?tfRk3zg78_ti61QOq`EaQJ@{L$4?bS z?=&ZHB#FEy0`62~P@KIxU3cUVrf$6U=BlGm7RG+&hms}&gv}GRw{F@f5>Z|tBi|PX zw`wy-4+Uf278p%rqJ^x08GoxRm1udC=%5!^i0;Y@8I8~=5YwP_kIlZ5GCMNzaldu) zbRtygT4j#tt!kBxptW(v*!muEAK7&7XRDv4Y_gN=wCASe93R}(rNJf6*e#OfD;rzU z3o#RipkfdJqFOm0pTut?{H7pGg;QV77-EE1XY9vSEA~Ng$=jyR4o+$FLtKc+*-Ph4 zGj+^MJW;l_K~-Y{3E5IHB0=CpZhIyjDrdPwM0eJ@TpU?j zRn?g)gG6nBxozxU^9CxvvU`ko(F-@DD9;ey=WZhgcpKbe;is~tkcs&X-I5B-iAPt* zHdn{4vaTWd%>MQlCM`tc(n77<47$(cl6K4+I)E>YBIJfn|K6`osQTa8YosAM*ZN!25+yeBcS~4^Zsk`P^xu}`007jF%s_T~xYWTAF)A^~+kz4i8er{!9 zH*V;dNT)&#lyz=*G1YlTLlu)`$aHSs4VrnO zf^T(e$CiHZx0-=9(^&s085lD->JjU~YmX(A34y@@e@aM{M#Q@b6$Dy`fP(?w55>XyF_B( z3{c@*rAMccgNr1dVNg6N=axQpmRawi3izqc27H-7TktwUebb!%0@*UZ%n->LvC93r zo3FdMCZyK(Tt~*GeTFf~swSYNd`W{F3yLu%`oJ!c%#_XP%Tnz{4G< zVgD>CQMpGL{t%JVs{cg&!qLZX{JYOLy_a;dTmh`MHGu7%&)W%`>Otkban}55R^X=M zIly&WI9)ntF(~VXV$*<9wHK873)WZ1c#gd-bh&=xRPrsc<&M{`A$n#HqjL7ps-s^O z6;i~*9X1(L`nt5|?$oq^g^7q1hIeM!^`?C7U~N13a}U4Na}UIJK?(ci#)=IvhPNH5 za-d+lTFvLvVoi&pESKa>4zn7l5zvvEafIi`K8BJg zk3+v6BWM=5SmfNMNGG={FC(A*K5I**fduzdzNe}X@wJLWf@xa95xTGxXMpDnCgLcr zsg_1`{22isg7?#`*=wPk%jIvUcP0(uBDvemRjafMe!z?ZARrQ%Zm6nr3#_W|!O#|J zu1a0W9I%zo-9>sBT0uwbR-{?X~tuUWd>Nhb={e&Gvg>h;%cR?ypK zoin^kHsOf<7&uwX_v`5ad%F_}Jkoo2@r^)XKHMQhPt?$}L&G~EmH|NAfdQFH{*8u( z>3a`W`V&U4khoZDWO|d$GAkbB>hBsuoiUAqk^$w5Jkl}iVDYY?Wovu9)blic>RHzX zeP?{-RcR~gNQQz5Pr(?@l7yjIC-6;-KFOL$@O*9o8eUj723V7CXx)Q_RywZ_r@IH7 zP7`Ad=(E0pMN`~|)d5ka7Lkp)QW9y^lnb9)m{Hds?H+CbQ^YG~_97*y;@<2O^*c2yyxX_^ zN>cDb*}2lB?Lrl}$SEsrBTH1gK;-V)Oet}8i<3qotR^#dS`?l~Xs^WxWqYD6+u_O1 z6`L|%o!Z)hyFP<{&IE2(^cZ*W-%3Q1tm2dwq-hx1gGCc$4m7i@*4_*@tfm`V63ESb zZq0>n%CW=#^xTtVj=5O2dqr}#X~1*9Q4~}EdcJ$Pyw3rs>r!;L8GG{0_O~)S^n>hM z9tPHgN+tf0QU14Y_$Fkc*pMk+@>8T~QW8L#et%?>6hdZJ$iSu&{+dLfq@y7mWU zleLRwYOoaz!beR3R;UG;blXUWBLe)cFnZcI{-1kk&#Geb%O8TRfEE8_4mr;p)I})B?P;hpDiZh5v*DAT*ydpmI2+ zFzXt2gPqLitS)i%s~?*%c|(U=%Ire~)+Cu|(%|n4ZDVoj_8*XU-zSt=(lQ*n5+auo zPvLkB@?N5|yraDlqOu~5eQJTx(&tuEPH)g$Hg*8{$PsVm6jrF&mR~(*iFTiBIY{r7 zY*5ZI9PXk_-T7Tp_Dj;GQWH-lGoX1h`Fu2s*zs&xvS_j>$U9sD>v|RnO#Mz4eevm_axMNh#gu^=?=sx%z%p=T2B_wun+?? zrD+}QcV0ZXx%G+kRcE;cLamj&u^kC) z-xO(==aw0^tW1Gl2R9BnCy4B_!T8^J!O`?H$qd|SL7(yZ)wMQWam$UiLpNLXGAoq( zse6geUs1%f5eE*~as9YIe;O???@6bf**&ior=!FEk+O~0ozT0776)2eE>wu9zVYK! ztEb+5@})=?vbs`t*nI>7^lBj7$4*9kk?1pY0L9-j5#A9T@MHprtcN@HVq#2;+j zk9f~U_lVEfxgJrEo%azF*+m|4l3nbd699S+0h&LG3Ud4vj^RN`(LWf$gZ;HCNnij6 zOq0AkY)ihYs*x$?S5F!z+-%=E$g6R2AUh2|$155s$s2Caot^)6~Q6`9t4G z`hUYg`{Xcyf*j_+iTQXC+rL{R2F{|6qSl9|~LIeELXw z_Uui#-ot<62P1s2zg7Va>?zmN$19TKB8TIHng8!Dl8YRk3IZ#GP}%h!%hC8iv{ uZ%juluuSg95fH4Gn_Tc2>wlPRT>dM~U$^roAr)2_HP18Tz=v=U=zjnSKRu=Z From 1a15582c49f790e75460d04e74aee241aa61f388 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 24 Aug 2022 09:43:48 +0000 Subject: [PATCH 0030/1289] Fixing style errors. --- htdocs/bom/bom_card.php | 154 ++++++++++++++++++++-------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f1823e7a79a..e66462d8584 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -147,93 +147,93 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Add line - if ($action == 'addline' && $user->rights->bom->write) { - $langs->load('errors'); - $error = 0; +if ($action == 'addline' && $user->rights->bom->write) { + $langs->load('errors'); + $error = 0; - // Set if we used free entry or predefined product - $bom_child_id = (int) GETPOST('bom_id', 'int'); - if ($bom_child_id > 0) { - $bom_child = new BOM($db); - $res = $bom_child->fetch($bom_child_id); - if ($res) { - $idprod = $bom_child->fk_product; - } - } else { - $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); - } - - $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); - $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); - $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if ($qty == '') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } - if (!($idprod > 0)) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Product')), null, 'errors'); - $error++; - } - - if ($object->fk_product == $idprod) { - setEventMessages($langs->trans('TheProductXIsAlreadyTheProductToProduce'), null, 'errors'); - $error++; - } - - if (!$error) { - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null); - - if ($result <= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } else { - unset($_POST['idprod']); - unset($_POST['idprodservice']); - unset($_POST['qty']); - unset($_POST['qty_frozen']); - unset($_POST['disable_stock_change']); - - $object->fetchLines(); - - $object->calculateCosts(); - } + // Set if we used free entry or predefined product + $bom_child_id = (int) GETPOST('bom_id', 'int'); + if ($bom_child_id > 0) { + $bom_child = new BOM($db); + $res = $bom_child->fetch($bom_child_id); + if ($res) { + $idprod = $bom_child->fk_product; } + } else { + $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); } - // Update line - if ($action == 'updateline' && $user->rights->bom->write) { - $langs->load('errors'); - $error = 0; + $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); + $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); + $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $efficiency = price2num(GETPOST('efficiency', 'alpha')); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + if ($qty == '') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } + if (!($idprod > 0)) { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Product')), null, 'errors'); + $error++; + } - // Set if we used free entry or predefined product - $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); - $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); - $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + if ($object->fk_product == $idprod) { + setEventMessages($langs->trans('TheProductXIsAlreadyTheProductToProduce'), null, 'errors'); + $error++; + } - if ($qty == '') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; + if (!$error) { + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null); + + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } else { + unset($_POST['idprod']); + unset($_POST['idprodservice']); + unset($_POST['qty']); + unset($_POST['qty_frozen']); + unset($_POST['disable_stock_change']); + + $object->fetchLines(); + + $object->calculateCosts(); } + } +} - if (!$error) { - $bomline = new BOMLine($db); - $bomline->fetch($lineid); + // Update line +if ($action == 'updateline' && $user->rights->bom->write) { + $langs->load('errors'); + $error = 0; - $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key); + // Set if we used free entry or predefined product + $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); + $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); + $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $efficiency = price2num(GETPOST('efficiency', 'alpha')); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if ($result <= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } else { - unset($_POST['idprod']); - unset($_POST['idprodservice']); - unset($_POST['qty']); - unset($_POST['qty_frozen']); - unset($_POST['disable_stock_change']); + if ($qty == '') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } + + if (!$error) { + $bomline = new BOMLine($db); + $bomline->fetch($lineid); + + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key); + + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } else { + unset($_POST['idprod']); + unset($_POST['idprodservice']); + unset($_POST['qty']); + unset($_POST['qty_frozen']); + unset($_POST['disable_stock_change']); $object->fetchLines(); From f5d7f66ca06b6add32898630b937e7a5b45f8332 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 24 Aug 2022 11:53:25 +0200 Subject: [PATCH 0031/1289] Ajout gestion fk_unit --- htdocs/bom/bom_card.php | 5 +++-- htdocs/bom/class/bom.class.php | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f1823e7a79a..eb75494e01c 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -183,7 +183,7 @@ if (empty($reshook)) { } if (!$error) { - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null); + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -223,7 +223,7 @@ if (empty($reshook)) { $bomline = new BOMLine($db); $bomline->fetch($lineid); - $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key); + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -234,6 +234,7 @@ if (empty($reshook)) { unset($_POST['qty']); unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); + } $object->fetchLines(); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 72aed7146a3..2b576fc0b5f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -569,7 +569,7 @@ class BOM extends CommonObject * @param string $import_key Import Key * @return int <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null) + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit='') { global $mysoc, $conf, $langs, $user; @@ -637,6 +637,7 @@ class BOM extends CommonObject $this->line->fk_bom_child = $fk_bom_child; $this->line->import_key = $import_key; $this->line->position = $rankToUse; + $this->line->fk_unit = $fk_unit; $result = $this->line->create($user); @@ -668,7 +669,7 @@ class BOM extends CommonObject * @param string $import_key Import Key * @return int <0 if KO, Id of updated BOM-Line if OK */ - public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null) + public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit) { global $mysoc, $conf, $langs, $user; @@ -738,6 +739,7 @@ class BOM extends CommonObject $this->line->efficiency = $efficiency; $this->line->import_key = $import_key; $this->line->position = $rankToUse; + $this->line->fk_unit = $fk_unit; $result = $this->line->update($user); From ab2b445b53ce807408fb293ce8af9573af1affee Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 24 Aug 2022 12:15:28 +0200 Subject: [PATCH 0032/1289] FIX accolade et gestion fk_unit --- htdocs/bom/bom_card.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e66462d8584..3c188077237 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -183,7 +183,7 @@ if ($action == 'addline' && $user->rights->bom->write) { } if (!$error) { - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null); + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -195,10 +195,11 @@ if ($action == 'addline' && $user->rights->bom->write) { unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); - $object->fetchLines(); - - $object->calculateCosts(); } + + $object->fetchLines(); + + $object->calculateCosts(); } } @@ -223,7 +224,7 @@ if ($action == 'updateline' && $user->rights->bom->write) { $bomline = new BOMLine($db); $bomline->fetch($lineid); - $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key); + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -235,10 +236,11 @@ if ($action == 'updateline' && $user->rights->bom->write) { unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); - $object->fetchLines(); - - $object->calculateCosts(); } + + $object->fetchLines(); + + $object->calculateCosts(); } } @@ -619,6 +621,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } } } From 8f336b1e505eabd96f0667eac015dcca720b0244 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 24 Aug 2022 10:20:16 +0000 Subject: [PATCH 0033/1289] Fixing style errors. --- htdocs/bom/bom_card.php | 722 ++++++++++++++++----------------- htdocs/bom/class/bom.class.php | 2 +- 2 files changed, 361 insertions(+), 363 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 3c188077237..a80792705ee 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -147,328 +147,326 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Add line -if ($action == 'addline' && $user->rights->bom->write) { - $langs->load('errors'); - $error = 0; + if ($action == 'addline' && $user->rights->bom->write) { + $langs->load('errors'); + $error = 0; - // Set if we used free entry or predefined product - $bom_child_id = (int) GETPOST('bom_id', 'int'); - if ($bom_child_id > 0) { - $bom_child = new BOM($db); - $res = $bom_child->fetch($bom_child_id); - if ($res) { - $idprod = $bom_child->fk_product; - } - } else { - $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); - } - - $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); - $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); - $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if ($qty == '') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } - if (!($idprod > 0)) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Product')), null, 'errors'); - $error++; - } - - if ($object->fk_product == $idprod) { - setEventMessages($langs->trans('TheProductXIsAlreadyTheProductToProduce'), null, 'errors'); - $error++; - } - - if (!$error) { - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit); - - if ($result <= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; + // Set if we used free entry or predefined product + $bom_child_id = (int) GETPOST('bom_id', 'int'); + if ($bom_child_id > 0) { + $bom_child = new BOM($db); + $res = $bom_child->fetch($bom_child_id); + if ($res) { + $idprod = $bom_child->fk_product; + } } else { - unset($_POST['idprod']); - unset($_POST['idprodservice']); - unset($_POST['qty']); - unset($_POST['qty_frozen']); - unset($_POST['disable_stock_change']); - + $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); } - $object->fetchLines(); + $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); + $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); + $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $efficiency = price2num(GETPOST('efficiency', 'alpha')); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + if ($qty == '') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } + if (!($idprod > 0)) { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Product')), null, 'errors'); + $error++; + } - $object->calculateCosts(); + if ($object->fk_product == $idprod) { + setEventMessages($langs->trans('TheProductXIsAlreadyTheProductToProduce'), null, 'errors'); + $error++; + } + + if (!$error) { + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit); + + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } else { + unset($_POST['idprod']); + unset($_POST['idprodservice']); + unset($_POST['qty']); + unset($_POST['qty_frozen']); + unset($_POST['disable_stock_change']); + } + + $object->fetchLines(); + + $object->calculateCosts(); + } } -} // Update line -if ($action == 'updateline' && $user->rights->bom->write) { - $langs->load('errors'); - $error = 0; + if ($action == 'updateline' && $user->rights->bom->write) { + $langs->load('errors'); + $error = 0; - // Set if we used free entry or predefined product - $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); - $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); - $efficiency = price2num(GETPOST('efficiency', 'alpha')); - $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - - if ($qty == '') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } - - if (!$error) { - $bomline = new BOMLine($db); - $bomline->fetch($lineid); - - $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit); - - if ($result <= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } else { - unset($_POST['idprod']); - unset($_POST['idprodservice']); - unset($_POST['qty']); - unset($_POST['qty_frozen']); - unset($_POST['disable_stock_change']); + // Set if we used free entry or predefined product + $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); + $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); + $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $efficiency = price2num(GETPOST('efficiency', 'alpha')); + $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + if ($qty == '') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; } - $object->fetchLines(); + if (!$error) { + $bomline = new BOMLine($db); + $bomline->fetch($lineid); - $object->calculateCosts(); - } -} + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit); + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } else { + unset($_POST['idprod']); + unset($_POST['idprodservice']); + unset($_POST['qty']); + unset($_POST['qty_frozen']); + unset($_POST['disable_stock_change']); + } + $object->fetchLines(); -/* - * View - */ - -$form = new Form($db); -$formfile = new FormFile($db); - - -$title = $langs->trans('BOM'); -$help_url ='EN:Module_BOM'; -llxHeader('', $title, $help_url); - -// Part to create -if ($action == 'create') { - print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); - - print '
'; - print ''; - print ''; - print ''; - - print dol_get_fiche_head(array(), ''); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - - print '
'."\n"; - - print dol_get_fiche_end(); - - print $form->buttonsSaveCancel("Create"); - - print '
'; -} - -// Part to edit record -if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); - - print '
'; - print ''; - print ''; - print ''; - print ''; - - print dol_get_fiche_head(); - - //$object->fields['keyfield']['disabled'] = 1; - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; - - print '
'; - - print dol_get_fiche_end(); - - print $form->buttonsSaveCancel("Create"); - - print '
'; -} - -// Part to show record -if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $head = bomPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); - - $formconfirm = ''; - - // Confirmation to delete - if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1); - } - // Confirmation to delete line - if ($action == 'deleteline') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + $object->calculateCosts(); + } } - // Confirmation of validation - if ($action == 'validate') { - // We check that object has a temporary ref - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') { - $object->fetch_product(); - $numref = $object->getNextNumRef($object->product); - } else { - $numref = $object->ref; + + + /* + * View + */ + + $form = new Form($db); + $formfile = new FormFile($db); + + + $title = $langs->trans('BOM'); + $help_url ='EN:Module_BOM'; + llxHeader('', $title, $help_url); + + // Part to create + if ($action == 'create') { + print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); + + print '
'; + print ''; + print ''; + print ''; + + print dol_get_fiche_head(array(), ''); + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + + print '
'."\n"; + + print dol_get_fiche_end(); + + print $form->buttonsSaveCancel("Create"); + + print '
'; + } + + // Part to edit record + if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); + + print '
'; + print ''; + print ''; + print ''; + print ''; + + print dol_get_fiche_head(); + + //$object->fields['keyfield']['disabled'] = 1; + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; + + print '
'; + + print dol_get_fiche_end(); + + print $form->buttonsSaveCancel("Create"); + + print '
'; + } + + // Part to show record + if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $head = bomPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); } - $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (! empty($conf->notification->enabled)) - { + // Confirmation of validation + if ($action == 'validate') { + // We check that object has a temporary ref + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') { + $object->fetch_product(); + $numref = $object->getNextNumRef($object->product); + } else { + $numref = $object->ref; + } + + $text = $langs->trans('ConfirmValidateBom', $numref); + /*if (! empty($conf->notification->enabled)) + { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('BOM_VALIDATE', $object->socid, $object); - }*/ + }*/ - $formquestion = array(); - if (!empty($conf->bom->enabled)) { - $langs->load("mrp"); - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } - $formquestion = array( + $formquestion = array(); + if (!empty($conf->bom->enabled)) { + $langs->load("mrp"); + $forcecombo = 0; + if ($conf->browser->name == 'ie') { + $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + } + $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - ); + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220); - } - - // Confirmation of closing - if ($action == 'close') { - $text = $langs->trans('ConfirmCloseBom', $object->ref); - /*if (! empty($conf->notification->enabled)) - { + // Confirmation of closing + if ($action == 'close') { + $text = $langs->trans('ConfirmCloseBom', $object->ref); + /*if (! empty($conf->notification->enabled)) + { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('BOM_CLOSE', $object->socid, $object); - }*/ + }*/ - $formquestion = array(); - if (!empty($conf->bom->enabled)) { - $langs->load("mrp"); - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } - $formquestion = array( + $formquestion = array(); + if (!empty($conf->bom->enabled)) { + $langs->load("mrp"); + $forcecombo = 0; + if ($conf->browser->name == 'ie') { + $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + } + $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - ); + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $text, 'confirm_close', $formquestion, 0, 1, 220); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $text, 'confirm_close', $formquestion, 0, 1, 220); - } + // Confirmation of reopen + if ($action == 'reopen') { + $text = $langs->trans('ConfirmReopenBom', $object->ref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('BOM_CLOSE', $object->socid, $object); + }*/ - // Confirmation of reopen - if ($action == 'reopen') { - $text = $langs->trans('ConfirmReopenBom', $object->ref); - /*if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; - $notify = new Notify($db); - $text .= '
'; - $text .= $notify->confirmMessage('BOM_CLOSE', $object->socid, $object); - }*/ - - $formquestion = array(); - if (!empty($conf->bom->enabled)) { - $langs->load("mrp"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } - $formquestion = array( + $formquestion = array(); + if (!empty($conf->bom->enabled)) { + $langs->load("mrp"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $forcecombo = 0; + if ($conf->browser->name == 'ie') { + $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + } + $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - ); + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $text, 'confirm_reopen', $formquestion, 0, 1, 220); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $text, 'confirm_reopen', $formquestion, 0, 1, 220); - } + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } - // Clone confirmation - if ($action == 'clone') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); - } + // Confirmation of action xxxx + if ($action == 'setdraft') { + $text = $langs->trans('ConfirmSetToDraft', $object->ref); - // Confirmation of action xxxx - if ($action == 'setdraft') { - $text = $langs->trans('ConfirmSetToDraft', $object->ref); + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetToDraft'), $text, 'confirm_setdraft', $formquestion, 0, 1, 220); + } - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetToDraft'), $text, 'confirm_setdraft', $formquestion, 0, 1, 220); - } + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } - // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } - - // Print form confirm - print $formconfirm; + // Print form confirm + print $formconfirm; - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; - /* - // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->bom->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->bom->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (! empty($conf->project->enabled)) - { + $morehtmlref = '
'; + /* + // Ref bis + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->bom->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->bom->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->project->enabled)) + { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) @@ -495,51 +493,51 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=''; } } - } - */ - $morehtmlref .= '
'; + } + */ + $morehtmlref .= '
'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; - print '
'; - print '
'; - print ''."\n"; + print '
'; + print '
'; + print '
'; + print '
'."\n"; - // Common attributes - $keyforbreak = 'duration'; - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - $object->calculateCosts(); - print ''; - print ''; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''.price($object->total_cost).'
'.$langs->trans("UnitCost").''.price($object->unit_cost).'
'; - print '
'; - print '
'; - - print '
'; - - print dol_get_fiche_end(); - - - - /* - * Lines - */ - - if (!empty($object->table_element_line)) { - //Products - $res = $object->fetchLinesbytypeproduct(0); + // Common attributes + $keyforbreak = 'duration'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; $object->calculateCosts(); + print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''.price($object->total_cost).''; + print ''.$langs->trans("UnitCost").''.price($object->unit_cost).''; - print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - print '
+ print ''; + print ''; + print ''; + + print '
'; + + print dol_get_fiche_end(); + + + + /* + * Lines + */ + + if (!empty($object->table_element_line)) { + //Products + $res = $object->fetchLinesbytypeproduct(0); + $object->calculateCosts(); + + print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); + + print ' @@ -547,79 +545,79 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea '; - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print '
'; - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add products/services form - - - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } - } - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
'; - } - print '
'; + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } - print "\n"; + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } - mrpCollapseBomManagement(); + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form - //Services - $filtertype = 1; - $res = $object->fetchLinesbytypeproduct(1); - $object->calculateCosts(); + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); + } + } - print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; - print '
+ print "
\n"; + + mrpCollapseBomManagement(); + + + //Services + $filtertype = 1; + $res = $object->fetchLinesbytypeproduct(1); + $object->calculateCosts(); + + print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); + + print '
'; - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - $tagidfortablednd = 'tablelinesservice'; - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; - } + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + $tagidfortablednd = 'tablelinesservice'; + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + } - print '
'; - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; - } + print '
'; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); - } + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + } - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add services form - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add services form + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl'); } } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 2b576fc0b5f..d5f3351770e 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -569,7 +569,7 @@ class BOM extends CommonObject * @param string $import_key Import Key * @return int <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit='') + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '') { global $mysoc, $conf, $langs, $user; From c581024c8c39bf45e60fc503a373ced50099ba9b Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Wed, 3 Aug 2022 03:02:07 +0200 Subject: [PATCH 0034/1289] NEW: Public counters feature --- htdocs/adherents/admin/website.php | 9 +++++++++ htdocs/langs/en_US/members.lang | 1 + htdocs/public/members/new.php | 11 +++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 884c6e67be2..b4c40936bbf 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -58,6 +58,7 @@ if ($action == 'update') { $public = GETPOST('MEMBER_ENABLE_PUBLIC'); $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); + $publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); $forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09'); @@ -65,6 +66,7 @@ if ($action == 'update') { $res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); if ($forcetype < 0) { $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); @@ -216,6 +218,13 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1); print "\n"; + // SHow counter of validated members publicly + print '\n"; + // Jump to an online payment page print ''; print ''; print ''; + if($publiccounters) print ''; print ''; print "\n"; @@ -811,6 +816,8 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print ''; print ''; + $membercount = $objp->membercount>0? $objp->membercount: "–"; + if($publiccounters) print ''; print ''; print ""; $i++; From 0427cce9b262a2062a4e6904ea1dda1db796a9f5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 26 Aug 2022 19:23:51 +0000 Subject: [PATCH 0035/1289] Fixing style errors. --- htdocs/adherents/admin/website.php | 2 +- htdocs/public/members/new.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index b4c40936bbf..4ea40427de7 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -218,7 +218,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1); print "\n"; - // SHow counter of validated members publicly + // SHow counter of validated members publicly print ''; print ''; print ''; - if($publiccounters) print ''; + if ($publiccounters) print ''; print ''; print "\n"; @@ -817,7 +817,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''; print ''; $membercount = $objp->membercount>0? $objp->membercount: "–"; - if($publiccounters) print ''; + if ($publiccounters) print ''; print ''; print ""; $i++; From 65cf35036770cec4264ef1c8a572347c0b31ab1b Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Sat, 27 Aug 2022 11:48:05 +0200 Subject: [PATCH 0036/1289] Date filters are lost when clicking on a title When filtering on a date, $param ONLY contains that entire date. I don't know if it's better to fill $param with month, day and year or get the full date (unix time) --- htdocs/modulebuilder/template/myobject_list.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index d9af4add8ce..87ecc59d33c 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -145,8 +145,16 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + if (empty(GETPOST('search_'.$key.'_dtstart', 'int'))) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + } else { + $search[$key.'_dtstart'] = GETPOST('search_'.$key.'_dtstart', 'int'); + } + if (empty(GETPOST('search_'.$key.'_dtend', 'int'))) { + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } else { + $search[$key.'_dtend'] = GETPOST('search_'.$key.'_dtend', 'int'); + } } } From a3fb4ad03014966faa625798d44cdaedf404486d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 29 Aug 2022 10:22:01 +0200 Subject: [PATCH 0037/1289] use of getUserRemoteIp() --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index dbda57d348f..9720df0881c 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -232,7 +232,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $object->type_code = GETPOST("type_code", 'aZ09'); $object->category_code = GETPOST("category_code", 'aZ09'); $object->severity_code = GETPOST("severity_code", 'aZ09'); - $object->ip = (empty($_SERVER['REMOTE_ADDR']) ? 'unknown' : $_SERVER['REMOTE_ADDR']); + $object->ip = getUserRemoteIP(); $sql = "SELECT COUNT(ref) as nb_tickets"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; From a1bae3453a3019aaf546f8384a292ea141e3986c Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 1 Sep 2022 08:34:22 +0200 Subject: [PATCH 0038/1289] Add an option to manage input size for customer / supplier references --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/delivery/card.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e02ff5d8875..eae47265e24 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2260,7 +2260,7 @@ if ($action == 'create') { $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', '', null, null, '', 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 .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b97bf147dbb..ddc31616c09 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2320,7 +2320,7 @@ if ($action == 'create' && $usercancreate) { $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', '', null, null, '', 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 .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 839a61b2413..a4e8b52f9a2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4355,7 +4355,7 @@ if ($action == 'create') { } // 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', '', null, null, '', 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); // InfraS change // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 439f312bef6..983488e086d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1357,7 +1357,7 @@ if ($action == 'create') { $morehtmlref .= '
'; // Ref customer $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedCustomerRef'); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); // Ref supplier $morehtmlref .= '
'; $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 108f81751b3..41422bdb6ce 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -323,7 +323,7 @@ if ($action == 'create') { // Create. Seems to no be used $morehtmlref = '
'; // Ref customer shipment $morehtmlref .= $form->editfieldkey("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); $morehtmlref .= '
'.$langs->trans("RefDeliveryReceipt").' : '.$object->ref; // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3a0a9869571..1929b7b0f22 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1728,7 +1728,7 @@ if ($action == 'create') { $morehtmlref = '
'; // Ref customer shipment $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 67ec98e3c96..62926138e63 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2015,7 +2015,7 @@ if ($action == 'create') { $morehtmlref = '
'; // Ref supplier $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty'); if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && !empty($usercancreate) && $action == 'edit_thirdparty') { From 52a80a5fe4f8e32aa199094ffbf9f8b4e9c48a2d Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 1 Sep 2022 08:44:49 +0200 Subject: [PATCH 0039/1289] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a4e8b52f9a2..856051f65fe 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4355,7 +4355,7 @@ if ($action == 'create') { } // 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); // InfraS change + $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 .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { From db7bb77d03ff51565856aec6dac8f5de99598726 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:31:56 +0200 Subject: [PATCH 0040/1289] Update bom_card.php --- htdocs/bom/bom_card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 25b7a8730dd..2801b8e3d66 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/bom/bom_card.php - * \ingroup bom - * \brief Page to create/edit/view bom + * \file htdocs/bom/bom_card.php + * \ingroup bom + * \brief Page to create/edit/view BOM */ // Load Dolibarr environment @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("mrp", "other")); +$langs->loadLangs(array('mrp', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (!empty($conf->notification->enabled)) + /*if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -363,7 +363,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of closing if ($action == 'close') { $text = $langs->trans('ConfirmCloseBom', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -391,7 +391,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of reopen if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenBom', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (!empty($conf->project->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -477,7 +477,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (!empty($object->fk_project)) { + if (! empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=$proj->getNomUrl(); From 20e9dc3f0791811931129a4e1dbc6fbc30f8eca1 Mon Sep 17 00:00:00 2001 From: Lefteris Kotsonis Date: Mon, 5 Sep 2022 16:49:57 +0200 Subject: [PATCH 0041/1289] [NEW][#22048][Added notes to productlot module] --- htdocs/core/lib/product.lib.php | 18 +++ .../install/mysql/migration/16.0.0-17.0.0.sql | 3 + .../product/stock/class/productlot.class.php | 10 +- htdocs/product/stock/productlot_note.php | 113 ++++++++++++++++++ 4 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 htdocs/product/stock/productlot_note.php diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 56cb195060b..106dbc22bbc 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -251,6 +251,24 @@ function productlot_prepare_head($object) $head[$h][2] = 'documents'; $h++; + // Notes + if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = DOL_URL_ROOT .'/product/stock/productlot_note.php?id=' . $object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= '' . $nbNote . ''; + } + $head[$h][2] = 'note'; + $h++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 2c093019e72..7a94f70f7c5 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -142,3 +142,6 @@ CREATE TABLE llx_bank_extrafields )ENGINE=innodb; ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); + +ALTER TABLE llx_product_lot ADD COLUMN note_public text DEFAULT NULL after batch; +ALTER TABLE llx_product_lot ADD COLUMN note_private text DEFAULT NULL after note_public; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index d2f21ac372e..bfaee702d01 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -102,6 +102,8 @@ class Productlot extends CommonObject 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), + 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',), + 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',) ); /** @@ -124,6 +126,8 @@ class Productlot extends CommonObject //public $qc_frequency = ''; public $datec = ''; public $tms = ''; + public $note_private; + public $note_public; /** * @var int ID @@ -295,7 +299,9 @@ class Productlot extends CommonObject $sql .= " t.tms,"; $sql .= " t.fk_user_creat,"; $sql .= " t.fk_user_modif,"; - $sql .= " t.import_key"; + $sql .= " t.import_key,"; + $sql .= " t.note_public,"; + $sql .= " t.note_private"; $sql .= " FROM ".$this->db->prefix().$this->table_element." as t"; if ($product_id > 0 && $batch != '') { $sql .= " WHERE t.batch = '".$this->db->escape($batch)."' AND t.fk_product = ".((int) $product_id); @@ -329,6 +335,8 @@ class Productlot extends CommonObject $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_modif = $obj->fk_user_modif; $this->import_key = $obj->import_key; + $this->note_public = $obj->note_public; + $this->note_private = $obj->note_private; // Retrieve all extrafield // fetch optionals attributes and labels diff --git a/htdocs/product/stock/productlot_note.php b/htdocs/product/stock/productlot_note.php new file mode 100644 index 00000000000..c8cd43f2091 --- /dev/null +++ b/htdocs/product/stock/productlot_note.php @@ -0,0 +1,113 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file productlot_note.php + * \ingroup productlot + * \brief Tab for notes on productlot + */ + + + +require '../../main.inc.php'; +dol_include_once('/product/stock/class/productlot.class.php'); +dol_include_once('/core/lib/product.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array('other', 'products')); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Productlot($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->productlot->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('productlotnote')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->productlot->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; +} + +$permissionnote = $user->rights->produit->lire; // Used by the include of actions_setnotes.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->calibration->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +$help_url = ''; +llxHeader('', $langs->trans('productlot'), $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = productlot_prepare_head($object); + + print dol_get_fiche_head($head, 'note', '', -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'batch'); + + print '
'; + print '
'; + + $cssclass = "titlefield"; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + print '
'; + + + print dol_get_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); From b01dbdb3a2b0acef1c40dec34b03a6919bdab968 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Tue, 6 Sep 2022 15:25:25 +0200 Subject: [PATCH 0042/1289] Update myobject_list.php --- htdocs/modulebuilder/template/myobject_list.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 87ecc59d33c..3f24016ffe6 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -147,13 +147,9 @@ foreach ($object->fields as $key => $val) { if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { if (empty(GETPOST('search_'.$key.'_dtstart', 'int'))) { $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - } else { - $search[$key.'_dtstart'] = GETPOST('search_'.$key.'_dtstart', 'int'); } if (empty(GETPOST('search_'.$key.'_dtend', 'int'))) { $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); - } else { - $search[$key.'_dtend'] = GETPOST('search_'.$key.'_dtend', 'int'); } } } @@ -465,6 +461,14 @@ foreach ($search as $key => $val) { $param .= '&search_'.$key.'[]='.urlencode($skey); } } + } elseif (preg_match('/dtstart/', $key) && !empty($val)) { + $param .= '&search'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.urlencode(GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.urlencode(GETPOST('search_'.$key.'year', 'int')); + } elseif (preg_match('/dtend/', $key) && !empty($val)) { + $param .= '&search'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.urlencode(GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.urlencode(GETPOST('search_'.$key.'year', 'int')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } From d65c955d8d8a2cbf74b39e5da789f6a42d6dfe1d Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Tue, 6 Sep 2022 15:27:24 +0200 Subject: [PATCH 0043/1289] Update myobject_list.php --- htdocs/modulebuilder/template/myobject_list.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 3f24016ffe6..9049df31a5d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -145,12 +145,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - if (empty(GETPOST('search_'.$key.'_dtstart', 'int'))) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - } - if (empty(GETPOST('search_'.$key.'_dtend', 'int'))) { - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); - } + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); } } From 585a936154f42856300d6748d48a77259147556c Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 7 Sep 2022 00:34:22 +0200 Subject: [PATCH 0044/1289] Update myobject_list.php Better code now --- htdocs/modulebuilder/template/myobject_list.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 9049df31a5d..5a22268cf07 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -457,12 +457,8 @@ foreach ($search as $key => $val) { $param .= '&search_'.$key.'[]='.urlencode($skey); } } - } elseif (preg_match('/dtstart/', $key) && !empty($val)) { - $param .= '&search'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.urlencode(GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.urlencode(GETPOST('search_'.$key.'year', 'int')); - } elseif (preg_match('/dtend/', $key) && !empty($val)) { - $param .= '&search'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); $param .= '&search_'.$key.'day='.urlencode(GETPOST('search_'.$key.'day', 'int')); $param .= '&search_'.$key.'year='.urlencode(GETPOST('search_'.$key.'year', 'int')); } elseif ($search[$key] != '') { From ec752621dd042775853b1bf1aec45a99b78973b8 Mon Sep 17 00:00:00 2001 From: Lefteris Kotsonis Date: Wed, 7 Sep 2022 14:07:43 +0200 Subject: [PATCH 0045/1289] Updated llx_product_lot.sql with note entries --- htdocs/install/mysql/tables/llx_product_lot.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql index 162f1c6c122..4e6914884ac 100644 --- a/htdocs/install/mysql/tables/llx_product_lot.sql +++ b/htdocs/install/mysql/tables/llx_product_lot.sql @@ -22,6 +22,8 @@ CREATE TABLE llx_product_lot ( entity integer DEFAULT 1, fk_product integer NOT NULL, -- Id of product batch varchar(128) DEFAULT NULL, -- Lot or serial number + note_public text DEFAULT NULL, + note_private text DEFAULT NULL, eatby date DEFAULT NULL, -- Eatby date sellby date DEFAULT NULL, -- Sellby date eol_date datetime NULL, From d776d36e8bd4cb23d99451ac36467ab7eb1ed214 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 14:36:50 +0200 Subject: [PATCH 0046/1289] Update myobject_list.php --- htdocs/modulebuilder/template/myobject_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 5a22268cf07..d774680d166 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -458,9 +458,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.urlencode(GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.urlencode(GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.urlencode(GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } From 2b9350cd098a4259ae4b30c04fead80a547f1731 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 7 Sep 2022 20:51:13 +0200 Subject: [PATCH 0047/1289] Update productcustomerprice.class.php fetchAll --- htdocs/product/class/productcustomerprice.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index ed003d85667..ff000462567 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -356,7 +356,7 @@ class Productcustomerprice extends CommonObject * @param array $filter Filter for select * @return int <0 if KO, >0 if OK */ - public function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { // phpcs:enable global $langs; @@ -421,7 +421,7 @@ class Productcustomerprice extends CommonObject $sql .= $this->db->plimit($limit + 1, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->lines = array(); @@ -832,7 +832,7 @@ class Productcustomerprice extends CommonObject 't.fk_product' => $this->fk_product, 't.fk_soc' => $obj->rowid ); - $result = $prodsocprice->fetch_all('', '', 0, 0, $filter); + $result = $prodsocprice->fetchAll('', '', 0, 0, $filter); if ($result < 0) { $error++; $this->error = $prodsocprice->error; From ec30316f49b0a3f6ecf9c9d63bdb4583b9b248da Mon Sep 17 00:00:00 2001 From: Lefteris Kotsonis Date: Thu, 8 Sep 2022 10:55:41 +0200 Subject: [PATCH 0048/1289] Removed note_public and note_private variables from productlot.class.php --- htdocs/product/stock/class/productlot.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index bfaee702d01..7009d0d55fc 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -101,9 +101,7 @@ class Productlot extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'llx_user.rowid'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',) + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000) ); /** @@ -126,8 +124,6 @@ class Productlot extends CommonObject //public $qc_frequency = ''; public $datec = ''; public $tms = ''; - public $note_private; - public $note_public; /** * @var int ID From 499720851fc9ce2807beb0d8282b455a7235f3da Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 8 Sep 2022 10:59:24 +0200 Subject: [PATCH 0049/1289] fix error of brackets + better look code --- htdocs/public/ticket/create_ticket.php | 265 +++++++++++++------------ 1 file changed, 133 insertions(+), 132 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 75e5dcdb868..79334a5b5f5 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -233,24 +233,24 @@ if (empty($reshook)) { if (!$error) { $object->db->begin(); - $object->type_code = GETPOST("type_code", 'aZ09'); - $object->category_code = GETPOST("category_code", 'aZ09'); - $object->severity_code = GETPOST("severity_code", 'aZ09'); - $object->ip = getUserRemoteIP(); + $object->type_code = GETPOST("type_code", 'aZ09'); + $object->category_code = GETPOST("category_code", 'aZ09'); + $object->severity_code = GETPOST("severity_code", 'aZ09'); + $object->ip = getUserRemoteIP(); - $sql = "SELECT COUNT(ref) as nb_tickets"; - $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; - $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) { - $i++; - $obj = $db->fetch_object($resql); - $nb_post_ip = $obj->nb_tickets; + $sql = "SELECT COUNT(ref) as nb_tickets"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; + $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $i++; + $obj = $db->fetch_object($resql); + $nb_post_ip = $obj->nb_tickets; + } } - } $object->track_id = generate_random_id(16); @@ -320,122 +320,81 @@ if (empty($reshook)) { $object->context['disableticketemail'] = 1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later - if ($nb_post_ip >= getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000)) { - $error++; - $errors = array($langs->trans("AlreadyTooMuchPostOnThisIPAdress")); - array_push($object->errors, array($langs->trans("AlreadyTooMuchPostOnThisIPAdress"))); - $action = 'create_ticket'; - } - - if (!$error) { - $id = $object->create($user); - if ($id <= 0) { + if ($nb_post_ip >= getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000)) { $error++; - $errors = ($object->error ? array($object->error) : $object->errors); - array_push($object->errors, $object->error ? array($object->error) : $object->errors); - $action = 'create_ticket'; - } - } - - if (!$error && $id > 0) { - if ($usertoassign > 0) { - $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0); - } - - if (!$error) { - $object->db->commit(); - $action = "infos_success"; - } else { - $object->db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); + $errors = array($langs->trans("AlreadyTooMuchPostOnThisIPAdress")); + array_push($object->errors, array($langs->trans("AlreadyTooMuchPostOnThisIPAdress"))); $action = 'create_ticket'; } if (!$error) { - $res = $object->fetch($id); - if ($res) { - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $formmail = new FormMail($db); + $id = $object->create($user); + if ($id <= 0) { + $error++; + $errors = ($object->error ? array($object->error) : $object->errors); + array_push($object->errors, $object->error ? array($object->error) : $object->errors); + $action = 'create_ticket'; + } + } - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); + if (!$error && $id > 0) { + if ($usertoassign > 0) { + $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0); + } - $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; + if (!$error) { + $object->db->commit(); + $action = "infos_success"; + } else { + $object->db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'create_ticket'; + } - // Send email to customer + if (!$error) { + $res = $object->fetch($id); + if ($res) { + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $formmail = new FormMail($db); - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id); - $message = ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')).'

'; - $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'
'; + // Init to avoid errors + $filepath = array(); + $filename = array(); + $mimetype = array(); - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; - $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', ''.$object->track_id.'').'
'; - $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl').'

'; + $attachedfiles = $formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; - $message .= $infos_new_ticket; - $message .= getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE', $langs->transnoentities('TicketMessageMailSignatureText', $mysoc->name)); + // Send email to customer - $sendto = GETPOST('email', 'alpha'); + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id); + $message = ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')).'

'; + $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'
'; - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; - $replyto = $from; - $sendtocc = ''; - $deliveryreceipt = 0; + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', ''.$object->track_id.'').'
'; + $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl').'

'; - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); - if ($mailfile->error || $mailfile->errors) { - setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } else { - $result = $mailfile->sendfile(); - } - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } + $message .= $infos_new_ticket; + $message .= getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE', $langs->transnoentities('TicketMessageMailSignatureText', $mysoc->name)); - // Send email to TICKET_NOTIFICATION_EMAIL_TO - $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; - if ($sendto) { - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); - $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'

'; - $message_admin .= '
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; - $message_admin .= '
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; - $message_admin .= '
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; - $message_admin .= '
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; - $message_admin .= '
  • '.$langs->trans('From').' : '.$object->origin_email.'
  • '; - // Extrafields - $extrafields->fetch_name_optionals_label($object->table_element); - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $key = substr($key, 8); // remove "options_" - $message_admin .= '
  • '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' : '.$extrafields->showOutputField($key, $value, '', $object->table_element).'
  • '; - } - } - $message_admin .= '
'; + $sendto = GETPOST('email', 'alpha'); - $message_admin .= '

'.$langs->trans('Message').' :
'.$object->message.'

'; - $message_admin .= '

'.$langs->trans('SeeThisTicketIntomanagementInterface').'

'; - - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; + $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; $replyto = $from; + $sendtocc = ''; + $deliveryreceipt = 0; if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); if ($mailfile->error || $mailfile->errors) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); } else { @@ -444,32 +403,74 @@ if (empty($reshook)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } + + // Send email to TICKET_NOTIFICATION_EMAIL_TO + $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; + if ($sendto) { + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); + $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'

'; + $message_admin .= '
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; + $message_admin .= '
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; + $message_admin .= '
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; + $message_admin .= '
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; + $message_admin .= '
  • '.$langs->trans('From').' : '.$object->origin_email.'
  • '; + // Extrafields + $extrafields->fetch_name_optionals_label($object->table_element); + if (is_array($object->array_options) && count($object->array_options) > 0) { + foreach ($object->array_options as $key => $value) { + $key = substr($key, 8); // remove "options_" + $message_admin .= '
  • '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' : '.$extrafields->showOutputField($key, $value, '', $object->table_element).'
  • '; + } + } + $message_admin .= '
'; + + $message_admin .= '

'.$langs->trans('Message').' :
'.$object->message.'

'; + $message_admin .= '

'.$langs->trans('SeeThisTicketIntomanagementInterface').'

'; + + $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; + $replyto = $from; + + if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; + } + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); + if ($mailfile->error || $mailfile->errors) { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } else { + $result = $mailfile->sendfile(); + } + if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } + } } + + // Copy files into ticket directory + $destdir = $conf->ticket->dir_output.'/'.$object->ref; + if (!dol_is_dir($destdir)) { + dol_mkdir($destdir); + } + foreach ($filename as $i => $val) { + dol_move($filepath[$i], $destdir.'/'.$filename[$i], 0, 1); + $formmail->remove_attached_files($i); + } + + //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); + + // Make a redirect to avoid to have ticket submitted twice if we make back + $messagetoshow = $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '{s1}', '{s2}'); + $messagetoshow = str_replace(array('{s1}', '{s2}'), array(''.$object->track_id.'', ''.$object->ref.''), $messagetoshow); + setEventMessages($messagetoshow, null, 'warnings'); + setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); + + header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); + exit; } - - // Copy files into ticket directory - $destdir = $conf->ticket->dir_output.'/'.$object->ref; - if (!dol_is_dir($destdir)) { - dol_mkdir($destdir); - } - foreach ($filename as $i => $val) { - dol_move($filepath[$i], $destdir.'/'.$filename[$i], 0, 1); - $formmail->remove_attached_files($i); - } - - //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); - - // Make a redirect to avoid to have ticket submitted twice if we make back - $messagetoshow = $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '{s1}', '{s2}'); - $messagetoshow = str_replace(array('{s1}', '{s2}'), array(''.$object->track_id.'', ''.$object->ref.''), $messagetoshow); - setEventMessages($messagetoshow, null, 'warnings'); - setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); - - header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); - exit; + } else { + setEventMessages($object->error, $object->errors, 'errors'); } - } else { - setEventMessages($object->error, $object->errors, 'errors'); } } } From 444ba4bf46e2225bbe6952a30fea6b2a548f3fb1 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 8 Sep 2022 11:40:40 +0200 Subject: [PATCH 0050/1289] FIX Returns --- htdocs/bom/ajax/ajax.php | 2 +- htdocs/bom/tpl/objectline_view.tpl.php | 4 +++- htdocs/core/class/cunits.class.php | 4 ++-- htdocs/core/lib/functions.lib.php | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index 2a57752edde..444ce9beeb2 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -66,7 +66,7 @@ $idproduct = GETPOST('idproduct', 'int'); top_httphead(); -if ($action == 'getDurationUnitByProduct') { +if ($action == 'getDurationUnitByProduct' && $user->hasRight('product', 'lire')) { $product = new Product($db); $res = $product->fetch($idproduct); diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 7c436d5721e..46c708f8c4e 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -65,7 +65,9 @@ if (empty($outputalsopricetotalwithtax)) { } // add html5 elements -$domData = ' data-element="'.$line->element.'service"'; +if($filtertype == 1) $domData = ' data-element="'.$line->element.'service"'; +else $domData = ' data-element="'.$line->element.'"'; + $domData .= ' data-id="'.$line->id.'"'; $domData .= ' data-qty="'.$line->qty.'"'; $domData .= ' data-product_type="'.$line->product_type.'"'; diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 3104ccd347d..102bbbda652 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -427,9 +427,9 @@ class CUnits // extends CommonObject { if ($mode == 'short_label') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$unit_type.'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$this->db->escape($unit_type).'"'); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $unit_type .'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $this->db->escape($unit_type) .'"'); } return $code; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index afee28da2fd..2e819b8539d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8539,11 +8539,11 @@ function dol_osencode($str) * @param string $fieldkey Field to search the key into * @param string $fieldid Field to get * @param int $entityfilter Filter by entity - * @param string $filters Filter on other fields + * @param string $filters Filter on other fields * @return int <0 if KO, Id of code if OK * @see $langs->getLabelFromKey */ -function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = array()) +function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '') { global $cache_codes; From 8152e3f82a6cf09ba9b97481258b00e57d2628bb Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 8 Sep 2022 11:43:48 +0200 Subject: [PATCH 0051/1289] Clean code --- htdocs/bom/class/bom.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 64af253b1f2..78b7e78f91f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -667,6 +667,7 @@ class BOM extends CommonObject * @param float $efficiency Efficiency in MO * @param int $position Position of BOM-Line in BOM-Lines * @param string $import_key Import Key + * @param int $fk_unit Unit of line * @return int <0 if KO, Id of updated BOM-Line if OK */ public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit) From d0429ad8a102bd248b6287fabf6c2737fd3f8422 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 8 Sep 2022 09:48:48 +0000 Subject: [PATCH 0052/1289] Fixing style errors. --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 46c708f8c4e..a3b9df0bdf0 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -65,7 +65,7 @@ if (empty($outputalsopricetotalwithtax)) { } // add html5 elements -if($filtertype == 1) $domData = ' data-element="'.$line->element.'service"'; +if ($filtertype == 1) $domData = ' data-element="'.$line->element.'service"'; else $domData = ' data-element="'.$line->element.'"'; $domData .= ' data-id="'.$line->id.'"'; From 1b5636ff66ce2dab7985b30af3e7b017edf2de03 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 8 Sep 2022 11:58:18 +0200 Subject: [PATCH 0053/1289] Fix stickler --- htdocs/bom/class/bom.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 78b7e78f91f..b61a65f95a2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -667,10 +667,10 @@ class BOM extends CommonObject * @param float $efficiency Efficiency in MO * @param int $position Position of BOM-Line in BOM-Lines * @param string $import_key Import Key - * @param int $fk_unit Unit of line + * @param int $fk_unit Unit of line * @return int <0 if KO, Id of updated BOM-Line if OK */ - public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit) + public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit = 0) { global $mysoc, $conf, $langs, $user; @@ -740,7 +740,7 @@ class BOM extends CommonObject $this->line->efficiency = $efficiency; $this->line->import_key = $import_key; $this->line->position = $rankToUse; - $this->line->fk_unit = $fk_unit; + if(!empty($fk_unit)) $this->line->fk_unit = $fk_unit; $result = $this->line->update($user); From f22744210e6f2c7d12b0a413f9da01bd48dd794d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 9 Sep 2022 11:31:06 +0200 Subject: [PATCH 0054/1289] Fix : missing column in etablishement sql --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 1 + htdocs/install/mysql/tables/llx_establishment.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 8121b94494d..5536e09ca42 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 @@ -149,3 +149,4 @@ UPDATE llx_c_effectif SET code='EF101-500', libelle='101 - 500' WHERE code='EF10 ALTER TABLE llx_rights_def ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +ALTER TABLE llx_establishment ADD COLUMN label varchar(255) NOT NULL AFTER entity; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 7159a53059c..1b0d2668cb0 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,6 +22,7 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, + label varchar(255) NOT NULL, ref varchar(30), name varchar(128), address varchar(255), From 857646ed364b9fc252343aa4d3fa78eec18d2fba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:00:38 +0200 Subject: [PATCH 0055/1289] update code toward php8 compliance --- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/api/class/api_documents.class.php | 2 +- htdocs/categories/class/api_categories.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a76fa1945c2..36d268a06cf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -480,7 +480,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; - $permissiontoread = $user->rights->societe->lire; + $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontodelete = $user->rights->societe->supprimer; $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index ba94415782f..786c3914b92 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -395,7 +395,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; - $permissiontoread = $user->rights->societe->lire; + $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontodelete = $user->rights->societe->supprimer; $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index d4d652f3e74..2c7653c3bb3 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -272,7 +272,7 @@ class Documents extends DolibarrApi if ($modulepart == 'societe' || $modulepart == 'thirdparty') { require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 76381c0d53d..e59ff070aec 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -315,7 +315,7 @@ class Categories extends DolibarrApi throw new RestException(401); } elseif ($type == Categorie::TYPE_CONTACT && !DolibarrApiAccess::$user->rights->contact->lire) { throw new RestException(401); - } elseif ($type == Categorie::TYPE_CUSTOMER && !DolibarrApiAccess::$user->rights->societe->lire) { + } elseif ($type == Categorie::TYPE_CUSTOMER && !DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } elseif ($type == Categorie::TYPE_SUPPLIER && !DolibarrApiAccess::$user->rights->fournisseur->lire) { throw new RestException(401); From 3f2faf466768471729ec95054b26a549b080aa64 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:02:48 +0200 Subject: [PATCH 0056/1289] update code toward php8 compliance --- htdocs/comm/index.php | 4 ++-- htdocs/contact/list.php | 2 +- htdocs/core/ajax/objectonoff.php | 2 +- htdocs/core/boxes/box_clients.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index ed6184e0cd4..01f3bba9eff 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -594,7 +594,7 @@ print '
'; /* * Last modified customers or prospects */ -if (isModEnabled("societe") && $user->rights->societe->lire) { +if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; @@ -700,7 +700,7 @@ if (isModEnabled("societe") && $user->rights->societe->lire) { /* * Last suppliers */ -if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->societe->lire) { +if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1070c9e0b9d..c2b0120790b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -312,7 +312,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Contact'; $objectlabel = 'Contact'; - $permissiontoread = $user->rights->societe->lire; + $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontodelete = $user->rights->societe->supprimer; $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index c66a49557d0..77cd3234cd8 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -67,7 +67,7 @@ if (!empty($user->socid)) { $socid = $user->socid; } -//$user->rights->societe->lire = 0;$user->rights->fournisseur->lire = 0; +//$user->hasRight('societe', 'lire') = 0;$user->rights->fournisseur->lire = 0; //restrictedArea($user, 'societe', $id); if (in_array($field, array('status'))) { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 364b79932ef..cb934debef3 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -86,7 +86,7 @@ class box_clients extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max)); - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; From 4ccc79f253a93ce423d36ef99a66ff2189da3c63 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:04:37 +0200 Subject: [PATCH 0057/1289] update code toward php8 compliance --- htdocs/core/boxes/box_customers_outstanding_bill_reached.php | 2 +- htdocs/core/boxes/box_dolibarr_state_board.php | 4 ++-- htdocs/core/boxes/box_fournisseurs.php | 2 +- htdocs/core/boxes/box_goodcustomers.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 2bf5a2c0693..ec82f1a57e4 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -86,7 +86,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastOutstandingBillReached", $max)); - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index a60d5c20a93..0f63582370c 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -114,8 +114,8 @@ class box_dolibarr_state_board extends ModeleBoxes $conditions = array( 'users' => $user->hasRight('user', 'user', 'lire'), 'members' => isModEnabled('adherent') && $user->rights->adherent->lire, - 'customers' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - 'prospects' => isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + 'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + 'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), 'suppliers' => ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->lire) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire) || (isModEnabled("supplier_invoice") && $user->rights->supplier_invoice->lire) diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 59280aeec62..1c14ac0be4f 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -81,7 +81,7 @@ class box_fournisseurs extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers", $max)); - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 3341e08107d..90ffc82a5d8 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -69,7 +69,7 @@ class box_goodcustomers extends ModeleBoxes $this->enabled = 0; // not enabled by default. Very slow on large database } - $this->hidden = empty($user->rights->societe->lire); + $this->hidden = !$user->hasRight('societe', 'lire'); } /** @@ -90,7 +90,7 @@ class box_goodcustomers extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleGoodCustomers", $max)); - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid, s.nom as name, s.logo, s.code_client, s.code_fournisseur, s.client, s.fournisseur, s.tms as datem, s.status as status,"; $sql .= " count(*) as nbfact, sum(".$this->db->ifsql('f.paye=1', '1', '0').") as nbfactpaye"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; From 06ea3d3ae1d1462517e2fe850c72446673b7936e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 11:06:34 +0200 Subject: [PATCH 0058/1289] Update index.php $help_url --- htdocs/accountancy/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 21c736900aa..bd7d6273848 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -79,7 +79,7 @@ if (GETPOST('addbox')) { * View */ -$help_url = ''; +$help_url = 'EN:Module_Double_Entry_Accounting#Setup'; llxHeader('', $langs->trans("AccountancyArea"), $help_url); From e73b8983bf4f1c0b95614cd43e2fb8725e820010 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:07:00 +0200 Subject: [PATCH 0059/1289] update code toward php8 compliance --- htdocs/core/boxes/box_contacts.php | 2 +- htdocs/core/boxes/box_prospect.php | 2 +- htdocs/core/lib/security.lib.php | 4 ++-- htdocs/hrm/position_card.php | 2 +- htdocs/margin/index.php | 2 +- htdocs/margin/lib/margins.lib.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index f257d7db18d..f051fe5ade3 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -85,7 +85,7 @@ class box_contacts extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedContacts", $max)); - if ($user->rights->societe->lire && $user->rights->societe->contact->lire) { + if ($user->hasRight('societe', 'lire') && $user->rights->societe->contact->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; $sql .= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail"; diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 205cf09419c..69e8432a879 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -86,7 +86,7 @@ class box_prospect extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedProspects", $max)); - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index ce6f9b38320..f4f1d1be5cd 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -831,7 +831,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl if ($user->socid != $objectid) { return false; } - } elseif (isModEnabled("societe") && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) { + } elseif (isModEnabled("societe") && ($user->hasRight('societe', 'lire') && empty($user->rights->societe->client->voir))) { // If internal user: Check permission for internal users that are restricted on their objects $sql = "SELECT COUNT(sc.fk_soc) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -857,7 +857,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.fk_soc = ".((int) $user->socid); - } elseif (isModEnabled("societe") && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) { + } elseif (isModEnabled("societe") && ($user->hasRight('societe', 'lire') && empty($user->rights->societe->client->voir))) { // If internal user: Check permission for internal users that are restricted on their objects $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 746e1265a0b..168756d9851 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -337,7 +337,7 @@ function displayPositionCard(&$object) // */ // $filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id; // $urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id; -// $genallowed = $user->rights->societe->lire; +// $genallowed = $user->hasRight('societe', 'lire'); // $delallowed = $user->rights->societe->creer; // // print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); diff --git a/htdocs/margin/index.php b/htdocs/margin/index.php index 8363cd331c4..79595d5a8ee 100644 --- a/htdocs/margin/index.php +++ b/htdocs/margin/index.php @@ -27,7 +27,7 @@ require '../main.inc.php'; if ($user->rights->produit->lire) { $page = 'productMargins'; -} elseif ($user->rights->societe->lire) { +} elseif ($user->hasRight('societe', 'lire')) { $page = 'customerMargins'; } else { $page = 'agentMargins'; diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 802541b98ca..10e449026fa 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -71,7 +71,7 @@ function marges_prepare_head() $h++; } - if ($user->rights->societe->lire) { + if ($user->hasRight('societe', 'lire')) { $head[$h][0] = DOL_URL_ROOT."/margin/customerMargins.php"; $head[$h][1] = $langs->trans("CustomerMargins"); $head[$h][2] = 'customerMargins'; From b52bcf191fbc6be8f5baa73aee2158bc17527729 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:08:36 +0200 Subject: [PATCH 0060/1289] update code toward php8 compliance --- htdocs/societe/card.php | 4 ++-- htdocs/societe/index.php | 12 ++++++------ htdocs/societe/list.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/website.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bdc48872c03..ab3ce495872 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -137,7 +137,7 @@ if (!empty($canvas)) { } // Permissions -$permissiontoread = $user->rights->societe->lire; +$permissiontoread = $user->hasRight('societe', 'lire'); $permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0); $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php @@ -3277,7 +3277,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id; - $genallowed = $user->rights->societe->lire; + $genallowed = $user->hasRight('societe', 'lire'); $delallowed = $user->rights->societe->creer; print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 1d0bdfe39a1..e161cd8668c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -124,10 +124,10 @@ $result = $db->query($sql); if ($result) { while ($objp = $db->fetch_object($result)) { $found = 0; - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found = 1; $third['prospect']++; } - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found = 1; $third['customer']++; } if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { @@ -150,10 +150,10 @@ $thirdpartygraph .= '
'."\n"; } else { - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; $statstring .= ''; $statstring .= ""; } - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring .= ""; $statstring .= ''; $statstring .= ""; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ff6de888284..6ebd9e3336d 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -383,7 +383,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Societe'; $objectlabel = 'ThirdParty'; - $permissiontoread = $user->rights->societe->lire; + $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontodelete = $user->rights->societe->supprimer; $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 30b19e59d8b..fe5654a0d06 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -79,7 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $hookmanager->initHooks(array('thirdpartybancard', 'globalcard')); // Permissions -$permissiontoread = $user->rights->societe->lire; +$permissiontoread = $user->hasRight('societe', 'lire'); $permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php $permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write))); diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 8de63dfeffc..17ebb6d7988 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -161,7 +161,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'WebsiteAccount'; $objectlabel = 'WebsiteAccount'; - $permissiontoread = $user->rights->societe->lire; + $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontodelete = $user->rights->societe->supprimer; $uploaddir = $conf->societe->multidir_output[$object->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; From 1485e3bd7934ade1ad4629f12fa6967f21a3f35d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:10:33 +0200 Subject: [PATCH 0061/1289] update code toward php8 compliance --- .../societe/canvas/company/tpl/card_view.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/class/api_thirdparties.class.php | 16 ++++++++-------- htdocs/ticket/list.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index d1ba18f82fd..48fd3374322 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -283,7 +283,7 @@ for ($i = 1; $i <= 4; $i++) { */ $filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid; -$genallowed = $user->rights->societe->lire; +$genallowed = $user->hasRight('societe', 'lire'); $delallowed = $user->rights->societe->creer; print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang); diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 98979c917d4..5ae12a3c501 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -209,7 +209,7 @@ if ($this->control->tpl['action_delete']) { */ $filedir = $conf->societe->multidir_output[$this->control->tpl['entity']].'/'.$socid; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid; -$genallowed = $user->rights->societe->lire; +$genallowed = $user->hasRight('societe', 'lire'); $delallowed = $user->rights->societe->creer; print $formfile->showdocuments('company', $socid, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $objcanvas->control->object->default_lang); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index f197a1b7024..db85884c68d 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -132,7 +132,7 @@ class Thirdparties extends DolibarrApi { $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -848,7 +848,7 @@ class Thirdparties extends DolibarrApi */ public function getOutStandingProposals($id, $mode = 'customer') { - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -890,7 +890,7 @@ class Thirdparties extends DolibarrApi */ public function getOutStandingOrder($id, $mode = 'customer') { - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -931,7 +931,7 @@ class Thirdparties extends DolibarrApi */ public function getOutStandingInvoices($id, $mode = 'customer') { - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -972,7 +972,7 @@ class Thirdparties extends DolibarrApi */ public function getSalesRepresentatives($id, $mode = 0) { - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -1015,7 +1015,7 @@ class Thirdparties extends DolibarrApi { $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -1439,7 +1439,7 @@ class Thirdparties extends DolibarrApi */ public function getSocieteAccounts($id, $site = null) { - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401); } @@ -1870,7 +1870,7 @@ class Thirdparties extends DolibarrApi { global $conf; - if (!DolibarrApiAccess::$user->rights->societe->lire) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'lire')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login.'. No read permission on thirdparties.'); } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 80656681015..0551532b00f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -491,7 +491,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); -if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) { +if ($socid && !$projectid && !$project_ref && $user->hasRight('societe', 'lire')) { $socstat = new Societe($db); $res = $socstat->fetch($socid); if ($res > 0) { From a2b8dd446b79f69f8d67b72ead644c3f1a8caf91 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:13:02 +0200 Subject: [PATCH 0062/1289] update code toward php8 compliance --- htdocs/admin/mails_templates.php | 2 +- htdocs/barcode/printsheet.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/website.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 3d8d7f3db4f..86f8752d91f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -186,7 +186,7 @@ if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) { if (isModEnabled('recruitment') && !empty($user->rights->recruitment->recruitmentjobposition->read)) { $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); } -if (isModEnabled("societe") && !empty($user->rights->societe->lire)) { +if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) { $elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty')); } if (isModEnabled('project')) { diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 96caac1dbb4..373effecbe8 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -397,7 +397,7 @@ if (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire) print ''; } -if (!empty($user->rights->societe->lire)) { +if ($user->hasRight('societe', 'lire')) { print ''; print '
'; print '
'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 96bd34143c7..cb5a7f41f8f 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -104,7 +104,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh } } - if (isModEnabled('societe') && !empty($user->rights->societe->lire)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire')) { print '
'; print img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth inline-block"'); print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 9cadb431ec5..b4ae935677b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -242,7 +242,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) { + if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && ($user->hasRight('societe', 'lire'))) { $head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode($object->id); $head[$h][1] = $langs->trans("WebSiteAccounts"); $nbNote = 0; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 17ebb6d7988..5dc25da93a5 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -250,7 +250,7 @@ print dol_get_fiche_end(); $newcardbutton = ''; if (isModEnabled('website')) { - if (!empty($user->rights->societe->lire)) { + if ($user->hasRight('societe', 'lire')) { $newcardbutton .= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id)); } else { $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', 0); From c8a70ba221d922c9e52c00bc11441551349ccac2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:14:25 +0200 Subject: [PATCH 0063/1289] update code toward php8 compliance --- htdocs/comm/card.php | 2 +- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/core/class/html.formintervention.class.php | 2 +- htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/core/lib/security.lib.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 67df6af0298..1eca4555e91 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -131,7 +131,7 @@ if ($id > 0 && empty($object->id)) { } } if ($object->id > 0) { - if (!($object->client > 0) || empty($user->rights->societe->lire)) { + if (!($object->client > 0) || !$user->hasRight('societe', 'lire')) { accessforbidden(); } } diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 6267c6ff390..c763bc1a04e 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -104,7 +104,7 @@ class FormContract while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->hasRight('societe', 'lire')) { // Do nothing } else { $labeltoshow = dol_trunc($obj->ref, 18); diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 107e9ba378a..751e77eafe1 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -99,7 +99,7 @@ class FormIntervention while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->hasRight('societe', 'lire')) { // Do nothing } else { $labeltoshow = dol_trunc($obj->ref, 18); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 4d34211ed17..d4c3b1aa21f 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -206,7 +206,7 @@ class FormProjets while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->hasRight('societe', 'lire')) { // Do nothing } else { if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) { // We discard closed except if selected diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index f4f1d1be5cd..1c0d7d1aab1 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -421,7 +421,7 @@ function restrictedArea(User $user, $features, $objectid = 0, $tableandshare = ' } if ($feature == 'societe') { - if (empty($user->rights->societe->lire) && empty($user->rights->fournisseur->lire)) { + if (!$user->hasRight('societe', 'lire') && empty($user->rights->fournisseur->lire)) { $readok = 0; $nbko++; } From 236b86bdd3f0a968e8f3d88560212576c7178b76 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:18:31 +0200 Subject: [PATCH 0064/1289] update code toward php8 compliance --- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/contact/list.php | 4 ++-- htdocs/societe/card.php | 6 +++--- htdocs/societe/list.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 786c3914b92..e417f21832c 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -396,7 +396,7 @@ if (empty($reshook)) { $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; $permissiontoread = $user->hasRight('societe', 'lire'); - $permissiontodelete = $user->rights->societe->supprimer; + $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c2b0120790b..387fc2c06e6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -313,7 +313,7 @@ if (empty($reshook)) { $objectclass = 'Contact'; $objectlabel = 'Contact'; $permissiontoread = $user->hasRight('societe', 'lire'); - $permissiontodelete = $user->rights->societe->supprimer; + $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -690,7 +690,7 @@ $arrayofmassactions = array( // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); -if ($user->rights->societe->supprimer) { +if ($user->hasRight('societe', 'supprimer')) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if ($user->rights->societe->creer) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ab3ce495872..4b612df0c00 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -139,7 +139,7 @@ if (!empty($canvas)) { // Permissions $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0); +$permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0); $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -914,7 +914,7 @@ if (empty($reshook)) { } // Delete third party - if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) { + if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) { $object->fetch($socid); $object->oldcopy = clone $object; $result = $object->delete($socid, $user); @@ -3247,7 +3247,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete); - if ($user->rights->societe->supprimer) { + if ($user->hasRight('societe', 'supprimer')) { $deleteUrl = $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(); $buttonId = 'action-delete-no-ajax'; if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 6ebd9e3336d..680ab8aff82 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -384,7 +384,7 @@ if (empty($reshook)) { $objectclass = 'Societe'; $objectlabel = 'ThirdParty'; $permissiontoread = $user->hasRight('societe', 'lire'); - $permissiontodelete = $user->rights->societe->supprimer; + $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -898,7 +898,7 @@ if ($user->rights->societe->creer) { if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) { $arrayofmassactions = array(); } -if ($user->rights->societe->supprimer) { +if ($user->hasRight('societe', 'supprimer')) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From 1b5465d7d0bc76747a906b91d67e623b1b12137d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:19:54 +0200 Subject: [PATCH 0065/1289] update code toward php8 compliance --- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/societe/canvas/company/tpl/card_view.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/class/api_thirdparties.class.php | 2 +- htdocs/societe/website.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 36d268a06cf..71e80f703af 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -481,7 +481,7 @@ if (empty($reshook)) { $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; $permissiontoread = $user->hasRight('societe', 'lire'); - $permissiontodelete = $user->rights->societe->supprimer; + $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->rights->societe->creer; $uploaddir = $conf->societe->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 48fd3374322..fb9a38ed442 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -263,7 +263,7 @@ for ($i = 1; $i <= 4; $i++) { ">trans("Modify"); ?> -rights->societe->supprimer) { ?> +hasRight('societe', 'supprimer')) { ?> use_javascript_ajax) { ?> trans('Delete'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 5ae12a3c501..369ef413fc1 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -190,7 +190,7 @@ if ($this->control->tpl['action_delete']) { ">trans("Modify"); ?> -rights->societe->supprimer) { ?> +hasRight('societe', 'supprimer')) { ?> use_javascript_ajax) { ?> trans('Delete'); ?> diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index db85884c68d..7fe72779c6c 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -527,7 +527,7 @@ class Thirdparties extends DolibarrApi */ public function delete($id) { - if (!DolibarrApiAccess::$user->rights->societe->supprimer) { + if (!DolibarrApiAccess::$user->hasRight('societe', 'supprimer')) { throw new RestException(401); } $result = $this->company->fetch($id); diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 5dc25da93a5..9ca58ab0bf4 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -162,7 +162,7 @@ if (empty($reshook)) { $objectclass = 'WebsiteAccount'; $objectlabel = 'WebsiteAccount'; $permissiontoread = $user->hasRight('societe', 'lire'); - $permissiontodelete = $user->rights->societe->supprimer; + $permissiontodelete = $user->hasRight('societe', 'supprimer'); $uploaddir = $conf->societe->multidir_output[$object->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } From e96eee56b0e3cc2c50408072fd7c1c4d4d496acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 10 Sep 2022 13:55:40 +0200 Subject: [PATCH 0066/1289] sample deprecated function --- htdocs/commande/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 -- .../class/productcustomerprice.class.php | 22 ++++++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d6a4aead2ec..adc4b5b04aa 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -789,7 +789,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result >= 0) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8be014b8959..05a828417b8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1534,7 +1534,6 @@ abstract class CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return array with list of possible values for type of contacts * @@ -1548,7 +1547,6 @@ abstract class CommonObject */ public function listeTypeContacts($source = 'internal', $option = 0, $activeonly = 0, $code = '', $element = '', $excludeelement = '') { - // phpcs:enable global $langs, $conf; $langs->loadLangs(array('bills', 'contracts', 'interventions', 'orders', 'projects', 'propal', 'ticket', 'agenda')); diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index ff000462567..197816f48ca 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -354,11 +354,31 @@ class Productcustomerprice extends CommonObject * @param int $limit page * @param int $offset offset * @param array $filter Filter for select + * @deprecated since dolibarr v17 use fetchAll * @return int <0 if KO, >0 if OK */ + public function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) + { + // phpcs:enable + + dol_syslog(get_class($this)."::fetch_all is deprecated, use fetchAll instead", LOG_NOTICE); + + return $this->fetchAll($sortorder, $sortfield, $limit, $offset, $filter); + } + + /** + * Load all customer prices in memory from database + * + * @param string $sortorder order + * @param string $sortfield field + * @param int $limit page + * @param int $offset offset + * @param array $filter Filter for select + * @return int <0 if KO, >0 if OK + * @since dolibarr v17 + */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { - // phpcs:enable global $langs; if (empty($sortfield)) { From 5451bef0f710dda77297f17d22f6038f97c927f1 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 13:58:19 +0200 Subject: [PATCH 0067/1289] scrutinizer CMailFile: undeclared variable --- htdocs/core/class/CMailFile.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index ba657f58087..b3ff0aae930 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -878,7 +878,11 @@ class CMailFile $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; - $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); + if (isset($supportedoauth2array)) { + $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); + } else { + $OAUTH_SERVICENAME = 'Unknown'; + } require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; From 705b436494fcd84f5ee3480fbeee6d0a17b76a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 10 Sep 2022 14:03:47 +0200 Subject: [PATCH 0068/1289] replace other deprecated --- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/cron/class/cronjob.class.php | 2 +- htdocs/product/ajax/products.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/class/api_products.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/price.php | 4 ++-- htdocs/resource/class/dolresource.class.php | 2 +- htdocs/resource/list.php | 2 +- htdocs/societe/price.php | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c4f620f6686..7b491e71a23 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1027,7 +1027,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4c4a0a6c19a..8101177f412 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1412,7 +1412,7 @@ class Propal extends CommonObject } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($this->db); $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $objsoc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { // If there is some prices specific to the customer if (count($prodcustprice->lines) > 0) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9cbe8b5c686..6dbc879d4e3 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -498,7 +498,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b0c2250c49..016d9ea99e3 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1567,7 +1567,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $productCustomerPriceStatic = new Productcustomerprice($db); $filter = array('fk_product' => $idprod, 'fk_soc' => $object->socid); - $nbCustomerPrices = $productCustomerPriceStatic->fetch_all('', '', 1, 0, $filter); + $nbCustomerPrices = $productCustomerPriceStatic->fetchAll('', '', 1, 0, $filter); if ($nbCustomerPrices > 0) { $productCustomerPrice = $productCustomerPriceStatic->lines[0]; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 033e6512bd8..7fb3539eb91 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -576,7 +576,7 @@ class Cronjob extends CommonObject $sql .= " WHERE ".implode(' AND ', $sqlwhere); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 0e606932ce2..e2768ba8ccb 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -190,7 +190,7 @@ if ($action == 'fetch' && !empty($id)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $socid); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $found = true; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 17387e3948d..7d542316ccc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1035,7 +1035,7 @@ if (empty($reshook)) { $filter = array('t.fk_product' => $object->id, 't.fk_soc' => $soc->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines [0]->price); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1c17deae602..91a55b4ca30 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -670,7 +670,7 @@ class Products extends DolibarrApi if ($thirdparty_id) { $filter['t.fk_soc'] .= $thirdparty_id; } - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); } if (empty($prodcustprice->lines)) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 360709dc5a0..925ac9dbbce 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1850,7 +1850,7 @@ class Product extends CommonObject $filter = array('t.fk_product' => $this->id, 't.fk_soc' => $thirdparty_buyer->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $result = $prodcustprice->fetchAll('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { $pu_ht = price($prodcustprice->lines[0]->price); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 341b8a56e62..19d2f388ce6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2213,10 +2213,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll($sortorder, $sortfield, 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 46371fead0f..3e1a2615cd9 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -527,7 +527,7 @@ class Dolresource extends CommonObject if ($limit) { $sql .= $this->db->plimit($limit, $offset); } - dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $this->lines = array(); $resql = $this->db->query($sql); diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 1ef64555133..d67f55f51f2 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -168,7 +168,7 @@ if ($search_type != '') { } // Including the previous script generate the correct SQL filter for all the extrafields -// we are playing with the behaviour of the Dolresource::fetch_all() by generating a fake +// we are playing with the behaviour of the Dolresource::fetchAll() by generating a fake // extrafields filter key to make it works $filter['ef.resource'] = $sql; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a9f17f4b50a..12d7a7d62fb 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -532,10 +532,10 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetchAll('', '', 0, 0, $filter); } - $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); + $result = $prodcustprice->fetchAll($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } From 349e33592db873c055a5ffb9bd20e112bd76c023 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 14:09:58 +0200 Subject: [PATCH 0069/1289] scrutinizer in accountancy/class/accountingaccount.class.php: variable not always defined --- .../class/accountingaccount.class.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index bf487d47c2c..95296624145 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -811,9 +811,9 @@ class AccountingAccount extends CommonObject $suggestedaccountingaccountfor = ''; if ((($buyer->country_code == $seller->country_code) || empty($buyer->country_code))) { // If buyer in same country than seller (if not defined, we assume it is same country) - if ($type=='customer' && !empty($product->accountancy_code_sell)) { + if ($type == 'customer' && !empty($product->accountancy_code_sell)) { $code_p = $product->accountancy_code_sell; - } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + } elseif ($type == 'supplier' && !empty($product->accountancy_code_buy)) { $code_p = $product->accountancy_code_buy; } $suggestedid = $accountingAccount['dom']; @@ -821,36 +821,36 @@ class AccountingAccount extends CommonObject } else { if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with VAT - if ($type=='customer' && !empty($product->accountancy_code_sell)) { + if ($type == 'customer' && !empty($product->accountancy_code_sell)) { $code_p = $product->accountancy_code_sell; - } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + } elseif ($type == 'supplier' && !empty($product->accountancy_code_buy)) { $code_p = $product->accountancy_code_buy; } $suggestedid = $accountingAccount['dom']; $suggestedaccountingaccountfor = 'eecwithvat'; } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number - if ($type=='customer' && !empty($product->accountancy_code_sell)) { + if ($type == 'customer' && !empty($product->accountancy_code_sell)) { $code_p = $product->accountancy_code_sell; - } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + } elseif ($type == 'supplier' && !empty($product->accountancy_code_buy)) { $code_p = $product->accountancy_code_buy; } $suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ? $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; } elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { // European intravat sale - if ($type=='customer' && !empty($product->accountancy_code_sell_intra)) { + if ($type == 'customer' && !empty($product->accountancy_code_sell_intra)) { $code_p = $product->accountancy_code_sell_intra; - } elseif ($type=='supplier' && !empty($product->accountancy_code_buy_intra)) { + } elseif ($type == 'supplier' && !empty($product->accountancy_code_buy_intra)) { $code_p = $product->accountancy_code_buy_intra; } $suggestedid = $accountingAccount['intra']; $suggestedaccountingaccountfor = 'eec'; } else { // Foreign sale - if ($type=='customer' && !empty($product->accountancy_code_sell_export)) { + if ($type == 'customer' && !empty($product->accountancy_code_sell_export)) { $code_p = $product->accountancy_code_sell_export; - } elseif ($type=='supplier' && !empty($product->accountancy_code_buy_export)) { + } elseif ($type == 'supplier' && !empty($product->accountancy_code_buy_export)) { $code_p = $product->accountancy_code_buy_export; } $suggestedid = $accountingAccount['export']; @@ -870,12 +870,12 @@ class AccountingAccount extends CommonObject // Manage Deposit if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { $accountdeposittoventilated = new self($this->db); - if ($type=='customer') { + if ($type == 'customer') { $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); - } elseif ($type=='supplier') { + } elseif ($type == 'supplier') { $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); } - if ($result < 0) { + if (isset($result) && $result < 0) { return -1; } From 034da214c01298281684ac5de01cc0b0307baec8 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 14:14:15 +0200 Subject: [PATCH 0070/1289] scrutinizer in takepos/send.php : string[] implicitely converted to a boolean --- htdocs/takepos/send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 2003abaf1f1..918c218ad95 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -85,7 +85,7 @@ if ($action == "send") { $sendto = $email; $from = $mysoc->email; $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1); - if ($mail->error || $mail->errors) { + if ($mail->error || !empty($mail->errors)) { setEventMessages($mail->error, $mail->errors, 'errors'); } else { $result = $mail->sendfile(); From cabfc61ba3fb3f569d4d49ed89f2b3d32ec6b6d2 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 14:39:36 +0200 Subject: [PATCH 0071/1289] scrutinizer in bookmarks/bookmarks.lib.php: variable $Bookmark not defined for all paths --- htdocs/bookmarks/bookmarks.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 2abd90cf538..df42b8942a5 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -89,6 +89,7 @@ function printDropdownBookmarksList() $listbtn = ''; $listbtn .= img_picto('', 'edit', 'class="paddingright opacitymedium"').$langs->trans('EditBookmarks').''; + $bookmarkList = ''; // Menu with list of bookmarks $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; From f6d2033a242feb7c30be12bdb3fe03087901e540 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 15:00:34 +0200 Subject: [PATCH 0072/1289] Fix php / token error --- htdocs/recruitment/recruitmentcandidature_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 0d2cc848aaa..f06fc476883 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -574,7 +574,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Contract refused / accepted if ($object->status == $object::STATUS_CONTRACT_PROPOSED) { if ($permissiontoadd) { - print ''.$langs->trans("Accept").' / '.$langs->trans("Decline").''; + print ''.$langs->trans("Accept").' / '.$langs->trans("Decline").''; } } From 4c74687c1032946fe88f68b2197b1365438a9ae6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 15:01:36 +0200 Subject: [PATCH 0073/1289] Update recruitmentjobposition_card.php --- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index b2172aca80d..44a65e90271 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -446,7 +446,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Close as recruited/canceled if ($object->status == $object::STATUS_VALIDATED) { if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; print '>'.$langs->trans('Close').''; } else { print ''.$langs->trans('Close').''; From 4f45c89ecb53252e3e29f51461546193769c2028 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 10 Sep 2022 13:02:21 +0000 Subject: [PATCH 0074/1289] Fixing style errors. --- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 44a65e90271..a20d631e3f2 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -446,7 +446,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Close as recruited/canceled if ($object->status == $object::STATUS_VALIDATED) { if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '// close').'"'; print '>'.$langs->trans('Close').''; } else { print ''.$langs->trans('Close').''; From 1c561b75f0cc104db99a706a341946d09107c397 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 15:20:00 +0200 Subject: [PATCH 0075/1289] scrutinizer in holiday/card_group.php: doc of function sendMail incomplete --- htdocs/holiday/card_group.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/card_group.php b/htdocs/holiday/card_group.php index de10c3d72f6..8ebddf045a7 100644 --- a/htdocs/holiday/card_group.php +++ b/htdocs/holiday/card_group.php @@ -657,10 +657,12 @@ if (is_object($db)) { } /** * send email to validator for current leave represented by (id) - * @param $id validator for current leave represented by (id) - * @param $cancreate flag for user right - * @param $now date - * @param $autoValidation boolean flag on autovalidation + * + * @param int $id validator for current leave represented by (id) + * @param int $cancreate flag for user right + * @param int $now date + * @param int $autoValidation boolean flag on autovalidation + * * @return stdClass * @throws Exception */ From 4ec58d76544989c6f3cc77e7139cc4ec529a70dc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 15:20:31 +0200 Subject: [PATCH 0076/1289] Update recruitmentjobposition_card.php --- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index a20d631e3f2..85100f992bd 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -446,7 +446,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Close as recruited/canceled if ($object->status == $object::STATUS_VALIDATED) { if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '// close').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '// close').'"'; print '>'.$langs->trans('Close').''; } else { print ''.$langs->trans('Close').''; From b66b71817c0c402b5d1994e13f2120d5ee955005 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 15:49:54 +0200 Subject: [PATCH 0077/1289] scrutinizer in core/lib/ftp.lib.php: $localpath never defiened for ftp_get, added it and modify consequently file where the function is called --- htdocs/core/lib/ftp.lib.php | 5 +++-- htdocs/ftp/index.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/ftp.lib.php b/htdocs/core/lib/ftp.lib.php index 118c85e9b74..807bae63b0a 100644 --- a/htdocs/core/lib/ftp.lib.php +++ b/htdocs/core/lib/ftp.lib.php @@ -193,11 +193,12 @@ function dol_ftp_delete($connect_id, $file, $newsection) * Download a FTP file * * @param resource $connect_id Connection handler - * @param string $file File + * @param string $localfile The local file path + * @param string $file The remote file path * @param string $newsection $newsection * @return result */ -function dol_ftp_get($connect_id, $file, $newsection) +function dol_ftp_get($connect_id, $localfile, $file, $newsection) { global $conf; diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 857d41fc85b..6d06f501e8f 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -317,7 +317,7 @@ if ($action == 'download') { $newsection = $section; - $result = dol_ftp_get($connect_id, $file, $newsection); + $result = dol_ftp_get($connect_id, $localfile, $file, $newsection); if ($result) { From 44728ff93a9aac3484c98b0d8dd3add705fd1dfd Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 16:21:16 +0200 Subject: [PATCH 0078/1289] scrutinizer in core/class/notify.class.php : variable \labeltouse not defined for all paths --- htdocs/core/class/notify.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 3f26a98c728..b1e37ab1948 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -625,6 +625,8 @@ class Notify $mimefilename_list[] = $ref.".pdf"; } + $labeltouse = !empty($labeltouse) ? $labeltouse : ''; + $parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list, 'outputlangs'=>$outputlangs, 'labeltouse'=>$labeltouse); if (!isset($action)) { $action = ''; From 21274c94328b9df1f2e4be154adb1f0c2785089d Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 16:43:04 +0200 Subject: [PATCH 0079/1289] scrutinizer in core/class/html.formsetup.class.php: variable $valconst wasn't defined for all paths --- htdocs/core/class/html.formsetup.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index c2183653686..aef01514eba 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -758,6 +758,8 @@ class FormSetupItem $val = GETPOST($this->confKey, 'array'); if ($val && is_array($val)) { $val_const = implode(',', $val); + } else { + $val_const = ''; } } elseif ($this->type == 'html') { $val_const = GETPOST($this->confKey, 'restricthtml'); From 0819b04171e87b3a2c7a13aa4ac37d3faf14d26d Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 16:52:40 +0200 Subject: [PATCH 0080/1289] scrutinizer in asset/class/assetdepreciationoptions.class.php : variable $mode_info substituted by $field_info --- htdocs/asset/class/assetdepreciationoptions.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index ce2ddd73c08..49efadca869 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -163,8 +163,8 @@ class AssetDepreciationOptions extends CommonObject } // Unset required option (notnull) if field disabled - if (!empty($mode_info['enabled_field'])) { - $info = explode(':', $mode_info['enabled_field']); + if (!empty($field_info['enabled_field'])) { + $info = explode(':', $field_info['enabled_field']); if ($this->deprecation_options[$info[0]][$info[1]] != $info[2] && isset($this->fields[$field_key]['notnull'])) { unset($this->fields[$field_key]['notnull']); } From 0b944e62ee86b77b292abc78667bb1bccd093ebf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 17:01:21 +0200 Subject: [PATCH 0081/1289] Update recruitmentjobposition_card.php --- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 85100f992bd..d7d115b04b0 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -446,7 +446,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Close as recruited/canceled if ($object->status == $object::STATUS_VALIDATED) { if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '// close').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; print '>'.$langs->trans('Close').''; } else { print ''.$langs->trans('Close').''; From 3cf7eda258f27160c207b981cd557a83e42a3cbb Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 10 Sep 2022 17:11:24 +0200 Subject: [PATCH 0082/1289] scrutinizer in core/modules/printing/printgcp.modules.php: var $printer_id not defined for all paths --- htdocs/core/modules/printing/printgcp.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 391f5b435d7..c04d3ac9ca5 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -332,6 +332,7 @@ class printing_printgcp extends PrintingDriver } $fileprint .= '/'.$file; $mimetype = dol_mimetype($fileprint); + $printer_id = ''; // select printer uri for module order, propal,... $sql = "SELECT rowid, printer_id, copy FROM ".MAIN_DB_PREFIX."printing WHERE module='".$this->db->escape($module)."' AND driver='printgcp' AND userid=".((int) $user->id); $result = $this->db->query($sql); From 231270d7816a1d98741e33265dfe65a6fea755c9 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:27:25 +0200 Subject: [PATCH 0083/1289] Update bom_note.php --- htdocs/bom/bom_note.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 9984a1498b8..0c32b8643fb 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -17,9 +17,9 @@ */ /** - * \file bom_note.php - * \ingroup bom - * \brief Car with notes on BillOfMaterials + * \file htdocs/bom/bom_note.php + * \ingroup bom + * \brief Card with notes on BillOfMaterials */ // Load Dolibarr environment @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array("mrp", "companies")); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -40,9 +40,13 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; + +// Initialize technical objects for hooks $hookmanager->initHooks(array('bomnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Massactions +$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); From 8c3c817b231656389e8d74f7372469506f802889 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:30:48 +0200 Subject: [PATCH 0084/1289] Update bom_net_needs.php --- htdocs/bom/bom_net_needs.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 668ed29a62e..1b8afa91e52 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -35,20 +35,24 @@ $langs->loadLangs(array("mrp", "other", "stocks")); // Get parameters $id = GETPOST('id', 'int'); $lineid = GETPOST('lineid', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomnet_needs'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); - +$backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects $object = new BOM($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; + +// Initialize technical objects for hooks $hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array + +// Massaction +$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -73,13 +77,13 @@ if ($object->id > 0) { } - // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); +// Permissions $permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -123,13 +127,11 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); - $title = $langs->trans('BOM'); $help_url ='EN:Module_BOM'; llxHeader('', $title, $help_url); - // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $head = bomPrepareHead($object); From ee8ea00a5b8f0f8c20142c2e0d769173566f5396 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:44:08 +0200 Subject: [PATCH 0085/1289] Update bom_list.php --- htdocs/bom/bom_list.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index eb78228f068..3374204e22f 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/bom/bom_list.php - * \ingroup bom - * \brief List page for bom + * \file htdocs/bom/bom_list.php + * \ingroup bom + * \brief List page for BillOfMaterials */ // Load Dolibarr environment @@ -29,8 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; // Load translation files required by the page -$langs->loadLangs(array("mrp", "other")); +$langs->loadLangs(array('mrp', 'other')); +// Get Parameters +$id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -38,16 +40,14 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') - -$id = GETPOST('id', 'int'); +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int'); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action From a7fff0be48f9089882e11f51029eedc154061cd3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:50:00 +0200 Subject: [PATCH 0086/1289] Update bom_document.php --- htdocs/bom/bom_document.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index a0390ef5105..29aca029d36 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -17,35 +17,35 @@ */ /** - * \file bom_document.php - * \ingroup bom - * \brief Tab for documents linked to BillOfMaterials + * \file htdocs/bom/bom_document.php + * \ingroup bom + * \brief Tab for documents linked to BillOfMaterials */ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page $langs->loadLangs(array("mrp", "companies", "other", "mails")); - +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'bom', $id); +// if ($user->socid > 0) accessforbidden(); +// if ($user->socid > 0) $socid = $user->socid; +// $result = restrictedArea($user, 'bom', $id); -// Get parameters +// Load variables for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); From 8c9159ae047d92c6414cc04dc59717353363eca9 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:54:24 +0200 Subject: [PATCH 0087/1289] Update bom_card.php --- htdocs/bom/bom_card.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 2cf2b3a4dd3..46d4f0b8ff9 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/bom/bom_card.php - * \ingroup bom - * \brief Page to create/edit/view bom + * \file htdocs/bom/bom_card.php + * \ingroup bom + * \brief Page to create/edit/view BillOfMaterial */ // Load Dolibarr environment @@ -32,17 +32,18 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("mrp", "other")); +$langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); +$id = GETPOST('id', 'int'); +$lineid = GETPOST('lineid', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomcard'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$backtopage = GETPOST('backtopage', 'alpha'); + // PDF $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); @@ -54,6 +55,7 @@ $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); @@ -84,6 +86,7 @@ if ($object->id > 0) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); +// Permissions $permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php From 181ad927a47a1c6e24df61a347058519b9e0b7e1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:59:06 +0200 Subject: [PATCH 0088/1289] Update bom_agenda.php --- htdocs/bom/bom_agenda.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index ac3f672ad33..cb6685045f7 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -32,15 +32,16 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("mrp", "other")); +$langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = GETPOST('socid', 'int'); if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -50,8 +51,10 @@ if (GETPOST('actioncode', 'array')) { } else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } + $search_agenda_label = GETPOST('search_agenda_label'); +// Load variables for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -74,6 +77,7 @@ $object = new BOM($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('bomagenda', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); From 9552cd8f478f27727fbd840a8fd89ccd00462aa1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 21:10:29 +0200 Subject: [PATCH 0089/1289] Update barcode.php --- htdocs/admin/barcode.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 966281cb0d1..96dd7affdba 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -32,10 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; // Load translation files required by the page $langs->load("admin"); +// Security Check Access if (!$user->admin) { accessforbidden(); } +// Get Parameters $action = GETPOST('action', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php From a8451336f08880641b3cd4eea71a237b85753cd8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sat, 10 Sep 2022 21:12:25 +0200 Subject: [PATCH 0090/1289] Update workstation_agenda.php --- htdocs/workstation/workstation_agenda.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index c09bef044c6..83219b1da93 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -53,6 +53,7 @@ if (GETPOST('actioncode', 'array')) { $search_agenda_label = GETPOST('search_agenda_label'); +// Load variables for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -85,6 +86,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->workstation->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoadd = $user->rights->workstation->workstation->write; // Used by the include of actions_addupdatedelete.inc.php // Security check From 2acfa41b1661fda3e49083dc85fef49bdec6d350 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:20:51 +0200 Subject: [PATCH 0091/1289] Update bom_card.php --- htdocs/bom/bom_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 2801b8e3d66..ddb45b6e0bd 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); From 35f3f8b92885cca39863ec29769c53e41e4a3bf2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:35:07 +0200 Subject: [PATCH 0092/1289] Update evaluation_agenda.php --- htdocs/hrm/evaluation_agenda.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index ed9e9ecc196..bebdbdee9f9 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -20,9 +20,9 @@ */ /** - * \file evaluation_agenda.php - * \ingroup hr - * \brief Tab of events on Evaluation + * \file htdocs/hrm/evaluation_agenda.php + * \ingroup hrm + * \brief Tab of events on Evaluation */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -88,6 +88,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php From 8b9ba57786ad1dc76d1ca5408436ddf10d088dee Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:38:04 +0200 Subject: [PATCH 0093/1289] Update evaluation_card.php --- htdocs/hrm/evaluation_card.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 9c73d8c99b6..d88688bbb23 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -20,9 +20,9 @@ */ /** - * \file evaluation_card.php - * \ingroup hrm - * \brief Page to create/edit/view evaluation + * \file htdocs/hrm/evaluation_card.php + * \ingroup hrm + * \brief Page to create/edit/view evaluation */ // Load Dolibarr environment @@ -32,14 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skillrank.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + // Load translation files required by the page -$langs->loadLangs(array("hrm", "other", 'products')); +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? // Get parameters $id = GETPOST('id', 'int'); @@ -79,7 +80,7 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - +// Permissions $permissiontoread = $user->rights->hrm->evaluation->read; $permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontovalidate = $user->rights->hrm->evaluation_advance->validate; From 8712b5eaeac6bdb52570c8ddd22c1ff35787e8c5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:41:25 +0200 Subject: [PATCH 0094/1289] Update evaluation_contact.php --- htdocs/hrm/evaluation_contact.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 205192055c6..1c1d9ed26fd 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -20,11 +20,12 @@ */ /** - * \file evaluation_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Evaluation + * \file htdocs/hrm/evaluation_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Evaluation */ + // Load Dolibarr environment require '../main.inc.php'; @@ -34,8 +35,9 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -53,6 +55,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->evaluation->write; // Security check (enable the most restrictive one) @@ -64,10 +67,13 @@ $permission = $user->rights->hrm->evaluation->write; //if (!$permissiontoread) accessforbidden(); + /* - * Add a new contact + * Action */ +// Add a new contact + if ($action == 'addcontact' && $permission) { $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); From 74d5c1eb6cf02e50b9c9447a8ed018bcf4e7eff8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:44:05 +0200 Subject: [PATCH 0095/1289] Update evaluation_document.php --- htdocs/hrm/evaluation_document.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index cf93c75edbf..23f9d260f0f 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -20,9 +20,9 @@ */ /** - * \file evaluation_document.php - * \ingroup hrm - * \brief Tab for documents linked to Evaluation + * \file htdocs/hrm/evaluation_document.php + * \ingroup hrm + * \brief Tab for documents linked to Evaluation */ @@ -38,15 +38,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); - +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); -// Get parameters + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -80,7 +80,8 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/evaluation/".get_exdir(0, 0, 0, 1, $object); } -$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +// Permissions +$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php $permissiontoread = $user->rights->hrm->evaluation->read; // Security check (enable the most restrictive one) From 2a9cc278430af62325c3fae30e8f84c0453b2d1e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:46:49 +0200 Subject: [PATCH 0096/1289] Update evaluation_list.php --- htdocs/hrm/evaluation_list.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index cc584b2e8d4..f475cef7af7 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -20,9 +20,9 @@ */ /** - * \file evaluation_list.php - * \ingroup hrm - * \brief List page for evaluation + * \file htdocs/hrm/evaluation_list.php + * \ingroup hrm + * \brief List page for evaluation */ @@ -40,8 +40,9 @@ require_once __DIR__.'/class/evaluation.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -49,8 +50,8 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'evaluationlist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->hrm->evaluation->read; -$permissiontoadd = $user->rights->hrm->evaluation->write; +// Permissions +$permissiontoread = $user->rights->hrm->evaluation->read; +$permissiontoadd = $user->rights->hrm->evaluation->write; $permissiontodelete = $user->rights->hrm->evaluation->delete; // Security check From 0374cb103e7be0e73744990b4993403e7817e72f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:49:12 +0200 Subject: [PATCH 0097/1289] Update evaluation_note.php --- htdocs/hrm/evaluation_note.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 1b6b5a35564..5c02b533bb7 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -20,25 +20,27 @@ */ /** - * \file evaluation_note.php - * \ingroup hrm - * \brief Tab for notes on Evaluation + * \file htdocs/hrm/evaluation_note.php + * \ingroup hrm + * \brief Tab for notes on Evaluation */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; + // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -47,6 +49,7 @@ $object = new Evaluation($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -56,8 +59,9 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php -$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php +// Permissions +$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php +$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); From a083de68f805e2036c3f65a0e31b954ee411f0db Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:52:00 +0200 Subject: [PATCH 0098/1289] Update index.php --- htdocs/hrm/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index e8554c9da3d..05967606a8e 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/hrm/index.php - * \ingroup hrm - * \brief Home page for HRM area. + * \file htdocs/hrm/index.php + * \ingroup hrm + * \brief Home page for HRM area. */ @@ -32,10 +32,10 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; From 9e0a4988abf0a3839edc931f21a0e2eca4a0cb02 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:53:39 +0200 Subject: [PATCH 0099/1289] Update job_agenda.php --- htdocs/hrm/job_agenda.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index b6ce99c9801..808ceea430f 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -20,24 +20,24 @@ */ /** - * \file job_agenda.php - * \ingroup hrm - * \brief Tab of events on Job + * \file htdocs/hrm/job_agenda.php + * \ingroup hrm + * \brief Tab of events on Job */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +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'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -87,8 +87,9 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); From 6430310d74139e034b07d08e186a35b6a69a44d2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:57:59 +0200 Subject: [PATCH 0100/1289] Update job_card.php --- htdocs/hrm/job_card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index a9ec4f77121..d8be48bce69 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -20,7 +20,7 @@ */ /** - * \file job_card.php + * \file htdocs/hrm/job_card.php * \ingroup hrm * \brief Page to create/edit/view job */ @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other", 'products')); +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? // Get parameters $id = GETPOST('id', 'int'); @@ -76,9 +76,9 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->hrm->all->delete; $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job'; From b084da450226b1dc638c9fcb9b2eb7492993ca73 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 10:59:44 +0200 Subject: [PATCH 0101/1289] Update job_contact.php --- htdocs/hrm/job_contact.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 4a6c9995127..dc25ad6eae2 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -20,22 +20,23 @@ */ /** - * \file job_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Job + * \file htdocs/hrm/job_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Job */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -53,6 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->job->write; // Security check (enable the most restrictive one) From cbe98f44cdfb829d3f7530a85b50f8672b2d6635 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:01:36 +0200 Subject: [PATCH 0102/1289] Update job_document.php --- htdocs/hrm/job_document.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index 0e4d34e0412..eda504b07cd 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -20,9 +20,9 @@ */ /** - * \file job_document.php - * \ingroup hrm - * \brief Tab for documents linked to Job + * \file htdocs/hrm/job_document.php + * \ingroup hrm + * \brief Tab for documents linked to Job */ // Load Dolibarr environment @@ -36,15 +36,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); - +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); -// Get parameters + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -68,6 +68,7 @@ $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -78,6 +79,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php From c1dbb9559f915123f582863579738ef7d240a09f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:03:44 +0200 Subject: [PATCH 0103/1289] Update job_list.php --- htdocs/hrm/job_list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 53cb43ad080..ed0fb480a3a 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -20,9 +20,9 @@ */ /** - * \file job_list.php - * \ingroup hrm - * \brief List page for job + * \file htdocs/hrm/job_list.php + * \ingroup hrm + * \brief List page of jobs */ @@ -40,8 +40,9 @@ require_once __DIR__.'/class/job.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; +$permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; // Security check From 6e701e4bc2b867526078ea332a71746df3a23b3f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:05:59 +0200 Subject: [PATCH 0104/1289] Update job_note.php --- htdocs/hrm/job_note.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php index 7205afec247..9e64e27d6ae 100644 --- a/htdocs/hrm/job_note.php +++ b/htdocs/hrm/job_note.php @@ -20,9 +20,9 @@ */ /** - * \file job_note.php - * \ingroup hrm - * \brief Tab for notes on Job + * \file htdocs/hrm/job_note.php + * \ingroup hrm + * \brief Tab for notes on Job */ @@ -33,12 +33,13 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -47,6 +48,7 @@ $object = new Job($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -56,6 +58,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php From 6dcddafaa7439222f0be2c2d37164d1a534db3d7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:14:22 +0200 Subject: [PATCH 0105/1289] Update position_agenda.php --- htdocs/hrm/position_agenda.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index fc90a24dec6..fa0e6ab3aed 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -20,9 +20,9 @@ */ /** - * \file position_agenda.php - * \ingroup hrm - * \brief Tab of events on Position + * \file htdocs/hrm/position_agenda.php + * \ingroup hrm + * \brief Tab of events on Position */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -79,6 +79,7 @@ $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -88,6 +89,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php From f9248ab4b83ee7c374b0a662816fc1e99fbfa309 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:16:31 +0200 Subject: [PATCH 0106/1289] Update position_card.php --- htdocs/hrm/position_card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 746e1265a0b..00d8f96236d 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -20,9 +20,9 @@ */ /** - * \file position_card.php - * \ingroup hrm - * \brief Page to create/edit/view position + * \file htdocs/hrm/position_card.php + * \ingroup hrm + * \brief Page to create/edit/view job position */ @@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; //dol_include_once('/hrm/position.php'); +// Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); @@ -50,6 +51,7 @@ if ($res < 0) { dol_print_error($db, $object->error); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->hrm->all->delete; From 3cd4a74beaac13ee88d108baac44ceab35d9c63f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:19:09 +0200 Subject: [PATCH 0107/1289] Update position_contact.php --- htdocs/hrm/position_contact.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index f443099a9e4..4d85987f4d6 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -20,22 +20,23 @@ */ /** - * \file position_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Position + * \file htdocs/hrm/position_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Job Position */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; // Load translation files required by the page $langs->loadLangs(array("hrm", "companies", "other", "mails")); +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -47,12 +48,14 @@ $object = new Position($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->position->write; // Security check (enable the most restrictive one) From c78c08bf1c139ebe797f5aa1ed64961dd13425cd Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:20:54 +0200 Subject: [PATCH 0108/1289] Update position_document.php --- htdocs/hrm/position_document.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index c51f2204441..30f33453c03 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -20,9 +20,9 @@ */ /** - * \file position_document.php - * \ingroup hrm - * \brief Tab for documents linked to Position + * \file htdocs/hrm/position_document.php + * \ingroup hrm + * \brief Tab for documents linked to Position */ // Load Dolibarr environment @@ -39,13 +39,13 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; // Load translation files required by the page $langs->loadLangs(array("hrm", "companies", "other", "mails")); - +// Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); -// Get parameters +// Get parameters for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -79,8 +79,9 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/position/".get_exdir(0, 0, 0, 1, $object); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); From 36653325464af5593610209758360de38f994eb1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:23:15 +0200 Subject: [PATCH 0109/1289] Update position_list.php --- htdocs/hrm/position_list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index e9eb83e12e4..e79af867a74 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -20,9 +20,9 @@ */ /** - * \file position_list.php - * \ingroup hrm - * \brief List page for position + * \file htdocs/hrm/position_list.php + * \ingroup hrm + * \brief List page for job positions */ @@ -40,8 +40,9 @@ require_once __DIR__.'/class/position.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; +// Permissions +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; // Security check From 2f07d48894934c79bdf1ae7984082ef616411782 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:25:22 +0200 Subject: [PATCH 0110/1289] Update position_note.php --- htdocs/hrm/position_note.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 99d6581247f..1ecd77b4bdc 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -20,26 +20,27 @@ */ /** - * \file position_note.php - * \ingroup hrm - * \ingroup hrm - * \brief Tab for notes on Position + * \file htdocs/hrm/position_note.php + * \ingroup hrm + * \brief Tab for notes on Position */ // Load Dolibarr environment require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; + // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); + // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -58,7 +59,8 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = $user->rights->hrm->all->write; +// Permissions +$permissionnote = $user->rights->hrm->all->write; $permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) From 06ec607f22d89e60e594976484fe3047f3173fad Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:27:02 +0200 Subject: [PATCH 0111/1289] Update skill_agenda.php --- htdocs/hrm/skill_agenda.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 23f98d75f3f..9646aaccb88 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -20,24 +20,24 @@ */ /** - * \file skill_agenda.php - * \ingroup hrm - * \brief Tab of events on skill + * \file htdocs/hrm/skill_agenda.php + * \ingroup hrm + * \brief Tab of events on skill */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +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'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -56,6 +56,7 @@ if (GETPOST('actioncode', 'array')) { } $search_agenda_label = GETPOST('search_agenda_label'); +// Get Parameters for Pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -87,6 +88,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php From 95a94a7c899e8882057fd2a57ec0dabbe30b27c3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:29:11 +0200 Subject: [PATCH 0112/1289] Update skill_card.php --- htdocs/hrm/skill_card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 4fd3a0bc28b..c057d0e0e31 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -20,9 +20,9 @@ */ /** - * \file skill_card.php + * \file htdocs/hrm/skill_card.php * \ingroup hrm - * \brief Page to create/edit/view skill + * \brief Page to create/edit/view skills */ @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other", 'products')); +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? // Get parameters $id = GETPOST('id', 'int'); @@ -77,9 +77,9 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - -$permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +// Permissions +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->hrm->all->delete; $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill'; From c44725b080e34eecd382d4f01100278b73fb224b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:32:08 +0200 Subject: [PATCH 0113/1289] Update skill_contact.php --- htdocs/hrm/skill_contact.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index c5fe154557c..562421a5272 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -20,22 +20,25 @@ */ /** - * \file skill_contact.php - * \ingroup hrm - * \brief Tab for contacts linked to Skill + * \file htdocs/hrm/skill_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Skill */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; -// Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); +// Load translation files required by the page +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); + + +// Get Parameters $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); @@ -53,6 +56,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions $permission = $user->rights->hrm->skill->write; // Security check (enable the most restrictive one) @@ -65,9 +69,11 @@ $permission = $user->rights->hrm->skill->write; /* - * Add a new contact + * Action */ +// Add a new contact + if ($action == 'addcontact' && $permission) { $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); From fa3451fb7474c4ff93021f109a041f48feebce0c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:34:40 +0200 Subject: [PATCH 0114/1289] Update skill_document.php --- htdocs/hrm/skill_document.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index c0fe492be06..2f9f8e0db81 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -20,9 +20,9 @@ */ /** - * \file skill_document.php - * \ingroup hrm - * \brief Tab for documents linked to skill + * \file htdocs/hrm/skill_document.php + * \ingroup hrm + * \brief Tab for documents linked to skill */ @@ -37,15 +37,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies", "other", "mails")); - +$langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); +// Get Parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $ref = GETPOST('ref', 'alpha'); -// Get parameters +// Get Parameters for Pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -79,8 +79,9 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/skill/".get_exdir(0, 0, 0, 1, $object); } +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); From 710f755efe126377b0e1d88d591e8c7dce67fa81 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:37:16 +0200 Subject: [PATCH 0115/1289] Update skill_list.php --- htdocs/hrm/skill_list.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 65a3cac0ecf..032dbcacdcd 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -20,9 +20,9 @@ */ /** - * \file skill_list.php - * \ingroup hrm - * \brief List page for skill + * \file htdocs/hrm/skill_list.php + * \ingroup hrm + * \brief List page for skill */ @@ -40,8 +40,11 @@ require_once __DIR__.'/class/skill.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); + +// Get Parameters +$id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? @@ -49,10 +52,8 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skilllist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') - -$id = GETPOST('id', 'int'); +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; +// Permissions +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; // Security check From 6d57f4f0c70c6bc38b005b2f5816795fcfb6d3cf Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 11 Sep 2022 09:38:05 +0000 Subject: [PATCH 0116/1289] Fixing style errors. --- htdocs/hrm/skill_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 032dbcacdcd..664d54212a3 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -131,7 +131,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -// Permissions +// Permissions $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; From e617c2678b3f9ae088b03afa35bc5a9a7df3fa87 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:38:33 +0200 Subject: [PATCH 0117/1289] Update skill_note.php --- htdocs/hrm/skill_note.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php index 45a0690f176..3b892e0694e 100644 --- a/htdocs/hrm/skill_note.php +++ b/htdocs/hrm/skill_note.php @@ -20,9 +20,9 @@ */ /** - * \file skill_note.php - * \ingroup hrm - * \brief Tab for notes on skill + * \file htdocs/hrm/skill_note.php + * \ingroup hrm + * \brief Tab for notes on skill */ @@ -33,12 +33,12 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "companies")); +$langs->loadLangs(array('hrm', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -56,7 +56,8 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = $user->rights->hrm->all->write; +// Permissions +$permissionnote = $user->rights->hrm->all->write; $permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php // Security check (enable the most restrictive one) From 3752272f1b3cc0463dde249ec3b598e7f7d7d9a9 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:41:00 +0200 Subject: [PATCH 0118/1289] Update skill_tab.php --- htdocs/hrm/skill_tab.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 393e20ba3c4..d479a843776 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -20,13 +20,12 @@ */ /** - * \file skill_tab.php - * \ingroup hrm - * \brief Page to add/delete/view skill to jobs/users + * \file htdocs/hrm/skill_tab.php + * \ingroup hrm + * \brief Page to add/delete/view skill to jobs/users */ - // Load Dolibarr environment require '../main.inc.php'; @@ -39,8 +38,9 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("hrm", "other")); +$langs->loadLangs(array('hrm', 'other')); +// Get Parameters $id = GETPOST('id', 'int'); $TSkillsToAdd = GETPOST('fk_skill', 'array'); $objecttype = GETPOST('objecttype', 'alpha'); @@ -73,8 +73,9 @@ $hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hoo // Load object include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +// Permissions $permissiontoread = $user->rights->hrm->all->read; -$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php // Security check (enable the most restrictive one) if ($user->socid > 0) accessforbidden(); From 733a7d2c81e62c756adc00a0b13a02ddf495caef Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:42:59 +0200 Subject: [PATCH 0119/1289] Update skill_extrafields.php --- htdocs/hrm/admin/skill_extrafields.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/admin/skill_extrafields.php b/htdocs/hrm/admin/skill_extrafields.php index adcf6277dd0..1ca37038e93 100644 --- a/htdocs/hrm/admin/skill_extrafields.php +++ b/htdocs/hrm/admin/skill_extrafields.php @@ -21,9 +21,9 @@ */ /** - * \file admin/skill_extrafields.php - * \ingroup hrm - * \brief Page to setup extra fields of hrm + * \file htdocs/hrm/admin/skill_extrafields.php + * \ingroup hrm + * \brief Page to setup extra fields of hrm skills */ // Load Dolibarr environment @@ -48,6 +48,7 @@ $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'hrm_skill'; //Must be the $table_element of the class that manage extrafield +// Security check if (!$user->admin) { accessforbidden(); } From a5c216e16a4dd82f8e35aae9659de15834e5b43a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:44:31 +0200 Subject: [PATCH 0120/1289] Update job_extrafields.php --- htdocs/hrm/admin/job_extrafields.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 5d6ea5d6990..6af5f1ffc67 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -21,9 +21,9 @@ */ /** - * \file admin/job_extrafields.php - * \ingroup hrm - * \brief Page to setup extra fields of hrm + * \file htdocs/hrm/admin/job_extrafields.php + * \ingroup hrm + * \brief Page to setup extra fields of hrm jobs */ // Load Dolibarr environment @@ -44,10 +44,12 @@ foreach ($tmptype2label as $key => $val) { $type2label[$key] = $langs->transnoentitiesnoconv($val); } +// Get Parameters $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'hrm_job'; //Must be the $table_element of the class that manage extrafield +// Security Check if (!$user->admin) { accessforbidden(); } From f911e79b1cb0404a0434a1b89ed82579ba187fb5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:46:13 +0200 Subject: [PATCH 0121/1289] Update evaluation_extrafields.php --- htdocs/hrm/admin/evaluation_extrafields.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/admin/evaluation_extrafields.php b/htdocs/hrm/admin/evaluation_extrafields.php index 6513ea311e3..ddf20696ff7 100644 --- a/htdocs/hrm/admin/evaluation_extrafields.php +++ b/htdocs/hrm/admin/evaluation_extrafields.php @@ -21,9 +21,9 @@ */ /** - * \file admin/evaluation_extrafields.php - * \ingroup hrm - * \brief Page to setup extra fields of hrm + * \file htdocs/hrm/admin/evaluation_extrafields.php + * \ingroup hrm + * \brief Page to setup extra fields of hrm evaluation */ // Load Dolibarr environment @@ -44,10 +44,12 @@ foreach ($tmptype2label as $key => $val) { $type2label[$key] = $langs->transnoentitiesnoconv($val); } +// Get Parameters $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'hrm_evaluation'; //Must be the $table_element of the class that manage extrafield +// Security Check if (!$user->admin) { accessforbidden(); } From 97018db06dd15dcb7a7b2729c27d636296cd3a13 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:48:30 +0200 Subject: [PATCH 0122/1289] Update admin_hrm.php --- htdocs/hrm/admin/admin_hrm.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 6763fb43f8e..dc8d20403a3 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -16,10 +16,12 @@ */ /** - * \file htdocs/hrm/admin/admin_hrm.php - * \ingroup HRM - * \brief HRM module setup page + * \file htdocs/hrm/admin/admin_hrm.php + * \ingroup HRM + * \brief HRM module setup page */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -27,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'hrm')); +// Get Parameters $action = GETPOST('action', 'aZ09'); // Other parameters HRM_* @@ -34,8 +37,9 @@ $list = array( // 'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example ); +// Permissions $permissiontoread = $user->admin; -$permissiontoadd = $user->admin; +$permissiontoadd = $user->admin; // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); From e43a86521a79767ad5d85ae36ba6030200f11fc7 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:50:37 +0200 Subject: [PATCH 0123/1289] Update admin_establishment.php --- htdocs/hrm/admin/admin_establishment.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index f28c0285e1f..00722526e9d 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -16,10 +16,12 @@ */ /** - * \file htdocs/hrm/admin/admin_establishment.php - * \ingroup HRM - * \brief HRM Establishment module setup page + * \file htdocs/hrm/admin/admin_establishment.php + * \ingroup HRM + * \brief HRM Establishment module setup page */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php'; @@ -29,8 +31,9 @@ $langs->loadLangs(array('admin', 'hrm')); $error = 0; +// Permissions $permissiontoread = $user->admin; -$permissiontoadd = $user->admin; +$permissiontoadd = $user->admin; // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); From e4faf16c564b12899911275eee69b59f85fb865b Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 21:53:25 +0200 Subject: [PATCH 0124/1289] scrutinizer: multiple attribute errors considered as boolean instead of string[] in if() --- htdocs/public/ticket/create_ticket.php | 4 ++-- htdocs/ticket/class/ticket.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index b4df70e3dd8..e982a4507b8 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -368,7 +368,7 @@ if (empty($reshook)) { } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); - if ($mailfile->error || $mailfile->errors) { + if ($mailfile->error || !empty($mailfile->errors)) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); } else { $result = $mailfile->sendfile(); @@ -409,7 +409,7 @@ if (empty($reshook)) { } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); - if ($mailfile->error || $mailfile->errors) { + if ($mailfile->error || !empty($mailfile->errors)) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); } else { $result = $mailfile->sendfile(); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5306b0c0141..df581d96fdc 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1654,7 +1654,7 @@ class Ticket extends CommonObject $sendtocc = ''; $deliveryreceipt = 0; $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $tmpmessage, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error || $mailfile->errors) { + if ($mailfile->error || !empty($mailfile->errors)) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); } else { $result = $mailfile->sendfile(); From 8742e457aa6c2eff9ea6911efb773c52ca38835c Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 22:08:38 +0200 Subject: [PATCH 0125/1289] scrutinizer on ftp/index.php : type result compared with 'false' --- htdocs/ftp/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 857d41fc85b..74a459328f4 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -709,7 +709,7 @@ print '
'; if (!empty($conn_id)) { $disconnect = dol_ftp_close($conn_id); - if ($disconnect == false) { + if (!$disconnect) { setEventMessages($langs->trans("ErrorFTPNodisconnect"), null, 'errors'); } } From 0ac45a01ffd4dab83cf8b563763b4f8e056030ee Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 22:21:52 +0200 Subject: [PATCH 0126/1289] scrutinizer on product/stock/stocktransfer/class/stocktransferline.class.php: unset a non-existent var --- .../stock/stocktransfer/class/stocktransferline.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index a5d49dcc3a7..14febad09d4 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -232,7 +232,6 @@ class StockTransferLine extends CommonObjectLine // Reset some properties unset($object->id); - unset($object->fk_user_creat); unset($object->import_key); From da10379090a5365bc63a1620192daa739595e252 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 22:26:02 +0200 Subject: [PATCH 0127/1289] scrutinizer on product/stock/stocktransfer/class/stocktransferline.class.php: unset a non-existent var --- htdocs/product/stock/stocktransfer/class/stocktransfer.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index d0f27eb46f4..da21a95cdb7 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -140,6 +140,7 @@ class StockTransfer extends CommonObject public $note_private; public $date_creation; public $tms; + public $lead_time_for_warning; public $fk_user_creat; public $fk_user_modif; public $import_key; From 9cdcac7c1c773b51322cf5be19ba645a7ef529a3 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 22:38:51 +0200 Subject: [PATCH 0128/1289] scrutinizer on product/stock/stocktransfer/class/stocktransfer.class.php: var ref_client undefined on object, so added it and added also ref_customer because ref_client is deprecated --- .../stocktransfer/class/stocktransfer.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index da21a95cdb7..a71098fc2bf 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -57,6 +57,19 @@ class StockTransfer extends CommonObject */ public $isextrafieldmanaged = 1; + /** + * @var string Customer ref + * @deprecated + * @see $ref_customer + */ + public $ref_client; + + /** + * @var string Customer ref + */ + public $ref_customer; + + /** * @var string String with name of icon for stocktransfer. Must be the part after the 'object_' into object_stocktransfer.png */ From f5adbf798365022c225f2ca706f5d0677c85dd47 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 11 Sep 2022 22:57:00 +0200 Subject: [PATCH 0129/1289] scrutinizer on core/modules/import/import_xlsx.modules.php : array $where not always defined --- htdocs/core/modules/import/import_xlsx.modules.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 6d7c5bf82fd..6b2c02de197 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -876,11 +876,12 @@ class ImportXlsx extends ModeleImports if (!empty($updatekeys)) { // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) + $where = array(); + if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM " . $tablename; $data = array_combine($listfields, $listvalues); - $where = array(); $filters = array(); foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; @@ -929,6 +930,7 @@ class ImportXlsx extends ModeleImports // Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' $sqlSelect = "SELECT rowid FROM " . $tablename; + if (empty($keyfield)) { $keyfield = 'rowid'; } From 472602121d0ea84f232507e776519f794a3496fd Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:57:58 +0200 Subject: [PATCH 0130/1289] Update note.php --- htdocs/fourn/commande/note.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index ee5c0335ce9..167c506b651 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -20,11 +20,12 @@ */ /** - * \file htdocs/fourn/commande/note.php - * \ingroup commande - * \brief Fiche note commande + * \file htdocs/fourn/commande/note.php + * \ingroup commande + * \brief page for notes on supplier orders */ + // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; @@ -36,6 +37,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array("suppliers", "orders", "companies", "stocks")); +// Get Parameters $id = GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'); $ref = GETPOST('ref'); $action = GETPOST('action', 'aZ09'); @@ -45,12 +47,14 @@ if ($user->socid) { $socid = $user->socid; } +// Init Objects $hookmanager->initHooks(array('ordersuppliercardnote')); $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); $object = new CommandeFournisseur($db); $object->fetch($id, $ref); +// Permissions $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php @@ -70,6 +74,7 @@ if (empty($reshook)) { /* * View */ + $title = $object->ref." - ".$langs->trans('Notes'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; llxHeader('', $title, $help_url); From 4d21d7664422299da1d351fd73bd8a5ba5880206 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:01:47 +0200 Subject: [PATCH 0131/1289] Update list.php --- htdocs/fourn/commande/list.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 4b8c1cffc6d..b08396706d4 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -26,27 +26,30 @@ */ /** - * \file htdocs/fourn/commande/list.php - * \ingroup fournisseur - * \brief List of purchase orders + * \file htdocs/fourn/commande/list.php + * \ingroup fournisseur + * \brief List of purchase orders */ + // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Load translation files required by the page $langs->loadLangs(array("orders", "sendings", 'deliveries', 'companies', 'compta', 'bills', 'projects', 'suppliers', 'products')); +// Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -54,6 +57,7 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierorderlist'; +// Search Criteria $search_date_order_startday = GETPOST('search_date_order_startday', 'int'); $search_date_order_startmonth = GETPOST('search_date_order_startmonth', 'int'); $search_date_order_startyear = GETPOST('search_date_order_startyear', 'int'); @@ -62,6 +66,7 @@ $search_date_order_endmonth = GETPOST('search_date_order_endmonth', 'int'); $search_date_order_endyear = GETPOST('search_date_order_endyear', 'int'); $search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver $search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear); + $search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int'); $search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int'); $search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int'); @@ -79,6 +84,7 @@ $search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int'); $search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int'); $search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); + $search_date_approve_startday = GETPOST('search_date_approve_startday', 'int'); $search_date_approve_startmonth = GETPOST('search_date_approve_startmonth', 'int'); $search_date_approve_startyear = GETPOST('search_date_approve_startyear', 'int'); From 32ebee39ff6e38bd25fc13380d3a328f3f7f83b6 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:04:48 +0200 Subject: [PATCH 0132/1289] Update info.php --- htdocs/fourn/commande/info.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 017818e3e6b..698fead1a43 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -19,17 +19,18 @@ */ /** - * \file htdocs/fourn/commande/info.php - * \ingroup commande - * \brief Fiche commande + * \file htdocs/fourn/commande/info.php + * \ingroup commande + * \brief Info page for Purchase Order / Supplier Order */ + // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -37,8 +38,9 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array("suppliers", "orders", "companies", "stocks")); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +// Get Paramters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -79,6 +81,7 @@ if (empty($user->rights->fournisseur->commande->lire)) { accessforbidden(); } +// Init Hooks $hookmanager->initHooks(array('ordersuppliercardinfo')); From 0a7d535f342b0678f2570551bdc1b12f638048ac Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:08:04 +0200 Subject: [PATCH 0133/1289] Update index.php --- htdocs/fourn/commande/index.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 5fc4d46072e..dc30d1296f9 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Vinicius Nogueira - * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -20,16 +20,22 @@ */ /** - * \file htdocs/fourn/commande/index.php - * \ingroup commande fournisseur - * \brief Home page of supplier's orders area + * \file htdocs/fourn/commande/index.php + * \ingroup commande fournisseur + * \brief Home page of supplier's orders area */ + // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + + +// Load translation files required by the page +$langs->loadLangs(array("suppliers", "orders")); + // Security check $orderid = GETPOST('orderid'); @@ -43,8 +49,6 @@ $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('orderssuppliersindex')); -// Load translation files required by the page -$langs->loadLangs(array("suppliers", "orders")); /* From f47893bfd9c012cbca2f75f5f510cc8a0caa5686 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:12:27 +0200 Subject: [PATCH 0134/1289] Update card.php --- htdocs/fourn/commande/card.php | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 3a0568c8fbe..470525102cc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -28,22 +28,24 @@ */ /** - * \file htdocs/fourn/commande/card.php - * \ingroup supplier, order - * \brief Card supplier order + * \file htdocs/fourn/commande/card.php + * \ingroup supplier, order + * \brief Card supplier order */ + // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + if (isModEnabled('supplier_proposal')) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } @@ -60,29 +62,33 @@ if (!empty($conf->variants->enabled)) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } + +// Load translation files required by the page $langs->loadLangs(array('admin', 'orders', 'sendings', 'companies', 'bills', 'propal', 'receptions', 'supplier_proposal', 'deliveries', 'products', 'stocks', 'productbatch')); if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } + +// Get Parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$action = GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); -$cancel = GETPOST('cancel', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$origin = GETPOST('origin', 'alpha'); -$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility -$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; +$cancel = GETPOST('cancel', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$origin = GETPOST('origin', 'alpha'); +$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility +$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; -//PDF +// PDF $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); From e1eb25ab457286f937ea26db5dd6117a35a9cf10 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:22:59 +0200 Subject: [PATCH 0135/1289] Update ChangeLog --- ChangeLog | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a87f3fbc2d..8b4c9cf871d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,14 +53,11 @@ NEW: Add column "Total HT" to products array on document creation card NEW: Add configuration for text color of button action NEW: Add entity filter in exports NEW: Show the event block on recurring invoices #20870 -NEW: Add filter "opportunity status" on statistics of projects. NEW: Add firstname, lastname and max number of attendees for module "Event Organization" NEW: Add margin info in proposal and order list NEW: Add massaction "Edit Extrafield" for Product NEW: Add more fields to detect duplicate during import of thirdparties NEW: Add option to foce delivery on email for purchase order receipt to yes -NEW: Add param border table for md theme -NEW: Add param color button action NEW: Add possibility to create contract from invoice NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name NEW: Add private and public notes on tax files. @@ -70,12 +67,10 @@ NEW: allow cut&paste as real numeric value to excel NEW: A public form to send a message and create a lead is available NEW: automatically set totally received status in reception NEW: Auto set invoice paid when adding credit not and remain to pay is 0 -NEW: Can change value of AWP during the inventory NEW: Can enter price with tax for predefined products on purchase objects NEW: Can filter on a thirdparty on product statistics NEW: Can removed doc templates from setup page of thirdparty NEW: Can use ! to make a search that exclude a string -NEW: Change in theme colors does not need to use the refresh button NEW: clean values and amount in FEC import NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action NEW: Contact filter project list @@ -94,25 +89,26 @@ NEW: JS inventory autocalc input NEW: language support for more emailing target selectors NEW: leave requests: add field into type dictionary to block request if balance is negative NEW: Mass action "Close shipments" -NEW: Module BOM - Add tabs for nets Bom -NEW: Module BOM - Add the possibility to add sub-BOMs to BOM +NEW: Module BOM - add tabs for nets Bom +NEW: Module BOM - add the possibility to add sub-BOMs to BOM NEW: Module Recruitment - Add a public page with list of all open job positions. NEW: Module Recruitment - Add a tab with list of application on the jobposition file. -NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens) NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439) NEW: possibility to consume multiple batch NEW: Reverse movement product consumption NEW: Send email to the supplier order contact NEW: add permission to report time on timesheet -NEW: Knowledge Management - Add status "Obsolete" to KM articles +NEW: Knowledge Management - add status "Obsolete" to KM articles NEW: MRP - split consumption line on MO -NEW: MRP - Display physical and virtual stock of the products when creating OF from a BOM -NEW: MRP - Display product ref in "Object link" product tab for BOM +NEW: MRP - display physical and virtual stock of the products when creating OF from a BOM +NEW: MRP - display product ref in "Object link" product tab for BOM +NEW: Projects - add filter "opportunity status" on statistics of projects. NEW: Proposals - option update prices on proposal cloning NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: Stocks - stock filter in reassort lists NEW: Stocks - stock limit in stock export CSV +NEW: Stocks - Inventory - can change value of AWP during the inventory NEW: Supplier order - Show ref supplier of reception in linked object block NEW: support user_modif in order NEW: Surveys - Show number of votes into the label of tab "Results" of a survey @@ -122,6 +118,10 @@ NEW: TakePOS - show product reference NEW: TakePOS - add constant to hide categories NEW: TakePOS - add constant to show category description NEW: TakePOS - add constant to show only the products in stock +NEW: Themes - add param color button action +NEW: Themes - Change in theme colors does not need to use the refresh button +NEW: Themes - more mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) +NEW: Themes - MD - add param border table for md theme NEW: Third-Parties - Add rules "customer accountancy code" is mandatory to validate invoice NEW: Third-Parties - Can set the parent company during the creation of thirdparty (action=add of societe/card.php) NEW: Tickets - create Third-party with contact if not found on public ticket From 9dd96b2a03dcec22bc814581416daab41ab2aea9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 12 Sep 2022 10:50:59 +0200 Subject: [PATCH 0136/1289] better fix --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index c70cb16af3c..1a4629d7445 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 @@ -149,7 +149,8 @@ UPDATE llx_c_effectif SET code='EF101-500', libelle='101 - 500' WHERE code='EF10 ALTER TABLE llx_rights_def ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; -ALTER TABLE llx_establishment ADD COLUMN label varchar(255) NOT NULL AFTER entity; +UPDATE llx_establishment SET name='' WHERE name IS NULL; +ALTER TABLE llx_establishment CHANGE name label varchar(255) NOT NULL; ALTER TABLE llx_don ADD UNIQUE INDEX idx_don_uk_ref (ref, entity); From dde3b71cadee16baa42c98656b29dde6b147b92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 11:33:43 +0200 Subject: [PATCH 0137/1289] FIX tooltip of technical tables added of a module --- htdocs/admin/modulehelp.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 0c53bebfc52..63a1ff214c1 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -382,15 +382,16 @@ if ($mode == 'feature') { $text .= '

'; $text .= '
'.$langs->trans("AddDataTables").': '; - $sqlfiles = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql', '\.sql\.back')); + $sqlfiles1 = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, 'llx.*-'.$moduledir.'\.sql', array('\.key\.sql', '\.sql\.back')); + $sqlfiles2 = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql', '\.sql\.back')); + $sqlfiles = array_merge($sqlfiles1, $sqlfiles2); + if (count($sqlfiles) > 0) { - $text .= $langs->trans("Yes").' ('; $i = 0; foreach ($sqlfiles as $val) { - $text .= ($i ? ', ' : '').preg_replace('/\.sql$/', '', preg_replace('/llx_/', '', $val['name'])); + $text .= ($i ? ', ' : '').preg_replace('/\-'.$moduledir.'$/', '', preg_replace('/\.sql$/', '', preg_replace('/llx_/', '', $val['name']))); $i++; } - $text .= ')'; } else { $text .= $langs->trans("No"); } @@ -413,7 +414,7 @@ if ($mode == 'feature') { $text .= '
'.$langs->trans("AddData").': '; $filedata = dol_buildpath($moduledir.'/sql/data.sql'); if (dol_is_file($filedata)) { - $text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)'; + $text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)'; } else { $text .= $langs->trans("No"); } From cad8b1ee7e84f704b3f66f3bda54940ee31e6cec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 12:25:15 +0200 Subject: [PATCH 0138/1289] Fix autoadd in basket after a search (only if search on barcode) --- htdocs/takepos/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 004ce45c459..b567ff5fee9 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -684,8 +684,8 @@ function Search2(keyCodeForEnter, moreorless) { console.log("There is only 1 answer with barcode matching the search, so we change the thirdparty "+data[0]['rowid']); ChangeThirdparty(data[0]['rowid']); } - else if ('product' == data[0]['object']) { - console.log("There is only 1 answer matching the search, so we add the product in basket, qty="+data[0]['qty']); + else if ($('#search').val() == data[0]['barcode'] && 'product' == data[0]['object']) { + console.log("There is only 1 answer and we found search on a barcode, so we add the product in basket, qty="+data[0]['qty']); ClickProduct(0, data[0]['qty']); } } From 95e1b97f42350375af61e1d9c45fe9714f163c88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 13:09:21 +0200 Subject: [PATCH 0139/1289] Fix missing inventory code in reception --- htdocs/fourn/class/fournisseur.commande.class.php | 4 +++- htdocs/fourn/commande/dispatch.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f350c4f3640..08126bf5974 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2006,6 +2006,8 @@ class CommandeFournisseur extends CommonOrder $now = dol_now(); + $inventorycode = $langs->trans("Reception").' '.$this->ref; + if (($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY || $this->statut == self::STATUS_RECEIVED_COMPLETELY)) { $this->db->begin(); @@ -2039,7 +2041,7 @@ class CommandeFournisseur extends CommonOrder // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) $mouv->origin = &$this; $mouv->setOrigin($this->element, $this->id); - $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch); + $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode); if ($result < 0) { $this->error = $mouv->error; $this->errors = $mouv->errors; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index a1ddef959a0..acb9766a318 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -221,6 +221,7 @@ if ($action == 'denydispatchline' && $permissiontocontrol) { if ($action == 'dispatch' && $permissiontoreceive) { $error = 0; + $notrigger = 0; $db->begin(); From f48752fc1693c792951a5fd2d194f4ccf9ea1315 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 13:25:07 +0200 Subject: [PATCH 0140/1289] FIX inventory code must be different at each transation --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/mrp/mo_production.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 08126bf5974..ad666573b18 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2006,7 +2006,7 @@ class CommandeFournisseur extends CommonOrder $now = dol_now(); - $inventorycode = $langs->trans("Reception").' '.$this->ref; + $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); if (($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY || $this->statut == self::STATUS_RECEIVED_COMPLETELY)) { $this->db->begin(); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 1c6f3f7ec39..34b9191db94 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -660,8 +660,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { $defaultstockmovementlabel = GETPOST('inventorylabel', 'alphanohtml') ? GETPOST('inventorylabel', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); - //$defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $object->ref.'_'.dol_print_date(dol_now(), 'dayhourlog'); - $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : $langs->trans("ProductionForRef", $object->ref); + $defaultstockmovementcode = GETPOST('inventorycode', 'alphanohtml') ? GETPOST('inventorycode', 'alphanohtml') : dol_print_date(dol_now(), 'dayhourlog'); print '
'; print '
'.$langs->trans("ConfirmProductionDesc", $langs->transnoentitiesnoconv("Confirm")).'
'; From a35d7f8a4b1199add41780d23765ad4e857c996b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 14:17:14 +0200 Subject: [PATCH 0141/1289] Fix must not overwrite the var that is an object of cache --- htdocs/fourn/commande/dispatch.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index acb9766a318..ccf95de4232 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1202,10 +1202,6 @@ if ($id > 0 || !empty($ref)) { while ($i < $num) { $objp = $db->fetch_object($resql); - $tmpproduct->id = $objp->fk_product; - $tmpproduct->ref = $objp->ref; - $tmpproduct->label = $objp->label; - if ($action == 'editline' && $lineid == $objp->dispatchlineid) { print ' From dfb7c5ea48566138b4721269e514a61eb27a6af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 12 Sep 2022 14:50:55 +0200 Subject: [PATCH 0142/1289] clean aurore model --- .../doc/pdf_aurore.modules.php | 78 +++---------------- 1 file changed, 12 insertions(+), 66 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 8ca9a36b0f8..b1129bbb1ed 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -140,10 +140,10 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -168,24 +168,18 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->postotalht = 174; if (!empty($conf->global->PRODUCT_USE_UNITS)) { - $this->posxtva = 101; - $this->posxup = 118; + $this->posxup = 112; $this->posxqty = 135; $this->posxunit = 151; } else { - $this->posxtva = 102; - $this->posxup = 126; + $this->posxup = 120; $this->posxqty = 145; $this->posxunit = 162; } - if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || !empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) { - $this->posxup = $this->posxtva; - } - $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images + $this->posxpicture = $this->posxup - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) { // To work with US executive format $this->posxpicture -= 20; - $this->posxtva -= 20; $this->posxup -= 20; $this->posxqty -= 20; $this->posxunit -= 20; @@ -276,7 +270,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } } if (count($realpatharray) == 0) { - $this->posxpicture = $this->posxtva; + $this->posxpicture = $this->posxup; } if ($conf->supplier_proposal->dir_output) { @@ -358,7 +352,6 @@ class pdf_aurore extends ModelePDFSupplierProposal if (empty($this->atleastonediscount)) { $delta = ($this->postotalht - $this->posxdiscount); $this->posxpicture += $delta; - $this->posxtva += $delta; $this->posxup += $delta; $this->posxqty += $delta; $this->posxunit += $delta; @@ -460,7 +453,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) { $curX = $this->posxpicture - 1; - $pdf->Image($realpatharray[$i], $curX + (($this->posxtva - $this->posxpicture - $imglinesize['width']) / 2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + $pdf->Image($realpatharray[$i], $curX + (($this->posxup - $this->posxpicture - $imglinesize['width']) / 2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height']; } @@ -472,7 +465,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($posYAfterImage > 0) { $descWidth = $this->posxpicture - $curX; } else { - $descWidth = $this->posxtva - $curX; + $descWidth = $this->posxup - $curX; } pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); @@ -528,22 +521,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut - // VAT Rate - /* - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-3, 3, $vat_rate, 0, 'R'); - } - - // Unit price before discount - $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxup, $curY); - if ($up_excl_tax > 0) - $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); - */ - // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); @@ -805,7 +782,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy = $pdf->GetY() + 1; } - /* PHFAVRE + /* elseif ($object->availability_code || $object->availability) // Show availability conditions { $pdf->SetFont('','B', $default_font_size - 2); @@ -1138,22 +1115,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); - /* - if ($object->close_code == 'discount_vat') - { - $index++; - $pdf->SetFillColor(255,255,255); - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle, 0, $outputlangs), $useborder, 'R', 1); - - $resteapayer=0; - } - */ - $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); @@ -1226,16 +1187,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); } - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { - $pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height); - //$pdf->line($this->posxtva-2, $tab_top, $this->posxtva-2, $tab_top + $tab_height); - if (empty($hidetop)) { - $pdf->SetXY($this->posxtva - 5, $tab_top + 1); - $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities("VAT"), '', 'C'); - } - } - - $pdf->line($this->posxup - 3, $tab_top, $this->posxup - 3, $tab_top + $tab_height); + $pdf->line($this->posxup + 1, $tab_top, $this->posxup + 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxup - 1, $tab_top + 1); $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C'); @@ -1349,12 +1301,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier")." : ".dol_trunc($outputlangs->convToOutputCharset($object->ref_fourn), 65), '', 'R'); } - /* PHFAVRE - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->delivery_date, "day", false, $outputlangs, true), '', 'R'); - */ if ($object->thirdparty->code_fournisseur) { $posy += 4; From 59e86f4a6ba6a58ae1e2c9a334e707b67a3cc846 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 15:16:38 +0200 Subject: [PATCH 0143/1289] NEW Make module WebservicesClient deprecated. Use module WebHook instead --- htdocs/core/modules/modWebServicesClient.class.php | 2 +- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index d44d48ef13a..f2b75119523 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -46,7 +46,7 @@ class modWebServicesClient extends DolibarrModules $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "Enable the web service client to call external supplier web services"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; + $this->version = 'experimental_deprecated'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 973eb6ba915..169d764b80b 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -71,7 +71,7 @@ class modMyModule extends DolibarrModules $this->editor_name = 'Editor name'; $this->editor_url = 'https://www.example.com'; - // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' + // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; From 56c2b8b7758a031b0f5462a03b4088bb89031418 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Mon, 12 Sep 2022 15:12:36 +0200 Subject: [PATCH 0144/1289] Product: display TTC price on price card --- htdocs/product/price.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 787cc034f68..d6d64ecf347 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1193,7 +1193,11 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print price($object->price_ttc).' '.$langs->trans($object->price_base_type); } else { print price($object->price).' '.$langs->trans($object->price_base_type); + if (!empty($conf->global->PRODUCT_DISPLAY_VAT_INCL_PRICES) && !empty($object->price_ttc)) { + print ' - ' . price($object->price_ttc).' '.$langs->trans('TTC') . ''; + } } + print ''; // Price minimum @@ -1202,7 +1206,11 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); } else { print price($object->price_min).' '.$langs->trans($object->price_base_type); + if (!empty($conf->global->PRODUCT_DISPLAY_VAT_INCL_PRICES) && !empty($object->price_min_ttc)) { + print ' - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . ''; + } } + print ''; // Price by quantity From 3d88e8cc0ecf47a301c48ceeab7a28474640c828 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Mon, 12 Sep 2022 15:14:01 +0200 Subject: [PATCH 0145/1289] add tr ids --- htdocs/product/price.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index d6d64ecf347..f0bdf563546 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1188,7 +1188,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; // Price - print '
'; // Price minimum - print ''; if (!$i) { $totalarray['nbfield']++; From 527cfadf0f168e61918c1e1a8aa3215cc4236934 Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Mon, 12 Sep 2022 16:31:00 +0200 Subject: [PATCH 0148/1289] nl2br like on the card --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 181ae20589d..65ceda08242 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -988,7 +988,7 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['t.description']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; From 09eede8cde5dd513b42d1c22ecd88559e7fedcbc Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:42:47 +0200 Subject: [PATCH 0149/1289] scrutinizer on expensereport/class/expensereport_ik.class.php: method fetchLine was not defined --- .../expensereport/class/expensereport_ik.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 0d374f1c722..14f6908377e 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -126,6 +126,19 @@ class ExpenseReportIk extends CommonObject return $result; } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database From 54a211509be0423132d460120379671351dde3d8 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:51:25 +0200 Subject: [PATCH 0150/1289] scrutinizer on delivery/class/delivery.class.php: attribute $linked_object does not exist but $linked_objects does --- htdocs/delivery/class/delivery.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 55f6293a9d2..ad1a3b9934a 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -973,7 +973,7 @@ class Delivery extends CommonObject $sqlSourceLine .= ", p.ref, p.label"; $sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st"; $sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid"; - $sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $resultSourceLine = $this->db->query($sqlSourceLine); if ($resultSourceLine) { @@ -986,12 +986,12 @@ class Delivery extends CommonObject // Get lines of sources alread delivered $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; - $sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c"; - $sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; + $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c"; + $sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd"; $sql .= " WHERE ld.fk_delivery = l.rowid"; $sql .= " AND ld.fk_origin_line = cd.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid"; - $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid"; + $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']); $sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid); $sql .= " GROUP BY ld.fk_origin_line"; From 22ab13975f186a35387f2f3c953a94147d2f6813 Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:57:23 +0200 Subject: [PATCH 0151/1289] scrutinizer on expensereport/class/expensereport_rule.class.php: method fetchLine wasn't defined --- .../class/expensereport_rule.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 02bf8b8ce5c..d695359229d 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject } + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + /** * Update object into database * From 209bf00b69e3d734a7f7007f3c06f48531e790c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 00:11:00 +0200 Subject: [PATCH 0152/1289] Trans --- htdocs/commande/class/commande.class.php | 5 ++++- htdocs/langs/en_US/admin.lang | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 301bbe761be..8b0967c64b6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3662,7 +3662,10 @@ class Commande extends CommonOrder } elseif ($status == self::STATUS_SHIPMENTONPROCESS) { $labelStatus = $langs->transnoentitiesnoconv('StatusOrderSent').$billedtext; $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderSentShort').$billedtext; - $labelTooltip = $langs->transnoentitiesnoconv("StatusOrderSent").' - '.$langs->transnoentitiesnoconv("DateDeliveryPlanned").dol_print_date($this->date_livraison).$billedtext; + $labelTooltip = $langs->transnoentitiesnoconv("StatusOrderSent"); + if (!empty($this->delivery_date)) { + $labelTooltip .= ' - '.$langs->transnoentitiesnoconv("DateDeliveryPlanned").dol_print_date($this->delivery_date, 'day').$billedtext; + } $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->transnoentitiesnoconv('StatusOrderToBill'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d3b2f251a6c..46af4f95355 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2310,4 +2310,6 @@ Images=Images MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form ScriptIsEmpty=The script is empty ShowHideTheNRequests=Show/hide the %s SQL request(s) -DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s \ No newline at end of file +DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s +TriggerCodes=Triggerable events +TriggerCodeInfo=Enter here the list of trigger codes that must generate a post of a web request \ No newline at end of file From f10338293513b75cecb02d97977945881ead18bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 00:16:38 +0200 Subject: [PATCH 0153/1289] Debug webhook --- .../triggers/interface_95_modWebhook_WebhookTriggers.class.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index a8932934bd1..94b4b861e86 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -104,7 +104,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers $actionarray = explode(",", $tmpobject->trigger_codes); if (is_array($actionarray) && in_array($action, $actionarray)) { $jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}'; - $response = getURLContent($tmpobject->url, 'POST', $jsonstr); + $response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, array(), array('http', 'https'), 0, -1); if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) { $nbPosts ++; } else { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 46af4f95355..704d9ed238e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2312,4 +2312,4 @@ ScriptIsEmpty=The script is empty ShowHideTheNRequests=Show/hide the %s SQL request(s) DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s TriggerCodes=Triggerable events -TriggerCodeInfo=Enter here the list of trigger codes that must generate a post of a web request \ No newline at end of file +TriggerCodeInfo=Enter here the trigger code(s) that must generate a post of a web request (only external URL are allowed). You can enter several trigger codes separated by a comma. From 39b89143cc3ac63a7e7a67626187bfb7aadd9686 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 00:52:11 +0200 Subject: [PATCH 0154/1289] Fix colspan --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index a3b8171cc62..735f8892129 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -335,7 +335,7 @@ print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', print ''; if ($num == 0) { - print ''; + print ''; } else { while ($obj = $db->fetch_object($resql)) { $user = new User($db); From 7485188b49562607504827bbe92bb504d1873ede Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 01:11:09 +0200 Subject: [PATCH 0155/1289] Update price.php --- htdocs/product/price.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index f0bdf563546..aa9a34336b0 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1188,7 +1188,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; // Price - print ''; // Price minimum - print ''; if (!$i) { $totalarray['nbfield']++; From 7d4c7e0f6b7090a98838366da9df4049efb27f88 Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Tue, 13 Sep 2022 14:28:57 +0200 Subject: [PATCH 0167/1289] stickler --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 4f7c4bf7a42..d74b84dd7ba 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -988,7 +988,7 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['t.description']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; From a3a973466f8daa7f223c1311d355929b618e182c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Sep 2022 15:12:31 +0200 Subject: [PATCH 0168/1289] FIX broken feature, wrong fk_parent_line after cloning object --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index bfce6bab9a8..c459ea7b84a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1265,7 +1265,7 @@ class Propal extends CommonObject break; } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $line->product_type == 9) { $fk_parent_line = $result; } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0b7da7a5dbc..c2c4eada0b2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1073,7 +1073,7 @@ class Commande extends CommonOrder return -1; } // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $line->product_type == 9) { $fk_parent_line = $result; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5379de84bef..bdf1192f1a5 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -872,7 +872,7 @@ class Facture extends CommonInvoice ); // Defined the new fk_parent_line - if ($result > 0) { + if ($result > 0 && $newinvoiceline->product_type == 9) { $fk_parent_line = $result; } } From 6ecd862a88cf8a256b79d14d8daa4f803ebe07f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 15:37:54 +0200 Subject: [PATCH 0169/1289] Fix restore option MAIN_OPTIMIZEFORCOLORBLIND --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/usergroups.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ea2d941be3d..0d400274557 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6634,7 +6634,7 @@ class Form } // Add a "Now" link - if ($conf->use_javascript_ajax && $addnowlink) { + if (!empty($conf->use_javascript_ajax) && $addnowlink) { // Script which will be inserted in the onClick of the "Now" link $reset_scripts = ""; if ($addnowlink == 2) { // local computer time diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index bbfef844bb6..4b524f66b3e 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -1099,8 +1099,8 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) } - // Use MAIN_OPTIMIZEFORTEXTBROWSER - if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND)) { + // Use MAIN_OPTIMIZEFORCOLORBLIND + if ($foruserprofile) { //$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND); $default = $langs->trans('No'); print ''; From a8b47261326987188bb34ed3d8f8247b079d84ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 15:39:15 +0200 Subject: [PATCH 0170/1289] Test the "now" link on date selection for smartphone --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0d400274557..5bf6cec8192 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6713,7 +6713,7 @@ class Form } } // If reset_scripts is not empty, print the link with the reset_scripts in the onClick - if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { + if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $retstring .= ' '; From a2c62d39b4eece149f1fce631d9a855c818c9b3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Sep 2022 15:42:26 +0200 Subject: [PATCH 0171/1289] FIX some upgrade sql errors --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +++ htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_element_categorie.key.sql | 2 +- htdocs/install/mysql/tables/llx_user.sql | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 6d9aebf934f..f7e7a7a1ba5 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -689,3 +689,6 @@ ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity); ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); + +-- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2() +ALTER TABLE llx_user CHANGE COLUMN note note_private text; diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 4d7bca3f7c9..d0e9cdc7b95 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -175,5 +175,5 @@ create table llx_element_categorie ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); -ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); +ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); diff --git a/htdocs/install/mysql/tables/llx_element_categorie.key.sql b/htdocs/install/mysql/tables/llx_element_categorie.key.sql index 5ad41616d38..9bc70cf0863 100644 --- a/htdocs/install/mysql/tables/llx_element_categorie.key.sql +++ b/htdocs/install/mysql/tables/llx_element_categorie.key.sql @@ -19,4 +19,4 @@ ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); -ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); +ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 7b86b5c3396..e70716d90c4 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -75,8 +75,8 @@ create table llx_user idpers2 varchar(128), idpers3 varchar(128), - note_public text, - note_private text DEFAULT NULL, + note_public text, + note_private text DEFAULT NULL, model_pdf varchar(255) DEFAULT NULL, datelastlogin datetime, datepreviouslogin datetime, From d3dce0526870079b6e422539174bc2b77592bc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 13 Sep 2022 15:44:54 +0200 Subject: [PATCH 0172/1289] add debug in thirdparty merge --- htdocs/societe/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4b612df0c00..90aafe95f5d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -342,6 +342,7 @@ if (empty($reshook)) { if (!$error) { //We finally remove the old thirdparty if ($soc_origin->delete($soc_origin->id, $user) < 1) { + setEventMessages($soc_origin->error, $soc_origin->errors, 'errors'); $error++; } } From 81ce609b7bba714831e54b8df61f66b09abe6a89 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 13 Sep 2022 16:04:20 +0200 Subject: [PATCH 0173/1289] FIX no when contains an @ --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 96a614857ba..4b6ee860c74 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -711,6 +711,7 @@ class User extends CommonObject // If module is abc@module, we check permission user->rights->module->abc->permlevel1 $tmp = explode('@', $rightsPath, 2); if (! empty($tmp[1])) { + if (strpos($module, '@') !== false) $module = $tmp[1]; $rightsPath = $tmp[1]; $permlevel2 = $permlevel1; $permlevel1 = $tmp[0]; From 0d20f332d00783e8c49d7e6306431d7af7d36742 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:59:07 +0200 Subject: [PATCH 0174/1289] Update emailcollector.class.php --- .../class/emailcollector.class.php | 161 +++++++++--------- 1 file changed, 83 insertions(+), 78 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 47d62197a70..b37d791a64a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -16,37 +16,38 @@ */ /** - * \file emailcollector/class/emailcollector.class.php - * \ingroup emailcollector - * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete) + * \file htdocs/emailcollector/class/emailcollector.class.php + * \ingroup emailcollector + * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete) */ // Put here all includes required by your class file -require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; -require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; +include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // customer proposal -require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // customer order -require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipment -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // supplier invoice -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // supplier order -require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // supplier proposal -require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // reception -include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; -//require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; // Holidays (leave request) -//require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // expernse repor +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; + +require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal +require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order +require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice +require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address +require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice +require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project +require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception +require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting +require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party +require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal +require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket +//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report +//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request) // use Webklex\PHPIMAP; -require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php'; -use Webklex\PHPIMAP\ClientManager; +require DOL_DOCUMENT_ROOT .'/includes/webklex/php-imap/vendor/autoload.php'; +use Webklex\PHPIMAP\ClientManager; use Webklex\PHPIMAP\Exceptions\ConnectionFailedException; use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException; use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException; @@ -64,14 +65,17 @@ class EmailCollector extends CommonObject * @var string ID to identify managed object */ public $element = 'emailcollector'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'emailcollector_emailcollector'; + /** * @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; + /** * @var int Does emailcollector support extrafields ? 0=No, 1=Yes */ @@ -91,6 +95,7 @@ class EmailCollector extends CommonObject * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); + /** * @var array List of child tables. To know object to delete on cascade. */ @@ -206,7 +211,6 @@ class EmailCollector extends CommonObject */ public $import_key; - public $host; public $port; public $hostcharset; @@ -1738,61 +1742,61 @@ class EmailCollector extends CommonObject $objectid = $reg[2]; // See also list into interface_50_modAgenda_ActionsAuto - if ($reg[1] == 'thi') { + if ($reg[1] == 'thi') { // Third-party $objectemail = new Societe($this->db); } - if ($reg[1] == 'ctc') { + if ($reg[1] == 'ctc') { // Contact $objectemail = new Contact($this->db); } - if ($reg[1] == 'inv') { // customer invoices + if ($reg[1] == 'inv') { // Customer Invoice $objectemail = new Facture($this->db); } - if ($reg[1] == 'sinv') { // supplier invoices + if ($reg[1] == 'sinv') { // Supplier Invoice $objectemail = new FactureFournisseur($this->db); } - if ($reg[1] == 'pro') { // customer proposals + if ($reg[1] == 'pro') { // Customer Proposal $objectemail = new Propal($this->db); } - if ($reg[1] == 'ord') { // customer orders + if ($reg[1] == 'ord') { // Customer Order $objectemail = new Commande($this->db); } - if ($reg[1] == 'shi') { // shipments + if ($reg[1] == 'shi') { // Shipment $objectemail = new Expedition($this->db); } - if ($reg[1] == 'spro') { // supplier proposal + if ($reg[1] == 'spro') { // Supplier Proposal $objectemail = new SupplierProposal($this->db); } - if ($reg[1] == 'sord') { // supplier order + if ($reg[1] == 'sord') { // Supplier Order $objectemail = new CommandeFournisseur($this->db); } - if ($reg[1] == 'rec') { // Reception + if ($reg[1] == 'rec') { // Reception $objectemail = new Reception($this->db); } - if ($reg[1] == 'proj') { + if ($reg[1] == 'proj') { // Project $objectemail = new Project($this->db); } - if ($reg[1] == 'tas') { + if ($reg[1] == 'tas') { // Task $objectemail = new Task($this->db); } - if ($reg[1] == 'con') { + if ($reg[1] == 'con') { // Contact $objectemail = new Contact($this->db); } - if ($reg[1] == 'use') { + if ($reg[1] == 'use') { // User $objectemail = new User($this->db); } - if ($reg[1] == 'tic') { + if ($reg[1] == 'tic') { // Ticket $objectemail = new Ticket($this->db); } - if ($reg[1] == 'recruitmentcandidature') { + if ($reg[1] == 'recruitmentcandidature') { // Recruiting Candidate $objectemail = new RecruitmentCandidature($this->db); } - if ($reg[1] == 'mem') { + if ($reg[1] == 'mem') { // Member $objectemail = new Adherent($this->db); } - /*if ($reg[1] == 'leav') { + /*if ($reg[1] == 'leav') { // Leave / Holiday $objectemail = new Holiday($db); } - if ($reg[1] == 'exp') { + if ($reg[1] == 'exp') { // ExpenseReport $objectemail = new ExpenseReport($db); }*/ } elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) { @@ -2213,42 +2217,42 @@ class EmailCollector extends CommonObject } $arrayobject = array( 'propale' => array('table' => 'propal', - 'fields' => array('ref'), - 'class' => 'comm/propal/class/propal.class.php', - 'object' => 'Propal'), + 'fields' => array('ref'), + 'class' => 'comm/propal/class/propal.class.php', + 'object' => 'Propal'), 'holiday' => array('table' => 'holiday', - 'fields' => array('ref'), - 'class' => 'holiday/class/holiday.class.php', - 'object' => 'Holiday'), + 'fields' => array('ref'), + 'class' => 'holiday/class/holiday.class.php', + 'object' => 'Holiday'), 'expensereport' => array('table' => 'expensereport', - 'fields' => array('ref'), - 'class' => 'expensereport/class/expensereport.class.php', - 'object' => 'ExpenseReport'), + 'fields' => array('ref'), + 'class' => 'expensereport/class/expensereport.class.php', + 'object' => 'ExpenseReport'), 'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentjobposition', - 'fields' => array('ref'), - 'class' => 'recruitment/class/recruitmentjobposition.class.php', - 'object' => 'RecruitmentJobPosition'), + 'fields' => array('ref'), + 'class' => 'recruitment/class/recruitmentjobposition.class.php', + 'object' => 'RecruitmentJobPosition'), 'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentcandidature', - 'fields' => array('ref'), - 'class' => 'recruitment/class/recruitmentcandidature.class.php', - 'object' => ' RecruitmentCandidature'), + 'fields' => array('ref'), + 'class' => 'recruitment/class/recruitmentcandidature.class.php', + 'object' => ' RecruitmentCandidature'), 'societe' => array('table' => 'societe', 'fields' => array('code_client', 'code_fournisseur'), 'class' => 'societe/class/societe.class.php', 'object' => 'Societe'), - 'commande' => array('table' => 'commande', + 'commande' => array('table' => 'commande', 'fields' => array('ref'), 'class' => 'commande/class/commande.class.php', 'object' => 'Commande'), - 'expedition' => array('table' => 'expedition', + 'expedition' => array('table' => 'expedition', 'fields' => array('ref'), 'class' => 'expedition/class/expedition.class.php', 'object' => 'Expedition'), - 'contract' => array('table' => 'contrat', + 'contract' => array('table' => 'contrat', 'fields' => array('ref'), 'class' => 'contrat/class/contrat.class.php', 'object' => 'Contrat'), - 'fichinter' => array('table' => 'fichinter', + 'fichinter' => array('table' => 'fichinter', 'fields' => array('ref'), 'class' => 'fichinter/class/fichinter.class.php', 'object' => 'Fichinter'), @@ -2256,51 +2260,51 @@ class EmailCollector extends CommonObject 'fields' => array('ref'), 'class' => 'ticket/class/ticket.class.php', 'object' => ' Ticket'), - 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord', + 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord', 'fields' => array('ref'), 'class' => 'knowledgemanagement/class/knowledgemanagement.class.php', 'object' => 'KnowledgeRecord'), - 'supplier_proposal' => array('table' => 'supplier_proposal', + 'supplier_proposal' => array('table' => 'supplier_proposal', 'fields' => array('ref'), 'class' => 'supplier_proposal/class/supplier_proposal.class.php', 'object' => 'SupplierProposal'), - 'fournisseur/commande' => array('table' => 'commande_fournisseur', + 'fournisseur/commande' => array('table' => 'commande_fournisseur', 'fields' => array('ref', 'ref_supplier'), 'class' => 'fourn/class/fournisseur.commande.class.php', 'object' => 'SupplierProposal'), - 'facture' => array('table' => 'facture', + 'facture' => array('table' => 'facture', 'fields' => array('ref'), 'class' => 'compta/facture/class/facture.class.php', 'object' => 'Facture'), - 'fournisseur/facture' => array('table' => 'facture_fourn', + 'fournisseur/facture' => array('table' => 'facture_fourn', 'fields' => array('ref', ref_client), 'class' => 'fourn/class/fournisseur.facture.class.php', 'object' => 'FactureFournisseur'), - 'produit' => array('table' => 'product', + 'produit' => array('table' => 'product', 'fields' => array('ref'), 'class' => 'product/class/product.class.php', 'object' => 'Product'), - 'productlot' => array('table' => 'product_lot', + 'productlot' => array('table' => 'product_lot', 'fields' => array('batch'), 'class' => 'product/stock/class/productlot.class.php', 'object' => 'Productlot'), - 'projet' => array('table' => 'projet', + 'projet' => array('table' => 'projet', 'fields' => array('ref'), 'class' => 'projet/class/projet.class.php', 'object' => 'Project'), - 'projet_task' => array('table' => 'projet_task', + 'projet_task' => array('table' => 'projet_task', 'fields' => array('ref'), 'class' => 'projet/class/task.class.php', 'object' => 'Task'), - 'ressource' => array('table' => 'resource', + 'ressource' => array('table' => 'resource', 'fields' => array('ref'), 'class' => 'ressource/class/dolressource.class.php', 'object' => 'Dolresource'), - 'bom' => array('table' => 'bom_bom', + 'bom' => array('table' => 'bom_bom', 'fields' => array('ref'), 'class' => 'bom/class/bom.class.php', 'object' => 'BOM'), - 'mrp' => array('table' => 'mrp_mo', + 'mrp' => array('table' => 'mrp_mo', 'fields' => array('ref'), 'class' => 'mrp/class/mo.class.php', 'object' => 'Mo'), @@ -2875,6 +2879,7 @@ class EmailCollector extends CommonObject 2.2.1 text/plain 2.2.2 text/html */ + /** * Sub function for getpart(). Only called by createPartArray() and itself. * @@ -2993,10 +2998,10 @@ class EmailCollector extends CommonObject /** * Converts a string from one encoding to another. * - * @param string $string String to convert - * @param string $fromEncoding String encoding - * @param string $toEncoding String return encoding - * @return string Converted string if conversion was successful, or the original string if not + * @param string $string String to convert + * @param string $fromEncoding String encoding + * @param string $toEncoding String return encoding + * @return string Converted string if conversion was successful, or the original string if not * @throws Exception */ protected function convertStringEncoding($string, $fromEncoding, $toEncoding = 'UTF-8') From 7ff31889cdbbe94416c04643a2ed0e288f9d3c06 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:14:51 +0200 Subject: [PATCH 0175/1289] Update eldy.lib.php edit: loadLangs --- htdocs/core/menus/standard/eldy.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index afaad336f9e..130eb6192e5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -114,7 +114,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1), - 'loadLangs' => array(), + 'loadLangs' => array("members"), 'submenus' => array(), ); @@ -170,7 +170,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1), - 'loadLangs' => array("products"), + 'loadLangs' => array("products", "stocks"), 'submenus' => array(), ); @@ -379,7 +379,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1), - 'loadLangs' => array("holiday"), + 'loadLangs' => array("hrm", "holiday"), 'submenus' => array(), ); @@ -410,7 +410,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"', 'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1), - 'loadLangs' => array("other"), + 'loadLangs' => array("ticket", "knowledgemanagement"), 'submenus' => array(), ); From 2cf793d0fe0c191dee07a10044b9aea9931794c8 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 13 Sep 2022 18:29:46 +0000 Subject: [PATCH 0176/1289] Fixing style errors. --- htdocs/emailcollector/class/emailcollector.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b37d791a64a..e46bfbe9355 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception -require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting +require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket @@ -65,17 +65,17 @@ class EmailCollector extends CommonObject * @var string ID to identify managed object */ public $element = 'emailcollector'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'emailcollector_emailcollector'; - + /** * @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var int Does emailcollector support extrafields ? 0=No, 1=Yes */ @@ -95,7 +95,7 @@ class EmailCollector extends CommonObject * @var array List of child tables. To test if we can delete object. */ protected $childtables = array(); - + /** * @var array List of child tables. To know object to delete on cascade. */ @@ -2879,7 +2879,7 @@ class EmailCollector extends CommonObject 2.2.1 text/plain 2.2.2 text/html */ - + /** * Sub function for getpart(). Only called by createPartArray() and itself. * From cea9a4c4cc51a4deb8877776b1384bb1d4eb0d34 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 13 Sep 2022 20:34:40 +0200 Subject: [PATCH 0177/1289] cocorrection on expensereport/class/expensereport_ik.class.php: table_element_line doest not exist on class, so removed the call of fetchLine --- .../class/expensereport_ik.class.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 14f6908377e..503fa92b108 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -120,24 +120,10 @@ class ExpenseReportIk extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } + return $result; } - /** - * Load object lines in memory from the database - * - * @return int <0 if KO, 0 if not found, >0 if OK - */ - public function fetchLines() - { - $this->lines = array(); - - $result = $this->fetchLinesCommon(); - return $result; - } /** From cba04c9648eaf5dabb970a4663a07b5cc710bd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 13 Sep 2022 20:48:59 +0200 Subject: [PATCH 0178/1289] Update bonprelevement.class.php --- .../class/bonprelevement.class.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 18216c1cda6..06b912ec343 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -450,9 +450,6 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error); } } - //var_dump($paiement->amounts); - //var_dump($thirdpartyid); - //var_dump($cursoramounts); } // Update withdrawal line @@ -1039,15 +1036,15 @@ class BonPrelevement extends CommonObject $account = new Account($this->db); if ($account->fetch($id) > 0) { $this->emetteur_code_banque = $account->code_banque; - $this->emetteur_code_guichet = $account->code_guichet; - $this->emetteur_numero_compte = $account->number; + $this->emetteur_code_guichet = $account->code_guichet; + $this->emetteur_numero_compte = $account->number; $this->emetteur_number_key = $account->cle_rib; - $this->emetteur_iban = $account->iban; - $this->emetteur_bic = $account->bic; + $this->emetteur_iban = $account->iban; + $this->emetteur_bic = $account->bic; - $this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics); + $this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics); - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->proprio; } $this->factures = $factures_prev_id; @@ -1057,8 +1054,6 @@ class BonPrelevement extends CommonObject // This also set the property $this->total with amount that is included into file $result = $this->generate($format, $executiondate, $type); if ($result < 0) { - /*var_dump($this->error); - var_dump($this->invoice_in_error); */ $error++; } } @@ -1684,7 +1679,7 @@ class BonPrelevement extends CommonObject fclose($this->file); if (!empty($conf->global->MAIN_UMASK)) { - @chmod($this->file, octdec($conf->global->MAIN_UMASK)); + @chmod($this->filename, octdec($conf->global->MAIN_UMASK)); } return $result; From 7124b5bf755199b00173d7308a6799fa826942f8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 14 Sep 2022 05:16:50 +0200 Subject: [PATCH 0179/1289] FIX #22264 Accountancy - Translation on chart of accounts export --- htdocs/core/modules/modAccounting.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index e0bf3a9bbc5..83c1e99183f 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -256,11 +256,11 @@ class modAccounting extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Chartofaccounts'; - $this->export_icon[$r] = 'accounting'; + $this->export_icon[$r] = 'Accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); - $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa.accountparent'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); + $this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'accounting_account as aa'; From 81e8b872a82279410520665bd3b4bd2b6c86d8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Sep 2022 08:51:22 +0200 Subject: [PATCH 0180/1289] Update bonprelevement.class.php --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 06b912ec343..0db7bc2b2b9 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2175,7 +2175,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf;*/ } } else { - fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); + fputs($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf); + $XML_SEPA_INFO = ''; } return $XML_SEPA_INFO; } From edef39bed984a9c01848593e3a5e0d03dffff9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Sep 2022 09:01:56 +0200 Subject: [PATCH 0181/1289] strftime is deprecated in php8.1 --- .../prelevement/class/bonprelevement.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d87317e2420..9a1789dd49b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -419,8 +419,8 @@ class BonPrelevement extends CommonObject } else { $paiement = new Paiement($this->db); } - $paiement->datepaye = $date; - $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice + $paiement->datepaye = $date; + $paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice if ($this->type == 'bank-transfer') { $paiement->paiementid = 2; @@ -766,8 +766,8 @@ class BonPrelevement extends CommonObject $datetimeprev = $executiondate; } - $month = strftime("%m", $datetimeprev); - $year = strftime("%Y", $datetimeprev); + $month = date("%m", $datetimeprev); + $year = date("%Y", $datetimeprev); $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); @@ -1746,8 +1746,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, date("%d%m", $this->date_echeance)); + fputs($this->file, substr(date("%y", $this->date_echeance), 1)); // Raison Sociale Destinataire C2 @@ -1972,8 +1972,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, strftime("%d%m", $this->date_echeance)); - fputs($this->file, substr(strftime("%y", $this->date_echeance), 1)); + fputs($this->file, date("%d%m", $this->date_echeance)); + fputs($this->file, substr(date("%y", $this->date_echeance), 1)); // Raison Sociale C2 From e403a3a896e3d0cd4f475586d524435bf3c8e5fd Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Sep 2022 09:40:46 +0200 Subject: [PATCH 0182/1289] FIX : input hidden with fk_product of line on mo production can be usefull --- htdocs/mrp/mo_production.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index d92c595c6ec..bc83b841f09 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1008,6 +1008,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disable = 'disabled'; } + // input hidden with fk_product of line + print ''; + // Qty print ''; From ebf35432bd93e2fa7f7f7942197c93ea09e77b42 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 14 Sep 2022 11:30:57 +0200 Subject: [PATCH 0183/1289] FIX recruitment linked files --- htdocs/core/lib/files.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 04c3a481d00..b2100f5a693 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2857,6 +2857,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for import module $accessallowed = $user->rights->import->run; $original_file = $conf->import->dir_temp.'/'.$original_file; + } elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_output)) { + // Wrapping for import module + $accessallowed = $user->rights->recruitment->recruitmentjobposition->read; + $original_file = $conf->recruitment->dir_output.'/'.$original_file; } elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) { // Wrapping for wysiwyg editor $accessallowed = 1; From 0fe65591e80bfcc498a7be55bf9f73275e901ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 14:01:41 +0200 Subject: [PATCH 0184/1289] Fix message avec import simulation Fix suggested name of import profile avec a save. Fix trans --- htdocs/core/modules/modSociete.class.php | 2 +- htdocs/imports/import.php | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 327262ce39f..7f7624b167f 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -747,7 +747,7 @@ class modSociete extends DolibarrModules 's.fk_departement' => "StateCode", 's.fk_pays' => "CountryCode", 's.birthday' => "DateOfBirth", - 's.poste' => "Role", + 's.poste' => "PostOrFunction", 's.phone' => "Phone", 's.phone_perso' => "PhonePerso", 's.phone_mobile' => "PhoneMobile", diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a66814ce1b1..8916041520d 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -235,6 +235,7 @@ if ($action == 'add_import_model') { $result = $objimport->create($user); if ($result >= 0) { setEventMessages($langs->trans("ImportModelSaved", $objimport->model_name), null, 'mesgs'); + $import_name = ''; } else { $langs->load("errors"); if ($objimport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') { @@ -1286,7 +1287,7 @@ if ($step == 4 && $datatoimport) { print ''; // Lines for remark - print ''; + print ''; print ''; print '
'; + print $langs->trans("MemberCountersArePublic"); + print ''; + print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1); + print "
'; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index e4ca610c44f..aebe3affdae 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -15,6 +15,7 @@ ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, logi ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. SetLinkToUser=Link to a Dolibarr user SetLinkToThirdParty=Link to a Dolibarr third party +MemberCountersArePublic=Counters of valid members are public MembersCards=Generation of cards for members MembersList=List of members MembersListToValid=List of draft members (to be validated) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..531bfcfd152 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -753,10 +753,14 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW foreach ($measuringUnits->records as $lines) $units[$lines->short_label] = $langs->trans(ucfirst($lines->label)); - $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy"; + $publiccounters = $conf->global->MEMBER_COUNTERS_ARE_PUBLIC; + + $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy, COUNT(a.rowid) AS membercount"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as a"; + $sql .= " ON d.rowid = a.fk_adherent_type AND a.statut>0"; $sql .= " WHERE d.entity IN (".getEntity('member_type').")"; - $sql .= " AND d.statut=1"; + $sql .= " AND d.statut=1 GROUP BY d.rowid"; $result = $db->query($sql); if ($result) { @@ -772,6 +776,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''.$langs->trans("Amount").''.$langs->trans("MembersNature").''.$langs->trans("VoteAllowed").''.$langs->trans("Members").''.$langs->trans("NewSubscription").'
'.yn($objp->vote).''.$membercount.'
'; print $langs->trans("MemberCountersArePublic"); print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 531bfcfd152..25ad932456a 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -776,7 +776,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''.$langs->trans("Amount").''.$langs->trans("MembersNature").''.$langs->trans("VoteAllowed").''.$langs->trans("Members").''.$langs->trans("Members").''.$langs->trans("NewSubscription").'
'.yn($objp->vote).''.$membercount.''.$membercount.'
'.$langs->trans("St if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) { $thirdpartygraph .= '
'; $dataseries = array(); - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $dataseries[] = array($langs->trans("Prospects"), round($third['prospect'])); } - if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { + if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $dataseries[] = array($langs->trans("Customers"), round($third['customer'])); } if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { @@ -173,12 +173,12 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $thirdpartygraph .= $dolgraph->show(); $thirdpartygraph .= '
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("SellingPrice").''; + print '
'.$langs->trans("SellingPrice").''; if ($object->price_base_type == 'TTC') { print price($object->price_ttc).' '.$langs->trans($object->price_base_type); } else { @@ -1201,7 +1201,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print '
'.$langs->trans("MinPrice").''; + print '
'.$langs->trans("MinPrice").''; if ($object->price_base_type == 'TTC') { print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); } else { From 4e1380f4ebd96d1bf18e86dc2ddba469e2f2c1fa Mon Sep 17 00:00:00 2001 From: Faustin Date: Mon, 12 Sep 2022 16:19:25 +0200 Subject: [PATCH 0146/1289] scrutinizer on imports/import.php: action builddoc never existed on import --- htdocs/imports/import.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 2c85007c086..4b08662d886 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield') } } */ -if ($action == 'builddoc') { - // Build import file - $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); - if ($result < 0) { - setEventMessages($objimport->error, $objimport->errors, 'errors'); - } else { - setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); - } -} +// if ($action == 'builddoc') { +// // Build import file +// $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); +// if ($result < 0) { +// setEventMessages($objimport->error, $objimport->errors, 'errors'); +// } else { +// setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); +// } +// } if ($action == 'deleteprof') { if (GETPOST("id", 'int')) { From 3c5f3f7b858d57a82be46c08b4999a96cd4ba7a7 Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Mon, 12 Sep 2022 16:28:06 +0200 Subject: [PATCH 0147/1289] fix --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 4af49c7a3d5..181ae20589d 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -988,7 +988,7 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['t.description']['checked'])) { print ''; - print dol_escape_htmltag($object->description); + print $object->description; print ''; - print $object->description; + print nl2br($object->description); print '
'.$langs->trans('None').'
'.$langs->trans('None').'
'.$langs->trans("SellingPrice").''; + print '
'.$langs->trans("SellingPrice").''; if ($object->price_base_type == 'TTC') { print price($object->price_ttc).' '.$langs->trans($object->price_base_type); } else { @@ -1201,7 +1201,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print '
'.$langs->trans("MinPrice").''; + print '
'.$langs->trans("MinPrice").''; if ($object->price_base_type == 'TTC') { print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); } else { From d911f13ca001ffa85ef831d843bf400a2e586659 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 01:40:37 +0200 Subject: [PATCH 0156/1289] Update ajax.php --- htdocs/bom/ajax/ajax.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index 444ce9beeb2..9a55c609252 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -33,20 +33,9 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} -// Do not check anti CSRF attack test if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } -// If there is no need to load and show top and left menu -if (!defined("NOLOGIN")) { - define("NOLOGIN", '1'); -} -if (!defined('NOIPCHECK')) { - define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -} if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } From d1fbdbb33fb9b7fcb128d34151a9f27b84c54d9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 02:14:02 +0200 Subject: [PATCH 0157/1289] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index f1ce166cf81..8ea7de98442 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -438,7 +438,7 @@ if (empty($reshook)) { include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); if ($mailfile->error || $mailfile->errors) { - setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + setEventMessages($mailfile->error, !empty($mailfile->errors), 'errors'); } else { $result = $mailfile->sendfile(); } From c6144df3976be647ae8c2e95f462568ddcb2ce95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 02:15:31 +0200 Subject: [PATCH 0158/1289] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 8ea7de98442..62802744690 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -437,8 +437,8 @@ if (empty($reshook)) { } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket'); - if ($mailfile->error || $mailfile->errors) { - setEventMessages($mailfile->error, !empty($mailfile->errors), 'errors'); + if ($mailfile->error || !empty($mailfile->errors)) { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); } else { $result = $mailfile->sendfile(); } From 7c92a45cd630b615d499b67aff09cf32353f3b57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 02:21:24 +0200 Subject: [PATCH 0159/1289] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 35 +++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 62802744690..107547c9248 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -232,29 +232,34 @@ if (empty($reshook)) { } if (!$error) { - $object->db->begin(); - $object->type_code = GETPOST("type_code", 'aZ09'); $object->category_code = GETPOST("category_code", 'aZ09'); $object->severity_code = GETPOST("severity_code", 'aZ09'); $object->ip = getUserRemoteIP(); - $sql = "SELECT COUNT(ref) as nb_tickets"; - $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; - $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) { - $i++; - $obj = $db->fetch_object($resql); - $nb_post_ip = $obj->nb_tickets; + $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000); + + // Calculate nb of post for IP + $nb_post_ip = 0; + if ($nb_post_max > 0) { // Calculate only if there is a limit to check + $sql = "SELECT COUNT(ref) as nb_tickets"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket"; + $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $i++; + $obj = $db->fetch_object($resql); + $nb_post_ip = $obj->nb_tickets; + } } } - + $object->track_id = generate_random_id(16); + $object->db->begin(); $object->subject = GETPOST("subject", "restricthtml"); $object->message = GETPOST("message", "restricthtml"); @@ -321,7 +326,7 @@ if (empty($reshook)) { $object->context['disableticketemail'] = 1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later - if ($nb_post_ip >= getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000)) { + if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) { $error++; $errors = array($langs->trans("AlreadyTooMuchPostOnThisIPAdress")); array_push($object->errors, array($langs->trans("AlreadyTooMuchPostOnThisIPAdress"))); From 1579ddea88291cb62b7e4a89a395e8d0029287d2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 13 Sep 2022 00:26:00 +0000 Subject: [PATCH 0160/1289] Fixing style errors. --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 107547c9248..75f9fc11bb7 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -256,7 +256,7 @@ if (empty($reshook)) { } } } - + $object->track_id = generate_random_id(16); $object->db->begin(); From 3a8e66bfad76cc532a23b3d2f5e60318daabaada Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 02:30:15 +0200 Subject: [PATCH 0161/1289] Fix phpunit --- htdocs/admin/modulehelp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 63a1ff214c1..01c29b48a26 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -382,9 +382,9 @@ if ($mode == 'feature') { $text .= '

'; $text .= '
'.$langs->trans("AddDataTables").': '; - $sqlfiles1 = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, 'llx.*-'.$moduledir.'\.sql', array('\.key\.sql', '\.sql\.back')); - $sqlfiles2 = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql', '\.sql\.back')); - $sqlfiles = array_merge($sqlfiles1, $sqlfiles2); + $listofsqlfiles1 = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, 'llx.*-'.$moduledir.'\.sql', array('\.key\.sql', '\.sql\.back')); + $listofsqlfiles2 = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql', '\.sql\.back')); + $sqlfiles = array_merge($listofsqlfiles1, $listofsqlfiles2); if (count($sqlfiles) > 0) { $i = 0; From 6cf5c51f0b6b18ba4c76f0440c7a6c8ce25aefba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 02:33:49 +0200 Subject: [PATCH 0162/1289] Fix phpunit --- htdocs/bom/class/bom.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index ddb589a567d..ef99f9f7bb7 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -567,6 +567,7 @@ class BOM extends CommonObject * @param int $position Position of BOM-Line in BOM-Lines * @param int $fk_bom_child Id of BOM Child * @param string $import_key Import Key + * @param string $fk_unit Unit * @return int <0 if KO, Id of created object if OK */ public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '') @@ -740,7 +741,9 @@ class BOM extends CommonObject $this->line->efficiency = $efficiency; $this->line->import_key = $import_key; $this->line->position = $rankToUse; - if(!empty($fk_unit)) $this->line->fk_unit = $fk_unit; + if (!empty($fk_unit)) { + $this->line->fk_unit = $fk_unit; + } $result = $this->line->update($user); From d90ca726f48cda5d0fafacd74c30eb787cdaff8e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 13 Sep 2022 08:53:02 +0200 Subject: [PATCH 0163/1289] Update setup.php --- htdocs/modulebuilder/template/admin/setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 1c46028b142..8e60b2a296c 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -97,7 +97,7 @@ if (!class_exists('FormSetup')) { $formSetup = new FormSetup($db); -// Hôte +// HTTP HOST $item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST']; $item->cssClass = 'minwidth500'; @@ -106,7 +106,7 @@ $item->cssClass = 'minwidth500'; $item = $formSetup->newItem('MYMODULE_MYPARAM1'); $item->defaultFieldValue = 'default value'; -// Setup conf MYMODULE_MYPARAM1 as a simple textarea input but we replace the text of field title +// Setup conf MYMODULE_MYPARAM2 as a simple textarea input but we replace the text of field title $item = $formSetup->newItem('MYMODULE_MYPARAM2'); $item->nameText = $item->getNameText().' more html text '; From 77ec9ee669275b8125b49057f8d45a249736409c Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:26:37 +0200 Subject: [PATCH 0164/1289] FIX : ToOfferALinkForOnlinePayment not translated ToOfferALinkForOnlinePayment is defined on stripe.lang --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 72eb041f873..c47e9fc7c60 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1265,7 +1265,7 @@ class pdf_sponge extends ModelePDFFactures require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; global $langs; - $langs->loadLangs(array('payment', 'paybox')); + $langs->loadLangs(array('payment', 'paybox', 'stripe')); $servicename = $langs->transnoentities('Online'); $paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', ''); $linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' '.$outputlangs->transnoentities("ClickHere").''; From 7aa8fa98ec0b8bd8d1f7146296dea140ac8b651c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2022 13:43:44 +0200 Subject: [PATCH 0165/1289] Update doc --- build/exe/doliwamp/README.md | 2 ++ build/makepack-howto.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build/exe/doliwamp/README.md b/build/exe/doliwamp/README.md index be8cf1f3ac5..8f9878bfa29 100644 --- a/build/exe/doliwamp/README.md +++ b/build/exe/doliwamp/README.md @@ -9,3 +9,5 @@ The build of .exe files need to have some windows executable files already insta If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file). + +!!! See file ../makepack-howto.txt diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index be88302cd1d..988471e3c53 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -25,9 +25,9 @@ Prerequisites to build autoexe DoliWamp package: ***** Prerequisites For Windows ***** -Install Perl +Install Perl. Install WampServer-3.2.*-64.exe -isetup-5.5.8.exe +Install isetup-5.5.8.exe ***** Actions to do a BETA ***** From 4f9c273c644f2ccc157674144ec9a87cd9102db4 Mon Sep 17 00:00:00 2001 From: Atm-Gregr Date: Tue, 13 Sep 2022 14:19:28 +0200 Subject: [PATCH 0166/1289] retours --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 65ceda08242..4f7c4bf7a42 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -988,7 +988,7 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['t.description']['checked'])) { print '
'; - print nl2br($object->description); + print dolGetFirstLineOfText($object->description, 5); print ''; - print dolGetFirstLineOfText($object->description, 5); + print dolGetFirstLineOfText($object->description, 5); print '
'.$langs->trans("Remark").'
'.$langs->trans("Note").'
'; @@ -1470,8 +1471,8 @@ if ($step == 4 && $datatoimport) { print ''; $nameofimportprofile = str_replace(' ', '-', $langs->trans("ImportProfile").' '.$titleofmodule.' '.dol_print_date(dol_now('gmt'), 'dayxcard')); - if (is_object($objimport) && !empty($objimport->model_name)) { - $nameofimportprofile = $objimport->model_name; + if (GETPOST('import_name')) { // If we have submited a form, we take value used fot the update try + $nameofimportprofile = $import_name; } print ''; @@ -1966,9 +1967,9 @@ if ($step == 5 && $datatoimport) { print '
'; print ''.$langs->trans("NowClickToRunTheImport", $langs->transnoentitiesnoconv("RunImportFile")).'
'; - if (empty($nboferrors)) { + /*if (empty($nboferrors)) { print $langs->trans("DataLoadedWithId", $importid).'
'; - } + }*/ print '
'; print '
'; From ba2aafaf6f7495a457a94e7e9f162cb05d1d273c Mon Sep 17 00:00:00 2001 From: GregM Date: Wed, 14 Sep 2022 14:29:50 +0200 Subject: [PATCH 0185/1289] Update ActionComm type_code on email message ticket --- htdocs/ticket/class/ticket.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index df581d96fdc..1d7360b44a7 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1732,6 +1732,7 @@ class Ticket extends CommonObject $error = 0; $now = dol_now(); + $send_email = GETPOST('send_email','int'); // Clean parameters if (isset($this->fk_track_id)) { @@ -1752,6 +1753,9 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } + if ($send_email > 0){ + $actioncomm->type_code = 'AC_EMAIL'; + } $actioncomm->socid = $this->socid; $actioncomm->label = $this->subject; $actioncomm->note_private = $this->message; From b7db0af78b5b707b0fe478c5baf8259a061af72c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Sep 2022 12:48:21 +0000 Subject: [PATCH 0186/1289] Fixing style errors. --- htdocs/ticket/class/ticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1d7360b44a7..2ee10b855a8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1732,7 +1732,7 @@ class Ticket extends CommonObject $error = 0; $now = dol_now(); - $send_email = GETPOST('send_email','int'); + $send_email = GETPOST('send_email', 'int'); // Clean parameters if (isset($this->fk_track_id)) { @@ -1753,7 +1753,7 @@ class Ticket extends CommonObject if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; } - if ($send_email > 0){ + if ($send_email > 0) { $actioncomm->type_code = 'AC_EMAIL'; } $actioncomm->socid = $this->socid; From 7d5d04a30d5f7d08e5e3610f53d35c53154ade7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 15:24:07 +0200 Subject: [PATCH 0187/1289] Doc --- htdocs/core/lib/json.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index fe50503ed99..9e3a5bb6126 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -39,6 +39,8 @@ if (!function_exists('json_encode')) { /** * Implement json_encode for PHP that does not support it. * Use json_encode and json_decode in your code ! + * Note: We can found some special chars into a json string: + * Quotation mark (") = \", Backslash (\) = \\, Slash (/) = \/, Backspace = \b, Form feed = \f, New line =\n, Carriage return =\r, Horizontal tab = \t * * @param mixed $elements PHP Object to json encode * @return string Json encoded string From 34da698537c5360164ca14acc0a0e4640ee5441b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 16:01:45 +0200 Subject: [PATCH 0188/1289] FIX Import in upgrade when using a socialnetwork field. --- htdocs/core/db/Database.interface.php | 9 +++++++++ htdocs/core/db/mysqli.class.php | 12 ++++++++++++ htdocs/core/db/pgsql.class.php | 14 +++++++++++++- htdocs/core/db/sqlite3.class.php | 14 +++++++++++++- htdocs/core/lib/website.lib.php | 6 +++--- htdocs/core/modules/import/import_csv.modules.php | 12 ++++++++---- htdocs/core/modules/import/import_xlsx.modules.php | 8 ++++++-- htdocs/debugbar/class/TraceableDB.php | 12 ++++++++++++ 8 files changed, 76 insertions(+), 11 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 1d24b058614..faff7ff5172 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -182,9 +182,18 @@ interface Database * * @param string $stringtoencode String to escape * @return string String escaped + * @deprecated */ public function escapeunderscore($stringtoencode); + /** + * Escape a string to insert data into a like + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escapeforlike($stringtoencode); + /** * Sanitize a string for SQL forging * diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 29c2d30df2f..f2c5f9f3a03 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -479,12 +479,24 @@ class DoliDBMysqli extends DoliDB * * @param string $stringtoencode String to escape * @return string String escaped + * @deprecated */ public function escapeunderscore($stringtoencode) { return str_replace('_', '\_', (string) $stringtoencode); } + /** + * Escape a string to insert data into a like + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escapeforlike($stringtoencode) + { + return str_replace(array('_', '\\', '%'), array('\_', '\\\\', '\%'), (string) $stringtoencode); + } + /** * Return generic error code of last operation. * diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index fe3269867a9..e259933cd07 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -726,10 +726,22 @@ class DoliDBPgsql extends DoliDB * * @param string $stringtoencode String to escape * @return string String escaped + * @deprecated */ public function escapeunderscore($stringtoencode) { - return str_replace('_', '\_', $stringtoencode); + return str_replace('_', '\_', (string) $stringtoencode); + } + + /** + * Escape a string to insert data into a like + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escapeforlike($stringtoencode) + { + return str_replace(array('_', '\\', '%'), array('\_', '\\\\', '\%'), (string) $stringtoencode); } /** diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 8d0141e8ca6..e31eeffe457 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -654,10 +654,22 @@ class DoliDBSqlite3 extends DoliDB * * @param string $stringtoencode String to escape * @return string String escaped + * @deprecated */ public function escapeunderscore($stringtoencode) { - return str_replace('_', '\_', $stringtoencode); + return str_replace('_', '\_', (string) $stringtoencode); + } + + /** + * Escape a string to insert data into a like + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escapeforlike($stringtoencode) + { + return str_replace(array('_', '\\', '%'), array('\_', '\\\\', '\%'), (string) $stringtoencode); } /** diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index e9de957e4a8..e9ea4dbcf09 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -947,11 +947,11 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $sql .= " AND ("; $searchalgo = ''; if (preg_match('/meta/', $algo)) { - $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.title LIKE '%".$db->escapeunderscore($db->escape($searchstring))."%' OR wp.description LIKE '%".$db->escapeunderscore($db->escape($searchstring))."%'"; - $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.keywords LIKE '".$db->escapeunderscore($db->escape($searchstring)).",%' OR wp.keywords LIKE '% ".$db->escapeunderscore($db->escape($searchstring))."%'"; // TODO Use a better way to scan keywords + $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.title LIKE '%".$db->escapeforlike($db->escape($searchstring))."%' OR wp.description LIKE '%".$db->escapeforlike($db->escape($searchstring))."%'"; + $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.keywords LIKE '".$db->escapeforlike($db->escape($searchstring)).",%' OR wp.keywords LIKE '% ".$db->escapeforlike($db->escape($searchstring))."%'"; // TODO Use a better way to scan keywords } if (preg_match('/content/', $algo)) { - $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.content LIKE '%".$db->escapeunderscore($db->escape($searchstring))."%'"; + $searchalgo .= ($searchalgo ? ' OR ' : '')."wp.content LIKE '%".$db->escapeforlike($db->escape($searchstring))."%'"; } $sql .= $searchalgo; if (is_array($otherfilters) && !empty($otherfilters['category'])) { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 32284a2cbd1..0bea7d1d739 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -835,8 +835,8 @@ class ImportCsv extends ModeleImports $sqlSelect = "SELECT ".$fname." FROM ".$tablename; $data = array_combine($listfields, $listvalues); - $where = array(); - $filters = array(); + $where = array(); // filters to forge SQL request + $filters = array(); // filters to forge output error message foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; $key = preg_replace('/^.*\./i', '', $key); @@ -846,8 +846,12 @@ class ImportCsv extends ModeleImports $socialnetwork = $tmp[1]; $jsondata = $data[$key]; $json = json_decode($jsondata); - $where[] = $key." LIKE '%\"".$socialnetwork."\":\"".$this->db->escape($json->$socialnetwork)."\"%'"; - $filters[] = $col." LIKE '%\"".$socialnetwork."\":\"".$this->db->escape($json->$socialnetwork)."\"%'"; + $stringtosearch = json_encode($socialnetwork).':'.json_encode($json->$socialnetwork); + //var_dump($stringtosearch); + //var_dump($this->db->escape($stringtosearch)); // This provide a value for sql string (but not for a like) + $where[] = $key." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'"; + $filters[] = $col." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'"; + //var_dump($where[1]); // This provide a value for sql string inside a like } else { $where[] = $key.' = '.$data[$key]; $filters[] = $col.' = '.$data[$key]; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d8a9d77a98e..8652f106ca2 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -891,8 +891,12 @@ class ImportXlsx extends ModeleImports $socialnetwork = $tmp[1]; $jsondata = $data[$key]; $json = json_decode($jsondata); - $where[] = $key." LIKE '%\"".$socialnetwork."\":\"".$this->db->escape($json->$socialnetwork)."\"%'"; - $filters[] = $col." LIKE '%\"".$socialnetwork."\":\"".$this->db->escape($json->$socialnetwork)."\"%'"; + $stringtosearch = json_encode($socialnetwork).':'.json_encode($json->$socialnetwork); + //var_dump($stringtosearch); + //var_dump($this->db->escape($stringtosearch)); // This provide a value for sql string (but not for a like) + $where[] = $key." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'"; + $filters[] = $col." LIKE '%".$this->db->escapeforlike($this->db->escape($stringtosearch))."%'"; + //var_dump($where[1]); // This provide a value for sql string inside a like } else { $where[] = $key.' = '.$data[$key]; $filters[] = $col.' = '.$data[$key]; diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index 082e45e4f43..785af37fc94 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -255,12 +255,24 @@ class TraceableDB extends DoliDB * * @param string $stringtoencode String to escape * @return string String escaped + * @deprecated */ public function escapeunderscore($stringtoencode) { return $this->db->escapeunderscore($stringtoencode); } + /** + * Escape a string to insert data into a like + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escapeforlike($stringtoencode) + { + return str_replace(array('_', '\\', '%'), array('\_', '\\\\', '\%'), (string) $stringtoencode); + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get last ID after an insert INSERT From 5f27435ffcf7f61c14d9982c6eb3ab44b17bac42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 16:06:42 +0200 Subject: [PATCH 0189/1289] Fix position of import --- htdocs/core/modules/modAccounting.class.php | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 5e30978693e..737d2831db6 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -272,6 +272,24 @@ class modAccounting extends DolibarrModules //-------- $r = 0; + // Chart of accounts + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "Chartofaccounts"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('aa'=>MAIN_DB_PREFIX.'accounting_account'); + $this->import_tables_creator_array[$r] = array('aa'=>'fk_user_author'); // Fields to store import user id + $this->import_fields_array[$r] = array('aa.fk_pcg_version'=>"Chartofaccounts*", 'aa.account_number'=>"AccountAccounting*", 'aa.label'=>"Label*", 'aa.account_parent'=>"Accountparent", "aa.fk_accounting_category"=>"AccountingCategory", "aa.pcg_type"=>"Pcgtype*", 'aa.active'=>'Status*', 'aa.datec'=>"DateCreation"); + $this->import_regex_array[$r] = array('aa.fk_pcg_version'=>'pcg_version@'.MAIN_DB_PREFIX.'accounting_system', 'aa.account_number'=>'^.{1,32}$', 'aa.label'=>'^.{1,255}$', 'aa.account_parent'=>'^.{0,32}$', 'aa.fk_accounting_category'=>'rowid@'.MAIN_DB_PREFIX.'c_accounting_category', 'aa.pcg_type'=>'^.{1,20}$', 'aa.active'=>'^0|1$', 'aa.datec'=>'^\d{4}-\d{2}-\d{2}$'); + $this->import_convertvalue_array[$r] = array( + 'aa.account_number'=>array('rule'=>'accountingaccount'), + 'aa.account_parent'=>array('rule'=>'fetchidfromref', 'classfile'=>'/accountancy/class/accountingaccount.class.php', 'class'=>'AccountingAccount', 'method'=>'fetch', 'element'=>'AccountingAccount'), + 'aa.fk_accounting_category'=>array('rule'=>'fetchidfromcodeorlabel', 'classfile'=>'/accountancy/class/accountancycategory.class.php', 'class'=>'AccountancyCategory', 'method'=>'fetch', 'dict'=>'DictionaryAccountancyCategory'), + ); + $this->import_examplevalues_array[$r] = array('aa.fk_pcg_version'=>"PCG99-ABREGE", 'aa.account_number'=>"707", 'aa.label'=>"Product sales", 'aa.account_parent'=>"ref:7 or id:1407", "aa.fk_accounting_category"=>"", "aa.pcg_type"=>"PROD", 'aa.active'=>'1', 'aa.datec'=>"2017-04-28"); + $this->import_updatekeys_array[$r] = array('aa.fk_pcg_version'=>'Chartofaccounts', 'aa.account_number'=>'AccountAccounting'); + // General ledger $r++; $this->import_code[$r] = $this->rights_class.'_'.$r; @@ -393,23 +411,5 @@ class modAccounting extends DolibarrModules 'b.multicurrency_amount'=>"90 (Necessary if devise is different than EUR)", 'b.multicurrency_code'=>"US (Necessary if devise is different than EUR)", ); - - // Chart of accounts - $r++; - $this->import_code[$r] = $this->rights_class.'_'.$r; - $this->import_label[$r] = "Chartofaccounts"; // Translation key - $this->import_icon[$r] = $this->picto; - $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('aa'=>MAIN_DB_PREFIX.'accounting_account'); - $this->import_tables_creator_array[$r] = array('aa'=>'fk_user_author'); // Fields to store import user id - $this->import_fields_array[$r] = array('aa.fk_pcg_version'=>"Chartofaccounts*", 'aa.account_number'=>"AccountAccounting*", 'aa.label'=>"Label*", 'aa.account_parent'=>"Accountparent", "aa.fk_accounting_category"=>"AccountingCategory", "aa.pcg_type"=>"Pcgtype*", 'aa.active'=>'Status*', 'aa.datec'=>"DateCreation"); - $this->import_regex_array[$r] = array('aa.fk_pcg_version'=>'pcg_version@'.MAIN_DB_PREFIX.'accounting_system', 'aa.account_number'=>'^.{1,32}$', 'aa.label'=>'^.{1,255}$', 'aa.account_parent'=>'^.{0,32}$', 'aa.fk_accounting_category'=>'rowid@'.MAIN_DB_PREFIX.'c_accounting_category', 'aa.pcg_type'=>'^.{1,20}$', 'aa.active'=>'^0|1$', 'aa.datec'=>'^\d{4}-\d{2}-\d{2}$'); - $this->import_convertvalue_array[$r] = array( - 'aa.account_number'=>array('rule'=>'accountingaccount'), - 'aa.account_parent'=>array('rule'=>'fetchidfromref', 'classfile'=>'/accountancy/class/accountingaccount.class.php', 'class'=>'AccountingAccount', 'method'=>'fetch', 'element'=>'AccountingAccount'), - 'aa.fk_accounting_category'=>array('rule'=>'fetchidfromcodeorlabel', 'classfile'=>'/accountancy/class/accountancycategory.class.php', 'class'=>'AccountancyCategory', 'method'=>'fetch', 'dict'=>'DictionaryAccountancyCategory'), - ); - $this->import_examplevalues_array[$r] = array('aa.fk_pcg_version'=>"PCG99-ABREGE", 'aa.account_number'=>"707", 'aa.label'=>"Product sales", 'aa.account_parent'=>"ref:7 or id:1407", "aa.fk_accounting_category"=>"", "aa.pcg_type"=>"PROD", 'aa.active'=>'1', 'aa.datec'=>"2017-04-28"); - $this->import_updatekeys_array[$r] = array('aa.fk_pcg_version'=>'Chartofaccounts', 'aa.account_number'=>'AccountAccounting'); } } From 337cc7553ddef8137e9ed7d3ff1c0b217d8e858b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 17:44:47 +0200 Subject: [PATCH 0190/1289] Fix rounding --- htdocs/core/lib/price.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 6b85e837b07..f85e78865ed 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -372,16 +372,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // If rounding is not using base 10 (rare) if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { if ($price_base_type == 'HT') { - $result[0] = round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[0] = price2num(round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[2] = price2num($result[0] + $result[1] + $result[9] + $result[10], 'MT'); } else { - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[2] = price2num(round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[0] = price2num($result[2] - $result[1] - $result[9] - $result[10], 'MT'); } } From 3a078ec77dd2c8872b12c043c784fd0ced0ee011 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 18:12:05 +0200 Subject: [PATCH 0191/1289] Fix type of var --- htdocs/core/class/commonobject.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7b78d9bbcb9..02c38e9a89e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3553,8 +3553,8 @@ abstract class CommonObject } $forcedroundingmode = $roundingadjust; - if ($forcedroundingmode == 'auto' && isset($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)) { - $forcedroundingmode = $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND; + if ($forcedroundingmode == 'auto' && getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND')) { + $forcedroundingmode = getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND'); } elseif ($forcedroundingmode == 'auto') { $forcedroundingmode = '0'; } @@ -3679,14 +3679,17 @@ abstract class CommonObject } $sqlfix = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldtva." = ".price2num($obj->total_tva - $diff).", total_ttc = ".price2num($obj->total_ttc - $diff)." WHERE rowid = ".((int) $obj->rowid); dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix); - $resqlfix = $this->db->query($sqlfix); + + $resqlfix = $this->db->query($sqlfix); + if (!$resqlfix) { dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $this->total_tva = (float) price2num($this->total_tva - $diff); + $this->total_ttc = (float) price2num($this->total_ttc - $diff); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff); } } From 8f7f104806cef5197260b35c21bd638ac8780dad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 18:34:13 +0200 Subject: [PATCH 0192/1289] Fix test on MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND --- htdocs/core/class/commonobject.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 02c38e9a89e..94d6e039477 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3553,7 +3553,7 @@ abstract class CommonObject } $forcedroundingmode = $roundingadjust; - if ($forcedroundingmode == 'auto' && getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND')) { + if ($forcedroundingmode == 'auto' && isset($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)) { $forcedroundingmode = getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND'); } elseif ($forcedroundingmode == 'auto') { $forcedroundingmode = '0'; @@ -3686,10 +3686,10 @@ abstract class CommonObject dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva = (float) price2num($this->total_tva - $diff); - $this->total_ttc = (float) price2num($this->total_ttc - $diff); - $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff); - $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff); + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } From 90dbb933883aa1306946f19123236913ae1d5d0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2022 18:51:07 +0200 Subject: [PATCH 0193/1289] Try fix rounding --- htdocs/core/class/commonobject.class.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 94d6e039477..fd71e78afc6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3716,6 +3716,13 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* @@ -3749,11 +3756,11 @@ abstract class CommonObject if (empty($nodatabaseupdate)) { $sql = "UPDATE ".$this->db->prefix().$this->table_element.' SET'; - $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht)).","; - $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva)).","; - $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1)).","; - $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2)).","; - $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc)); + $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).","; + $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).","; + $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1)); $sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1)); $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); From 85525f9ea935149310d9a32a8245e244629126dc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:13:18 +0200 Subject: [PATCH 0194/1289] update code toward php8 compliance --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b1476b393d0..cc523be2eda 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 5492643514d121700eaa7fd242174403f73d637e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:16:08 +0200 Subject: [PATCH 0195/1289] update code toward php8 compliance --- htdocs/admin/pdf.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index b5a823edfb4..57ac961095d 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_TOP").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; -print ''; +print ''; print ''; print ''; From c56e8b08d64853d9e210384b954aaa9010741bef Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:17:50 +0200 Subject: [PATCH 0196/1289] update code toward php8 compliance --- htdocs/core/modules/action/rapport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php index 61579399247..fabb43fbdda 100644 --- a/htdocs/core/modules/action/rapport.class.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -98,10 +98,10 @@ class CommActionRapport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; From 67cabdfa9e5f7f55b19af7291295737bc845019c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:19:17 +0200 Subject: [PATCH 0197/1289] update code toward php8 compliance --- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index e313c612eb0..f47373f2e51 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; // Get source company $this->emetteur = $mysoc; From 732f2159158f673a0426a780fedd1f59997e1960 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:22:11 +0200 Subject: [PATCH 0198/1289] update code toward php8 compliance --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 3ab1cdcc193..b30806a4690 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 314a1fa7853..10659e18e66 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From a54be07c074a91361fc2c69b9774e88706971d7f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:23:27 +0200 Subject: [PATCH 0199/1289] update code toward php8 compliance --- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 21c131ad2a6..1fcad3a1b72 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; // Retrieves transmitter $this->emetteur = $mysoc; From 5891cfe8d50c8a526f8e9cf1bdb979adbf998206 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:24:36 +0200 Subject: [PATCH 0200/1289] update code toward php8 compliance --- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 34cdb41e6b8..f2f3e79ba19 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 7a0cc9c9163eff6da8f76edf55e196933ec9645a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:25:38 +0200 Subject: [PATCH 0201/1289] update code toward php8 compliance --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 1875cfb833c..560896ea559 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION From 5cd89aff35ed999f5148462cf12613220963a0eb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:26:57 +0200 Subject: [PATCH 0202/1289] update code toward php8 compliance --- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 7d880328663..e4114670eec 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 69a5d6ceac41ad50fbeb15e80fdf5564d3716078 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:28:09 +0200 Subject: [PATCH 0203/1289] update code toward php8 compliance --- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 2e0c3f2d05c..0c0cfae1750 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 944ad3087c384f0591a14d91ace59a1eb02b79a4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 14 Sep 2022 19:29:23 +0200 Subject: [PATCH 0204/1289] update code toward php8 compliance --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 9e2e5286874..922d4acf418 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; + $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; + $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; + $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts From 17fa3b327e9ac864bb08f54302189b1367b39449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 14 Sep 2022 21:33:43 +0200 Subject: [PATCH 0205/1289] fix usage of getDolGlobalInt --- htdocs/admin/pdf.php | 8 ++++---- htdocs/core/modules/action/rapport.class.php | 8 ++++---- .../core/modules/asset/doc/pdf_standard_asset.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 8 ++++---- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 8 ++++---- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 8 ++++---- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 8 ++++---- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 8 ++++---- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 8 ++++---- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 8 ++++---- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 8 ++++---- .../modules/expensereport/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 8 ++++---- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 8 ++++---- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 8 ++++---- htdocs/core/modules/product/doc/pdf_standard.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 8 ++++---- htdocs/core/modules/project/doc/pdf_timespent.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- htdocs/core/modules/rapport/pdf_paiement.class.php | 8 ++++---- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 8 ++++---- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 8 ++++---- .../core/modules/stocktransfer/doc/pdf_eagle.modules.php | 8 ++++---- .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 8 ++++---- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 8 ++++---- .../modules/supplier_order/doc/pdf_cornas.modules.php | 8 ++++---- .../modules/supplier_order/doc/pdf_muscadet.modules.php | 8 ++++---- .../modules/supplier_payment/doc/pdf_standard.modules.php | 8 ++++---- .../mymodule/doc/pdf_standard_myobject.modules.php | 8 ++++---- .../doc/pdf_standard_recruitmentjobposition.modules.php | 8 ++++---- 37 files changed, 148 insertions(+), 148 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 57ac961095d..686d13e7e39 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_TOP").''; -print ''; +print ''; print ''; print ''.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php index fabb43fbdda..4835c39c194 100644 --- a/htdocs/core/modules/action/rapport.class.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -98,10 +98,10 @@ class CommActionRapport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index f47373f2e51..14815f169f2 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Get source company $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index b30806a4690..bbbd82ec1c7 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 10659e18e66..e09fef45bf0 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 1fcad3a1b72..f32b2306624 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Retrieves transmitter $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cc523be2eda..2b89f229730 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index f2f3e79ba19..df28616276d 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 560896ea559..5b45d0014be 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index e4114670eec..550957511ba 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 0c0cfae1750..ad8e0bd71a5 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 922d4acf418..485ff20951f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? getDolGlobalInt('MAIN_PDF_MARGIN_LEFT') : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT') : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? getDolGlobalInt('MAIN_PDF_MARGIN_TOP') : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM') : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index e37977144d2..781d581aaf7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = round($formatarray['height'] / 2); $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 0237c294a0d..3872ad3d4a2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f6536cbb1df..fae58f49419 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2a94a94103e..76dc8950670 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index cb1c2fb64e0..9264da3f680 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index bb4a6826278..2d3e89a6316 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 6f2a6fcf694..d93a7d99076 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_codestockservice = 0; // Display stock-service code diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index ed10b5ee2bf..1a61a588ae3 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; //Available in several languages diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index e4bcc0e4f04..92cf586f848 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index df013a2fad0..3bae695f511 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 1dc5b7bf3f9..c3ce64e3df7 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects $this->page_hauteur = $formatarray['height']; } $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 9d118b2a555..02f3f0c8cfb 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c2971c9344e..ea95036b280 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9d52132db56..cdac495c393 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index e4991a5830d..8cb10e0a0f8 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -54,10 +54,10 @@ class pdf_paiement $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->tab_top = 30; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 050459d91d2..1b4588e57bb 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 3fd3917da2d..d3fa898d0a1 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_codestockservice = 0; // Display product-service code diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 87a6bcf0e38..2971741f078 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index fa49b0b6d44..493dd0f2f6f 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 39a9aab7e78..6e340a39981 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 00d1e2e28e7..a11983991cc 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 410a631fa62..5b9a572736b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 676c5768ea3..a6a272d6274 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 3990d49fa6d..382b5a0f0ab 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -121,10 +121,10 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); // Get source company $this->emetteur = $mysoc; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 2e85bfab121..bf267a475c6 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -121,10 +121,10 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $this->page_largeur = $formatarray['width']; $this->page_hauteur = $formatarray['height']; $this->format = array($this->page_largeur, $this->page_hauteur); - $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; - $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; - $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; - $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; + $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10); + $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); + $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); + $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION From 094c2c3027e6e769996fb58f621aedb93ae316b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 01:02:49 +0200 Subject: [PATCH 0206/1289] Fix condition on a field --- htdocs/projet/class/project.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7ee71bc1569..849c1c53398 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -345,6 +345,7 @@ class Project extends CommonObject $this->fields['accept_booth_suggestions']['enabled'] = 0; $this->fields['price_registration']['enabled'] = 0; $this->fields['price_booth']['enabled'] = 0; + $this->fields['max_attendees']['enabled'] = 0; } } From 9881e7753d0fa9d638e8c9326968e4529cfd4ac0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 01:35:54 +0200 Subject: [PATCH 0207/1289] Fix regression --- .../societe/mod_codeclient_elephant.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 820dfafdc7e..100799dff95 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -172,27 +172,32 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode "ErrorBadMaskBadRazMonth", "ErrorCantUseRazWithYearOnOneDigit", ); + + $cssforerror = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') == 'mod_codeclient_elephant' ? 'error' : 'opacitymedium'); + if ($type != 1) { $examplecust = $this->getNextValue($objsoc, 0); - if (!$examplecust) { - $examplecust = '
'.$langs->trans('NotConfigured').'
'; + if (!$examplecust && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { + $langs->load("errors"); + $examplecust = ''.$langs->trans('ErrorBadMask').''; $error = 1; } if (in_array($examplecust, $errmsg)) { $langs->load("errors"); - $examplecust = '
'.$langs->trans($examplecust).'
'; + $examplecust = ''.$langs->trans($examplecust).''; $error = 1; } } if ($type != 0) { $examplesup = $this->getNextValue($objsoc, 1); - if (!$examplesup) { - $examplesup = '
'.$langs->trans('NotConfigured').'
'; + if (!$examplesup && ($cssforerror == 'error' || $this->error != 'NotConfigured')) { + $langs->load("errors"); + $examplesup = ''.$langs->trans('ErrorBadMask').''; $error = 1; } if (in_array($examplesup, $errmsg)) { $langs->load("errors"); - $examplesup = '
'.$langs->trans($examplesup).'
'; + $examplesup = ''.$langs->trans($examplesup).''; $error = 1; } } @@ -202,11 +207,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } elseif ($type == 1) { return $examplesup; } else { - if ($error == 1) { - return $examplecust.' '.$examplesup; - } else { - return $examplecust.'
'.$examplesup; - } + return $examplecust.'
'.$examplesup; } } From 91bdaae8986d0338927da071a0d445ce2390a13f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 03:08:33 +0200 Subject: [PATCH 0208/1289] Look and feel v17 --- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/list.php | 45 ++++++++++++--- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 12 ++-- htdocs/compta/facture/card.php | 6 +- htdocs/compta/facture/class/facture.class.php | 13 +---- htdocs/compta/facture/list.php | 21 ++++--- htdocs/core/class/commoninvoice.class.php | 56 +++++++++++++------ htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/list.php | 6 +- htdocs/fourn/facture/card.php | 2 +- htdocs/langs/en_US/bills.lang | 2 + htdocs/societe/class/societe.class.php | 5 ++ 13 files changed, 114 insertions(+), 60 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 0a1d1bdbc06..0f019c80f4b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1742,7 +1742,7 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print ''; - print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''; $provider = preg_replace('/_ID$/', '', $key); $listinsetup[] = array( $provider.'_NAME', @@ -172,6 +180,7 @@ foreach ($conf->global as $key => $val) { } } + // $list is defined into oauth.lib.php to the list of supporter OAuth providers. foreach ($listinsetup as $key) { $supported = 0; @@ -186,6 +195,8 @@ foreach ($listinsetup as $key) { $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; + + if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) { $supported = 1; } @@ -252,20 +263,25 @@ foreach ($listinsetup as $key) { // TODO Move this into token generation if ($supported) { - if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { - print ''; - print ''.$langs->trans("Scopes").''; - print ''; - print ''; - print ''; - } else { - print ''; - print ''.$langs->trans("Scopes").''; - print ''; - //print ''; - print $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope']; - print ''; + $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes'])); + $currentscopes = explode(',', getDolGlobalString($key[4])); + $scopestodispay = array(); + foreach ($availablescopes as $keyscope => $valscope) { + if (in_array($keyscope, $currentscopes)) { + $scopestodispay[$keyscope] = 1; + } else { + $scopestodispay[$keyscope] = 0; + } } + // Api Scope + print ''; + print ''.$langs->trans("Scopes").''; + print ''; + foreach ($scopestodispay as $scope => $val) { + print ''; + print ''; + } + print ''; } } diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 62162616a1a..fa1fd18f049 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -172,7 +172,7 @@ if ($mode == 'setup' && $user->admin) { $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); - $shortscope = $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope']; + $shortscope = ''; if (getDolGlobalString($key[4])) { $shortscope = getDolGlobalString($key[4]); } diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index bacd8135739..d48775fe84e 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -23,29 +23,17 @@ */ -$shortscopegoogle = 'userinfo_email,userinfo_profile'; -$shortscopegoogle .= ',openid,email,profile'; // For openid connect -if (!empty($conf->printing->enabled)) { - $shortscopegoogle .= ',cloud_print'; -} -if (!empty($conf->global->OAUTH_GOOGLE_GSUITE)) { - $shortscopegoogle .= ',admin_directory_user'; -} -if (!empty($conf->global->OAUTH_GOOGLE_GMAIL)) { - $shortscopegoogle.=',gmail_full'; -} - // Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth) $supportedoauth2array = array( - 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'defaultscope'=>$shortscopegoogle), + 'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'), ); if (!empty($conf->stripe->enabled)) { - $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'defaultscope'=>'read_write'); - $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'defaultscope'=>'read_write'); + $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); + $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write'); } -$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers', 'defaultscope'=>'user,public_repo'); +$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers', 'availablescopes'=>'user,public_repo'); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'defaultscope'=>'ToComplete'); + $supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'availablescopes'=>'Standard'); } diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index f30d73c2d4e..b993cbdd81e 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -89,10 +89,13 @@ if ($state) { $requestedpermissionsarray = explode(',', $statewithscopeonly); // Example: 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print'. $statewithanticsrfonly = preg_replace('/^.*\-/', '', $state); } -if ($action != 'delete' && empty($requestedpermissionsarray)) { - print 'Error, parameter state is not defined'; - exit; + +if ($action != 'delete' && (empty($statewithscopeonly) || empty($requestedpermissionsarray))) { + setEventMessages($langs->trans('ScopeUndefined'), null, 'errors'); + header('Location: '.$backtourl); + exit(); } + //var_dump($requestedpermissionsarray);exit; diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index b7f7c0c2c1a..661ecc45e4f 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -36,4 +36,5 @@ OAUTH_SECRET=OAuth secret OAuthProviderAdded=OAuth provider added AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=An OAuth entry for this provider and label already exists URLOfServiceForAuthorization=URL provided by OAuth service for authentication -Scopes=Scopes \ No newline at end of file +Scopes=Scopes +ScopeUndefined=Scope undefined (see previous tab) \ No newline at end of file diff --git a/htdocs/langs/fr_FR/oauth.lang b/htdocs/langs/fr_FR/oauth.lang index 493cf00deb9..70b98cd0cd0 100644 --- a/htdocs/langs/fr_FR/oauth.lang +++ b/htdocs/langs/fr_FR/oauth.lang @@ -34,3 +34,5 @@ OAUTH_ID=ID OAuth OAUTH_SECRET=Code secret OAuth OAuthProviderAdded=Fournisseur OAuth ajouté AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=Une entrée OAuth pour ce fournisseur et ce libellé existe déjà +ScopeUndefined=Portée non définie (voir onglet précédent) +Scopes=Portées \ No newline at end of file From f2fe369bb523cf72fb3a6c3a9375b997514139a1 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 18 Sep 2022 02:25:53 +0200 Subject: [PATCH 0287/1289] unwanted code line --- htdocs/admin/oauth.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index a9ce5118342..45a51c89060 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -24,7 +24,6 @@ * \brief Setup page to configure oauth access api */ -use Sabre\VObject\Component\Available; // Load Dolibarr environment require '../main.inc.php'; From a2aee527e40655e624a219a342d80cdf243d9f8c Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 18 Sep 2022 02:27:25 +0200 Subject: [PATCH 0288/1289] unwanted code line --- htdocs/admin/oauth.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 45a51c89060..bb7fabd1963 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -167,7 +167,6 @@ $i = 0; // Define $listinsetup foreach ($conf->global as $key => $val) { if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) { - print ''; $provider = preg_replace('/_ID$/', '', $key); $listinsetup[] = array( $provider.'_NAME', From 9ba2b41aee142316c2f4947ae30981e8f4e8029e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Sep 2022 00:31:11 +0200 Subject: [PATCH 0289/1289] FIX filter lost when sorting on productMargin --- htdocs/margin/productMargins.php | 47 ++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ac006c042aa..a47ec246aaf 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -74,17 +74,18 @@ if (!$sortfield) { $startdate = $enddate = ''; -if (!empty($_POST['startdatemonth'])) { - $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); +if (GETPOST('startdatemonth')) { + $startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int')); } -if (!empty($_POST['enddatemonth'])) { - $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); +if (GETPOST('enddatemonth')) { + $enddate = dol_mktime(23, 59, 59, GETPOST('enddatemonth', 'int'), GETPOST('enddateday', 'int'), GETPOST('enddateyear')); } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Product($db); $hookmanager->initHooks(array('marginproductlist')); + /* * View */ @@ -224,13 +225,31 @@ $sql .= $db->order($sortfield, $sortorder); // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); +$param = '&id='.((int) $id); +if (GETPOST('startdatemonth', 'int')) { + $param .= '&startdateyear='.GETPOST('startdateyear', 'int'); + $param .= '&startdatemonth='.GETPOST('startdatemonth', 'int'); + $param .= '&startdateday='.GETPOST('startdateday', 'int'); +} +if (GETPOST('enddatemonth', 'int')) { + $param .= '&enddateyear='.GETPOST('enddateyear', 'int'); + $param .= '&enddatemonth='.GETPOST('enddatemonth', 'int'); + $param .= '&enddateday='.GETPOST('enddateday', 'int'); +} +$listofcateg = GETPOST('categories', 'array:int'); +if (is_array($listofcateg)) { + foreach ($listofcateg as $val) { + $param .= '&categories[]='.$val; + } +} + dol_syslog('margin::productMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&id=".$id, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); + print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); //var_dump($conf->global->MARGIN_TYPE); if ($conf->global->MARGIN_TYPE == "1") { @@ -247,20 +266,20 @@ if ($result) { print ''; if ($id > 0) { - print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&id=".$id, '', $sortfield, $sortorder); - print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$id, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder, 'center '); } else { - print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&id=".$id, '', $sortfield, $sortorder); + print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); } - print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "product_qty", "", "&id=".$id, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$id, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&id=".$id, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&id=".$id, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "product_qty", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { - print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&id=".$id, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } if (!empty($conf->global->DISPLAY_MARK_RATES)) { - print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&id=".$id, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } print "\n"; From d452d225b6f1cf1d9eca7b6ee6bd0926e14570af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Sep 2022 09:24:19 +0200 Subject: [PATCH 0290/1289] FIX support of array parameters in "add to bookmark" feature. --- htdocs/bookmarks/bookmarks.lib.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 54bd7a41282..26d834fb5d9 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -42,8 +42,12 @@ function printDropdownBookmarksList() if (!empty($_SERVER["QUERY_STRING"])) { if (is_array($_GET)) { foreach ($_GET as $key => $val) { - if ($val != '') { - $url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); + if (is_array($val)) { + foreach ($val as $tmpsubval) { + $url_param[] = http_build_query(array(dol_escape_htmltag($key).'[]' => dol_escape_htmltag($tmpsubval))); + } + } elseif ($val != '') { + $url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); } } } @@ -61,10 +65,11 @@ function printDropdownBookmarksList() if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var)) && $val != '' && !array_key_exists($key, $url_param)) { - $url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); + $url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); } } } + $url .= ($tmpurl ? '?'.$tmpurl : ''); if (!empty($url_param)) { $url .= '&'.implode('&', $url_param); From e56362a5debb1c162668d4fb69711dcb9e31973e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Sep 2022 09:37:57 +0200 Subject: [PATCH 0291/1289] FIX filters lost when sorting on customerMargins --- htdocs/margin/customerMargins.php | 54 ++++++++++++++++++++++--------- htdocs/margin/productMargins.php | 3 +- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 290a94908c0..e5f21b5095f 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -43,8 +43,6 @@ $result = restrictedArea($user, 'societe', '', ''); $result = restrictedArea($user, 'margins'); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -64,18 +62,18 @@ if (!$sortorder) { } $startdate = $enddate = ''; - -if (!empty($_POST['startdatemonth'])) { - $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); +if (GETPOST('startdatemonth')) { + $startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int')); } -if (!empty($_POST['enddatemonth'])) { - $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); +if (GETPOST('enddatemonth')) { + $enddate = dol_mktime(23, 59, 59, GETPOST('enddatemonth', 'int'), GETPOST('enddateday', 'int'), GETPOST('enddateyear')); } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Societe($db); $hookmanager->initHooks(array('margincustomerlist')); + /* * View */ @@ -188,7 +186,7 @@ print ''; // Total Margin print ''; // Margin Rate @@ -271,6 +269,30 @@ $sql .= $db->order($sortfield, $sortorder); // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); +$param = '&socid='.((int) $socid); +if (GETPOST('startdatemonth', 'int')) { + $param .= '&startdateyear='.GETPOST('startdateyear', 'int'); + $param .= '&startdatemonth='.GETPOST('startdatemonth', 'int'); + $param .= '&startdateday='.GETPOST('startdateday', 'int'); +} +if (GETPOST('enddatemonth', 'int')) { + $param .= '&enddateyear='.GETPOST('enddateyear', 'int'); + $param .= '&enddatemonth='.GETPOST('enddatemonth', 'int'); + $param .= '&enddateday='.GETPOST('enddateday', 'int'); +} +$listofproducts = GETPOST('products', 'array:int'); +if (is_array($listofproducts)) { + foreach ($listofproducts as $val) { + $param .= '&products[]='.$val; + } +} +$listofcateg = GETPOST('categories', 'array:int'); +if (is_array($listofcateg)) { + foreach ($listofcateg as $val) { + $param .= '&categories[]='.$val; + } +} + dol_syslog('margin::customerMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -293,19 +315,19 @@ if ($result) { print ''; if (!empty($client)) { - print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&socid=".$socid, '', $sortfield, $sortorder); - print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&socid=".$socid, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center"', $sortfield, $sortorder); } else { - print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder); + print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); } - print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder); if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { - print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); } if (!empty($conf->global->DISPLAY_MARK_RATES)) { - print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder); } print "\n"; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index a47ec246aaf..48e0d50cd4c 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -73,7 +73,6 @@ if (!$sortfield) { } $startdate = $enddate = ''; - if (GETPOST('startdatemonth')) { $startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int')); } @@ -150,7 +149,7 @@ print '
'.$langs->trans("TotalMargin").''; -print ''; // set by jquery (see below) +print ' '.$langs->getCurrencySymbol($conf->currency).''; // set by jquery (see below) print '
'; // Total Margin print ''; // Margin Rate From 39863897b776eeeb343596f81e86fc2dcf81c66f Mon Sep 17 00:00:00 2001 From: rsanjoseo Date: Sun, 18 Sep 2022 11:30:41 +0200 Subject: [PATCH 0292/1289] Add a new tab with php errors and warnings to the debug bar --- .../class/DataCollector/DolPhpCollector.php | 168 ++++++++++++++++++ htdocs/debugbar/class/DebugBar.php | 2 + 2 files changed, 170 insertions(+) create mode 100644 htdocs/debugbar/class/DataCollector/DolPhpCollector.php diff --git a/htdocs/debugbar/class/DataCollector/DolPhpCollector.php b/htdocs/debugbar/class/DataCollector/DolPhpCollector.php new file mode 100644 index 00000000000..3d6536bd258 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolPhpCollector.php @@ -0,0 +1,168 @@ +name = $name; + set_error_handler([$this, 'errorHandler'], E_ALL); + } + + /** + * Called by the DebugBar when data needs to be collected. + * + * @return array Collected data. + */ + public function collect() + { + $messages = $this->getMessages(); + return [ + 'count' => count($messages), + 'messages' => $messages, + ]; + } + + /** + * Returns a list of messages ordered by their timestamp. + * + * @return array A list of messages ordered by time. + */ + public function getMessages() + { + $messages = $this->messages; + + usort($messages, function ($itemA, $itemB) { + if ($itemA['time'] === $itemB['time']) { + return 0; + } + return $itemA['time'] < $itemB['time'] ? -1 : 1; + }); + + return $messages; + } + + /** + * Returns a hash where keys are control names and their values an array of options as defined in + * {@see DebugBar\JavascriptRenderer::addControl()} + * + * @return array Needed details to render the widget. + */ + public function getWidgets() + { + $name = $this->getName(); + return [ + $name => [ + 'icon' => 'list', + 'widget' => 'PhpDebugBar.Widgets.MessagesWidget', + 'map' => "$name.messages", + 'default' => '[]', + ], + "$name:badge" => [ + 'map' => "$name.count", + 'default' => 'null', + ], + ]; + } + + /** + * Returns the unique name of the collector. + * + * @return string The widget name. + */ + public function getName() + { + return $this->name; + } + + /** + * Exception error handler. Called from constructor with set_error_handler to add all details. + * + * @param int $severity Error type. + * @param string $message Message of error. + * @param string $fileName File where error is generated. + * @param int $line Line number where error is generated. + * + * @return void + */ + public function errorHandler($severity, $message, $fileName, $line) + { + for ($i = 0; $i < 15; $i++) { + if ($type = $severity & (2 ** $i)) { + $label = $this->friendlyErrorType($type); + $this->messages[] = [ + 'message' => $message . ' (' . $fileName . ':' . $line . ')', + 'message_html' => null, + 'is_string' => true, + 'label' => $label, + 'time' => microtime(true), + ]; + } + } + } + + /** + * Return error name from error code. + * + * @info http://php.net/manual/es/errorfunc.constants.php + * + * @param int $type Error code. + * + * @return string Error name. + */ + private function friendlyErrorType($type) + { + $errors = [ + E_ERROR => 'ERROR', + E_WARNING => 'WARNING', + E_PARSE => 'PARSE', + E_NOTICE => 'NOTICE', + E_CORE_ERROR => 'CORE_ERROR', + E_CORE_WARNING => 'CORE_WARNING', + E_COMPILE_ERROR => 'COMPILE_ERROR', + E_COMPILE_WARNING => 'COMPILE_WARNING', + E_USER_ERROR => 'USER_ERROR', + E_USER_WARNING => 'USER_WARNING', + E_USER_NOTICE => 'USER_NOTICE', + E_STRICT => 'STRICT', + E_RECOVERABLE_ERROR => 'RECOVERABLE_ERROR', + E_DEPRECATED => 'DEPRECATED', + E_USER_DEPRECATED => 'USER_DEPRECATED', + ]; + + $result = ''; + if (isset($errors[$type])) { + $result = $errors[$type]; + } + + return $result; + } +} diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php index af824a64392..b2ec0f17bf0 100644 --- a/htdocs/debugbar/class/DebugBar.php +++ b/htdocs/debugbar/class/DebugBar.php @@ -10,6 +10,7 @@ dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php'); +dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php'); dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php'); @@ -36,6 +37,7 @@ class DolibarrDebugBar extends DebugBar $this->addCollector(new DolRequestDataCollector()); //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose $this->addCollector(new DolTimeDataCollector()); + $this->addCollector(new PhpCollector()); $this->addCollector(new DolMemoryCollector()); //$this->addCollector(new DolExceptionsCollector()); $this->addCollector(new DolQueryCollector()); From 345864b10db3b5659b7e38104ece62d7a022cf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 18 Sep 2022 20:38:14 +0200 Subject: [PATCH 0293/1289] add badge in propal admin --- htdocs/core/lib/propal.lib.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 71391f2e499..9a28f2e331f 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -122,7 +122,11 @@ function propal_prepare_head($object) */ function propal_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('propal'); + $extrafields->fetch_name_optionals_label('propaldet'); $h = 0; $head = array(); @@ -140,11 +144,19 @@ function propal_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['propal']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['propaldet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; From 29bb7505cc91c5ccc86155b36ac6a3a6c6c1050e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 18 Sep 2022 20:50:15 +0200 Subject: [PATCH 0294/1289] add badge in product admin --- htdocs/core/lib/product.lib.php | 32 +++++++++++++++++++++++--------- htdocs/core/lib/project.lib.php | 23 +++++++++++++++++------ htdocs/core/lib/propal.lib.php | 6 +++--- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index b5056c2cce3..393a2f618a0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/core/lib/product.lib.php - * \brief Ensemble de fonctions de base pour le module produit et service - * \ingroup product + * \file htdocs/core/lib/product.lib.php + * \brief Ensemble de fonctions de base pour le module produit et service + * \ingroup product */ /** @@ -279,7 +279,11 @@ function productlot_prepare_head($object) */ function product_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('product'); + $extrafields->fetch_name_optionals_label('product_fournisseur_price'); $h = 0; $head = array(); @@ -306,11 +310,19 @@ function product_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['product']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'; $head[$h][1] = $langs->trans("ProductSupplierExtraFields"); + $nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'supplierAttributes'; $h++; @@ -322,9 +334,9 @@ function product_admin_prepare_head() /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object informations. * - * @return array head array with tabs + * @return array head array with tabs */ function product_lot_admin_prepare_head() { @@ -556,11 +568,11 @@ function show_stats_for_company($product, $socid) } // MO - if (!empty($conf->mrp->enabled) && $user->rights->mrp->read) { + if (!empty($conf->mrp->enabled) && !empty($user->rights->mrp->read)) { $nblines++; $ret = $product->load_stats_mo($socid); if ($ret < 0) { - setEventMessage($product->error, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } $langs->load("mrp"); print '"; // Percentage of month - print ''; + print ''; if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) { print ''; From 240990c022908a6912ff0e57b5e611370c7d1727 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 17:41:58 +0200 Subject: [PATCH 0301/1289] Update oauth.php --- htdocs/admin/oauth.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 5ea646e0511..77a187d2cde 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -228,6 +228,26 @@ if (count($listinsetup) > 0) { print ''; print ''; + if ($supported) { + $redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php'; + print ''; + print ''; + print ''; + + if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { + print ''; + print ''; + print ''; + } + } else { + print ''; + print ''; + print ''; + print ''; + } + // Api Id print ''; print ''; From 2b9b6d6789237c89eb238f45388a13ffff318e8f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 19 Sep 2022 15:46:42 +0000 Subject: [PATCH 0302/1289] Fixing style errors. --- htdocs/admin/oauth.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 77a187d2cde..e98bb9a4fde 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -247,7 +247,7 @@ if (count($listinsetup) > 0) { print ''; print ''; } - + // Api Id print ''; print ''; @@ -269,25 +269,25 @@ if (count($listinsetup) > 0) { print ''; print ''; } else { - $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes'])); - $currentscopes = explode(',', getDolGlobalString($key[4])); - $scopestodispay = array(); - foreach ($availablescopes as $keyscope => $valscope) { - if (in_array($keyscope, $currentscopes)) { - $scopestodispay[$keyscope] = 1; - } else { - $scopestodispay[$keyscope] = 0; - } - } - // Api Scope - print ''; - print ''; - print ''; + $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes'])); + $currentscopes = explode(',', getDolGlobalString($key[4])); + $scopestodispay = array(); + foreach ($availablescopes as $keyscope => $valscope) { + if (in_array($keyscope, $currentscopes)) { + $scopestodispay[$keyscope] = 1; + } else { + $scopestodispay[$keyscope] = 0; + } + } + // Api Scope + print ''; + print ''; + print ''; } } else { print ''; From f3f3b952e921f05b24c2b0e45f9923c6b8cc6455 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 18:57:39 +0200 Subject: [PATCH 0303/1289] Fix label --- htdocs/projet/list.php | 67 ++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index eaf9c5022a3..a729112353f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -70,8 +70,8 @@ if (!$user->rights->projet->lire) { $diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", "aZ09comma"); -$sortorder = GETPOST("sortorder", 'aZ09comma'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters @@ -224,7 +224,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -349,13 +350,22 @@ if (empty($reshook)) { * View */ -$companystatic = new Societe($db); $form = new Form($db); + +$companystatic = new Societe($db); $formother = new FormOther($db); $formproject = new FormProjets($db); $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; -$title = $langs->trans("Projects"); +$title = $langs->trans("LeadsOrProjects"); +if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + $title = $langs->trans("Projects"); +} +if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + $title = $langs->trans("Leads"); +} +$morejs = array(); +$morecss = array(); // Get list of project id allowed to user (in a string list separated by comma) @@ -863,7 +873,14 @@ print '
'.$langs->trans("TotalMargin").''; -print ''; // set by jquery (see below) +print ' '.$langs->getCurrencySymbol($conf->currency).''; // set by jquery (see below) print '
'; @@ -585,7 +597,9 @@ function show_stats_for_company($product, $socid) } $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } print $hookmanager->resPrint; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 47fb9b6f186..6c4dbeffd8a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/core/lib/project.lib.php - * \brief Functions used by project module - * \ingroup project + * \file htdocs/core/lib/project.lib.php + * \brief Functions used by project module + * \ingroup project */ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -487,11 +487,14 @@ function project_timesheet_prepare_head($mode, $fuser = null) */ function project_admin_prepare_head() { - global $langs, $conf, $user; - $h = 0; - $head = array(); + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('projet'); + $extrafields->fetch_name_optionals_label('projet_task'); $h = 0; + $head = array(); $head[$h][0] = DOL_URL_ROOT."/projet/admin/project.php"; $head[$h][1] = $langs->trans("Projects"); @@ -502,11 +505,19 @@ function project_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT."/projet/admin/project_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFieldsProject"); + $nbExtrafields = $extrafields->attributes['projet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); + $nbExtrafields = $extrafields->attributes['projet_task']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_task'; $h++; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 9a28f2e331f..06fae0dd81d 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/core/lib/propal.lib.php - * \brief Ensemble de fonctions de base pour le module propal - * \ingroup propal + * \file htdocs/core/lib/propal.lib.php + * \brief Ensemble de fonctions de base pour le module propal + * \ingroup propal */ /** From 76ecf1d35a4f4da10fb9166c4763c434c675f43a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 19 Sep 2022 08:54:45 +0200 Subject: [PATCH 0295/1289] NEW Bank - Add salaries & vat in tab planned entries --- htdocs/compta/bank/treso.php | 50 +++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 0d76b40a3e2..14e07d1ea14 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -4,6 +4,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2015 Marcos García + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,13 +29,16 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'bills', 'companies')); +$langs->loadLangs(array('banks', 'bills', 'categories', 'companies', 'salaries')); // Security check if (GETPOSTISSET("account") || GETPOSTISSET("ref")) { @@ -58,9 +62,12 @@ $hookmanager->initHooks(array('banktreso', 'globalcard')); * View */ $societestatic = new Societe($db); +$userstatic = new User($db); $facturestatic = new Facture($db); $facturefournstatic = new FactureFournisseur($db); $socialcontribstatic = new ChargeSociales($db); +$salarystatic = new Salary($db); +$vatstatic = new TVA($db); $form = new Form($db); @@ -133,6 +140,27 @@ if (GETPOST("account") || GETPOST("ref")) { $sql .= " ORDER BY dlr ASC"; $sqls[] = $sql; + // Salaries + $sql = " SELECT 'salary' as family, sa.rowid as objid, sa.label as ref, (-1*sa.amount) as total_ttc, sa.dateep as dlr,"; + $sql .= " s.rowid as socid, CONCAT(s.firstname, ' ', s.lastname) as name, 0 as fournisseur"; + $sql .= " FROM ".MAIN_DB_PREFIX."salary as sa"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as s ON sa.fk_user = s.rowid"; + $sql .= " WHERE sa.entity = ".$conf->entity; + $sql .= " AND sa.paye = 0"; // Not paid + $sql .= " AND (sa.fk_account IN (0, ".$object->id.") OR sa.fk_account IS NULL)"; // Id bank account of salary + $sql .= " ORDER BY dlr ASC"; + $sqls[] = $sql; + + // VAT + $sql = " SELECT 'vat' as family, t.rowid as objid, t.label as ref, (-1*t.amount) as total_ttc, t.datev as dlr,"; + $sql .= " 0 as socid, 'noname' as name, 0 as fournisseur"; + $sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql .= " WHERE t.entity = ".$conf->entity; + $sql .= " AND t.paye = 0"; // Not paid + $sql .= " AND (t.fk_account IN (-1, 0, ".$object->id.") OR t.fk_account IS NULL)"; // Id bank account of vat + $sql .= " ORDER BY dlr ASC"; + $sqls[] = $sql; + // others sql $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreSQL', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -266,6 +294,26 @@ if (GETPOST("account") || GETPOST("ref")) { $totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done } + if ($tmpobj->family == 'salary') { + $salarystatic->ref = $tmpobj->ref; + $salarystatic->id = $tmpobj->objid; + $salarystatic->label = $langs->trans("SalaryPayment"); + $ref = $salarystatic->getNomUrl(1, ''); + + $userstatic->id = $tmpobj->socid; + $userstatic->name = $tmpobj->name; + $refcomp = $userstatic->getNomUrl(1); + + $totalpayment = -1 * $salarystatic->getSommePaiement(); // Payment already done + } + if ($tmpobj->family == 'vat') { + $vatstatic->ref = $tmpobj->ref; + $vatstatic->id = $tmpobj->objid; + $vatstatic->type = $tmpobj->type; + $ref = $vatstatic->getNomUrl(1, ''); + + $totalpayment = -1 * $vatstatic->getSommePaiement(); // Payment already done + } $parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook From d103b592aa4229e6e8f98ae340182b22573dd37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Sep 2022 09:58:38 +0200 Subject: [PATCH 0296/1289] Update modWebhook.class.php --- htdocs/core/modules/modWebhook.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index fd7f658bd48..ef4bced304d 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -2,7 +2,6 @@ /* Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2018-2019 Nicolas ZABOURI * Copyright (C) 2019-2020 Frédéric France - * Copyright (C) 2022 SuperAdmin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,10 +66,6 @@ class modWebhook extends DolibarrModules // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "WebhookDescription"; - // Author - $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; - // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'development'; // Url to the file with your last numberversion of this module From cc99ba0114cda42448fcc3a0780494e675882118 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 12:00:43 +0200 Subject: [PATCH 0297/1289] FIX extrafields with value '0' was '' --- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 3db65e198c5..baf13f77c67 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -101,7 +101,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l if ($action == 'edit_extras') { $value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]); } else { - $value = (!empty($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : ''); + $value = (isset($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : ''); //var_dump($tmpkeyextra.' - '.$value); } From 8221e4c4bdd53a3c20e3a2d2656c1ba8e00b6abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 19 Sep 2022 14:16:23 +0200 Subject: [PATCH 0298/1289] wip --- htdocs/modulebuilder/template/lib/mymodule.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index ab8a647efe4..0ebae6eb74f 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -30,6 +30,10 @@ function mymoduleAdminPrepareHead() { global $langs, $conf; + // global $db; + // $extrafields = new ExtraFields($db); + // $extrafields->fetch_name_optionals_label('myobject'); + $langs->load("mymodule@mymodule"); $h = 0; @@ -43,6 +47,10 @@ function mymoduleAdminPrepareHead() /* $head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' ' . $nbExtrafields . ''; + } $head[$h][2] = 'myobject_extrafields'; $h++; */ From 89080112520233c3c3df0ef241c884c45d159348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Mon, 19 Sep 2022 16:54:12 +0200 Subject: [PATCH 0299/1289] this should be cleaned when we click on the eraser --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index dc9a5c04b6e..db5182d0a4d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1408,7 +1408,7 @@ if ($action == 'create') { $deliverableQty = GETPOST($inputName, 'int'); } - print ''; + print ''; print ''; } else { if (!empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { From 7d7a9597c1acb36790fb051b6d8f764ce08aa652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 17:23:38 +0200 Subject: [PATCH 0300/1289] Fix regression --- htdocs/compta/stats/index.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index a81c732017f..9d4392c6b17 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -269,8 +269,8 @@ if ($result) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); - $cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0; - $cum[$obj->dm] = $obj->amount_ttc; + $cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount; + $cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc; if ($obj->amount_ttc) { $minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm); $maxyearmonth = max($maxyearmonth, $obj->dm); @@ -302,7 +302,11 @@ if ($modecompta == 'RECETTES-DEPENSES') { $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); - $cum[$obj->dm] += $obj->amount_ttc; + if (empty($cum[$obj->dm])) { + $cum[$obj->dm] = $obj->amount_ttc; + } else { + $cum[$obj->dm] += $obj->amount_ttc; + } if ($obj->amount_ttc) { $minyearmonth = ($minyearmonth ?min($minyearmonth, $obj->dm) : $obj->dm); $maxyearmonth = max($maxyearmonth, $obj->dm); @@ -404,12 +408,6 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $case = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage), "%Y-%m"); $caseprev = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage - 1), "%Y-%m"); - $total_ht[$annee]=0; - $total[$annee]=0; - $cum_ht[$case]=0; - $cum[$case]=0; - - if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output. if ($modecompta == 'CREANCES-DETTES') { // Value turnover of month w/o VAT @@ -452,7 +450,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { print "'; + print ''; //var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end); if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) { if ($annee_decalage > $minyear && $case <= $casenow) { @@ -482,7 +480,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { } } } - print ' 
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; + print '
'.$langs->trans("URLOfServiceForAuthorization").''; + print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''.$langs->trans("FeatureNotYetSupported").'
'.$langs->trans("FeatureNotYetSupported").'
'.$langs->trans("Scopes").''; - foreach ($scopestodispay as $scope => $val) { - print ''; - print ''; - } - print '
'.$langs->trans("Scopes").''; + foreach ($scopestodispay as $scope => $val) { + print ''; + print ''; + } + print '
'; +print ''; +// Action column +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} // Project ref if (!empty($arrayfields['p.ref']['checked'])) { print ''; } - print ''; if (!$i) { $totalarray['nbfield']++; } @@ -1534,14 +1557,26 @@ while ($i < min($num, $limit)) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + $db->free($resql); -$parameters = array('sql' => $sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +$parameters = array('arrayfields'=>$arrayfields, 'sql' => $sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; @@ -1130,8 +1147,12 @@ $totalarray = array( 'nbfield' => 0, 'val' => array(), ); -while ($i < min($num, $limit)) { +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } $object->id = $obj->id; $object->user_author_id = $obj->fk_user_creat; @@ -1512,15 +1533,17 @@ while ($i < min($num, $limit)) { } } // Action 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->id, $arrayofselected)) { - $selected = 1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print '
'.$langs->trans("NoRecordFound").'
\n"; print '
'; + print "
\n"; // End of page From fa58d35fa102cc835445dd25f44bc6e07faa6eea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 19:46:14 +0200 Subject: [PATCH 0304/1289] Clean code --- htdocs/admin/oauth.php | 4 ++-- htdocs/langs/en_US/oauth.lang | 4 ++-- htdocs/langs/fr_FR/oauth.lang | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index e98bb9a4fde..3a9b7daec2d 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -284,8 +284,8 @@ if (count($listinsetup) > 0) { print ''.$langs->trans("Scopes").''; print ''; foreach ($scopestodispay as $scope => $val) { - print ''; - print ''; + print ''; + print ''; } print ''; } diff --git a/htdocs/langs/en_US/oauth.lang b/htdocs/langs/en_US/oauth.lang index 661ecc45e4f..01bb08e38bd 100644 --- a/htdocs/langs/en_US/oauth.lang +++ b/htdocs/langs/en_US/oauth.lang @@ -36,5 +36,5 @@ OAUTH_SECRET=OAuth secret OAuthProviderAdded=OAuth provider added AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=An OAuth entry for this provider and label already exists URLOfServiceForAuthorization=URL provided by OAuth service for authentication -Scopes=Scopes -ScopeUndefined=Scope undefined (see previous tab) \ No newline at end of file +Scopes=Permissions (Scopes) +ScopeUndefined=Permissions (Scopes) undefined (see previous tab) \ No newline at end of file diff --git a/htdocs/langs/fr_FR/oauth.lang b/htdocs/langs/fr_FR/oauth.lang index 70b98cd0cd0..95cb2958bcb 100644 --- a/htdocs/langs/fr_FR/oauth.lang +++ b/htdocs/langs/fr_FR/oauth.lang @@ -34,5 +34,5 @@ OAUTH_ID=ID OAuth OAUTH_SECRET=Code secret OAuth OAuthProviderAdded=Fournisseur OAuth ajouté AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=Une entrée OAuth pour ce fournisseur et ce libellé existe déjà -ScopeUndefined=Portée non définie (voir onglet précédent) +ScopeUndefined=Permissions (Scopes) non définies (voir onglet précédent) Scopes=Portées \ No newline at end of file From 0adac294522727383731ce1c633a1b4a439171cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 19:55:18 +0200 Subject: [PATCH 0305/1289] Enhance look --- htdocs/admin/oauth.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 3a9b7daec2d..e50b4f772c6 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -178,7 +178,6 @@ if (count($listinsetup) > 0) { print ''; print '
'; - print ''; $i = 0; @@ -205,10 +204,12 @@ if (count($listinsetup) > 0) { $i++; - // Api Name + print '
'; + + // OAUTH service name $label = $langs->trans($keyforsupportedoauth2array); print ''; - print ''; print ''; } + + print '
'; + print ''; print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"'); if ($label == $keyforsupportedoauth2array) { print $supportedoauth2array[$keyforsupportedoauth2array]['name']; @@ -295,9 +296,12 @@ if (count($listinsetup) > 0) { print ''.$langs->trans("FeatureNotYetSupported").'
'."\n"; + + print '
'; } - print ''."\n"; print '
'; print $form->buttonsSaveCancel("Modify", ''); From 9c97613b39c088ac1028d25f0a80a6c294144e94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 20:24:54 +0200 Subject: [PATCH 0306/1289] FIX Bad backtopage and CSRF on link for ticket message --- htdocs/core/class/html.formticket.class.php | 3 +++ htdocs/main.inc.php | 2 +- htdocs/ticket/card.php | 4 +++- htdocs/ticket/messaging.php | 6 +++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 7c5007ddca2..176e2346c17 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -73,6 +73,8 @@ class FormTicket public $withfile; public $withfilereadonly; + public $backtopage; + public $ispublic; // To show information or not into public form public $withtitletopic; @@ -1363,6 +1365,7 @@ class FormTicket print ''; print ''; print ''; + print ''; foreach ($this->param as $key => $value) { print ''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 07bf2eeebc8..6fd72261bd1 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9abc2893cda..862ea805a72 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -57,7 +57,7 @@ $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); -$backtopage = GETPOST('$backtopage', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); $contactid = GETPOST('contactid', 'int'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -1521,6 +1521,8 @@ if ($action == 'create' || $action == 'presend') { $formticket->withsubstit = 1; $formticket->substit = $substitutionarray; + $formticket->backtopage = $backtopage; + $formticket->showMessageForm('100%'); print ''; } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 8d6b555229e..6c8438b5ac0 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -246,12 +246,12 @@ if (!empty($object->id)) { // Show link to add a message (if read and not closed) - $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init'; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); // Show link to add event (if read and not closed) - $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); From 6ddc32febcab1a56914a6d996f57c19bc6e83eb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 20:24:54 +0200 Subject: [PATCH 0307/1289] FIX Bad backtopage and CSRF on link for ticket message --- htdocs/core/class/html.formticket.class.php | 3 +++ htdocs/main.inc.php | 2 +- htdocs/ticket/card.php | 4 +++- htdocs/ticket/messaging.php | 6 +++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 32e6912b9ea..341c21e06f0 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -73,6 +73,8 @@ class FormTicket public $withfile; public $withfilereadonly; + public $backtopage; + public $ispublic; // To show information or not into public form public $withtitletopic; @@ -1358,6 +1360,7 @@ class FormTicket print ''; print ''; print ''; + print ''; foreach ($this->param as $key => $value) { print ''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e00c1887fa7..98de8c12e5c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -516,7 +516,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 589f7ca0590..7c79ab5a780 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -56,7 +56,7 @@ $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); -$backtopage = GETPOST('$backtopage', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); $contactid = GETPOST('contactid', 'int'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -1508,6 +1508,8 @@ if ($action == 'create' || $action == 'presend') { $formticket->withsubstit = 1; $formticket->substit = $substitutionarray; + $formticket->backtopage = $backtopage; + $formticket->showMessageForm('100%'); print ''; } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 91904a97dab..c774c4364e8 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -245,12 +245,12 @@ if (!empty($object->id)) { // Show link to add a message (if read and not closed) - $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init'; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); // Show link to add event (if read and not closed) - $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); From 574cba906feddd16daaf4fd94d4075dd8cc1d5e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 21:02:06 +0200 Subject: [PATCH 0308/1289] Look and feel v17 --- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 11 +++++++---- htdocs/core/lib/website2.lib.php | 2 +- htdocs/main.inc.php | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index e5b7512895c..1de16e0c764 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -163,7 +163,7 @@ class DolEditor $skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa } - $pluginstodisable = 'elementspath,save,flash'; + $pluginstodisable = 'elementspath,save,flash,div'; if (!empty($conf->dol_optimize_smallscreen)) { $pluginstodisable .= ',scayt,wsc,find,undo'; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 48e6eab2484..c098197cf5b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -822,7 +822,7 @@ class FormMail extends Form $out .= '
'; } } elseif (empty($this->withmaindocfile)) { - $out .= ''.$langs->trans("NoAttachedFiles").'
'; + //$out .= ''.$langs->trans("NoAttachedFiles").'
'; } if ($this->withfile == 2) { $maxfilesizearray = getMaxFileSizeArray(); @@ -837,7 +837,7 @@ class FormMail extends Form $out .= ''; } $out .= ' '; - $out .= ''; + $out .= ''; } } else { $out .= $this->withfile; @@ -947,10 +947,13 @@ class FormMail extends Form } $out .= ''; - $out .= ''; + $out .= ''; $out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody'); $out .= ''; - $out .= ''; + $out .= ''; + + $out .= ''; + $out .= ''; if ($this->withbodyreadonly) { $out .= nl2br($defaultmessage); $out .= ''; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6f532e078b3..74e6bc4d9e8 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -643,7 +643,7 @@ function showWebsiteTemplates(Website $website) print '
'; print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')'; - print '
ref.'&templateuserfile='.$subdir.'" class="button">'.$langs->trans("Load").''; + print '
ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").''; print ''; $i++; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6fd72261bd1..934782b89ec 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { From b1136f6115ff65e0df41b83dfc0e03abcbfb2951 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 21:10:07 +0200 Subject: [PATCH 0309/1289] NEW Save one click to select on delivery ack, on emails. --- htdocs/core/class/html.formmail.class.php | 7 ++++--- htdocs/langs/en_US/mails.lang | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c098197cf5b..83d3af6d9db 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1205,8 +1205,8 @@ class FormMail extends Form */ public function getHtmlForDeliveryreceipt() { - global $conf, $langs, $form; - $out = ''.$langs->trans("DeliveryReceipt").''; + global $conf, $langs; + $out = ''; if (!empty($this->withdeliveryreceiptreadonly)) { $out .= yn($this->withdeliveryreceipt); @@ -1227,7 +1227,8 @@ class FormMail extends Form if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_ORDER) && !empty($this->param['models']) && $this->param['models'] == 'order_supplier_send') { $defaultvaluefordeliveryreceipt = 1; } - $out .= $form->selectyesno('deliveryreceipt', (GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt), 1); + //$out .= $form->selectyesno('deliveryreceipt', (GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt), 1); + $out .= ''; } $out .= "\n"; return $out; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index b86ec3ebbd8..f83637c9c40 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -7,10 +7,10 @@ MailCard=EMailing card MailRecipients=Recipients MailRecipient=Recipient MailTitle=Description -MailFrom=Sender +MailFrom=From MailErrorsTo=Errors to MailReply=Reply to -MailTo=Receiver(s) +MailTo=To MailToUsers=To user(s) MailCC=Copy to MailToCCUsers=Copy to users(s) From 2fe6b4ecfcd2675a934975b2577ccfef4274991a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Sep 2022 21:13:57 +0200 Subject: [PATCH 0310/1289] NEW Can join several files by default on email form --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 83d3af6d9db..ff6147977f3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -831,7 +831,7 @@ class FormMail extends Form $out .= ''; // MAX_FILE_SIZE must precede the field type=file } // Can add other files - if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) { + if (empty($conf->global->FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE)) { $out .= ''; } else { $out .= ''; From 69fc6172f9372361467e2333d53c4ed4b4a0181a Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 20 Sep 2022 10:04:21 +0200 Subject: [PATCH 0311/1289] Error Trad --- htdocs/langs/fr_FR/mrp.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 1d17bc750ea..b9730cdb7f8 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,7 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) -BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travil est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" +BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travail est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" BOMProductsList=Liste des composants BOMServicesList=Liste des services GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. From 5690b7d59543cabe129887b1681827df23334a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 20 Sep 2022 10:14:11 +0200 Subject: [PATCH 0312/1289] add badges --- htdocs/core/lib/member.lib.php | 18 +++++++++++++++--- htdocs/core/lib/order.lib.php | 32 ++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 677d8cfdaef..64c0d429048 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -20,8 +20,8 @@ */ /** - * \file htdocs/core/lib/member.lib.php - * \brief Functions for module members + * \file htdocs/core/lib/member.lib.php + * \brief Functions for module members */ /** @@ -182,7 +182,11 @@ function member_type_prepare_head(AdherentType $object) */ function member_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('adherent'); + $extrafields->fetch_name_optionals_label('adherent_type'); $h = 0; $head = array(); @@ -205,11 +209,19 @@ function member_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsMember"); + $nbExtrafields = $extrafields->attributes['adherent']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member_type_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); + $nbExtrafields = $extrafields->attributes['adherent_type']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_type'; $h++; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 9128be56ea1..174ec36834b 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object) $h = 0; $head = array(); - if (isModEnabled('commande') && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][2] = 'order'; @@ -61,27 +61,27 @@ function commande_prepare_head(Commande $object) } if ((isModEnabled('expedition_bon') && $user->hasRight('expedition', 'lire')) - || ($conf->delivery_note->enabled && $user->hasRight('expedition', 'delivery', 'lire'))) { + || (isModEnabled('delivery_note') && $user->hasRight('expedition', 'delivery', 'lire'))) { $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $text = ''; - if ($conf->expedition_bon->enabled) { + if (isModEnabled('expedition_bon')) { $text .= $langs->trans("Shipments"); } - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) { + if (isModEnabled('expedition_bon') && isModEnabled('delivery_note')) { $text .= ' - '; } - if ($conf->delivery_note->enabled) { + if (isModEnabled('delivery_note')) { $text .= $langs->trans("Receivings"); } if ($nbShipments > 0 || $nbReceiption > 0) { $text .= ''.($nbShipments ? $nbShipments : 0); } - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) { + if (isModEnabled('expedition_bon') && isModEnabled('delivery_note') && ($nbShipments > 0 || $nbReceiption > 0)) { $text .= ' - '; } - if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) { + if (isModEnabled('expedition_bon') && isModEnabled('delivery_note') && ($nbShipments > 0 || $nbReceiption > 0)) { $text .= ($nbReceiption ? $nbReceiption : 0); } if ($nbShipments > 0 || $nbReceiption > 0) { @@ -145,7 +145,11 @@ function commande_prepare_head(Commande $object) */ function order_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('commande'); + $extrafields->fetch_name_optionals_label('commandedet'); $h = 0; $head = array(); @@ -159,11 +163,19 @@ function order_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/admin/order_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['commande']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/orderdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['commandedet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; @@ -186,7 +198,7 @@ function getCustomerOrderPieChart($socid = 0) $result = ''; - if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) { + if (!isModEnabled('commande') || !$user->hasRight('commande', 'lire')) { return ''; } @@ -276,7 +288,7 @@ function getCustomerOrderPieChart($socid = 0) $result .= "\n"; } } - if ($conf->use_javascript_ajax) { + if (!empty($conf->use_javascript_ajax)) { $result .= ''; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; From 5d32f0f6ac48527c0a59685f65270e854659a06f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 10:25:21 +0200 Subject: [PATCH 0313/1289] Code comment --- htdocs/core/login/functions_dolibarr.php | 4 ++-- htdocs/core/login/functions_ldap.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 5550584a3e7..e8c3ab38e46 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -124,8 +124,8 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes if ($passok) { $login = $obj->login; } else { - sleep(1); // Anti brut force protection dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE); + sleep(1); // Anti brut force protection. Must be same delay when login is not valid // Load translation files required by the page $langs->loadLangs(array('main', 'errors')); @@ -153,7 +153,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes } } else { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE); - sleep(1); + sleep(1); // Anti brut force protection. Must be same delay when password is not valid // Load translation files required by the page $langs->loadLangs(array('main', 'errors')); diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index a9e41b5a1ae..cd4ed16eae6 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -122,7 +122,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) print "DEBUG: User ".$usertotest." must change password
\n"; } $ldap->unbind(); - sleep(1); + sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid. $langs->load('ldap'); $_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN); return ''; @@ -245,7 +245,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) } if ($result == 1) { dol_syslog("functions_ldap::check_user_password_ldap Authentication KO bad user/password for '".$usertotest."'", LOG_NOTICE); - sleep(1); + sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid. // Load translation files required by the page $langs->loadLangs(array('main', 'other')); @@ -267,7 +267,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $ldap->ldapErrorText = ldap_error($ldap->connection); dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorCode." ".$ldap->ldapErrorText); } - sleep(1); // Anti brut force protection + sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid. // Load translation files required by the page $langs->loadLangs(array('main', 'other', 'errors')); From f273dd1711a09ae96d76c835fda20ebd86a876d3 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 20 Sep 2022 08:35:22 +0000 Subject: [PATCH 0314/1289] Fixing style errors. --- htdocs/core/class/cunits.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 7259592ed41..102bbbda652 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -429,7 +429,7 @@ class CUnits // extends CommonObject if ($mode == 'short_label') { return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$this->db->escape($unit_type).'"'); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, ' AND unit_type = "'. $this->db->escape($unit_type) .'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $this->db->escape($unit_type) .'"'); } return $code; From 8c7cb5b70bfccf98ed37db695eb2c6cd6b52800c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:15:15 +0200 Subject: [PATCH 0315/1289] FIX Warning php8 --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 4 ++-- .../mailings/thirdparties_services_expired.modules.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 14bb45f0687..c70416fec6e 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; - if ($user->rights->facture->lire) { + if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) { $sign = 1; - if ($object->type == Facture::TYPE_CREDIT_NOTE) { + if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) { $sign = -1; } if ($objectlink->statut != 3) { diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index b5dec9cbbe0..979782e61a5 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets { global $langs; - $s .= ''; if (count($this->arrayofproducts)) { $s .= ''; } else { @@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets } $s .= ''; $s .= ajax_combobox("filter_services_expired"); + return $s; } From 8aaefe8fbf77812eda38660931c60658e36b17d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:18:10 +0200 Subject: [PATCH 0316/1289] Fix warning --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe2d3691eac..9e488b2eafa 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8119,7 +8119,7 @@ abstract class CommonObject switch ($mode) { case "view": - $value = $this->array_options["options_".$key.$keysuffix]; // Value may be clean or formated later + $value = ((!empty($this->array_options) && array_key_exists("options_".$key.$keysuffix, $this->array_options)) ? $this->array_options["options_".$key.$keysuffix] : null); // Value may be cleaned or formated later break; case "create": case "edit": From dd4be90525ace20821ba05adb775df11d00f611f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 14:15:41 +0200 Subject: [PATCH 0317/1289] Fix warning --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 60ee78bbff5..6f08ea8f0ae 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -820,7 +820,7 @@ class Conf } // If we are in develop mode, we activate the option MAIN_SECURITY_CSRF_WITH_TOKEN to 1 if not already defined. - if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN) && $this->global->MAIN_FEATURES_LEVEL >= 2) { + if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN) && isset($this->global->MAIN_FEATURES_LEVEL) && $this->global->MAIN_FEATURES_LEVEL >= 2) { $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1; } From 1d9db98a11ca87c80251bd876925c63223527b67 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 20 Sep 2022 14:22:37 +0200 Subject: [PATCH 0318/1289] FIX Token Error : delete stock transfer --- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index b009ace7275..05133756e88 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -1027,7 +1027,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($object->status < $object::STATUS_TRANSFERED && $permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } /*else { From 83c82085c294d6cdb0bbf25b8c1cbb122afcb67b Mon Sep 17 00:00:00 2001 From: melina Date: Tue, 20 Sep 2022 14:29:28 +0200 Subject: [PATCH 0319/1289] Add url public interface --- htdocs/admin/ticket_public.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 8693da8deb2..4b5ca649ffc 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -53,8 +53,10 @@ $errors = array(); if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { if (GETPOST('value')) { $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', DOL_MAIN_URL_ROOT.'/public/ticket', 'chaine', 0, '', $conf->entity); } else { $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); } if (!($res > 0)) { $error++; @@ -137,8 +139,8 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha'); if (!empty($url_interface)) { $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity); - } else { - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); + } elseif ($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', DOL_MAIN_URL_ROOT.'/public/ticket', 'chaine', 0, '', $conf->entity); } if (!($res > 0)) { $error++; From 12ce79ab078d1663fc40a9846b1bfadd93321509 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 14:50:12 +0200 Subject: [PATCH 0320/1289] Fix rounding --- htdocs/core/lib/price.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 9be293a81ab..ca01317ad5d 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -372,16 +372,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // If rounding is not using base 10 (rare) if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { if ($price_base_type == 'HT') { - $result[0] = round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[0] = price2num(round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[2] = price2num($result[0] + $result[1] + $result[9] + $result[10], 'MT'); } else { - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[2] = price2num(round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[0] = price2num($result[2] - $result[1] - $result[9] - $result[10], 'MT'); } } From cb55095ca28628dac64171c03a4c9402bfac606d Mon Sep 17 00:00:00 2001 From: melina Date: Tue, 20 Sep 2022 14:52:34 +0200 Subject: [PATCH 0321/1289] Complete ticket public url --- htdocs/admin/ticket_public.php | 6 ++---- htdocs/ticket/class/ticket.class.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 4b5ca649ffc..8693da8deb2 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -53,10 +53,8 @@ $errors = array(); if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { if (GETPOST('value')) { $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', DOL_MAIN_URL_ROOT.'/public/ticket', 'chaine', 0, '', $conf->entity); } else { $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); } if (!($res > 0)) { $error++; @@ -139,8 +137,8 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha'); if (!empty($url_interface)) { $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity); - } elseif ($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { - $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', DOL_MAIN_URL_ROOT.'/public/ticket', 'chaine', 0, '', $conf->entity); + } else { + $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity); } if (!($res > 0)) { $error++; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4994faf5230..09ff042b41b 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1629,7 +1629,7 @@ class Ticket extends CommonObject $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$this->track_id; $tmpmessage .= "\n".$langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$this->track_id.''."\n"; } else { - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; $tmpmessage .= "\n".$langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$this->track_id.''."\n"; } From 5d39f7b6a33b4cb8808343c19ee702658b4c1884 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 15:20:17 +0200 Subject: [PATCH 0322/1289] Try to move to bionic --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92cd2059b15..7e900ebc77b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ # We use dist: xenial to have php 5.6+ available os: linux -dist: xenial -#dist: bionic +#dist: xenial +dist: bionic language: php @@ -20,7 +20,7 @@ services: addons: # Force postgresql to 9.4 (the oldest availablable on xenial) - postgresql: '9.4' + postgresql: '10' apt: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ @@ -74,6 +74,8 @@ notifications: before_install: - | + echo "Add ondrej PPA" + add-apt-repository -y ppa:ondrej/php echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini From 8a032a560a76c36921d84867e36eb28bd1b40695 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 20 Sep 2022 15:40:55 +0200 Subject: [PATCH 0323/1289] FIX --- htdocs/core/class/cunits.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 7259592ed41..477b6796a3c 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -427,9 +427,9 @@ class CUnits // extends CommonObject { if ($mode == 'short_label') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$this->db->escape($unit_type).'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, " AND unit_type = '".$this->db->escape($unit_type)."'"); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, ' AND unit_type = "'. $this->db->escape($unit_type) .'"'); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, " AND unit_type = '". $this->db->escape($unit_type) ."'"); } return $code; From c1e6ac6326764406aefaa13673a1bce1fe3d7a2d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 20 Sep 2022 13:47:24 +0000 Subject: [PATCH 0324/1289] Fixing style errors. --- htdocs/core/class/cunits.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 477b6796a3c..4afd59b5780 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -429,7 +429,7 @@ class CUnits // extends CommonObject if ($mode == 'short_label') { return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, " AND unit_type = '".$this->db->escape($unit_type)."'"); } elseif ($mode == 'code') { - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid',0, " AND unit_type = '". $this->db->escape($unit_type) ."'"); + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, " AND unit_type = '". $this->db->escape($unit_type) ."'"); } return $code; From 48f0a956822b73b50d6b4adabafda6f114e290ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 15:51:00 +0200 Subject: [PATCH 0325/1289] Try fix travis --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e900ebc77b..ebab9b0d017 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ addons: # Let's install Apache with. - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - - libapache2-mod-fastcgi + #- libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader @@ -72,6 +72,7 @@ notifications: on_failure: always use_notice: true + before_install: - | echo "Add ondrej PPA" @@ -240,6 +241,10 @@ before_script: - echo "Setting up Apache + FPM" + # setup link for php legacy + - sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php + # install apache web server + - sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | @@ -247,10 +252,11 @@ before_script: # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi - - sudo a2enmod rewrite actions fastcgi alias + - sudo a2enmod proxy_fcgi rewrite setenvif cgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - - sudo chown -R travis:travis /var/lib/apache2/fastcgi + #- sudo chown -R travis:travis /var/lib/apache2/fastcgi + # start php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf From 1162d858ddfca0f85d7408986265d767a37ac924 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:01:07 +0200 Subject: [PATCH 0326/1289] Try fix rounding --- htdocs/core/class/commonobject.class.php | 28 +++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 513717b56de..b9b09450642 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3529,10 +3529,11 @@ abstract class CommonObject if (!$resqlfix) { dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } @@ -3559,9 +3560,16 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); - // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* + // Now update global fields total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* $fieldht = 'total_ht'; $fieldtva = 'tva'; $fieldlocaltax1 = 'localtax1'; @@ -3592,11 +3600,11 @@ abstract class CommonObject if (empty($nodatabaseupdate)) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.' SET'; - $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht)).","; - $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva)).","; - $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1)).","; - $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2)).","; - $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc)); + $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).","; + $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).","; + $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1)); $sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1)); $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); From 802c06c15e744a70a38f63139145cbb65d389f9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:15:13 +0200 Subject: [PATCH 0327/1289] Try travis fix --- .travis.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebab9b0d017..21b010b3704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,19 @@ services: - mysql - postgresql + +before_install: +- | + echo "Add ondrej PPA" + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update + echo "Disabling Xdebug for composer" + export PHP_VERSION_NAME=$(phpenv version-name) + echo $PHP_VERSION_NAME + cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini + phpenv config-rm xdebug.ini + echo + addons: # Force postgresql to 9.4 (the oldest availablable on xenial) postgresql: '10' @@ -25,6 +38,7 @@ addons: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - pgdg-xenial + - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices # Let's install Apache with. @@ -73,16 +87,6 @@ notifications: use_notice: true -before_install: -- | - echo "Add ondrej PPA" - add-apt-repository -y ppa:ondrej/php - echo "Disabling Xdebug for composer" - export PHP_VERSION_NAME=$(phpenv version-name) - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini - phpenv config-rm xdebug.ini - echo - install: - | echo "Updating Composer" From 5afbfd0a0a96101a221bf9e1f80549ea6025f5d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:20:00 +0200 Subject: [PATCH 0328/1289] Try fix rounding --- htdocs/core/class/commonobject.class.php | 38 ++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4d09b8ae769..c9c7f096fd5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3494,10 +3494,11 @@ abstract class CommonObject if (!$resqlfix) { dol_print_error($this->db, 'Failed to update line'); } - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } @@ -3524,9 +3525,16 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); - // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* + // Now update global fields total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* $fieldht = 'total_ht'; $fieldtva = 'tva'; $fieldlocaltax1 = 'localtax1'; @@ -3557,16 +3565,16 @@ abstract class CommonObject if (empty($nodatabaseupdate)) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET'; - $sql .= " ".$fieldht." = ".price2num($this->total_ht).","; - $sql .= " ".$fieldtva." = ".price2num($this->total_tva).","; - $sql .= " ".$fieldlocaltax1." = ".price2num($this->total_localtax1).","; - $sql .= " ".$fieldlocaltax2." = ".price2num($this->total_localtax2).","; - $sql .= " ".$fieldttc." = ".price2num($this->total_ttc); - $sql .= ", multicurrency_total_ht = ".price2num($this->multicurrency_total_ht, 'MT', 1); - $sql .= ", multicurrency_total_tva = ".price2num($this->multicurrency_total_tva, 'MT', 1); - $sql .= ", multicurrency_total_ttc = ".price2num($this->multicurrency_total_ttc, 'MT', 1); - $sql .= ' WHERE rowid = '.$this->id; - + $sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).","; + $sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).","; + $sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).","; + $sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1)); + $sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1)); + $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); + $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); + $sql .= " WHERE rowid = ".((int) $this->id); + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); From bab7ff256fc862bb2b93a61c739c38ddc2199f7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:35:22 +0200 Subject: [PATCH 0329/1289] Try fix travis --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21b010b3704..28d8b7004b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,6 @@ services: before_install: - | - echo "Add ondrej PPA" - sudo add-apt-repository -y ppa:ondrej/php - sudo apt-get update echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) echo $PHP_VERSION_NAME @@ -47,6 +44,8 @@ addons: #- libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader + - php5.6 + - php5.6-pgsql env: global: From d39eca4d50e3deaffb5442baacb5527f038fc1ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 16:36:29 +0200 Subject: [PATCH 0330/1289] Fix phpcs --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c9c7f096fd5..5de1744a20d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3574,7 +3574,7 @@ abstract class CommonObject $sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1)); $sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1)); $sql .= " WHERE rowid = ".((int) $this->id); - + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); From ebc3df35ee47ed860e13f0edb97bd5c4c0aeabc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 17:27:32 +0200 Subject: [PATCH 0331/1289] Try fix --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 28d8b7004b7..9ddc5fe0379 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,11 +21,17 @@ services: before_install: - | + echo "Add ondrej PPA" + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update echo "Disabling Xdebug for composer" export PHP_VERSION_NAME=$(phpenv version-name) echo $PHP_VERSION_NAME + ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/ cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini phpenv config-rm xdebug.ini + phpenv rehash + phpenv config-add mysqli echo addons: @@ -46,6 +52,7 @@ addons: - pgloader - php5.6 - php5.6-pgsql + - php5.6-mysqli env: global: From 7efe0a9d5d71cdf9d4eff5a4477b968060384915 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 20 Sep 2022 17:35:46 +0200 Subject: [PATCH 0332/1289] intracommreport - module produit does not exist --- htdocs/intracommreport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 4cac639acf7..721ad15a2ce 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -123,7 +123,7 @@ $isInEEC = isInEEC($mysoc); $arrayfields = array( 'i.ref' => array('label'=>$langs->trans("Ref"), 'checked'=>1), 'i.label' => array('label'=>$langs->trans("Label"), 'checked'=>1), - 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->produit->enabled) && isModEnabled("service"))), + 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service"))), ); /* From 962018d5c74ba7f4361306c2649f30eb1b5244b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:14:34 +0200 Subject: [PATCH 0333/1289] Try fix --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ddc5fe0379..a456e92752e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -448,8 +448,8 @@ script: - | echo "Unit testing" - # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. - set -e + # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log and apache error.log file. + set +e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" @@ -461,6 +461,9 @@ after_script: ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log + echo "After script - Output last lines of apache error.log" + ls /var/log/apache2 + sudo tail -n 50 /var/log/apache2/travis_error_log after_success: - | @@ -469,14 +472,14 @@ after_success: after_failure: - | echo Failure detected, so we show samples of log to help diagnose - # This part of code is executed only if previous command that fails are enclosed with set +e - # Upgrade log files + # This part of code is executed only if the command that fails are enclosed with set +e + # Show upgrade log files for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` do echo "Debugging informations for file $ficlog" #cat $ficlog done - # Apache log file + # Show Apache log file echo "Debugging informations for file apache error.log" sudo cat /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then From 2869c39338642d435fde22b233781a671eab0d59 Mon Sep 17 00:00:00 2001 From: Thatoo Date: Tue, 20 Sep 2022 18:18:27 +0200 Subject: [PATCH 0334/1289] Add Line break to 'targetwithdetails' mode Add Line break to 'targetwithdetails' mode in pdf_build_address() function --- htdocs/core/lib/pdf.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b0c2250c49..f3129eabfe1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -538,7 +538,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1)); if (!empty($targetcontact->address)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; } else { $companytouseforaddress = $targetcompany; @@ -548,7 +548,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t $companytouseforaddress = $targetcontact->thirdparty; } - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n"; } // Country if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { @@ -595,7 +595,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t } } else { if (is_object($targetcompany)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; // Country if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) { $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); From 5c79a7e33dbbeff1ca2938da96c3f14619716a31 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 20 Sep 2022 18:24:26 +0200 Subject: [PATCH 0335/1289] Fix dispatch product --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d495035b5f6..5a03082d9a9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2096,7 +2096,7 @@ class CommandeFournisseur extends CommonOrder if (!empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN) && $qty < 0) { $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch); } else { - $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode); + $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); } if ($result < 0) { From d37e1f61ba7b35afea5281458359f5cb0a9b416d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:42:43 +0200 Subject: [PATCH 0336/1289] Prepare for php 7.0 --- .travis.yml | 67 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 637ba35995b..167b88cdebd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ # We use dist: xenial to have php 5.6+ available os: linux -dist: xenial -#dist: bionic +#dist: xenial +dist: bionic language: php @@ -18,19 +18,34 @@ services: - mysql - postgresql + +before_install: +- | + echo "Add ondrej PPA" + sudo add-apt-repository -y ppa:ondrej/php + sudo apt-get update + echo "Disabling Xdebug for composer" + export PHP_VERSION_NAME=$(phpenv version-name) + echo $PHP_VERSION_NAME + ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/ + cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini + phpenv config-rm xdebug.ini + phpenv rehash + phpenv config-add mysqli + echo + addons: - # Force postgresql to 9.4 (the oldest availablable on xenial) - postgresql: '9.4' + # Force postgresql version + postgresql: '10' apt: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - pgdg-xenial + - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices # Let's install Apache with. - apache2 - # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - - libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader @@ -44,11 +59,11 @@ jobs: #allow_failures: #- php: nightly include: - - stage: PHP 5.6-7.4 + - stage: PHP 7.0-7.4 if: type = push - php: '5.6' + php: '7.0' env: DB=postgresql - - stage: PHP 5.6-7.4 + - stage: PHP 7.0-7.4 if: type = pull_request OR type = push php: '7.4.22' env: DB=mysql @@ -57,7 +72,7 @@ jobs: php: nightly env: DB=mysql - stage: PHP Dev - if: type = push AND branch = 15.0 + if: type = push AND branch = 17.0 php: nightly env: DB=mysql @@ -72,13 +87,6 @@ notifications: on_failure: always use_notice: true -before_install: -- | - echo "Disabling Xdebug for composer" - export PHP_VERSION_NAME=$(phpenv version-name) - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini - phpenv config-rm xdebug.ini - echo install: - | @@ -94,13 +102,6 @@ install: - | echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION" - if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then - composer -n require phpunit/phpunit ^5 \ - php-parallel-lint/php-parallel-lint ^1 \ - php-parallel-lint/php-console-highlighter ^0 \ - php-parallel-lint/php-var-dump-check ~0.4 \ - squizlabs/php_codesniffer ^3 - fi if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then composer -n require phpunit/phpunit ^6 \ php-parallel-lint/php-parallel-lint ^1 \ @@ -246,6 +247,10 @@ before_script: - echo "Setting up Apache + FPM" + # setup link for php legacy + - sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php + # install apache web server + - sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | @@ -253,10 +258,11 @@ before_script: # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi - - sudo a2enmod rewrite actions fastcgi alias + - sudo a2enmod proxy_fcgi rewrite setenvif cgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - - sudo chown -R travis:travis /var/lib/apache2/fastcgi + #- sudo chown -R travis:travis /var/lib/apache2/fastcgi + # start php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf @@ -471,6 +477,9 @@ after_script: ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log + echo "After script - Output last lines of apache error.log" + ls /var/log/apache2 + sudo tail -n 50 /var/log/apache2/travis_error_log after_success: - | @@ -479,14 +488,14 @@ after_success: after_failure: - | echo Failure detected, so we show samples of log to help diagnose - # This part of code is executed only if previous command that fails are enclosed with set +e - # Upgrade log files + # This part of code is executed only if the command that fails are enclosed with set +e + # Show upgrade log files for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` do echo "Debugging informations for file $ficlog" #cat $ficlog done - # Apache log file + # Show Apache log file echo "Debugging informations for file apache error.log" sudo cat /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then From 2664f1bce041b142fe56298b4b534cc65d42cc8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:45:17 +0200 Subject: [PATCH 0337/1289] Test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a456e92752e..5247b051e23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ before_install: cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini phpenv config-rm xdebug.ini phpenv rehash - phpenv config-add mysqli echo addons: @@ -53,6 +52,7 @@ addons: - php5.6 - php5.6-pgsql - php5.6-mysqli + - php5.6-xml env: global: From d922876c697a8736a128fbffdfdb7a373000b725 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 18:52:41 +0200 Subject: [PATCH 0338/1289] Fix travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 167b88cdebd..57977255396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ jobs: include: - stage: PHP 7.0-7.4 if: type = push - php: '7.0' + php: '7.1' env: DB=postgresql - stage: PHP 7.0-7.4 if: type = pull_request OR type = push From 14805813ab8a90d90d91dde3ef7777d4d21754c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 19:13:15 +0200 Subject: [PATCH 0339/1289] Try travis fix --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 57977255396..b87eb1f3c68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ before_install: cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini phpenv config-rm xdebug.ini phpenv rehash - phpenv config-add mysqli echo addons: @@ -48,7 +47,11 @@ addons: - apache2 # We need pgloader for import mysql database into pgsql - pgloader - + - php + - php-pgsql + - php-mysqli + - php-xml + env: global: # Set to true for very verbose output @@ -478,7 +481,7 @@ after_script: #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log echo "After script - Output last lines of apache error.log" - ls /var/log/apache2 + sudo ls /var/log/apache2 sudo tail -n 50 /var/log/apache2/travis_error_log after_success: @@ -497,7 +500,7 @@ after_failure: done # Show Apache log file echo "Debugging informations for file apache error.log" - sudo cat /var/log/apache2/travis_error_log + sudo tail -n 50 /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then # Dolibarr log file echo "Debugging informations for file dolibarr.log (latest 50 lines)" From 10aefeccfe8e7ba8c8ba679f8aa236e135b61ca0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 19:32:16 +0200 Subject: [PATCH 0340/1289] Test travis --- .travis.yml | 2 +- htdocs/install/check.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b87eb1f3c68..a9cf43d8376 100644 --- a/.travis.yml +++ b/.travis.yml @@ -468,7 +468,7 @@ script: - | echo "Unit testing" # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. - set -e + set +e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 1923204c272..c72885ef1ea 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -82,7 +82,7 @@ if (!empty($useragent)) { // Check PHP version min $arrayphpminversionerror = array(5, 6, 0); -$arrayphpminversionwarning = array(5, 6, 0); +$arrayphpminversionwarning = array(7, 0, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { // Minimum to use (error if lower) print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); $checksok = 0; // 0=error, 1=warning From af0c6c0600eb610a6476481265d898d3d5670f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 19:36:47 +0200 Subject: [PATCH 0341/1289] Try restore old travis script --- .travis.yml | 57 +++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5247b051e23..92cd2059b15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ # We use dist: xenial to have php 5.6+ available os: linux -#dist: xenial -dist: bionic +dist: xenial +#dist: bionic language: php @@ -18,41 +18,21 @@ services: - mysql - postgresql - -before_install: -- | - echo "Add ondrej PPA" - sudo add-apt-repository -y ppa:ondrej/php - sudo apt-get update - echo "Disabling Xdebug for composer" - export PHP_VERSION_NAME=$(phpenv version-name) - echo $PHP_VERSION_NAME - ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/ - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini - phpenv config-rm xdebug.ini - phpenv rehash - echo - addons: # Force postgresql to 9.4 (the oldest availablable on xenial) - postgresql: '10' + postgresql: '9.4' apt: sources: # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - pgdg-xenial - - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices # Let's install Apache with. - apache2 # mod_php is not supported by Travis. Add fcgi. We install FPM later on. - #- libapache2-mod-fastcgi + - libapache2-mod-fastcgi # We need pgloader for import mysql database into pgsql - pgloader - - php5.6 - - php5.6-pgsql - - php5.6-mysqli - - php5.6-xml env: global: @@ -92,6 +72,13 @@ notifications: on_failure: always use_notice: true +before_install: +- | + echo "Disabling Xdebug for composer" + export PHP_VERSION_NAME=$(phpenv version-name) + cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini + phpenv config-rm xdebug.ini + echo install: - | @@ -251,10 +238,6 @@ before_script: - echo "Setting up Apache + FPM" - # setup link for php legacy - - sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php - # install apache web server - - sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | @@ -262,11 +245,10 @@ before_script: # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi - - sudo a2enmod proxy_fcgi rewrite setenvif cgi alias + - sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - #- sudo chown -R travis:travis /var/lib/apache2/fastcgi - # start php-fpm + - sudo chown -R travis:travis /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf @@ -448,8 +430,8 @@ script: - | echo "Unit testing" - # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log and apache error.log file. - set +e + # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. + set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" @@ -461,9 +443,6 @@ after_script: ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log - echo "After script - Output last lines of apache error.log" - ls /var/log/apache2 - sudo tail -n 50 /var/log/apache2/travis_error_log after_success: - | @@ -472,14 +451,14 @@ after_success: after_failure: - | echo Failure detected, so we show samples of log to help diagnose - # This part of code is executed only if the command that fails are enclosed with set +e - # Show upgrade log files + # This part of code is executed only if previous command that fails are enclosed with set +e + # Upgrade log files for ficlog in `ls $TRAVIS_BUILD_DIR/*.log` do echo "Debugging informations for file $ficlog" #cat $ficlog done - # Show Apache log file + # Apache log file echo "Debugging informations for file apache error.log" sudo cat /var/log/apache2/travis_error_log if [ "$DEBUG" = true ]; then From 46011509bcf738d915b3fc8b434e04a6c73d111a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 19:39:46 +0200 Subject: [PATCH 0342/1289] Try travis fix --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9cf43d8376..9b37e36b598 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,9 +48,12 @@ addons: # We need pgloader for import mysql database into pgsql - pgloader - php - - php-pgsql - - php-mysqli - - php-xml + - php7.1-pgsql + - php7.1-mysqli + - php7.1-xml + - php8.1-pgsql + - php8.1-mysqli + - php8.1-xml env: global: From 70372a1938e13af2837b90aa6cb725eb6b79cb48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 20:51:45 +0200 Subject: [PATCH 0343/1289] Fix php 8 compatibility --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49a782e1264..679e28e2803 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,8 +9,8 @@ English Dolibarr ChangeLog For users: --------------- -NEW: PHP 8.1 compatibility: - Warning!! Application works correctly with PHP8 and 8.1 but you will experience a lot of PHP warnings into the PHP server +NEW: PHP 8.0 compatibility (with mysql): + Warning!! Application works correctly with PHP 8.0 but you will experience a lot of PHP warnings into the PHP server log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. NEW: #20292 Include German public holidays From 8f1ea59bc64dc83a0f201ffd5bcd24305795d9c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 21:13:51 +0200 Subject: [PATCH 0344/1289] Fix for travis and PHP 8.1 with PGSQL --- .travis.yml | 2 ++ htdocs/core/db/DoliDB.class.php | 2 +- htdocs/core/lib/functions.lib.php | 16 +++++++++++++++- test/phpunit/FunctionsLibTest.php | 25 +++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b37e36b598..2a9d6807876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,9 +51,11 @@ addons: - php7.1-pgsql - php7.1-mysqli - php7.1-xml + - php7.1-intl - php8.1-pgsql - php8.1-mysqli - php8.1-xml + - php8.1-intl env: global: diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index aae315ec992..a3367841481 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/db/Database.interface.php'; */ abstract class DoliDB implements Database { - /** @var bool|resource|SQLite3 Database handler */ + /** @var bool|resource|SQLite3|PgSql\connection Database handler */ public $db; /** @var string Database type */ public $type; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0009ba93240..59570bffeea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1164,7 +1164,17 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) function dol_clone($object, $native = 0) { if (empty($native)) { + $tmpsavdb = null; + if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { + $tmpsavdb = $object->db; + unset($object->db); // Such property can not be serialized when PgSql/Connection + } + $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields + + if ($tmpsavdb) { + $object->db = $tmpsavdb; + } } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } @@ -3723,6 +3733,8 @@ function isValidMXRecord($domain) return 0; } } + + // function idn_to_ascii or checkdnsrr does not exists return -1; } @@ -4957,7 +4969,9 @@ function dol_print_error($db = '', $error = '', $errors = null) // Return a http header with error code if possible if (!headers_sent()) { - top_httphead(); + if (function_exists('top_httphead')) { // In CLI context, the method does not exists + top_httphead(); + } http_response_code(500); } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 47de2cbebcc..0b6feb18903 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -29,6 +29,7 @@ global $conf,$user,$langs,$db; //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php'; +require_once dirname(__FILE__).'/../../htdocs/product/class/product.class.php'; if (! defined('NOREQUIREUSER')) { define('NOREQUIREUSER', '1'); @@ -166,6 +167,30 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase print __METHOD__."\n"; } + /** + * testDolClone + * + * @return void + */ + public function testDolClone() + { + $newproduct1 = new Product($this->savdb); + + print __METHOD__." this->savdb has type ".(is_resource($this->savdb->db) ? get_resource_type($this->savdb->db) : (is_object($this->savdb->db) ? 'object' : 'unknown'))."\n"; + print __METHOD__." newproduct1->db->db has type ".(is_resource($newproduct1->db->db) ? get_resource_type($newproduct1->db->db) : (is_object($newproduct1->db->db) ? 'object' : 'unknown'))."\n"; + $this->assertEquals($this->savdb->connected, 1, 'Savdb is connected'); + $this->assertNotNull($newproduct1->db->db, 'newproduct1->db is not null'); + + $newproductcloned1 = dol_clone($newproduct1); + + print __METHOD__." this->savdb has type ".(is_resource($this->savdb->db) ? get_resource_type($this->savdb->db) : (is_object($this->savdb->db) ? 'object' : 'unknown'))."\n"; + print __METHOD__." newproduct1->db->db has type ".(is_resource($newproduct1->db->db) ? get_resource_type($newproduct1->db->db) : (is_object($newproduct1->db->db) ? 'object' : 'unknown'))."\n"; + $this->assertEquals($this->savdb->connected, 1, 'Savdb is connected'); + $this->assertNotNull($newproduct1->db->db, 'newproduct1->db is not null'); + + //print __METHOD__." newproductcloned1->db must be null\n"; + //$this->assertNull($newproductcloned1->db, 'newproductcloned1->db is null'); + } /** * testNum2Alpha From 05e6cfa8c1b65b1f52d4aacb436dfbebc8bf5474 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 21:15:25 +0200 Subject: [PATCH 0345/1289] Fix compatibility with PHP 8.1 and Psotgresql --- htdocs/core/lib/functions.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6c69cadc96..d76e23facdc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1156,7 +1156,17 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) function dol_clone($object, $native = 0) { if (empty($native)) { + $tmpsavdb = null; + if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { + $tmpsavdb = $object->db; + unset($object->db); // Such property can not be serialized when PgSql/Connection + } + $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields + + if ($tmpsavdb) { + $object->db = $tmpsavdb; + } } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } From 2b3f6cc1739054975959c928b1e50dad4fe35505 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 21:15:25 +0200 Subject: [PATCH 0346/1289] Fix compatibility with PHP 8.1 and Psotgresql --- ChangeLog | 4 ++-- htdocs/core/lib/functions.lib.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 679e28e2803..bc27c016c2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,8 +9,8 @@ English Dolibarr ChangeLog For users: --------------- -NEW: PHP 8.0 compatibility (with mysql): - Warning!! Application works correctly with PHP 8.0 but you will experience a lot of PHP warnings into the PHP server +NEW: PHP 8.0 and 8.1 compatibility (with mysql): + Warning!! Application works correctly with PHP 8.0 and 8.1 but you will experience a lot of PHP warnings into the PHP server log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. NEW: #20292 Include German public holidays diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6c69cadc96..d76e23facdc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1156,7 +1156,17 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) function dol_clone($object, $native = 0) { if (empty($native)) { + $tmpsavdb = null; + if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { + $tmpsavdb = $object->db; + unset($object->db); // Such property can not be serialized when PgSql/Connection + } + $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields + + if ($tmpsavdb) { + $object->db = $tmpsavdb; + } } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } From 06e6fd1b133626b3f8ad39ac73266eea444363c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 21:32:56 +0200 Subject: [PATCH 0347/1289] Make travis script simpler --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a9d6807876..cc9787c8fc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,8 @@ # from Dolibarr GitHub repository. # For syntax, see https://docs.travis-ci.com/user/languages/php/ -# We use dist: xenial to have php 5.6+ available +# We use dist: bionic = 18.04 os: linux -#dist: xenial dist: bionic language: php @@ -38,8 +37,6 @@ addons: postgresql: '10' apt: sources: - # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ - - pgdg-xenial - sourceline: 'ppa:ondrej/php' packages: # We need a webserver to test the webservices From a470eb79a8b11b99272dfe8814bce5a70ae8894a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Sep 2022 05:00:13 +0200 Subject: [PATCH 0348/1289] Revert "FIX: Preview button position on documents list (case when the file is too long)" This reverts commit 88b5594af31f54bed54d0c89e61930f78c48404e. --- htdocs/core/class/html.formfile.class.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index aa887aa4743..2493c24e242 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -837,7 +837,6 @@ class FormFile // Show file name with link to download $out .= ''; - $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param, 'paddingright')."\n"; $out .= 'trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); - $out .= ''; + $out .= ''."\n"; + $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); $out .= ''; // Show file size @@ -1298,11 +1298,6 @@ class FormFile // File name print ''; - // Preview link - if (!$editline) { - print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity), 'paddingright') . "\n"; - } - // Show file name with link to download //print "XX".$file['name']; //$file['name'] must be utf8 print '\n"; @@ -2102,10 +2101,9 @@ class FormFile * @param string $relativepath Relative path of docs * @param integer $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file). Use a negative value to show a generic picto even if preview not available. * @param string $param More param on http links - * @param string $moreclass Add more class to class style * @return string $out Output string with HTML */ - public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '', $moreclass = '') + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '') { global $langs, $conf; @@ -2113,7 +2111,7 @@ class FormFile if ($conf->browser->layout != 'phone' && !empty($conf->use_javascript_ajax)) { $urladvancedpreview = getAdvancedPreviewUrl($modulepart, $relativepath, 1, $param); // Return if a file is qualified for preview. if (count($urladvancedpreview)) { - $out .= ''; + $out .= ''; //$out.= ''; if (empty($ruleforpicto)) { //$out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); From 36e1bfb2973d9c0d92677d3bb486f4cc26f99e06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 00:46:02 +0200 Subject: [PATCH 0349/1289] NEW Option PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT showing wh on PDF --- htdocs/core/lib/pdf.lib.php | 26 +++++++++++++++++ htdocs/expedition/card.php | 18 +++++++----- htdocs/expedition/class/expedition.class.php | 29 +++++++++++++++++-- .../class/expeditionlinebatch.class.php | 2 +- htdocs/langs/en_US/productbatch.lang | 1 + htdocs/langs/en_US/stocks.lang | 2 +- htdocs/langs/fr_FR/stocks.lang | 2 +- htdocs/product/class/productbatch.class.php | 5 ++-- .../class/productstockentrepot.class.php | 6 ---- 9 files changed, 70 insertions(+), 21 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b0c2250c49..b7209dd1db0 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1644,7 +1644,17 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, //print $libelleproduitservice; } + // Show information for lot if ($dbatch) { + // $object is a shipment. + //var_dump($object->lines[$i]->details_entrepot); // array from llx_expeditiondet (we can have seral lines for one fk_origin_line) + //var_dump($object->lines[$i]->detail_batch); // array from llx_expeditiondet_batch (each line with a lot is linked to llx_expeditiondet) + + include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + include_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; + $tmpwarehouse = new Entrepot($db); + $tmpproductbatch = new Productbatch($db); + $format = 'day'; foreach ($dbatch as $detail) { $dte = array(); @@ -1658,8 +1668,24 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch); } $dte[] = $outputlangs->transnoentitiesnoconv('printQty', $detail->qty); + + // Add also info of planned warehouse for lot + if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) { + $resproductbatch = $tmpproductbatch->fetch($detail->fk_origin_stock); + if ($resproductbatch > 0) { + $reswarehouse = $tmpwarehouse->fetch($tmpproductbatch->warehouseid); + if ($reswarehouse > 0) { + $dte[] = $tmpwarehouse->ref; + } + } + } + $libelleproduitservice .= "__N__ ".implode(" - ", $dte); } + } else { + if (getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) { + // TODO Show warehouse for shipment line without batch + } } // Now we convert \n into br diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 60b3695609d..e46fea6790b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -285,12 +285,13 @@ if (empty($reshook)) { $totalqty += $subtotalqty; } else { - // No detail were provided for lots, so if a qty was provided, we can show an error. + // No detail were provided for lots, so if a qty was provided, we can throw an error. if (GETPOST($qty)) { // We try to set an amount // Case we dont use the list of available qty for each warehouse/lot // GUI does not allow this yet - setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors'); + setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse").' ('.$langs->trans("Line").' '.GETPOST($idl, 'int').')', null, 'errors'); + $error++; } } } elseif (GETPOSTISSET($stockLocation)) { @@ -328,7 +329,7 @@ if (empty($reshook)) { //var_dump($batch_line[2]); - if ($totalqty > 0) { // There is at least one thing to ship + if ($totalqty > 0 && !$error) { // There is at least one thing to ship and no error for ($i = 0; $i < $num; $i++) { $qty = "qtyl".$i; if (!isset($batch_line[$i])) { @@ -388,7 +389,7 @@ if (empty($reshook)) { $error++; } } - } else { + } elseif (!$error) { $labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip"); if (!empty($conf->stock->enabled)) { $labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse"); @@ -1120,12 +1121,15 @@ if ($action == 'create') { $type = 1; } - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; // Product label if ($line->fk_product > 0) { // If predefined product - $product->fetch($line->fk_product); + $res = $product->fetch($line->fk_product); + if ($res < 0) { + dol_print_error($db, $product->error, $product->errors); + } $product->load_stock('warehouseopen'); // Load all $product->stock_warehouse[idwarehouse]->detail_batch //var_dump($product->stock_warehouse[1]); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b1a767e197d..6a674a770ec 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -771,7 +771,7 @@ class Expedition extends CommonObject // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. - // Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version) + // Note: ->fk_origin_stock = id into table llx_product_batch (may be renamed into llx_product_stock_batch in another version) $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock, '', 1); if ($result < 0) { $error++; @@ -965,8 +965,9 @@ class Expedition extends CommonObject } // If product need a batch number, we should not have called this function but addline_batch instead. + // If this happen, we may have a bug in card.php page if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { - $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH'; + $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$orderline->fk_product; // return -4; } @@ -2498,12 +2499,28 @@ class ExpeditionLigne extends CommonObjectLine */ public $table_element = 'expeditiondet'; + + /** + * Id of the line. Duplicate of $id. + * + * @var int + * @deprecated + */ + public $line_id; // deprecated + /** * @deprecated * @see $fk_origin_line */ public $origin_line_id; + /** + * Code of object line that is origin of the shipment line. + * + * @var string + */ + public $fk_origin; // Example: 'orderline' + /** * @var int ID */ @@ -2533,8 +2550,16 @@ class ExpeditionLigne extends CommonObjectLine * @var int Id of product */ public $fk_product; + + // detail of lot and qty = array(id in llx_expeditiondet_batch, fk_expeditiondet, batch, qty, fk_origin_stock) + // We can use this to know warehouse planned to be used for each lot. public $detail_batch; + // detail of warehouses and qty + // We can use this to know warehouse when there is no lot. + public $details_entrepot; + + /** * @var int Id of warehouse */ diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php index b2562734447..5d99d1c7a74 100644 --- a/htdocs/expedition/class/expeditionlinebatch.class.php +++ b/htdocs/expedition/class/expeditionlinebatch.class.php @@ -44,7 +44,7 @@ class ExpeditionLineBatch extends CommonObject public $qty; public $dluo_qty; // deprecated, use qty public $entrepot_id; - public $fk_origin_stock; + public $fk_origin_stock; // rowid in llx_product_batch table public $fk_expeditiondet; diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang index 4bd64f44577..a1039e05e62 100644 --- a/htdocs/langs/en_US/productbatch.lang +++ b/htdocs/langs/en_US/productbatch.lang @@ -17,6 +17,7 @@ printBatch=Lot/Serial: %s printEatby=Eat-by: %s printSellby=Sell-by: %s printQty=Qty: %d +printPlannedWarehouse=Warehouse: %s AddDispatchBatchLine=Add a line for Shelf Life dispatching WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, automatic stock decrease is forced to 'Decrease real stocks on shipping validation' and automatic increase mode is forced to 'Increase real stocks on manual dispatching into warehouses' and can't be edited. Other options can be defined as you want. ProductDoesNotUseBatchSerial=This product does not use lot/serial number diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 492cdd48864..5332b8123e0 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -235,7 +235,7 @@ StockIncrease=Stock increase StockDecrease=Stock decrease InventoryForASpecificWarehouse=Inventory for a specific warehouse InventoryForASpecificProduct=Inventory for a specific product -StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use +StockIsRequiredToChooseWhichLotToUse=An existing stock is required to be able to choose which lot to use ForceTo=Force to AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances) StockAtDatePastDesc=You can view here the stock (real stock) at a given date in the past diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index a0642c4c627..2b3559787d3 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -234,7 +234,7 @@ StockIncrease=Augmentation du stock StockDecrease=Diminution du stock InventoryForASpecificWarehouse=Inventaire pour un entrepôt spécifique InventoryForASpecificProduct=Inventaire pour un produit spécifique -StockIsRequiredToChooseWhichLotToUse=Le module Stock est requis pour choisir une lot +StockIsRequiredToChooseWhichLotToUse=Un stock existant est requis pour pouvoir choisir un lot ForceTo=Forcer à AlwaysShowFullArbo=Afficher l'arborescence complète de l'entrepôt sur la popup du lien entrepôt (Avertissement: cela peut réduire considérablement les performances) StockAtDatePastDesc=Vous pouvez voir ici le stock (stock réel) à une date donnée dans le passé diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index f42563ceb19..00d2dc80fee 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -136,7 +136,6 @@ class Productbatch extends CommonObject global $langs; $sql = "SELECT"; $sql .= " t.rowid,"; - $sql .= " t.tms,"; $sql .= " t.fk_product_stock,"; $sql .= " t.sellby as oldsellby,"; @@ -148,8 +147,8 @@ class Productbatch extends CommonObject $sql .= " w.fk_product,"; $sql .= " pl.eatby,"; $sql .= " pl.sellby"; - - $sql .= " FROM ".$this->db->prefix()."product_batch as t INNER JOIN ".$this->db->prefix()."product_stock w on t.fk_product_stock = w.rowid"; + $sql .= " FROM ".$this->db->prefix()."product_batch as t"; + $sql .= " INNER JOIN ".$this->db->prefix()."product_stock w on t.fk_product_stock = w.rowid"; // llx_product_stock is a parent table so this link does NOT generate duplicate record $sql .= " LEFT JOIN ".$this->db->prefix()."product_lot as pl on pl.fk_product = w.fk_product and pl.batch = t.batch"; $sql .= " WHERE t.rowid = ".((int) $id); diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 95da65cd540..a0310a16359 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -114,23 +114,17 @@ class ProductStockEntrepot extends CommonObject // Insert request $sql = 'INSERT INTO '.$this->db->prefix().$this->table_element.'('; - $sql .= 'fk_product,'; $sql .= 'fk_entrepot,'; $sql .= 'seuil_stock_alerte,'; $sql .= 'desiredstock,'; $sql .= 'import_key'; - - $sql .= ') VALUES ('; - $sql .= ' '.(!isset($this->fk_product) ? 'NULL' : $this->fk_product).','; $sql .= ' '.(!isset($this->fk_entrepot) ? 'NULL' : $this->fk_entrepot).','; $sql .= ' '.(!isset($this->seuil_stock_alerte) ? '0' : $this->seuil_stock_alerte).','; $sql .= ' '.(!isset($this->desiredstock) ? '0' : $this->desiredstock).','; $sql .= ' '.(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'"); - - $sql .= ')'; $this->db->begin(); From 1f2ad8efbf57a40852d22adb00054819e5ba9411 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 01:13:53 +0200 Subject: [PATCH 0350/1289] FIX API reception return error 500 --- htdocs/api/class/api.class.php | 8 ++++++++ htdocs/core/lib/functions2.lib.php | 2 +- htdocs/reception/class/reception.class.php | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 32d691400d6..6561355edbe 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -160,6 +160,8 @@ class DolibarrApi unset($object->statuts_short); unset($object->statuts_logo); unset($object->statuts_long); + unset($object->statutshorts); + unset($object->statutshort); unset($object->labelStatus); unset($object->labelStatusShort); @@ -181,6 +183,7 @@ class DolibarrApi unset($object->picto); unset($object->fieldsforcombobox); + unset($object->regeximgext); unset($object->skip_update_total); unset($object->context); @@ -256,6 +259,11 @@ class DolibarrApi if (!empty($object->thirdparty) && is_object($object->thirdparty)) { $this->_cleanObjectDatas($object->thirdparty); } + + if (!empty($object->product) && is_object($object->product)) { + $this->_cleanObjectDatas($object->product); + } + return $object; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index ac051fd92e0..9808fbb28b9 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2655,7 +2655,7 @@ function getModuleDirForApiClass($moduleobject) $moduledirforclass = 'fichinter'; } elseif ($moduleobject == 'mos') { $moduledirforclass = 'mrp'; - } elseif (in_array($moduleobject, array('products', 'expensereports', 'users', 'tickets', 'boms'))) { + } elseif (in_array($moduleobject, array('products', 'expensereports', 'users', 'tickets', 'boms', 'receptions'))) { $moduledirforclass = preg_replace('/s$/', '', $moduleobject); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 7244fdcb60b..e3434a9a298 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -456,8 +456,8 @@ class Reception extends CommonObject $this->brouillon = 1; } - $file = $conf->reception->dir_output."/".get_exdir($this->id, 2, 0, 0, $this, 'reception')."/".$this->id.".pdf"; - $this->pdf_filename = $file; + //$file = $conf->reception->dir_output."/".get_exdir(0, 0, 0, 1, $this, 'reception')."/".$this->id.".pdf"; + //$this->pdf_filename = $file; // Tracking url $this->getUrlTrackingStatus($obj->tracking_number); @@ -1177,6 +1177,8 @@ class Reception extends CommonObject $line = new CommandeFournisseurDispatch($this->db); $line->fetch($obj->rowid); + + // TODO Remove or keep this ? $line->fetch_product(); $sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent'; From e835b73e92720e0c8d7aa84850908c83e52a81d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 01:35:32 +0200 Subject: [PATCH 0351/1289] Travis use 7.1 - 8.1 php version --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc9787c8fc1..4334bbff429 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,13 +64,13 @@ jobs: #allow_failures: #- php: nightly include: - - stage: PHP 7.0-7.4 + - stage: PHP 7.0-8.1 if: type = push php: '7.1' env: DB=postgresql - - stage: PHP 7.0-7.4 + - stage: PHP 7.0-8.1 if: type = pull_request OR type = push - php: '7.4.22' + php: '8.1' env: DB=mysql - stage: PHP Dev if: type = push AND branch = develop @@ -122,7 +122,7 @@ install: squizlabs/php_codesniffer ^3 fi # phpunit 9 is required for php 8 - if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ From 8e61f77f4df34b6789c2f3f0c2f5f9f0af7f901b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:16:18 +0200 Subject: [PATCH 0352/1289] Fix warnings --- htdocs/install/inc.php | 2 +- htdocs/install/upgrade.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 657e9841100..c717d55850e 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -319,7 +319,7 @@ function conf($dolibarr_main_document_root) $conf->db->port = trim($dolibarr_main_db_port); $conf->db->name = trim($dolibarr_main_db_name); $conf->db->user = trim($dolibarr_main_db_user); - $conf->db->pass = trim($dolibarr_main_db_pass); + $conf->db->pass = (empty($dolibarr_main_db_pass) ? '' : trim($dolibarr_main_db_pass)); // Mysql driver support has been removed in favor of mysqli if ($conf->db->type == 'mysql') { diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 25dd1ee84fd..22ef26295aa 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -117,9 +117,9 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $error = 0; // If password is encoded, we decode it - if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { + if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; - if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) { + if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted From b69031e979016765f2b13916a70a82a0a97181bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:23:03 +0200 Subject: [PATCH 0353/1289] Fix php8.1 --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 73c527cb2eb..ae26b84baa5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1405,7 +1405,7 @@ class Adherent extends CommonObject $this->email = $obj->email; $this->url = $obj->url; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->photo = $obj->photo; $this->statut = $obj->statut; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0a38c1294d4..638022b855a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1068,7 +1068,7 @@ class Contact extends CommonObject $this->phone_mobile = trim($obj->phone_mobile); $this->email = $obj->email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->photo = $obj->photo; $this->priv = $obj->priv; $this->mail = $obj->email; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 717278379e4..19f1c79565c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1844,7 +1844,7 @@ class Societe extends CommonObject $this->stcomm_picto = $obj->stcomm_picto; // picto statut commercial $this->email = $obj->email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->url = $obj->url; $this->phone = $obj->phone; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 126bebae64f..a0e6c16fe45 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -546,7 +546,7 @@ class User extends CommonObject $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin; From 2f2349d738e01d282ee9b1b429914c45df8e7952 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:27:51 +0200 Subject: [PATCH 0354/1289] Fix warnings --- htdocs/core/lib/payments.lib.php | 4 ++-- htdocs/public/payment/newpayment.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 1ebca6ba65a..19a251d1b38 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -471,7 +471,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, print '
'."\n"; if ($addformmessage) { - print ''; + print ''; print '
'; $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; @@ -482,7 +482,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, } // Add other message if VAT exists - if (!empty($object->total_vat) || $object->total_tva != 0) { + if (!empty($object->total_vat) || !empty($object->total_tva)) { $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; if (!empty($conf->global->$parammessageform)) { print $langs->transnoentities($conf->global->$parammessageform); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 0fbb1b69b02..61bb3472c56 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -912,14 +912,14 @@ print ''."\n"; print ''."\n"; // Additionnal information for each payment system if (!empty($conf->paypal->enabled)) { - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } if (!empty($conf->paybox->enabled)) { - print ''."\n"; + print ''."\n"; } if (!empty($conf->stripe->enabled)) { - print ''."\n"; + print ''."\n"; } print ''."\n"; print ''."\n"; From cc93166c530e08d528c1e6dddaaa080e7fc1abe3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:31:58 +0200 Subject: [PATCH 0355/1289] Fix warnings --- htdocs/install/step5.php | 4 ++-- htdocs/install/upgrade2.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index ee592007522..b91d48bad36 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -128,9 +128,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { $error = 0; // If password is encoded, we decode it - if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { + if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; - if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) { + if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 94eeb6d6243..229f68f213f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -123,9 +123,9 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ''; // If password is encoded, we decode it - if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { + if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; - if (preg_match('/crypted:/i', $dolibarr_main_db_pass)) { + if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted From b24cfc232f7baa3ceaad3ce38d61723c7e9612c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:56:16 +0200 Subject: [PATCH 0356/1289] Fix warning --- htdocs/install/upgrade2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 229f68f213f..c6cbab64965 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -455,7 +455,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '8.0.9'); $beforeversionarray = explode('.', '9.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { - migrate_user_photospath(); + //migrate_user_photospath(); } // Scripts for 11.0 @@ -480,6 +480,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '15.0.9'); $beforeversionarray = explode('.', '16.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + migrate_user_photospath(); migrate_user_photospath2(); } } From 14b6431957abd8c0c6d74167fa40fb0e81b050d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 04:14:51 +0200 Subject: [PATCH 0357/1289] Try to use phpunit 8 for php8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4334bbff429..e49a44aa77d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,7 +123,7 @@ install: fi # phpunit 9 is required for php 8 if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ + composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ php-parallel-lint/php-var-dump-check ~0.4 \ From b93c4b2969459e9cc6425d53bd868b2cc743a891 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 04:16:32 +0200 Subject: [PATCH 0358/1289] Fix error not reported --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e49a44aa77d..27274e81945 100644 --- a/.travis.yml +++ b/.travis.yml @@ -470,7 +470,7 @@ script: - | echo "Unit testing" # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. - set +e + set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" From 9f7c17333b62af9e07360472b59591716e0686ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 08:44:15 +0200 Subject: [PATCH 0359/1289] Update bonprelevement.class.php --- .../prelevement/class/bonprelevement.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9a1789dd49b..464051926f2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/compta/prelevement/class/bonprelevement.class.php - * \ingroup prelevement - * \brief File of withdrawal receipts class + * \file htdocs/compta/prelevement/class/bonprelevement.class.php + * \ingroup prelevement + * \brief File of withdrawal receipts class */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -760,14 +760,14 @@ class BonPrelevement extends CommonObject $error = 0; - $datetimeprev = time(); + $datetimeprev = dol_now('gmt'); //Choice the date of the execution direct debit if (!empty($executiondate)) { $datetimeprev = $executiondate; } - $month = date("%m", $datetimeprev); - $year = date("%Y", $datetimeprev); + $month = dol_print_date("%m", $datetimeprev, 'gmt'); + $year = dol_print_date("%Y", $datetimeprev, 'gmt'); $this->invoice_in_error = array(); $this->thirdparty_in_error = array(); From f53e3e9cce0710a4893123168fddb9b291ddf201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 09:42:44 +0200 Subject: [PATCH 0360/1289] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1e58f11aeb0..7404f2595e2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -129,22 +129,32 @@ class Facture extends CommonInvoice /** * @var int Date expected for delivery * @deprecated + * @see delivery_date */ - public $date_livraison; // deprecated; Use delivery_date instead. + public $date_livraison; + /** + * @var int Date expected for delivery + */ public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + /** + * @var string customer ref + * @deprecated + * @see ref_customer + */ + public $ref_client; + /** * @var string customer ref */ - public $ref_client; // deprecated; use ref_customer instead public $ref_customer; /** * @var int Ref Int * @deprecated */ - public $ref_int; // deprecated + public $ref_int; //Check constants for types public $type = self::TYPE_STANDARD; From 71a9cda8a29ba477e8be197acf35be37bee840a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 10:24:22 +0200 Subject: [PATCH 0361/1289] FIX missing token in export_file of accountancy --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 71e80f703af..3ebda931c52 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -883,7 +883,7 @@ if (empty($reshook)) { $newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").''; if (!empty($user->rights->accounting->mouvements->export)) { - $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export); + $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export); } $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); From a0579d115d72df4947fa7744e9030a78473c6a75 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Sep 2022 11:02:00 +0200 Subject: [PATCH 0362/1289] add element_element rowid --- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 516e4eddf51..3738ddfa867 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -63,8 +63,25 @@ foreach ($TMoChilds as $key => $objectlink) { echo ''; echo ''; echo ''; + echo "\n"; +} + +echo "\n"; + echo ''; echo "\n"; } From 9d1a4ede6e2609003a75f0588f268b645c3785e6 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 21 Sep 2022 11:06:54 +0200 Subject: [PATCH 0363/1289] Close #22245 : new increase holiday massaction --- htdocs/core/actions_massactions.inc.php | 51 ++++++++++++++++++++++++ htdocs/core/tpl/massactions_pre.tpl.php | 23 +++++++++++ htdocs/holiday/define_holiday.php | 53 ++++++++++++++++++++----- htdocs/langs/en_US/holiday.lang | 6 +++ 4 files changed, 124 insertions(+), 9 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 2854a631e42..aa73c9cdc8a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1507,6 +1507,57 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $ } } +if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday' && $confirm == 'yes')) && $permissiontoapprove) { + $db->begin(); + $objecttmp = new $objectclass($db); + $nbok = 0; + $typeholiday = GETPOST('typeholiday', 'alpha'); + $nbdaysholidays = GETPOST('nbdaysholidays', 'double'); + + if ($nbdaysholidays <= 0) { + setEventMessages($langs->trans("WrongAmount"), "", 'errors'); + $error++; + } + + if (!$error) { + foreach ($toselect as $toselectid) { + $balancecpuser = $objecttmp->getCPforUser($toselectid, $typeholiday); + if (!empty($balancecpuser)) { + $newnbdaysholidays = $nbdaysholidays + $balancecpuser; + } else { + $newnbdaysholidays = $nbdaysholidays; + } + $result = $holiday->addLogCP($user->id, $toselectid, $langs->transnoentitiesnoconv('ManualUpdate'), $newnbdaysholidays, $typeholiday); + if ($result <= 0) { + setEventMessages($holiday->error, $holiday->errors, 'errors'); + $error++; + break; + } + + $objecttmp->updateSoldeCP($toselectid, $newnbdaysholidays, $typeholiday); + if ($result > 0) { + $nbok++; + } else { + setEventMessages("", $langs->trans("ErrorUpdatingUsersCP"), 'errors'); + $error++; + break; + } + } + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("HolidayRecordsIncreased", $nbok), null, 'mesgs'); + } elseif ($nbok == 1) { + setEventMessages($langs->trans("HolidayRecordIncreased"), null, 'mesgs'); + } + $db->commit(); + $toselect=array(); + } else { + $db->rollback(); + } +} + $parameters['toselect'] = $toselect; $parameters['uploaddir'] = $uploaddir; $parameters['massaction'] = $massaction; diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 678bf219bef..d86f8074efd 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -283,6 +283,29 @@ if ($massaction == 'preapproveleave') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1); } +if ($massaction == 'preincreaseholiday') { + $langs->load("holiday", "hrm"); + require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; + $staticholiday = new Holiday($db); + $arraytypeholidays = $staticholiday->getTypes(1, 1); + $formquestion[] = array(); + $labeltypes = array(); + foreach ($typeleaves as $key => $val) { + $labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']); + } + $formquestion [] = array( 'type' => 'other', + 'name' => 'typeofholiday', + 'label' => $langs->trans("Type"), + 'value' => $form->selectarray('typeholiday', $labeltypes, GETPOST('typeholiday', 'alpha'), 1) + ); + $formquestion [] = array( 'type' => 'other', + 'name' => 'nbdaysholydays', + 'label' => $langs->trans("NumberDayAddMass"), + 'value' => '' + ); + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassIncreaseHoliday"), $langs->trans("ConfirmMassIncreaseHolidayQuestion", count($toselect)), "increaseholiday", $formquestion, 1, 0, 200, 500, 1); +} + // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( 'toselect' => $toselect, diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 486315f36ac..f47a4128c65 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -46,6 +46,9 @@ $search_supervisor = GETPOST('search_supervisor', 'int'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$confirm = GETPOST('confirm', 'alpha'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; @@ -113,14 +116,13 @@ if (empty($reshook)) { } // Mass actions - /* - $objectclass='Skeleton'; - $objectlabel='Skeleton'; - $permissiontoread = $user->rights->skeleton->read; - $permissiontodelete = $user->rights->skeleton->delete; - $uploaddir = $conf->skeleton->dir_output; + $objectclass = 'Holiday'; + $objectlabel = 'Holiday'; + $permissiontoread = $user->hasRight('holiday', 'read'); + $permissiontodelete = $user->hasRight('holiday', 'delete'); + $permissiontoapprove = $user->hasRight('holiday', 'approve'); + $uploaddir = $conf->holiday->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - */ // Si il y a une action de mise à jour if ($action == 'update' && GETPOSTISSET('update_cp')) { @@ -213,6 +215,17 @@ if ($result < 0) { setEventMessages($holiday->error, $holiday->errors, 'errors'); } +// List of mass actions available +$arrayofmassactions = array( + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if ($user->hasRight("holiday", "approve")) { + $arrayofmassactions['preincreaseholiday'] = img_picto('', 'add', 'class="pictofixedwidth"').$langs->trans("IncreaseHolidays"); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + print '
'; if ($optioncss != '') { @@ -226,7 +239,10 @@ print ''; print ''; print ''; -print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); +$title = $langs->trans("MenuConfCP"); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, '', '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); + +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; print '
'.$langs->trans('LastUpdateCP').': '."\n"; $lastUpdate = $holiday->getConfCP('lastUpdate'); @@ -298,6 +314,7 @@ if (count($typeleaves) == 0) { print '
'; } print ''; + print ''; // Action column print ''; $usersupervisor = new User($db); foreach ($listUsers as $users) { + $arrayofselected = is_array($toselect) ? $toselect : array(); + // If user has not permission to edit/read all, we must see only subordinates if (empty($user->rights->holiday->readall)) { if (($users['rowid'] != $user->id) && (!in_array($users['rowid'], $userchilds))) { @@ -389,11 +414,21 @@ if (count($typeleaves) == 0) { print ''; // Button modify - print ''."\n"; + print ''; print ''; $i++; diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 95c8f54d211..1921b9ed794 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -149,4 +149,10 @@ XIsAUsualNonWorkingDay=%s is usualy a NON working day BlockHolidayIfNegative=Block if balance negative LeaveRequestCreationBlockedBecauseBalanceIsNegative=The creation of this leave request is blocked because your balance is negative ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted +IncreaseHolidays=Increase holiday +HolidayRecordsIncreased= %s holiday records increased +HolidayRecordIncreased=Holiday record increased +ConfirmMassIncreaseHoliday=Bulk holiday increase +NumberDayAddMass=Number of day to add to the selection +ConfirmMassIncreaseHolidayQuestion=Are you sure you want to increase holiday of the %s selected record(s)? HolidayQtyNotModified=Balance of remaining days for %s has not been changed From 78adf501b396cb89ca0dce30772708841799a87a Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Sep 2022 11:08:46 +0200 Subject: [PATCH 0364/1289] stickler --- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 3738ddfa867..9f07a9048c2 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -70,11 +70,10 @@ foreach ($TMoChilds as $key => $objectlink) { $resql = $db->query($sql); $k = 0; - if ($resql){ + if ($resql) { $obj = $db->fetch_object($resql); if ($obj->rowid && $obj->rowid > 0 ) $k = $obj->rowid; } - echo '' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . ''; echo ''; echo "\n"; From 45c4a6ce1c2ec863c06d560bbd4963b4b73b08d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 10:57:30 +0200 Subject: [PATCH 0365/1289] Fix regression using confirm as POST (pb with cursor and download file) --- htdocs/accountancy/bookkeeping/list.php | 16 ++++++--- .../class/accountancyexport.class.php | 22 +++++++++++++ htdocs/core/class/html.form.class.php | 33 ++++++++++++------- htdocs/langs/en_US/accountancy.lang | 2 +- 4 files changed, 56 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 3ebda931c52..24c08b57574 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -653,21 +653,28 @@ if (!empty($sortfield)) { // Export into a file with format defined into setup (FEC, CSV, ...) // Must be after definition of $sql if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) { - // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them. + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumes too much memory on large export. + // Replace this with the query($sql) and loop on each line to export them. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { - // Export files + // Export files then exit $accountancyexport = new AccountancyExport($db); + + $mimetype = $accountancyexport->getMimeType($formatexportset); + + top_httphead($mimetype, 1); + + // Output data on screen $accountancyexport->export($object->lines, $formatexportset); $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); if (!empty($accountancyexport->errors)) { - setEventMessages('', $accountancyexport->errors, 'errors'); + dol_print_error('', '', $accountancyexport->errors); } elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) { // Specify as export : update field date_export or date_validated $error = 0; @@ -701,11 +708,10 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex if (!$error) { $db->commit(); - // setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs'); } else { $error++; $db->rollback(); - setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors'); + dol_print_error('', $langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated")); } } exit; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index e4af034b1f4..390aaa9ed4a 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -286,6 +286,28 @@ class AccountancyExport } + /** + * Return the MIME type of a file + * + * @param int $formatexportset Id of export format + * @return string MIME type. + */ + public function getMimeType($formatexportset) + { + $mime = 'text/csv'; + + switch ($formatexportset) { + case self::$EXPORT_TYPE_FEC: + $mime = 'text/tab-separated-values'; + break; + default: + $mime = 'text/csv'; + break; + } + + return $mime; + } + /** * Function who chose which export to use with the default config, and make the export into a file * diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a65c4a03108..a241aa367cf 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5156,6 +5156,8 @@ class Form $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; } + $postconfirmas = 'GET'; + $formconfirm .= ' resizable: false, height: "'.$height.'", @@ -5184,15 +5186,19 @@ class Form options += "&" + inputname + "=" + encodeURIComponent(inputvalue); }); } - var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options; - if (pageyes.length > 0) { - '.$jsforcursor.' - var post = $.post( + var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "&") + options; + if (pageyes.length > 0) {'; + if ($postconfirmas == 'GET') { + $formconfirm .= 'location.href = urljump;'; + } else { + $formconfirm .= $jsforcursor; + $formconfirm .= 'var post = $.post( pageyes, options, function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); } - ); - + );'; + } + $formconfirm .= ' console.log("after post ok"); } $(this).dialog("close"); @@ -5211,15 +5217,20 @@ class Form options += "&" + inputname + "=" + encodeURIComponent(inputvalue); }); } - var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options; + var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "&") + options; //alert(urljump); - if (pageno.length > 0) { - '.$jsforcursor.' - var post = $.post( + if (pageno.length > 0) {'; + if ($postconfirmas == 'GET') { + $formconfirm .= 'location.href = urljump;'; + } else { + $formconfirm .= $jsforcursor; + $formconfirm .= 'var post = $.post( pageno, options, function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); } - ); + );'; + } + $formconfirm .= ' console.log("after post ko"); } $(this).dialog("close"); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index d95791111cd..6e64f1c6e48 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -286,7 +286,7 @@ DescClosure=Consult here the number of movements by month not yet validated & lo OverviewOfMovementsNotValidated=Overview of movements not validated and locked AllMovementsWereRecordedAsValidated=All movements were recorded as validated and locked NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated and locked -ValidateMovements=Validate and lock record... +ValidateMovements=Validate and lock movements... DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible ValidateHistory=Bind Automatically From 861d8f4568cb0c996b2fa529e6bb0db54e6d7e27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:15:41 +0200 Subject: [PATCH 0366/1289] Doc --- ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7c41bbfaac0..e1030fa18de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ English Dolibarr ChangeLog For users: --------------- +NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6 + ... @@ -28,7 +30,7 @@ Following changes may create regressions for some external modules, but were nec For users: --------------- -NEW: PHP 8.0 and 8.1 compatibility (with mysql): +NEW: PHP 8.0 and 8.1 compatibility: Warning!! Application works correctly with PHP 8.0 and 8.1 but you will experience a lot of PHP warnings into the PHP server log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. From 26ab9d09f7f570370ea6aff6160ad0c7e899399d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:15:56 +0200 Subject: [PATCH 0367/1289] Doc --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bc27c016c2e..caa0b928f93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ English Dolibarr ChangeLog For users: --------------- -NEW: PHP 8.0 and 8.1 compatibility (with mysql): +NEW: PHP 8.0 and 8.1 compatibility: Warning!! Application works correctly with PHP 8.0 and 8.1 but you will experience a lot of PHP warnings into the PHP server log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17. NEW: Support for recurring purchase invoices. From 42c7671f94af494e8cd1d6daab3ed0ea97b8bf0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:19:34 +0200 Subject: [PATCH 0368/1289] Try phpunit 7.5.20 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 27274e81945..54fc180f515 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,7 +123,7 @@ install: fi # phpunit 9 is required for php 8 if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \ + composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5.20 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ php-parallel-lint/php-var-dump-check ~0.4 \ From f3ae54f8ac6d934f5d47a44e51bb6acb5151c5d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:40:28 +0200 Subject: [PATCH 0369/1289] Fix sort order --- htdocs/accountancy/bookkeeping/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 24c08b57574..086839f219b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -989,14 +989,14 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) { print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount'); print ''; } else { - print ''; + print ''; } print ''; } // Label operation if (!empty($arrayfields['t.label_operation']['checked'])) { print ''; } // Debit @@ -1014,7 +1014,7 @@ if (!empty($arrayfields['t.credit']['checked'])) { // Lettering code if (!empty($arrayfields['t.lettering_code']['checked'])) { print ''; } @@ -1122,10 +1122,10 @@ if (!empty($arrayfields['t.tms']['checked'])) { print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['t.date_export']['checked'])) { - print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['t.date_validated']['checked'])) { - print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['t.import_key']['checked'])) { print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center '); From dcf7ce4cfc8a112c9d1cb5e0831317fe9e1282b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:57:11 +0200 Subject: [PATCH 0370/1289] Fix sort --- htdocs/accountancy/bookkeeping/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 23d33acd3b7..087b410bcaf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -860,8 +860,8 @@ if ($optioncss != '') { print ''; } print ''; -print ''; -print ''; +print ''; +print ''; print ''; if (count($filter)) { From 5ef34e93c9346cf8e6ae5d5af418820c2462776a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 11:59:18 +0200 Subject: [PATCH 0371/1289] Doc --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 59570bffeea..cf784f50947 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -470,6 +470,7 @@ function GETPOSTISARRAY($paramname, $method = 0) * 'alphanohtml'=check there is no html content and no " and no ../ * 'aZ'=check it's a-z only * 'aZ09'=check it's simple alpha string (recommended for keys) + * 'aZ09comma'=check it's a string for a sortfield or sortorder * 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) * 'nohtml'=check there is no html content and no " and no ../ * 'restricthtml'=check html content is restricted to some tags only From ffddce4656100523a26f56220734ef3f3b598d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 13:49:36 +0200 Subject: [PATCH 0372/1289] add badges --- htdocs/core/lib/categories.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 8ff1dbb97ae..7d77b345d61 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -80,7 +80,10 @@ function categories_prepare_head(Categorie $object, $type) */ function categoriesadmin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('categorie'); $langs->load("categories"); @@ -94,6 +97,10 @@ function categoriesadmin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCategories"); + $nbExtrafields = $extrafields->attributes['categorie']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ' '.$nbExtrafields.''; + } $head[$h][2] = 'attributes_categories'; $h++; From c524a3ddc7a45c382c9af86bebc0fb974fb7945e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 14:08:23 +0200 Subject: [PATCH 0373/1289] Trans --- htdocs/langs/en_US/companies.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 2ef90f89600..e022c7cb09f 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -313,11 +313,11 @@ CustomerAbsoluteDiscountShort=Absolute discount CompanyHasRelativeDiscount=This customer has a default discount of %s%% CompanyHasNoRelativeDiscount=This customer has no relative discount by default HasRelativeDiscountFromSupplier=You have a default discount of %s%% from this vendor -HasNoRelativeDiscountFromSupplier=You have no default relative discount from this vendor +HasNoRelativeDiscountFromSupplier=No default relative discount from this vendor CompanyHasAbsoluteDiscount=This customer has discounts available (credits notes or down payments) for %s %s CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for %s %s CompanyHasCreditNote=This customer still has credit notes for %s %s -HasNoAbsoluteDiscountFromSupplier=You have no discount credit available from this vendor +HasNoAbsoluteDiscountFromSupplier=No discount/credit available from this vendor HasAbsoluteDiscountFromSupplier=You have discounts available (credits notes or down payments) for %s %s from this vendor HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for %s %s from this vendor HasCreditNoteFromSupplier=You have credit notes for %s %s from this vendor From 3790551fadb16e810293281227140e4cccdc4e29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 14:08:39 +0200 Subject: [PATCH 0374/1289] Fix CSRF --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 934782b89ec..870088efe93 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { From 70a1815b9c1090d94bf45b108a64f2f36194a5b5 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Sep 2022 14:12:55 +0200 Subject: [PATCH 0375/1289] remove code --- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 9f07a9048c2..7a9d4a2dd73 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -79,10 +79,4 @@ foreach ($TMoChilds as $key => $objectlink) { echo "\n"; } -echo "\n"; - - echo ''; - echo "\n"; -} - echo "\n"; From 0ca46076ebdb82cf75eaa2b4583b4da0fe0325f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 14:21:29 +0200 Subject: [PATCH 0376/1289] Fix field position --- htdocs/fourn/facture/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index cb655d7c7f6..bde4e570be8 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -193,9 +193,8 @@ $arrayfields = array( 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj == "1", 'position'=>95), 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj == "1", 'position'=>100), 'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>115), - 'u.login'=>array('label'=>"Author", 'checked'=>1), - 'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0), - 'rtp'=>array('label'=>"Rest", 'checked'=>0), + 'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0, 'position'=>116), + 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>117), 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), @@ -203,8 +202,9 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow - 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>500), + 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>501), + 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields From 283c9b966c4c5f6e6c88902f5ef8b3ca2b141843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 14:38:14 +0200 Subject: [PATCH 0377/1289] Clean code of setup of shipment module --- htdocs/admin/confexped.php | 147 ------ htdocs/admin/delivery.php | 532 +++++++++++--------- htdocs/core/modules/modExpedition.class.php | 2 +- 3 files changed, 294 insertions(+), 387 deletions(-) delete mode 100644 htdocs/admin/confexped.php diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php deleted file mode 100644 index 870b793fce8..00000000000 --- a/htdocs/admin/confexped.php +++ /dev/null @@ -1,147 +0,0 @@ - - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2011-2016 Juanjo Menent ù - * Copyright (C) 2015 Claudio Aschieri - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/admin/confexped.php - * \ingroup produit - * \brief Page to setup sending module - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; - -// Load translation files required by the page -$langs->loadLangs(array('admin', 'sendings', 'deliveries')); - -if (!$user->admin) { - accessforbidden(); -} - -$action = GETPOST('action', 'aZ09'); - - -/* - * Actions - */ - -// Shipment note -if (isModEnabled('expedition') && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - // This option should always be set to on when module is on. - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); -} -/* -if ($action == 'activate_sending') -{ - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); - header("Location: confexped.php"); - exit; -} -if ($action == 'disable_sending') -{ - dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity); - header("Location: confexped.php"); - exit; -} -*/ - -// Delivery note -if ($action == 'activate_delivery') { - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity); - header("Location: confexped.php"); - exit; -} elseif ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity); - header("Location: confexped.php"); - exit; -} - - -/* - * View - */ - -$dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/"; -$form = new Form($db); - -llxHeader("", $langs->trans("SendingsSetup")); - -$linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); -print '
'; -$head = expedition_admin_prepare_head(); - -print dol_get_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment'); - -// Miscellaneous parameters - -print '
-'.$objectlink->getLibStatut(3).''; - // For now, shipments must stay linked to order, so link is not deletable - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + + // we want to make the link via element_element for delete action + $sql = ' Select rowid from ' . MAIN_DB_PREFIX . 'element_element'; + $sql .= ' WHERE fk_source = '. $object->id . ' and fk_target = ' . $key; + + $resql = $db->query($sql); + $k = 0; + if ($resql){ + $obj = $db->fetch_object($resql); + if ($obj->rowid && $obj->rowid > 0 ) $k = $obj->rowid; + } + + echo '' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . ''; + echo '
'; @@ -320,11 +337,19 @@ if (count($typeleaves) == 0) { } print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]); print_liste_field_titre(''); + + if ($massactionbutton) { + $selectedfields = $form->showCheckAddButtons('checkforselect', 1); + } + + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print '
'; + print ''; if (!empty($user->rights->holiday->define_holiday)) { // Allowed to set the balance of any user print ''; } 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($userstatic->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print '
'.$langs->trans("NotReconciled").''; print '
'; -print ''; -print ''; -print ''; -print ''; -print ''."\n"; - -// expedition activation/desactivation -print ""; -print ''; -print ''; -print '"; -print ''; - -// Delivery note activate/deactivate Bon de livraison activation/desactivation -print ''; -print ''; -print ''; -print '"; -print ''; -print '
'.$langs->trans("Feature").' '.$langs->trans("Status").'
'.$langs->trans("SendingsAbility").''; -print ''; -print ''.img_picto($langs->trans("Required"), 'switch_on').''; -/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) -{ - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; -} -else -{ - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; -}*/ -print "
'; -print $langs->trans("DeliveriesOrderAbility"); -print '
'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1); -print '
'; -print ''; - -if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; -} else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; -} - -print "
'; - -print '
'; - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index de26d237d01..a1fef4091ce 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -56,6 +56,39 @@ $type = 'delivery'; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + +// Shipment note +if (isModEnabled('expedition') && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { + // This option should always be set to on when module is on. + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); +} +/* + if ($action == 'activate_sending') + { + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); + header("Location: confexped.php"); + exit; + } + if ($action == 'disable_sending') + { + dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity); + header("Location: confexped.php"); + exit; + } + */ + +// Delivery note +if ($action == 'activate_delivery') { + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this + dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity); + header("Location: delivery.php"); + exit; +} elseif ($action == 'disable_delivery') { + dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity); + header("Location: delivery.php"); + exit; +} + if ($action == 'updateMask') { $maskconstdelivery = GETPOST('maskconstdelivery', 'alpha'); $maskdelivery = GETPOST('maskdelivery', 'alpha'); @@ -160,6 +193,7 @@ if ($action == 'setmod') { } + /* * View */ @@ -178,275 +212,295 @@ $head = expedition_admin_prepare_head(); print dol_get_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment'); -// Delivery numbering model - -print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', ''); - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''."\n"; - -clearstatcache(); - -foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/delivery/"); - - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (preg_match('/^mod_delivery_([a-z0-9_]*)\.php$/', $file)) { - $file = substr($file, 0, dol_strlen($file) - 4); - - require_once $dir.$file.'.php'; - - $module = new $file; - - if ($module->isEnabled()) { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { - continue; - } - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { - continue; - } - - print ''; - - // Show example of numbering module - print ''."\n"; - - print ''; - - $delivery = new Delivery($db); - $delivery->initAsSpecimen(); - - // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval = $module->getNextValue($mysoc, $delivery); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { - $nextval = $langs->trans($nextval); - } - $htmltooltip .= $nextval.'
'; - } else { - $htmltooltip .= $langs->trans($module->error).'
'; - } - } - - print ''; - - print ''; - } - } - } - closedir($handle); - } - } -} - -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$module->name."\n"; - print $module->info(); - print ''; - $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) { - $langs->load("errors"); - print '
'.$langs->trans($tmp).'
'; - } elseif ($tmp == 'NotConfigured') { - print ''.$langs->trans($tmp).''; - } else { - print $tmp; - } - print '
'; - if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; - } - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '
'; - - -/* - * Documents Models for delivery - */ print '
'; -print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', ''); - -// Defini tableau def de modele -$type = "delivery"; -$def = array(); - -$sql = "SELECT nom"; -$sql .= " FROM ".MAIN_DB_PREFIX."document_model"; -$sql .= " WHERE type = '".$db->escape($type)."'"; -$sql .= " AND entity = ".$conf->entity; - -$resql = $db->query($sql); -if ($resql) { - $i = 0; - $num_rows = $db->num_rows($resql); - while ($i < $num_rows) { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } +print '
'.$langs->trans("DeliveriesOrderAbility").'
'; +if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { + print ' '.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - dol_print_error($db); + print ' '.img_picto($langs->trans("Enabled"), 'switch_on').''; } -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; +print '
'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1).''; +print '
'; +print '
'; -clearstatcache(); -foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/delivery/doc/"); - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - $filelist[] = $file; - } - closedir($handle); - arsort($filelist); +if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { + // Delivery numbering model - foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { - if (file_exists($dir.'/'.$file)) { - $name = substr($file, 4, dol_strlen($file) - 16); - $classname = substr($file, 0, dol_strlen($file) - 12); + print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', ''); - require_once $dir.'/'.$file; - $module = new $classname($db); + print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; - $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { - $modulequalified = 0; - } - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { - $modulequalified = 0; - } + clearstatcache(); - if ($modulequalified) { - print ''; + + // Show example of numbering module + print ''."\n"; + + print ''; - // Active - if (in_array($name, $def)) { - print ""; - } else { - print ""; - } - - // Default - print "'; + $delivery = new Delivery($db); + $delivery->initAsSpecimen(); // Info - $htmltooltip = ''.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); - $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval = $module->getNextValue($mysoc, $delivery); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { + $nextval = $langs->trans($nextval); + } + $htmltooltip .= $nextval.'
'; + } else { + $htmltooltip .= $langs->trans($module->error).'
'; + } + } + print ''; - // Preview - print ''; - print ''; } } } + closedir($handle); } } } + + print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'; - print (empty($module->name) ? $name : $module->name); - print "\n"; - if (method_exists($module, 'info')) { - print $module->info($langs); + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/delivery/"); + + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (preg_match('/^mod_delivery_([a-z0-9_]*)\.php$/', $file)) { + $file = substr($file, 0, dol_strlen($file) - 4); + + require_once $dir.$file.'.php'; + + $module = new $file; + + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + continue; + } + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + continue; + } + + print '
'.$module->name."\n"; + print $module->info(); + print ''; + $tmp = $module->getExample(); + if (preg_match('/^Error/', $tmp)) { + $langs->load("errors"); + print '
'.$langs->trans($tmp).'
'; + } elseif ($tmp == 'NotConfigured') { + print ''.$langs->trans($tmp).''; } else { - print $module->description; + print $tmp; + } + print '
'; + if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { + print img_picto($langs->trans("Activated"), 'switch_on'); + } else { + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print '\n"; - print 'scandir).'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; - print "\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; - print ""; - if ($conf->global->DELIVERY_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"), 'on'); - } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; - } - print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; - if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"), 'pdf').''; - } else { - print img_object($langs->trans("PreviewNotAvailable"), 'generic'); - } - print '
'; + + + /* + * Documents Models for delivery + */ + print '
'; + print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', ''); + + // Defini tableau def de modele + $type = "delivery"; + $def = array(); + + $sql = "SELECT nom"; + $sql .= " FROM ".MAIN_DB_PREFIX."document_model"; + $sql .= " WHERE type = '".$db->escape($type)."'"; + $sql .= " AND entity = ".$conf->entity; + + $resql = $db->query($sql); + if ($resql) { + $i = 0; + $num_rows = $db->num_rows($resql); + while ($i < $num_rows) { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } + } else { + dol_print_error($db); + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + clearstatcache(); + + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/delivery/doc/"); + + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + $filelist[] = $file; + } + closedir($handle); + arsort($filelist); + + foreach ($filelist as $file) { + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { + if (file_exists($dir.'/'.$file)) { + $name = substr($file, 4, dol_strlen($file) - 16); + $classname = substr($file, 0, dol_strlen($file) - 12); + + require_once $dir.'/'.$file; + $module = new $classname($db); + + $modulequalified = 1; + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + $modulequalified = 0; + } + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + $modulequalified = 0; + } + + if ($modulequalified) { + print ''; + + // Active + if (in_array($name, $def)) { + print ""; + } else { + print ""; + } + + // Default + print "'; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); + $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + print ''; + + // Preview + print ''; + + print ''; + } + } + } + } + } + } + } + + print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; + print (empty($module->name) ? $name : $module->name); + print "\n"; + if (method_exists($module, 'info')) { + print $module->info($langs); + } else { + print $module->description; + } + print '\n"; + print 'scandir).'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print "\n"; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ""; + if ($conf->global->DELIVERY_ADDON_PDF == "$name") { + print img_picto($langs->trans("Default"), 'on'); + } else { + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''; + if ($module->type == 'pdf') { + print ''.img_object($langs->trans("Preview"), 'pdf').''; + } else { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print '
'; + + // Other Options + print "
"; + print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2); + $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); + $htmltext = ''.$langs->trans("AvailableVariables").':
'; + foreach ($substitutionarray as $key => $val) { + $htmltext .= $key.'
'; + } + $htmltext .= '
'; + + print '\n"; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; + print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; + $variablename = 'DELIVERY_FREE_TEXT'; + if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + print ''; + } else { + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes'); + print $doleditor->Create(); + } + print '
'; + print "
'; + + print '
'; + print ''; + print '
'; + + print ''; } -print ''; -/* - * Autres Options - */ -print "
"; -print load_fiche_titre($langs->trans("OtherOptions"), '', ''); - -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2); -$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); -$htmltext = ''.$langs->trans("AvailableVariables").':
'; -foreach ($substitutionarray as $key => $val) { - $htmltext .= $key.'
'; -} -$htmltext .= '
'; - -print ''; -print ''; -print ''; -print '\n"; -print ''; - -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; -print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; -$variablename = 'DELIVERY_FREE_TEXT'; -if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { - print ''; -} else { - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes'); - print $doleditor->Create(); -} -print '
'; -print ''; -print "
'; - // End of page llxFooter(); $db->close(); diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 80625817b22..2ff117404ee 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -70,7 +70,7 @@ class modExpedition extends DolibarrModules ); // Config pages - $this->config_page_url = array("confexped.php"); + $this->config_page_url = array("expedition.php"); // Dependencies $this->depends = array("modCommande"); From 301e31161900b44b2b0b6659ca7a4c7fe4089cca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 14:39:39 +0200 Subject: [PATCH 0378/1289] Clean code of setup of shipment module --- htdocs/core/lib/expedition.lib.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index b9eb90d7f9f..1a4ddf4d335 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -79,11 +79,12 @@ function expedition_admin_prepare_head() $h = 0; $head = array(); + /* $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'general'; $h++; - + */ if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; @@ -107,12 +108,10 @@ function expedition_admin_prepare_head() $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; - $head[$h][1] = $langs->trans("Receivings"); - $head[$h][2] = 'receivings'; - $h++; - } + $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; + $head[$h][1] = $langs->trans("Receivings"); + $head[$h][2] = 'receivings'; + $h++; if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; From 9ddf65de637372856a03fedbdf4b351ff0e324e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 14:59:46 +0200 Subject: [PATCH 0379/1289] NEW extrafield price with currency --- htdocs/core/class/extrafields.class.php | 34 +++++++++++++++++-- htdocs/core/tpl/admin_extrafields_add.tpl.php | 1 + .../core/tpl/admin_extrafields_edit.tpl.php | 1 + htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0efee8461dc..2b42b89c51d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -80,6 +80,7 @@ class ExtraFields 'datetime'=>'DateAndTime', 'boolean'=>'Boolean', 'price'=>'ExtrafieldPrice', + 'pricecy'=>'ExtrafieldPriceWithCurrency', 'phone'=>'ExtrafieldPhone', 'mail'=>'ExtrafieldMail', 'url'=>'ExtrafieldUrl', @@ -113,7 +114,7 @@ class ExtraFields * * @param string $attrname Code of attribute * @param string $label label of attribute - * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datehour','price','phone','mail','password','url','select','checkbox','separate',...) + * @param string $type Type of attribute ('boolean','int','varchar','text','html','date','datehour','price', 'pricecy', 'phone','mail','password','url','select','checkbox','separate',...) * @param int $pos Position of attribute * @param string $size Size/length definition of attribute ('5', '24,8', ...). For float, it contains 2 numeric separated with a comma. * @param string $elementtype Element type. Same value than object->table_element (Example 'member', 'product', 'thirdparty', ...) @@ -182,7 +183,7 @@ class ExtraFields * This is a private method. For public method, use addExtraField. * * @param string $attrname code of attribute - * @param int $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...) + * @param int $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','pricecy','phone','mail','password','url','select','checkbox', ...) * @param string $length Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @param int $unique Is field unique or not @@ -217,6 +218,9 @@ class ExtraFields } elseif ($type == 'price') { $typedb = 'double'; $lengthdb = '24,8'; + } elseif ($type == 'pricecy') { + $typedb = 'varchar'; + $lengthdb = '64'; } elseif ($type == 'phone') { $typedb = 'varchar'; $lengthdb = '20'; @@ -567,6 +571,9 @@ class ExtraFields } elseif ($type == 'price') { $typedb = 'double'; $lengthdb = '24,8'; + } elseif ($type == 'pricecy') { + $typedb = 'varchar'; + $lengthdb = '64'; } elseif ($type == 'phone') { $typedb = 'varchar'; $lengthdb = '20'; @@ -1089,6 +1096,16 @@ class ExtraFields $value = price($value); } $out = ' '.$langs->getCurrencySymbol($conf->currency); + } elseif ($type == 'pricecy') { + $currency = $conf->currency; + if (!empty($value)) { + // $value in memory is a php numeric, we format it into user number format. + $pricetmp = explode(':', $value); + $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency; + $value = price($pricetmp[0]); + } + $out = ' '; + $out .= $form->selectCurrency($currency, $keyprefix.$key.$keysuffix.'currency_id'); } elseif ($type == 'double') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value = price($value); @@ -1624,6 +1641,17 @@ class ExtraFields if ($value || $value == '0') { $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency); } + } elseif ($type == 'pricecy') { + $currency = $conf->currency; + if (!empty($value)) { + // $value in memory is a php numeric, we format it into user number format. + $pricetmp = explode(':', $value); + $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency; + $value = $pricetmp[0]; + } + if ($value || $value == '0') { + $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1, $currency); + } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); if (($pos = strpos($valstr, "|")) !== false) { @@ -2095,6 +2123,8 @@ class ExtraFields } elseif (in_array($key_type, array('price', 'double'))) { $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); + } elseif (in_array($key_type, array('pricecy', 'double'))) { + $value_key = price2num(GETPOST("options_".$key, 'alpha')).':'.GETPOST("options_".$key."currency_id", 'alpha'); } elseif (in_array($key_type, array('html'))) { $value_key = GETPOST("options_".$key, 'restricthtml'); } elseif (in_array($key_type, array('text'))) { diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 97748290bd7..ed337b04e6a 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -97,6 +97,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} + else if (type == 'pricecurrency') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 7814560be9b..139a4bc4404 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -96,6 +96,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6a1146a2f9d..96861717642 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -439,6 +439,7 @@ Unique=Unique Boolean=Boolean (one checkbox) ExtrafieldPhone = Phone ExtrafieldPrice = Price +ExtrafieldPriceWithCurrency=Price with currency ExtrafieldMail = Email ExtrafieldUrl = Url ExtrafieldIP = IP From 8f29d5c0eb10d928d3b3dd28422d4b03c634f5af Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Sep 2022 15:58:41 +0200 Subject: [PATCH 0380/1289] add cast and quoted --- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 7a9d4a2dd73..31a0af8a10c 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -66,7 +66,7 @@ foreach ($TMoChilds as $key => $objectlink) { // we want to make the link via element_element for delete action $sql = ' Select rowid from ' . MAIN_DB_PREFIX . 'element_element'; - $sql .= ' WHERE fk_source = '. $object->id . ' and fk_target = ' . $key; + $sql .= ' WHERE fk_source = '. (int) $object->id . ' and fk_target = "' . $key .'"'; $resql = $db->query($sql); $k = 0; From 64c92cc66dcc4c1c39c7bff86c9dbd4f74eb5476 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Sep 2022 16:11:18 +0200 Subject: [PATCH 0381/1289] add escape --- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index 31a0af8a10c..9374fc2e4d0 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -65,8 +65,8 @@ foreach ($TMoChilds as $key => $objectlink) { echo ''; // we want to make the link via element_element for delete action - $sql = ' Select rowid from ' . MAIN_DB_PREFIX . 'element_element'; - $sql .= ' WHERE fk_source = '. (int) $object->id . ' and fk_target = "' . $key .'"'; + $sql = " Select rowid from " . MAIN_DB_PREFIX . "element_element"; + $sql .= " WHERE fk_source = ". (int) $object->id . " and fk_target = '" . dol_escape_htmltag($key) ."'"; $resql = $db->query($sql); $k = 0; From 13885f764ed6cfd7957674f0e77662d71f5138d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 17:29:37 +0200 Subject: [PATCH 0382/1289] Test phpunit fix --- test/phpunit/AdminLibTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 9ce135da263..317d486434e 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -78,7 +78,7 @@ class AdminLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class AdminLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class AdminLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class AdminLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } From 3e83fa3ad9a4587308ee92f98c3ecf8b53aa372f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 17:34:18 +0200 Subject: [PATCH 0383/1289] Fix for phpunit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 54fc180f515..27274e81945 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,7 +123,7 @@ install: fi # phpunit 9 is required for php 8 if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5.20 \ + composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ php-parallel-lint/php-var-dump-check ~0.4 \ From 6c17c2f04468c3d7e60bcf2fc0da70a22dcf6c7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 17:55:04 +0200 Subject: [PATCH 0384/1289] Test travis php7.1 --- test/phpunit/AccountingAccountTest.php | 8 ++++---- test/phpunit/ActionCommTest.php | 8 ++++---- test/phpunit/AdherentTest.php | 8 ++++---- test/phpunit/BOMTest.php | 8 ++++---- test/phpunit/BankAccountTest.php | 8 ++++---- test/phpunit/BarcodeTest.php | 8 ++++---- test/phpunit/BonPrelevementTest.php | 8 ++++---- test/phpunit/BuildDocTest.php | 8 ++++---- test/phpunit/CMailFileTest.php | 8 ++++---- test/phpunit/CategorieTest.php | 8 ++++---- test/phpunit/ChargeSocialesTest.php | 8 ++++---- test/phpunit/CodingPhpTest.php | 8 ++++---- test/phpunit/CodingSqlTest.php | 8 ++++---- test/phpunit/CommandeFournisseurTest.php | 8 ++++---- test/phpunit/CommandeTest.php | 8 ++++---- test/phpunit/CommonInvoiceTest.php | 8 ++++---- test/phpunit/CommonObjectTest.php | 8 ++++---- test/phpunit/CompanyBankAccountTest.php | 8 ++++---- test/phpunit/CompanyLibTest.php | 8 ++++---- test/phpunit/ContactTest.php | 8 ++++---- test/phpunit/ContratTest.php | 8 ++++---- test/phpunit/CoreTest.php | 8 ++++---- test/phpunit/DateLibTest.php | 8 ++++---- test/phpunit/DateLibTzFranceTest.php | 8 ++++---- test/phpunit/DiscountTest.php | 8 ++++---- test/phpunit/EmailCollectorTest.php | 8 ++++---- test/phpunit/EntrepotTest.php | 8 ++++---- test/phpunit/EvalMathTest.php | 8 ++++---- test/phpunit/ExpenseReportTest.php | 8 ++++---- test/phpunit/ExportTest.php | 8 ++++---- test/phpunit/FactureFournisseurTest.php | 8 ++++---- test/phpunit/FactureRecTest.php | 8 ++++---- test/phpunit/FactureTest.php | 8 ++++---- test/phpunit/FactureTestRounding.php | 8 ++++---- test/phpunit/FichinterTest.php | 8 ++++---- test/phpunit/FilesLibTest.php | 8 ++++---- test/phpunit/FormAdminTest.php | 8 ++++---- test/phpunit/FormTest.php | 8 ++++---- test/phpunit/Functions2LibTest.php | 8 ++++---- test/phpunit/FunctionsLibTest.php | 8 ++++---- test/phpunit/GetUrlLibTest.php | 8 ++++---- test/phpunit/HolidayTest.php | 8 ++++---- test/phpunit/ImagesLibTest.php | 8 ++++---- test/phpunit/ImportTest.php | 8 ++++---- test/phpunit/InventoryTest.php | 8 ++++---- test/phpunit/JsonLibTest.php | 8 ++++---- test/phpunit/KnowledgeRecordTest.php | 8 ++++---- test/phpunit/LangTest.php | 8 ++++---- test/phpunit/LesscTest.php | 8 ++++---- test/phpunit/LoanTest.php | 8 ++++---- test/phpunit/MarginsLibTest.php | 8 ++++---- test/phpunit/ModulesTest.php | 8 ++++---- test/phpunit/MouvementStockTest.php | 8 ++++---- test/phpunit/NumberingModulesTest.php | 8 ++++---- test/phpunit/PaypalTest.php | 8 ++++---- test/phpunit/PdfDocTest.php | 8 ++++---- test/phpunit/PgsqlTest.php | 8 ++++---- test/phpunit/PricesTest.php | 8 ++++---- test/phpunit/ProductTest.php | 8 ++++---- test/phpunit/ProjectTest.php | 8 ++++---- test/phpunit/PropalTest.php | 8 ++++---- test/phpunit/RestAPIDocumentTest.php | 8 ++++---- test/phpunit/RestAPIUserTest.php | 8 ++++---- test/phpunit/ScriptsTest.php | 8 ++++---- test/phpunit/SecurityTest.php | 8 ++++---- test/phpunit/SocieteTest.php | 8 ++++---- test/phpunit/StripeTest.php | 8 ++++---- test/phpunit/SupplierProposalTest.php | 8 ++++---- test/phpunit/TicketTest.php | 8 ++++---- test/phpunit/UserGroupTest.php | 8 ++++---- test/phpunit/UserTest.php | 8 ++++---- test/phpunit/UtilsTest.php | 8 ++++---- test/phpunit/WebservicesInvoicesTest.php | 8 ++++---- test/phpunit/WebservicesOrdersTest.php | 8 ++++---- test/phpunit/WebservicesOtherTest.php | 8 ++++---- test/phpunit/WebservicesProductsTest.php | 8 ++++---- test/phpunit/WebservicesThirdpartyTest.php | 8 ++++---- test/phpunit/WebservicesUserTest.php | 8 ++++---- test/phpunit/XCalLibTest.php | 8 ++++---- test/phpunit/functional/InstallTest.php | 4 ++-- test/phpunit/functional/TakePosFunctionalTest.php | 4 ++-- 81 files changed, 320 insertions(+), 320 deletions(-) diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index 7bee4dd3b00..97b067ff454 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -78,7 +78,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index b739b387a74..2499841d671 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -78,7 +78,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 6238466427e..a3e55063cd4 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -80,7 +80,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -104,7 +104,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -117,7 +117,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -132,7 +132,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index 1d8a6cfbfd2..c56afb7efa8 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -79,7 +79,7 @@ class BOMTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class BOMTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class BOMTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class BOMTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index 4ce31e8bd60..8f1169b6cbd 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -81,7 +81,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -94,7 +94,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -107,7 +107,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -123,7 +123,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/BarcodeTest.php b/test/phpunit/BarcodeTest.php index 132ba8c1126..67cc013c50b 100644 --- a/test/phpunit/BarcodeTest.php +++ b/test/phpunit/BarcodeTest.php @@ -81,7 +81,7 @@ class BarcodeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -94,7 +94,7 @@ class BarcodeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -107,7 +107,7 @@ class BarcodeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -123,7 +123,7 @@ class BarcodeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 314640aefda..ce5a4ae1bd8 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -80,7 +80,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -93,7 +93,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 81b05486c72..bf61ba38fbd 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -108,7 +108,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -144,7 +144,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -157,7 +157,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -172,7 +172,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 7e4b5dbacb7..729aa4b4c7f 100644 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -78,7 +78,7 @@ class CMailFileTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class CMailFileTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class CMailFileTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class CMailFileTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 67e7f937267..3bd870914e3 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -79,7 +79,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index 705d21ed95d..14a9fabc9ae 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -78,7 +78,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 979be4d8604..9c9af971616 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -110,7 +110,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -123,7 +123,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -136,7 +136,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -152,7 +152,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 96ae1f61ab0..b04f6ed4737 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -110,7 +110,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -123,7 +123,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -136,7 +136,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -152,7 +152,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 5240083512b..7d00f464665 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -80,7 +80,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -93,7 +93,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 064c205c0e9..cb439fe2c84 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -78,7 +78,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CommonInvoiceTest.php b/test/phpunit/CommonInvoiceTest.php index f4cfaefb809..1aed7c4326b 100644 --- a/test/phpunit/CommonInvoiceTest.php +++ b/test/phpunit/CommonInvoiceTest.php @@ -78,7 +78,7 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 7a01f750eef..97711832291 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -79,7 +79,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 8b78712209f..afdc040493e 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -78,7 +78,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index a2a83ee70a7..39b8109b3a3 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -78,7 +78,7 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index 1f8977f6919..e3f76ad57d0 100644 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -85,7 +85,7 @@ class ContactTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -99,7 +99,7 @@ class ContactTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -112,7 +112,7 @@ class ContactTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -127,7 +127,7 @@ class ContactTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index cd21427eba7..e834255ab9a 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -78,7 +78,7 @@ class ContratTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class ContratTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class ContratTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class ContratTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 87f3a3940f4..8ac448fa15e 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -101,7 +101,7 @@ class CoreTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -114,7 +114,7 @@ class CoreTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -127,7 +127,7 @@ class CoreTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -142,7 +142,7 @@ class CoreTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 983ad2af489..9e7fc91fc7a 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -85,7 +85,7 @@ class DateLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -98,7 +98,7 @@ class DateLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -111,7 +111,7 @@ class DateLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -126,7 +126,7 @@ class DateLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 0db809be2f7..b855b240648 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -78,7 +78,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -99,7 +99,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -112,7 +112,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -127,7 +127,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index 5841ba59c37..ec761a14316 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -78,7 +78,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/EmailCollectorTest.php b/test/phpunit/EmailCollectorTest.php index da77825b3b9..08652ffd2be 100644 --- a/test/phpunit/EmailCollectorTest.php +++ b/test/phpunit/EmailCollectorTest.php @@ -80,7 +80,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -93,7 +93,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index 691b3039744..8ee0c537f8a 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -78,7 +78,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -96,7 +96,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -109,7 +109,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/EvalMathTest.php b/test/phpunit/EvalMathTest.php index 1346538668c..885b80233c7 100644 --- a/test/phpunit/EvalMathTest.php +++ b/test/phpunit/EvalMathTest.php @@ -77,7 +77,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -91,7 +91,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index 247a9dd1012..6b2bb319385 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -79,7 +79,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 6f4928362ea..cf2f0520908 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -103,7 +103,7 @@ class ExportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -116,7 +116,7 @@ class ExportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -129,7 +129,7 @@ class ExportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -144,7 +144,7 @@ class ExportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 06d28a03067..e6ec6683253 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -79,7 +79,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 1fb62ecfd0e..5d7c99813e2 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -79,7 +79,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 891eaf05b99..5f12eacdd60 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -79,7 +79,7 @@ class FactureTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -100,7 +100,7 @@ class FactureTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -113,7 +113,7 @@ class FactureTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -129,7 +129,7 @@ class FactureTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index 7c225167e35..822311cb0e9 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -78,7 +78,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index fb8cdd0b12e..58c750c7b86 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -78,7 +78,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 8c819c6de64..e702f7482ce 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -79,7 +79,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 7217f3b57e2..7b492a4d8ec 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -78,7 +78,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FormTest.php b/test/phpunit/FormTest.php index 3345c7ddd1e..41f79ffb749 100644 --- a/test/phpunit/FormTest.php +++ b/test/phpunit/FormTest.php @@ -78,7 +78,7 @@ class FormTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class FormTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class FormTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class FormTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index db131fee67c..69ccdc45866 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -102,7 +102,7 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -115,7 +115,7 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -128,7 +128,7 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -143,7 +143,7 @@ class Functions2LibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 0b6feb18903..5357f7c8061 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -108,7 +108,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -133,7 +133,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -146,7 +146,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -162,7 +162,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/GetUrlLibTest.php b/test/phpunit/GetUrlLibTest.php index 97878ef9589..b8e3c50363f 100644 --- a/test/phpunit/GetUrlLibTest.php +++ b/test/phpunit/GetUrlLibTest.php @@ -79,7 +79,7 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class GetUrlLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index 4fbd57c212b..8e2e8aaaf8b 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -80,7 +80,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -94,7 +94,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -107,7 +107,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 960dd56c4b5..b8288aa25e6 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -80,7 +80,7 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -93,7 +93,7 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index ed285608690..d64c82cc4e8 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -101,7 +101,7 @@ class ImportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -114,7 +114,7 @@ class ImportTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -127,7 +127,7 @@ class ImportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -142,7 +142,7 @@ class ImportTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/InventoryTest.php b/test/phpunit/InventoryTest.php index ad2b19aebd3..a879c91b70e 100644 --- a/test/phpunit/InventoryTest.php +++ b/test/phpunit/InventoryTest.php @@ -79,7 +79,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -93,7 +93,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index a8619ae08c5..341cf51583f 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -101,7 +101,7 @@ class JsonLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -114,7 +114,7 @@ class JsonLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -127,7 +127,7 @@ class JsonLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -142,7 +142,7 @@ class JsonLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/KnowledgeRecordTest.php b/test/phpunit/KnowledgeRecordTest.php index 5e4d9a0d301..8c3ed03e9b5 100644 --- a/test/phpunit/KnowledgeRecordTest.php +++ b/test/phpunit/KnowledgeRecordTest.php @@ -81,7 +81,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf, $user, $langs, $db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -96,7 +96,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf, $user, $langs, $db; $conf = $this->savconf; @@ -112,7 +112,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } @@ -122,7 +122,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf, $user, $langs, $db; $db->rollback(); diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index e0eaded97de..18fa1c2d4db 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -110,7 +110,7 @@ class LangTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -123,7 +123,7 @@ class LangTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -136,7 +136,7 @@ class LangTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -152,7 +152,7 @@ class LangTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php index 691d413d020..6bf90b4a105 100644 --- a/test/phpunit/LesscTest.php +++ b/test/phpunit/LesscTest.php @@ -110,7 +110,7 @@ class LesscTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -123,7 +123,7 @@ class LesscTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -136,7 +136,7 @@ class LesscTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -152,7 +152,7 @@ class LesscTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index 3dba569c4e9..58f4b6f0041 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -78,7 +78,7 @@ class LoanTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class LoanTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class LoanTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class LoanTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index 1c7553eb76f..0b5aa0cfb5e 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -78,7 +78,7 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class MarginsLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 8fd67576a7e..5ef22cddd88 100644 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -77,7 +77,7 @@ class ModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -90,7 +90,7 @@ class ModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -103,7 +103,7 @@ class ModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -118,7 +118,7 @@ class ModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index 749f94ab20f..a781ea78e12 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -80,7 +80,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -93,7 +93,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index ceab1948732..b2b6285f9e3 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -77,7 +77,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -91,7 +91,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index 61027d02710..378c703684b 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -79,7 +79,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -97,7 +97,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -110,7 +110,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -126,7 +126,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 35350c3bdae..595930225c9 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -81,7 +81,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -94,7 +94,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -107,7 +107,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index 044d4576067..17c4c82714e 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -80,7 +80,7 @@ class PgsqlTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -94,7 +94,7 @@ class PgsqlTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -107,7 +107,7 @@ class PgsqlTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -122,7 +122,7 @@ class PgsqlTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index de847e68411..5378407c2b4 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -84,7 +84,7 @@ class PricesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; //$db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -97,7 +97,7 @@ class PricesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; //$db->rollback(); @@ -110,7 +110,7 @@ class PricesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -126,7 +126,7 @@ class PricesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 90dfab3fe04..d23d2562f22 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -78,7 +78,7 @@ class ProductTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -96,7 +96,7 @@ class ProductTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -109,7 +109,7 @@ class ProductTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class ProductTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index 0a5812036d3..f49fd5857e2 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -79,7 +79,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 235cc81e10c..493d99257a6 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -78,7 +78,7 @@ class PropalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class PropalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class PropalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class PropalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index c71ef7bcf63..1992e56d815 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -81,7 +81,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -94,7 +94,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -106,7 +106,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase * Init phpunit tests. * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf = $this->savconf; @@ -138,7 +138,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase * End phpunit tests. * @return void */ - protected function tearDown() + protected function tearDown(): void { echo __METHOD__."\n"; } diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index c908b631df8..a1214c1a047 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -87,7 +87,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -100,7 +100,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -113,7 +113,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -146,7 +146,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index fa0a4a9d72b..6132cd7837a 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -110,7 +110,7 @@ class ScriptsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -123,7 +123,7 @@ class ScriptsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -136,7 +136,7 @@ class ScriptsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -152,7 +152,7 @@ class ScriptsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index cc43d6c3a31..cadf8a7504f 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -106,7 +106,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -119,7 +119,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -132,7 +132,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -148,7 +148,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 1a93fb5d21f..ff24614e090 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -79,7 +79,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -105,7 +105,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -118,7 +118,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -134,7 +134,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/StripeTest.php b/test/phpunit/StripeTest.php index bb769e83e80..08eb585b7f7 100644 --- a/test/phpunit/StripeTest.php +++ b/test/phpunit/StripeTest.php @@ -79,7 +79,7 @@ class StripeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -97,7 +97,7 @@ class StripeTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -110,7 +110,7 @@ class StripeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -126,7 +126,7 @@ class StripeTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index ebcf30c29e6..11bd6c1e598 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -81,7 +81,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -98,7 +98,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -111,7 +111,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -132,7 +132,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index 60aea4b8098..09745d86e8e 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -79,7 +79,7 @@ class TicketTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -92,7 +92,7 @@ class TicketTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class TicketTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class TicketTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index 46eb3917001..b20bccb9b24 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -78,7 +78,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -120,7 +120,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index d6bc1093258..f318ae4cbac 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -78,7 +78,7 @@ class UserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -96,7 +96,7 @@ class UserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -109,7 +109,7 @@ class UserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -125,7 +125,7 @@ class UserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index 91ba85a7656..94679546350 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -78,7 +78,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -92,7 +92,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -105,7 +105,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -121,7 +121,7 @@ class UtilsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 04b0b27a44e..dccf1516993 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -99,7 +99,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; @@ -151,7 +151,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -164,7 +164,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -180,7 +180,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 7ad814f98ae..f790ac15902 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -82,7 +82,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -124,7 +124,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index 4b1d66c244d..5f5a6e833b1 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -82,7 +82,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -124,7 +124,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 0988b5109fe..f79bdc6313c 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -88,7 +88,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -101,7 +101,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -114,7 +114,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -130,7 +130,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index d9fb87759f8..7d8fb7aab8e 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -98,7 +98,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -111,7 +111,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -124,7 +124,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -140,7 +140,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 1af8398ffe6..6eba28dfde8 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -82,7 +82,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -95,7 +95,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -108,7 +108,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -124,7 +124,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 9c81c25c46e..dc4550fc84f 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -78,7 +78,7 @@ class XCalLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. @@ -91,7 +91,7 @@ class XCalLibTest extends PHPUnit\Framework\TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { global $conf,$user,$langs,$db; $db->rollback(); @@ -104,7 +104,7 @@ class XCalLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function setUp() + protected function setUp(): void { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -119,7 +119,7 @@ class XCalLibTest extends PHPUnit\Framework\TestCase * * @return void */ - protected function tearDown() + protected function tearDown(): void { print __METHOD__."\n"; } diff --git a/test/phpunit/functional/InstallTest.php b/test/phpunit/functional/InstallTest.php index ce3f9377244..f1ecdc60914 100644 --- a/test/phpunit/functional/InstallTest.php +++ b/test/phpunit/functional/InstallTest.php @@ -46,7 +46,7 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // Make sure we backup and remove the configuration file to force new install. @rename('htdocs/conf/conf.php', sys_get_temp_dir() . '/conf.php'); @@ -74,7 +74,7 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { // Remove the generated configuration and restore the backed up file. @unlink('htdocs/conf/conf.php'); diff --git a/test/phpunit/functional/TakePosFunctionalTest.php b/test/phpunit/functional/TakePosFunctionalTest.php index 5b9d03dcfef..3cb46a04fdf 100644 --- a/test/phpunit/functional/TakePosFunctionalTest.php +++ b/test/phpunit/functional/TakePosFunctionalTest.php @@ -103,7 +103,7 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase * * @return void */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } @@ -314,7 +314,7 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase * * @return void */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } } From fdef117f63267403953d0fb23fdedb8ba6982146 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 21 Sep 2022 18:11:00 +0200 Subject: [PATCH 0385/1289] FIX - php V8 propal index last draft --- htdocs/comm/propal/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 9f020bc1613..5bfed3ff1c9 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -78,7 +78,7 @@ if ($tmp) { */ if (!empty($conf->propal->enabled)) { $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; + $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.email, s.entity, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { From 4bcfbe5d3d4424a8a97a708b15489b750e3403e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 20:05:53 +0200 Subject: [PATCH 0386/1289] fix tpl --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index ed337b04e6a..a20c7cfa0b5 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -97,7 +97,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} - else if (type == 'pricecurrency') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} + else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 139a4bc4404..0f6e0ec7d5f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -96,7 +96,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();} else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} - else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} + else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();} else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();} From 138ab462378e9fa728b848519b19194676572a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 20:09:52 +0200 Subject: [PATCH 0387/1289] fix doc --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2b42b89c51d..3e7a3cc291a 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1099,7 +1099,7 @@ class ExtraFields } elseif ($type == 'pricecy') { $currency = $conf->currency; if (!empty($value)) { - // $value in memory is a php numeric, we format it into user number format. + // $value in memory is a php string like '10.01:USD' $pricetmp = explode(':', $value); $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency; $value = price($pricetmp[0]); @@ -1644,7 +1644,7 @@ class ExtraFields } elseif ($type == 'pricecy') { $currency = $conf->currency; if (!empty($value)) { - // $value in memory is a php numeric, we format it into user number format. + // $value in memory is a php string like '0.01:EUR' $pricetmp = explode(':', $value); $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency; $value = $pricetmp[0]; From 8dfd24b5cb57123471cec90011fbf5ed0a5a6087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 20:19:00 +0200 Subject: [PATCH 0388/1289] update doc --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d68a320482e..71cce2859f6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5315,7 +5315,7 @@ class Product extends CommonObject * @param string $origin_element Origin element type * @param int $origin_id Origin id of element * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) - * @param array $extrafields Array of extrafields + * @param Extrafields $extrafields Array of extrafields * @return int <0 if KO, >0 if OK */ public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) From e7afc7ac757141dd1a10381055868aea846ef985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 20:22:54 +0200 Subject: [PATCH 0389/1289] Update product.class.php --- htdocs/product/class/product.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 71cce2859f6..5dc2f69b529 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5255,7 +5255,7 @@ class Product extends CommonObject * @param string $origin_element Origin element type * @param int $origin_id Origin id of element * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) - * @param array $extrafields Array of extrafields + * @param Extrafields $extrafields Array of extrafields * @return int <0 if KO, >0 if OK */ public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) @@ -5924,7 +5924,8 @@ class Product extends CommonObject $this->tosell = 1; $this->tobuy = 1; $this->tobatch = 0; - $this->note = 'This is a comment (private)'; + $this->note_private = 'This is a comment (private)'; + $this->note_public = 'This is a comment (public)'; $this->date_creation = $now; $this->date_modification = $now; From caa54f7f110159e061160b80b7d469ca153e1293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 20:27:54 +0200 Subject: [PATCH 0390/1289] Update product.class.php --- htdocs/product/class/product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5dc2f69b529..f68b8249220 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro - * Copyright (C) 2019-2021 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 @@ -5921,8 +5921,8 @@ class Product extends CommonObject $this->description = 'This is description of this product specimen that was created the '.dol_print_date($now, 'dayhourlog').'.'; $this->specimen = 1; $this->country_id = 1; - $this->tosell = 1; - $this->tobuy = 1; + $this->status = 1; + $this->status_buy = 1; $this->tobatch = 0; $this->note_private = 'This is a comment (private)'; $this->note_public = 'This is a comment (public)'; From 2247bc2ae4f226690430a391e4988115ff1c5626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 21 Sep 2022 21:01:18 +0200 Subject: [PATCH 0391/1289] clean code --- htdocs/product/class/product.class.php | 152 ++++++++++++++----------- 1 file changed, 84 insertions(+), 68 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f68b8249220..ccc3a05c51f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -255,6 +255,14 @@ class Product extends CommonObject */ public $status = 0; + /** + * Status indicates whether the product is on sale '1' or not '0' + * @var int + * @deprecated + * @see $status + */ + public $tosell; + /** * Status indicate whether the product is available for purchase '1' or not '0' * @@ -262,6 +270,14 @@ class Product extends CommonObject */ public $status_buy = 0; + /** + * Status indicate whether the product is available for purchase '1' or not '0' + * @var int + * @deprecated + * @see $status_buy + */ + public $tobuy; + /** * Status indicates whether the product is a finished product '1' or a raw material '0' * @@ -1977,11 +1993,11 @@ class Product extends CommonObject $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $this->default_vat_code = $obj->default_vat_code; // Vat code supplier - $this->fourn_multicurrency_price = $obj->multicurrency_price; - $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; - $this->fourn_multicurrency_tx = $obj->multicurrency_tx; - $this->fourn_multicurrency_id = $obj->fk_multicurrency; - $this->fourn_multicurrency_code = $obj->multicurrency_code; + $this->fourn_multicurrency_price = $obj->multicurrency_price; + $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; + $this->fourn_multicurrency_tx = $obj->multicurrency_tx; + $this->fourn_multicurrency_id = $obj->fk_multicurrency; + $this->fourn_multicurrency_code = $obj->multicurrency_code; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { $this->packaging = $obj->packaging; } @@ -2042,11 +2058,11 @@ class Product extends CommonObject $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $this->default_vat_code = $obj->default_vat_code; // Vat code supplier - $this->fourn_multicurrency_price = $obj->multicurrency_price; - $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; - $this->fourn_multicurrency_tx = $obj->multicurrency_tx; - $this->fourn_multicurrency_id = $obj->fk_multicurrency; - $this->fourn_multicurrency_code = $obj->multicurrency_code; + $this->fourn_multicurrency_price = $obj->multicurrency_price; + $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; + $this->fourn_multicurrency_tx = $obj->multicurrency_tx; + $this->fourn_multicurrency_id = $obj->fk_multicurrency; + $this->fourn_multicurrency_code = $obj->multicurrency_code; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { $this->packaging = $obj->packaging; } @@ -2383,57 +2399,57 @@ class Product extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - $this->ref = $obj->ref; - $this->ref_ext = $obj->ref_ext; - $this->label = $obj->label; - $this->description = $obj->description; - $this->url = $obj->url; - $this->note_public = $obj->note_public; - $this->note_private = $obj->note_private; - $this->note = $obj->note_private; // deprecated + $this->ref = $obj->ref; + $this->ref_ext = $obj->ref_ext; + $this->label = $obj->label; + $this->description = $obj->description; + $this->url = $obj->url; + $this->note_public = $obj->note_public; + $this->note_private = $obj->note_private; + $this->note = $obj->note_private; // deprecated - $this->type = $obj->fk_product_type; - $this->status = $obj->tosell; - $this->status_buy = $obj->tobuy; - $this->status_batch = $obj->tobatch; - $this->batch_mask = $obj->batch_mask; + $this->type = $obj->fk_product_type; + $this->status = $obj->tosell; + $this->status_buy = $obj->tobuy; + $this->status_batch = $obj->tobatch; + $this->batch_mask = $obj->batch_mask; - $this->customcode = $obj->customcode; - $this->country_id = $obj->fk_country; + $this->customcode = $obj->customcode; + $this->country_id = $obj->fk_country; $this->country_code = getCountry($this->country_id, 2, $this->db); $this->state_id = $obj->fk_state; - $this->lifetime = $obj->lifetime; - $this->qc_frequency = $obj->qc_frequency; - $this->price = $obj->price; - $this->price_ttc = $obj->price_ttc; - $this->price_min = $obj->price_min; - $this->price_min_ttc = $obj->price_min_ttc; + $this->lifetime = $obj->lifetime; + $this->qc_frequency = $obj->qc_frequency; + $this->price = $obj->price; + $this->price_ttc = $obj->price_ttc; + $this->price_min = $obj->price_min; + $this->price_min_ttc = $obj->price_min_ttc; $this->price_base_type = $obj->price_base_type; - $this->cost_price = $obj->cost_price; + $this->cost_price = $obj->cost_price; $this->default_vat_code = $obj->default_vat_code; - $this->tva_tx = $obj->tva_tx; + $this->tva_tx = $obj->tva_tx; //! French VAT NPR - $this->tva_npr = $obj->tva_npr; - $this->recuperableonly = $obj->tva_npr; // For backward compatibility + $this->tva_npr = $obj->tva_npr; + $this->recuperableonly = $obj->tva_npr; // For backward compatibility //! Local taxes - $this->localtax1_tx = $obj->localtax1_tx; - $this->localtax2_tx = $obj->localtax2_tx; - $this->localtax1_type = $obj->localtax1_type; - $this->localtax2_type = $obj->localtax2_type; + $this->localtax1_tx = $obj->localtax1_tx; + $this->localtax2_tx = $obj->localtax2_tx; + $this->localtax1_type = $obj->localtax1_type; + $this->localtax2_type = $obj->localtax2_type; - $this->finished = $obj->finished; - $this->fk_default_bom = $obj->fk_default_bom; + $this->finished = $obj->finished; + $this->fk_default_bom = $obj->fk_default_bom; - $this->duration = $obj->duration; - $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1); + $this->duration = $obj->duration; + $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1); $this->duration_unit = substr($obj->duration, -1); - $this->canvas = $obj->canvas; + $this->canvas = $obj->canvas; $this->net_measure = $obj->net_measure; $this->net_measure_units = $obj->net_measure_units; - $this->weight = $obj->weight; - $this->weight_units = $obj->weight_units; - $this->length = $obj->length; - $this->length_units = $obj->length_units; + $this->weight = $obj->weight; + $this->weight_units = $obj->weight_units; + $this->length = $obj->length; + $this->length_units = $obj->length_units; $this->width = $obj->width; $this->width_units = $obj->width_units; $this->height = $obj->height; @@ -2442,32 +2458,32 @@ class Product extends CommonObject $this->surface = $obj->surface; $this->surface_units = $obj->surface_units; $this->volume = $obj->volume; - $this->volume_units = $obj->volume_units; + $this->volume_units = $obj->volume_units; $this->barcode = $obj->barcode; - $this->barcode_type = $obj->fk_barcode_type; + $this->barcode_type = $obj->fk_barcode_type; - $this->accountancy_code_buy = $obj->accountancy_code_buy; - $this->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra; - $this->accountancy_code_buy_export = $obj->accountancy_code_buy_export; - $this->accountancy_code_sell = $obj->accountancy_code_sell; - $this->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; - $this->accountancy_code_sell_export = $obj->accountancy_code_sell_export; + $this->accountancy_code_buy = $obj->accountancy_code_buy; + $this->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra; + $this->accountancy_code_buy_export = $obj->accountancy_code_buy_export; + $this->accountancy_code_sell = $obj->accountancy_code_sell; + $this->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; + $this->accountancy_code_sell_export = $obj->accountancy_code_sell_export; - $this->fk_default_warehouse = $obj->fk_default_warehouse; - $this->fk_default_workstation = $obj->fk_default_workstation; - $this->seuil_stock_alerte = $obj->seuil_stock_alerte; - $this->desiredstock = $obj->desiredstock; - $this->stock_reel = $obj->stock; + $this->fk_default_warehouse = $obj->fk_default_warehouse; + $this->fk_default_workstation = $obj->fk_default_workstation; + $this->seuil_stock_alerte = $obj->seuil_stock_alerte; + $this->desiredstock = $obj->desiredstock; + $this->stock_reel = $obj->stock; $this->pmp = $obj->pmp; - $this->date_creation = $obj->datec; - $this->date_modification = $obj->tms; - $this->import_key = $obj->import_key; - $this->entity = $obj->entity; + $this->date_creation = $obj->datec; + $this->date_modification = $obj->tms; + $this->import_key = $obj->import_key; + $this->entity = $obj->entity; - $this->ref_ext = $obj->ref_ext; - $this->fk_price_expression = $obj->fk_price_expression; - $this->fk_unit = $obj->fk_unit; + $this->ref_ext = $obj->ref_ext; + $this->fk_price_expression = $obj->fk_price_expression; + $this->fk_unit = $obj->fk_unit; $this->price_autogen = $obj->price_autogen; $this->model_pdf = $obj->model_pdf; From 744d1b0218f3fc318f51d4bdfaba0644fb67a619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 21 Sep 2022 21:52:39 +0200 Subject: [PATCH 0392/1289] Update bonprelevement.class.php --- htdocs/compta/prelevement/class/bonprelevement.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 464051926f2..a0beccfaff1 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1746,8 +1746,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, date("%d%m", $this->date_echeance)); - fputs($this->file, substr(date("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date("%d%m", $this->date_echeance, 'gmt')); + fputs($this->file, substr(dol_print_date("%y", $this->date_echeance, 'gmt'), 1)); // Raison Sociale Destinataire C2 @@ -1972,8 +1972,8 @@ class BonPrelevement extends CommonObject // Date d'echeance C1 fputs($this->file, " "); - fputs($this->file, date("%d%m", $this->date_echeance)); - fputs($this->file, substr(date("%y", $this->date_echeance), 1)); + fputs($this->file, dol_print_date("%d%m", $this->date_echeance, 'gmt')); + fputs($this->file, substr(dol_print_date("%y", $this->date_echeance, 'gmt'), 1)); // Raison Sociale C2 From 92aac0dca30b172a4fd4ceefac000941d676e31f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 23:52:17 +0200 Subject: [PATCH 0393/1289] Add log --- htdocs/contrat/class/contrat.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 78f97b3124a..29428ceb26d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3363,6 +3363,8 @@ class ContratLigne extends CommonObjectLine // If we change a planned date (start or end), sync dates for all services if (!$error && !empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES)) { + dol_syslog(get_class($this)."::update CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES is on so we update date for all lines", LOG_DEBUG); + if ($this->date_ouverture_prevue != $this->oldcopy->date_ouverture_prevue) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'contratdet SET'; $sql .= " date_ouverture_prevue = ".($this->date_ouverture_prevue != '' ? "'".$this->db->idate($this->date_ouverture_prevue)."'" : "null"); From 62233f270394cd49e22d3128e5eaecf80cc44337 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 01:52:02 +0200 Subject: [PATCH 0394/1289] Fix travis --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27274e81945..6422e33a7e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -114,7 +114,7 @@ install: php-parallel-lint/php-var-dump-check ~0.4 \ squizlabs/php_codesniffer ^3 fi - if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then + if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then composer -n require phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ @@ -259,7 +259,7 @@ before_script: # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | - if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi @@ -295,7 +295,7 @@ script: set -e #parallel-lint --exclude htdocs/includes --blame . # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + if [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \ --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \ --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \ @@ -310,7 +310,7 @@ script: # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e @@ -321,7 +321,7 @@ script: # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php . fi set +e From 4900ceec78679c07df4ef19ad4fff9b55924d080 Mon Sep 17 00:00:00 2001 From: jpb Date: Thu, 22 Sep 2022 08:38:28 +0200 Subject: [PATCH 0395/1289] fix issue #22356 --- htdocs/mrp/mo_list.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 12d2320742d..dfbe224e733 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -251,6 +251,13 @@ foreach ($search as $key => $val) { $sql .= natural_search('moparent.ref', $search[$key], 0); continue; } + + if ($key == 'status') { + $sql .= natural_search('t.status', $search[$key], 0); + continue; + } + + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { From eab8ef79064d0380072a76e1c21d51de5dac6c0c Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Thu, 22 Sep 2022 09:25:09 +0200 Subject: [PATCH 0396/1289] FIX - CronJob sendBackup --- htdocs/core/modules/modCron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 290eea449f5..d6bea3ff089 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -100,7 +100,7 @@ class modCron extends DolibarrModules $this->cronjobs = array( 0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true), 1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'), - 2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendDumpDatabase', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'), + 2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendBackup', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'), // 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) ); From 8258706b58161ee62d220b400d139aa50ab4d115 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 22 Sep 2022 10:24:47 +0200 Subject: [PATCH 0397/1289] US trasnlation --- htdocs/langs/en_US/mrp.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 9e1c8bb64ce..44fb4457999 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -82,6 +82,7 @@ ProductsToProduce=Products to produce UnitCost=Unit cost TotalCost=Total cost BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price) +BOMTotalCostService=If the "Workstation" module is activated and a workstation is defined by default on the line, then the calculation is "quantity (converted into hours) x workstation ahr", otherwise "quantity (converted into hours) x cost price of the service" GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it. ErrorAVirtualProductCantBeUsedIntoABomOrMo=A kit can't be used into a BOM or a MO Workstation=Workstation From d314ed380be83b5df193839ff730f7794025c2f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 13:01:11 +0200 Subject: [PATCH 0398/1289] NEW Can edit property css, cssview, csslist on extrafields --- htdocs/adherents/admin/member_extrafields.php | 8 ---- .../admin/member_type_extrafields.php | 8 ---- htdocs/admin/agenda_extrafields.php | 9 ---- htdocs/admin/bank_extrafields.php | 8 ---- htdocs/admin/bankline_extrafields.php | 8 ---- htdocs/admin/bom_extrafields.php | 8 ---- ...mande_fournisseur_dispatch_extrafields.php | 8 ---- htdocs/admin/delivery_extrafields.php | 8 ---- htdocs/admin/deliverydet_extrafields.php | 8 ---- htdocs/admin/ecm_directories_extrafields.php | 8 ---- htdocs/admin/ecm_files_extrafields.php | 8 ---- ...ventorganization_confbooth_extrafields.php | 8 ---- ...nization_confboothattendee_extrafields.php | 8 ---- htdocs/admin/expedition_extrafields.php | 7 ---- htdocs/admin/expeditiondet_extrafields.php | 8 ---- htdocs/admin/expensereport_extrafields.php | 9 ---- htdocs/admin/holiday_extrafields.php | 8 ---- htdocs/admin/knowledgerecord_extrafields.php | 8 ---- htdocs/admin/mrp_extrafields.php | 8 ---- htdocs/admin/order_extrafields.php | 8 ---- htdocs/admin/orderdet_extrafields.php | 8 ---- htdocs/admin/reception_extrafields.php | 8 ---- htdocs/admin/resource_extrafields.php | 7 ---- htdocs/admin/supplierinvoice_extrafields.php | 7 ---- .../admin/supplierinvoicedet_extrafields.php | 7 ---- htdocs/admin/supplierorder_extrafields.php | 7 ---- htdocs/admin/supplierorderdet_extrafields.php | 7 ---- htdocs/admin/ticket_extrafields.php | 6 --- htdocs/asset/admin/asset_extrafields.php | 8 ---- htdocs/asset/admin/assetmodel_extrafields.php | 8 ---- .../admin/categorie_extrafields.php | 7 ---- htdocs/comm/admin/propal_extrafields.php | 7 ---- htdocs/comm/admin/propaldet_extrafields.php | 7 ---- .../admin/facture_cust_extrafields.php | 12 ------ .../admin/facture_rec_cust_extrafields.php | 13 ------ .../admin/facturedet_cust_extrafields.php | 12 ------ .../admin/facturedet_rec_cust_extrafields.php | 12 ------ htdocs/contrat/admin/contract_extrafields.php | 7 ---- .../contrat/admin/contractdet_extrafields.php | 7 ---- htdocs/core/actions_extrafields.inc.php | 13 ++++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/tpl/admin_extrafields_add.tpl.php | 10 ++++- .../core/tpl/admin_extrafields_edit.tpl.php | 18 +++++++- .../core/tpl/admin_extrafields_view.tpl.php | 42 ++++++++++++++----- htdocs/don/admin/donation_extrafields.php | 7 ---- .../fichinter/admin/fichinter_extrafields.php | 7 ---- .../admin/fichinterdet_extrafields.php | 7 ---- htdocs/hrm/admin/evaluation_extrafields.php | 8 ---- htdocs/hrm/admin/job_extrafields.php | 8 ---- htdocs/hrm/admin/skill_extrafields.php | 8 ---- htdocs/langs/en_US/admin.lang | 7 ++++ htdocs/langs/en_US/modulebuilder.lang | 4 +- .../template/admin/myobject_extrafields.php | 10 +++-- .../admin/partnership_extrafields.php | 8 ---- .../product/admin/inventory_extrafields.php | 8 ---- htdocs/product/admin/product_extrafields.php | 8 ---- .../product/admin/product_lot_extrafields.php | 7 ---- .../admin/product_supplier_extrafields.php | 7 ---- htdocs/product/admin/stock_extrafields.php | 7 ---- .../admin/stock_mouvement_extrafields.php | 8 ---- htdocs/projet/admin/project_extrafields.php | 7 ---- .../projet/admin/project_task_extrafields.php | 7 ---- .../admin/candidature_extrafields.php | 8 ---- .../admin/jobposition_extrafields.php | 8 ---- .../salaries/admin/salaries_extrafields.php | 7 ---- htdocs/societe/admin/contact_extrafields.php | 7 ---- htdocs/societe/admin/societe_extrafields.php | 7 ---- .../admin/supplier_proposal_extrafields.php | 7 ---- .../supplier_proposaldet_extrafields.php | 7 ---- htdocs/user/admin/group_extrafields.php | 7 ---- htdocs/user/admin/user_extrafields.php | 7 ---- 71 files changed, 81 insertions(+), 520 deletions(-) diff --git a/htdocs/adherents/admin/member_extrafields.php b/htdocs/adherents/admin/member_extrafields.php index ef12b5cf68e..5776828c078 100644 --- a/htdocs/adherents/admin/member_extrafields.php +++ b/htdocs/adherents/admin/member_extrafields.php @@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '

'; diff --git a/htdocs/adherents/admin/member_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php index 2fc8864b323..ac796a4d3ab 100644 --- a/htdocs/adherents/admin/member_type_extrafields.php +++ b/htdocs/adherents/admin/member_type_extrafields.php @@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index cc91646b456..cade3a90e71 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -87,15 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index b872a22108c..3626eec4455 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -83,14 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/bankline_extrafields.php b/htdocs/admin/bankline_extrafields.php index d86733e4e24..06f1267343a 100644 --- a/htdocs/admin/bankline_extrafields.php +++ b/htdocs/admin/bankline_extrafields.php @@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/bom_extrafields.php b/htdocs/admin/bom_extrafields.php index 2facfc570b8..7b77702eea4 100644 --- a/htdocs/admin/bom_extrafields.php +++ b/htdocs/admin/bom_extrafields.php @@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 4f89dd8fff6..277d61e1b2f 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -92,14 +92,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/admin/delivery_extrafields.php b/htdocs/admin/delivery_extrafields.php index 32c8f34e570..214f209b2be 100644 --- a/htdocs/admin/delivery_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/deliverydet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php index 5030379320f..9c054f5bcfd 100644 --- a/htdocs/admin/deliverydet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -90,14 +90,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 4191e40a369..f820f376995 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index 1887103bcc9..563f9f58275 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/eventorganization_confbooth_extrafields.php b/htdocs/admin/eventorganization_confbooth_extrafields.php index 97bc4ad37bd..a4b14206c65 100644 --- a/htdocs/admin/eventorganization_confbooth_extrafields.php +++ b/htdocs/admin/eventorganization_confbooth_extrafields.php @@ -79,14 +79,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/eventorganization_confboothattendee_extrafields.php b/htdocs/admin/eventorganization_confboothattendee_extrafields.php index 552e814f8de..8830e42dd26 100644 --- a/htdocs/admin/eventorganization_confboothattendee_extrafields.php +++ b/htdocs/admin/eventorganization_confboothattendee_extrafields.php @@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index ed4e062970d..303b0f88167 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -89,13 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index e0ce6a82b8f..56a023e1c83 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -90,14 +90,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 3406b9092e7..69f6bf14d61 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -83,15 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index c51b2846cf9..21fce3d62d6 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -83,14 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/knowledgerecord_extrafields.php b/htdocs/admin/knowledgerecord_extrafields.php index 62580d585c3..13c628be99b 100644 --- a/htdocs/admin/knowledgerecord_extrafields.php +++ b/htdocs/admin/knowledgerecord_extrafields.php @@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/mrp_extrafields.php b/htdocs/admin/mrp_extrafields.php index 5553604eeff..cd18b47eec7 100644 --- a/htdocs/admin/mrp_extrafields.php +++ b/htdocs/admin/mrp_extrafields.php @@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 0339f3a2b45..8ebbce2cc4d 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 889a042389a..e9c0947d6a2 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -87,14 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 31b4d836db8..bf87698e5d8 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -92,14 +92,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index b7770797f21..62c1c4cfed2 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -85,13 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 760a89c4a0d..d0da90dcad4 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 55664d46966..8fa0f5130c9 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -89,13 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 63c679e3ef9..17a2eccbc58 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 7f38fe77cc8..6e5b8aa0175 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -88,13 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index fc792030ade..ccd0c75bd76 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -78,12 +78,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} // Creation of an optional field if ($action == 'create') { diff --git a/htdocs/asset/admin/asset_extrafields.php b/htdocs/asset/admin/asset_extrafields.php index b7a67151407..b5671e27071 100644 --- a/htdocs/asset/admin/asset_extrafields.php +++ b/htdocs/asset/admin/asset_extrafields.php @@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/asset/admin/assetmodel_extrafields.php b/htdocs/asset/admin/assetmodel_extrafields.php index 44f2b1d7ca4..cddd3831e8e 100644 --- a/htdocs/asset/admin/assetmodel_extrafields.php +++ b/htdocs/asset/admin/assetmodel_extrafields.php @@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index aea67145258..7f2fabe4a3a 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -80,13 +80,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index d0aa0db96b0..fa0c9117430 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -80,13 +80,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 4d68948e34c..0f904b31407 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -83,13 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 4268bd19fa1..67f3becb6b5 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -81,18 +81,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* - * * Creation of an optional field - * */ if ($action == 'create') { @@ -103,9 +93,7 @@ if ($action == 'create') { } /* - * * Edition of an optional field - * */ if ($action == 'edit' && !empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index d595a665daa..fb5282352fc 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -81,19 +81,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); - -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* - * * Creation of an optional field - * */ if ($action == 'create') { @@ -104,9 +93,7 @@ if ($action == 'create') { } /* - * * Edition of an optional field - * */ if ($action == 'edit' && !empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 0c24c6ed2b4..5bd66c4f0f7 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -82,18 +82,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* - * * Creation of an optional field - * */ if ($action == 'create') { @@ -104,9 +94,7 @@ if ($action == 'create') { } /* - * * Edition of an optional field - * */ if ($action == 'edit' && !empty($attrname)) { print "
"; diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 06553dcbdcf..01c6abc310a 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -82,18 +82,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* - * * Creation of an optional field - * */ if ($action == 'create') { @@ -104,9 +94,7 @@ if ($action == 'create') { } /* - * * Edition of an optional field - * */ if ($action == 'edit' && !empty($attrname)) { print "
"; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 8821a15608d..a7c092f5473 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 1d56089e83a..ad5922991e7 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 7a7ab380e29..83fd8d47c4f 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -28,8 +28,11 @@ $maxsizeint = 10; $mesg = array(); $extrasize = GETPOST('size', 'intcomma'); -$type = GETPOST('type', 'alpha'); -$param = GETPOST('param', 'alpha'); +$type = GETPOST('type', 'alphanohtml'); +$param = GETPOST('param', 'alphanohtml'); +$css = GETPOST('css', 'alphanohtml'); +$cssview = GETPOST('cssview', 'alphanohtml'); +$csslist = GETPOST('csslist', 'alphanohtml'); if ($type == 'double' && strpos($extrasize, ',') === false) { $extrasize = '24,8'; @@ -195,7 +198,8 @@ if ($action == 'add') { GETPOST('langfile', 'alpha'), 1, (GETPOST('totalizable', 'alpha') ? 1 : 0), - GETPOST('printable', 'alpha') + GETPOST('printable', 'alpha'), + array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist) ); if ($result > 0) { setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); @@ -365,7 +369,8 @@ if ($action == 'update') { GETPOST('langfile'), GETPOST('enabled', 'alpha'), (GETPOST('totalizable', 'alpha') ? 1 : 0), - GETPOST('printable', 'alpha') + GETPOST('printable', 'alpha'), + array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist) ); if ($result > 0) { setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cf784f50947..047d255eb59 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10646,7 +10646,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg) * @param string $iconClass class for icon element (Example: 'fa fa-file') * @param string $url the url for link * @param string $id attribute id of button - * @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip + * @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use param $helpText as tooltip help * @param array $params various params for future : recommended rather than adding more function arguments * @return string html button */ diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 97748290bd7..5995df64f21 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -192,9 +192,9 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con trans("Unique"); ?>> -trans("Required"); ?>> +trans("Mandatory"); ?>> -trans("AlwaysEditable"); ?>> +textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?>> textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> @@ -203,6 +203,12 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con trans("Totalizable"); ?>> + +textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?> + +textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?> + +textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?> textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 7814560be9b..f16526533ff 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -167,6 +167,9 @@ $help = $extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname]; $printable = $extrafields->attributes[$elementtype]['printable'][$attrname]; $enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname]; +$css = $extrafields->attributes[$elementtype]['css'][$attrname]; +$cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname]; +$csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname]; if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) { $param_chain = ''; @@ -279,10 +282,10 @@ if (in_array($type, array_keys($typewecanchangeinto))) { trans("Unique"); ?>> -trans("Required"); ?>> +trans("Mandatory"); ?>> -trans("AlwaysEditable"); ?>> +textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?>> textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> @@ -291,8 +294,19 @@ if (in_array($type, array_keys($typewecanchangeinto))) { textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?> + + textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>> + +textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?> + + +textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?> + + +textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?> + textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 285b7eb30a4..c93501ead18 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -38,14 +38,25 @@ $langs->load("modulebuilder"); '.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'

'."\n"; -print '
'; +$title = ''.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'
'."\n"; +//if ($action != 'create' && $action != 'edit') { +$newcardbutton = dolGetButtonTitle($langs->trans('NewAttribute'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=create', '', (($action != 'create' && $action != 'edit') ? 1 : 1)); +/*} else { + $newcardbutton = ''; +}*/ + +print '
'; +print '
'; +print '
'.$title.'
'; +print '
'.$newcardbutton.'
'; +print '
'; +print '
'; // Load $extrafields->attributes $extrafields->fetch_name_optionals_label($elementtype); print '
'; -print ''; +print '
'; print ''; print ''; print ''; print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; print ''; +print ''; +print ''; +print ''; if (isModEnabled('multicompany')) { print ''; } @@ -87,14 +101,14 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel // Position print "\n"; // Label - print "\n"; // We don't translate here, we want admin to know what is the key not translated value + print '\n"; // We don't translate here, we want admin to know what is the key not translated value // Label translated print '\n"; // Key - print "\n"; + print '\n"; // Type $typetoshow = $type2label[$extrafields->attributes[$elementtype]['type'][$key]]; - print '\n"; // Size @@ -113,6 +127,13 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel print '\n"; // Summable print '\n"; + // CSS + print '\n"; + // CSS view + print '\n"; + // CSS list + print '\n"; + // Multicompany if (isModEnabled('multicompany')) { print ''; } + // Actions print '"; } } else { - $colspan = 14; + $colspan = 17; if (isModEnabled('multicompany')) { $colspan++; } diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php index 7d774478217..a0454ea08d7 100644 --- a/htdocs/don/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -78,13 +78,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - /* ************************************************************************** */ /* */ diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 67427f8f73b..2a6a8d603d1 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/fichinter/admin/fichinterdet_extrafields.php b/htdocs/fichinter/admin/fichinterdet_extrafields.php index 69913abd188..ddc34952dc0 100644 --- a/htdocs/fichinter/admin/fichinterdet_extrafields.php +++ b/htdocs/fichinter/admin/fichinterdet_extrafields.php @@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/hrm/admin/evaluation_extrafields.php b/htdocs/hrm/admin/evaluation_extrafields.php index ddf20696ff7..8363829975e 100644 --- a/htdocs/hrm/admin/evaluation_extrafields.php +++ b/htdocs/hrm/admin/evaluation_extrafields.php @@ -88,14 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 6af5f1ffc67..8dff50f4b6f 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -88,14 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/hrm/admin/skill_extrafields.php b/htdocs/hrm/admin/skill_extrafields.php index 1ca37038e93..d2541af15fa 100644 --- a/htdocs/hrm/admin/skill_extrafields.php +++ b/htdocs/hrm/admin/skill_extrafields.php @@ -87,14 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6a1146a2f9d..7026e9df738 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2314,3 +2314,10 @@ ShowHideTheNRequests=Show/hide the %s SQL request(s) DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s TriggerCodes=Triggerable events TriggerCodeInfo=Enter here the trigger code(s) that must generate a post of a web request (only external URL are allowed). You can enter several trigger codes separated by a comma. +EditableWhenDraftOnly=If unchecked, the value can only be modified when object has a draft status +CssOnEdit=Css on edit pages +CssOnView=Css on view pages +CssOnList=Css on list pages +HelpCssOnEditDesc=The Css used when editing the field.
Example: "minwiwdth100 maxwidth500 widthcentpercentminusx" +HelpCssOnViewDesc=The Css used when viewing the field. +HelpCssOnListDesc=The Css used when field is inside a list table.
Example: "tdoverflowmax200" diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index d68b0b337f9..c7ca26ee149 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -91,8 +91,8 @@ ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active.

Examples:
1
isModEnabled('MAIN_MODULE_MYMODULE')
getDolGlobalString('MYMODULE_OPTION')==2 VisibleDesc=Is the field visible ? (Examples: 0=Never 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 end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
$user->hasRight('holiday', 'define_holiday')?1:5 -DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty -DisplayOnPdf=Display on PDF +DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty +DisplayOnPdf=On PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0) SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax. diff --git a/htdocs/modulebuilder/template/admin/myobject_extrafields.php b/htdocs/modulebuilder/template/admin/myobject_extrafields.php index 7a530721526..07653753646 100644 --- a/htdocs/modulebuilder/template/admin/myobject_extrafields.php +++ b/htdocs/modulebuilder/template/admin/myobject_extrafields.php @@ -113,10 +113,12 @@ print dol_get_fiche_end(); // Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; +if ((float) DOL_VERSION < 17) { // On v17+, the "New Attribute" button is included into tpl. + if ($action != 'create' && $action != 'edit') { + print '
'; + print ''.$langs->trans("NewAttribute").''; + print "
"; + } } diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php index 6406285777e..b96ea51a096 100644 --- a/htdocs/partnership/admin/partnership_extrafields.php +++ b/htdocs/partnership/admin/partnership_extrafields.php @@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/product/admin/inventory_extrafields.php b/htdocs/product/admin/inventory_extrafields.php index 3c9364349ef..74267ee1c8e 100644 --- a/htdocs/product/admin/inventory_extrafields.php +++ b/htdocs/product/admin/inventory_extrafields.php @@ -91,14 +91,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 724173478e3..4885c595097 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -92,14 +92,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/product/admin/product_lot_extrafields.php b/htdocs/product/admin/product_lot_extrafields.php index e318b050d7a..6f0f28ff235 100644 --- a/htdocs/product/admin/product_lot_extrafields.php +++ b/htdocs/product/admin/product_lot_extrafields.php @@ -85,13 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/product/admin/product_supplier_extrafields.php b/htdocs/product/admin/product_supplier_extrafields.php index 259f476e6af..afd46f104ae 100644 --- a/htdocs/product/admin/product_supplier_extrafields.php +++ b/htdocs/product/admin/product_supplier_extrafields.php @@ -93,13 +93,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/product/admin/stock_extrafields.php b/htdocs/product/admin/stock_extrafields.php index a42410d9bf6..a10de1f1e42 100644 --- a/htdocs/product/admin/stock_extrafields.php +++ b/htdocs/product/admin/stock_extrafields.php @@ -80,13 +80,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/product/admin/stock_mouvement_extrafields.php b/htdocs/product/admin/stock_mouvement_extrafields.php index d7a5d1e6d83..33aee41072e 100644 --- a/htdocs/product/admin/stock_mouvement_extrafields.php +++ b/htdocs/product/admin/stock_mouvement_extrafields.php @@ -91,14 +91,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index 2447c12631e..f2a17d3f150 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/projet/admin/project_task_extrafields.php b/htdocs/projet/admin/project_task_extrafields.php index 612a7f67e6d..731ac3629ae 100644 --- a/htdocs/projet/admin/project_task_extrafields.php +++ b/htdocs/projet/admin/project_task_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/recruitment/admin/candidature_extrafields.php b/htdocs/recruitment/admin/candidature_extrafields.php index 8d08cce1a70..24cc74b6892 100644 --- a/htdocs/recruitment/admin/candidature_extrafields.php +++ b/htdocs/recruitment/admin/candidature_extrafields.php @@ -79,14 +79,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/recruitment/admin/jobposition_extrafields.php b/htdocs/recruitment/admin/jobposition_extrafields.php index d41dee3b2c5..02e4eb2566d 100644 --- a/htdocs/recruitment/admin/jobposition_extrafields.php +++ b/htdocs/recruitment/admin/jobposition_extrafields.php @@ -79,14 +79,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - - /* * Creation of an optional field */ diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 7b9607e0f30..85b389d0697 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '

'; diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index dbd51ce1aac..6f9a24e27fc 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 8ba7e49d968..861f4888be0 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index dad2859cd8d..4d69ad5d8ae 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -76,13 +76,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print "
"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index 477134e319e..be89df64755 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 6793445879f..22700bfe619 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -83,13 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 2855c544b25..c6a2b2c4a28 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); -// Buttons -if ($action != 'create' && $action != 'edit') { - print '
'; - print ''.$langs->trans("NewAttribute").''; - print "
"; -} - // Creation of an optional field if ($action == 'create') { print '
'; From b2a6c7347f628031083ffa0aa9d713fae8b469a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 13:17:15 +0200 Subject: [PATCH 0399/1289] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7026e9df738..d6ca0c4d184 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -515,7 +515,7 @@ PageUrlForDefaultValuesCreate=
Example:
For the form to create a new third PageUrlForDefaultValuesList=
Example:
For the page that lists third parties, it is %s.
For URL of external modules installed into custom directory, do not include the "custom/" so use a path like mymodule/mypagelist.php and not custom/mymodule/mypagelist.php.
If you want default value only if url has some parameter, you can use %s AlsoDefaultValuesAreEffectiveForActionCreate=Also note that overwritting default values for form creation works only for pages that were correctly designed (so with parameter action=create or presend...) EnableDefaultValues=Enable customization of default values -EnableOverwriteTranslation=Enable usage of overwritten translation +EnableOverwriteTranslation=Allow customization of translations GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code. To change this value, you must edit it from Home-Setup-translation. WarningSettingSortOrder=Warning, setting a default sort order may result in a technical error when going on the list page if field is an unknown field. If you experience such an error, come back to this page to remove the default sort order and restore default behavior. Field=Field From 388dd6395bdc6d96c407f42a2ecdfd11b859bc8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 14:06:50 +0200 Subject: [PATCH 0400/1289] Clean code --- htdocs/bom/lib/bom.lib.php | 2 ++ htdocs/core/lib/contact.lib.php | 4 +++- htdocs/core/lib/contract.lib.php | 8 ++++++-- htdocs/core/lib/donation.lib.php | 4 +++- htdocs/core/lib/expensereport.lib.php | 4 +++- htdocs/core/lib/fichinter.lib.php | 4 +++- htdocs/core/lib/fourn.lib.php | 10 ++++++++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/hrm.lib.php | 9 +++------ htdocs/core/lib/invoice.lib.php | 4 +++- htdocs/core/lib/loan.lib.php | 4 +++- htdocs/core/lib/member.lib.php | 4 +++- htdocs/core/lib/order.lib.php | 4 +++- htdocs/core/lib/product.lib.php | 8 +++++--- htdocs/core/lib/project.lib.php | 8 ++++++-- htdocs/core/lib/propal.lib.php | 4 +++- htdocs/core/lib/reception.lib.php | 4 +++- htdocs/core/lib/resource.lib.php | 4 +++- htdocs/core/lib/salaries.lib.php | 4 +++- htdocs/core/lib/stock.lib.php | 4 +++- htdocs/core/lib/supplier_proposal.lib.php | 4 +++- htdocs/core/lib/ticket.lib.php | 5 ++++- .../lib/knowledgemanagement.lib.php | 2 ++ htdocs/margin/lib/margins.lib.php | 3 ++- htdocs/mrp/lib/mrp.lib.php | 2 ++ htdocs/partnership/lib/partnership.lib.php | 2 ++ htdocs/product/inventory/lib/inventory.lib.php | 2 ++ .../stock/stocktransfer/lib/stocktransfer.lib.php | 2 ++ htdocs/recruitment/lib/recruitment.lib.php | 2 ++ htdocs/workstation/lib/workstation.lib.php | 2 ++ htdocs/zapier/lib/zapier.lib.php | 2 ++ 31 files changed, 95 insertions(+), 32 deletions(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 94debfbee7b..df06986362f 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -134,6 +134,8 @@ function bomPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom', 'remove'); + return $head; } diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index d7c89b1cf99..e079cd431dd 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -103,7 +103,7 @@ function contact_prepare_head(Contact $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact'); + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'core'); // Notes if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { @@ -147,6 +147,8 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'info'; $tab++;*/ + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'remove'); return $head; diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 9ccffab8b49..7999db14f93 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -55,7 +55,7 @@ function contract_prepare_head(Contrat $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -96,6 +96,8 @@ function contract_prepare_head(Contrat $object) $head[$h][2] = 'agenda'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove'); return $head; @@ -126,7 +128,7 @@ function contract_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'core'); $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); @@ -146,6 +148,8 @@ function contract_admin_prepare_head() $head[$h][2] = 'attributeslines'; $h++; + complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'external'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'remove'); return $head; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index f951d9b522f..100998a3ac9 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -83,7 +83,7 @@ function donation_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'core'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; @@ -118,6 +118,8 @@ function donation_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove'); return $head; diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 3287227a05d..19e2e0ca00d 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -43,7 +43,7 @@ function expensereport_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'add', 'core'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; @@ -80,6 +80,8 @@ function expensereport_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'remove'); return $head; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 6bfb7f717de..eaa1f85d142 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -61,7 +61,7 @@ function fichinter_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'core'); // Tab to link resources if (isModEnabled('resource')) { @@ -125,6 +125,8 @@ function fichinter_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'remove'); return $head; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 59a16164f97..6b66c8d68e7 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -83,7 +83,7 @@ function facturefourn_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -120,6 +120,8 @@ function facturefourn_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'remove'); return $head; @@ -189,7 +191,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -229,7 +231,11 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) } $head[$h][2] = 'info'; $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'remove'); + return $head; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 047d255eb59..2a2675ed7bd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9057,7 +9057,7 @@ function getLanguageCodeFromCountryCode($countrycode) * 'ecm' to add a tab for another ecm view * 'stock' to add a tab for warehouse view * @param string $mode 'add' to complete head, 'remove' to remove entries - * @param string $filterorigmodule Filter on module origin. 'external' will show only external modules. 'core' only core modules. No filter by default. + * @param string $filterorigmodule Filter on module origin: 'external' will show only external modules. 'core' only core modules. No filter (default) will add both. * @return void */ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode = 'add', $filterorigmodule = '') diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index e53cc9b3965..5335dc1c75e 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -52,17 +52,11 @@ function establishment_prepare_head($object) $head[$h][2] = 'info'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove'); - - - $head[$h][0] = dol_buildpath("/hrm/admin/setup.php", 1); $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm'); - $head[$h][0] = dol_buildpath("/hrm/admin/about.php", 1); $head[$h][1] = $langs->trans("About"); $head[$h][2] = 'about'; @@ -70,6 +64,9 @@ function establishment_prepare_head($object) complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove'); + return $head; } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9e60f20fd25..54e639058c4 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -84,7 +84,7 @@ function facture_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -121,6 +121,8 @@ function facture_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove'); return $head; diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 4692c0b938b..6f87fd851fb 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -51,7 +51,7 @@ function loan_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan'); + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'core'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; @@ -82,6 +82,8 @@ function loan_prepare_head($object) $head[$tab][2] = 'info'; $tab++; + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'remove'); return $head; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 677d8cfdaef..f235be0d070 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -80,7 +80,7 @@ function member_prepare_head(Adherent $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'member'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'core'); $nbNote = 0; if (!empty($object->note_private)) { @@ -123,6 +123,8 @@ function member_prepare_head(Adherent $object) $h++; } + complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'remove'); return $head; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 9128be56ea1..80d2c0c534d 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -96,7 +96,7 @@ function commande_prepare_head(Commande $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'order'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -133,6 +133,8 @@ function commande_prepare_head(Commande $object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove'); return $head; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 393a2f618a0..8559cc275ac 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -153,7 +153,7 @@ function product_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'product'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'core'); // Notes if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { @@ -201,8 +201,6 @@ function product_prepare_head($object) $head[$h][2] = 'documents'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove'); - // Log $head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); @@ -213,6 +211,10 @@ function product_prepare_head($object) $head[$h][2] = 'agenda'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'external'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove'); + return $head; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 6c4dbeffd8a..a8d29794b9d 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -244,7 +244,7 @@ function project_prepare_head(Project $project, $moreparam = '') // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $project, $head, $h, 'project'); + complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { @@ -320,6 +320,8 @@ function project_prepare_head(Project $project, $moreparam = '') $head[$h][2] = 'agenda'; $h++; + complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'external'); + complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'remove'); return $head; @@ -381,7 +383,7 @@ function task_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'task'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -425,6 +427,8 @@ function task_prepare_head($object) $h++; } + complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'remove'); return $head; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 06fae0dd81d..54c0614b147 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -73,7 +73,7 @@ function propal_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -110,6 +110,8 @@ function propal_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'remove'); return $head; diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index 26f6817ed24..7f5c6e865de 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -66,7 +66,7 @@ function reception_prepare_head(Reception $object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'core'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; @@ -96,6 +96,8 @@ function reception_prepare_head(Reception $object) $head[$h][2] = 'note'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'remove'); return $head; diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index f222857b9d8..ebfbaf224f6 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -55,7 +55,7 @@ function resource_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -99,6 +99,8 @@ function resource_prepare_head($object) $head[$h][2] = 'info'; $h++;*/ + complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'remove'); return $head; diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 57cb9675e3f..51ec880e31e 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -42,7 +42,7 @@ function salaries_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'core'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; @@ -62,6 +62,8 @@ function salaries_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'remove'); return $head; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index 79844f5aed7..e2e8d7a63d2 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -69,13 +69,15 @@ function stock_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'core'); $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'remove'); return $head; diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index e5c0ed7dbf9..3c9915bc951 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -59,7 +59,7 @@ function supplier_proposal_prepare_head($object) // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'core'); if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { $nbNote = 0; @@ -96,6 +96,8 @@ function supplier_proposal_prepare_head($object) $head[$h][2] = 'info'; $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'remove'); return $head; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index eb814cb1295..4bfeeb5a5bf 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -102,7 +102,7 @@ function ticket_prepare_head($object) $h++; } - complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'core'); // Attached files include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -140,6 +140,9 @@ function ticket_prepare_head($object) $head[$h][2] = 'tabTicketLogs'; $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'external'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'remove'); return $head; diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php index 12db6245087..2f189b05f5c 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php @@ -61,5 +61,7 @@ function knowledgemanagementAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'knowledgemanagement', 'remove'); + return $head; } diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 10e449026fa..710862b250c 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -96,9 +96,10 @@ function marges_prepare_head() $head[$h][2] = 'checkMargins'; } - complete_head_from_modules($conf, $langs, null, $head, $h, 'margins', 'remove'); complete_head_from_modules($conf, $langs, null, $head, $h, 'margins'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'margins', 'remove'); + return $head; } diff --git a/htdocs/mrp/lib/mrp.lib.php b/htdocs/mrp/lib/mrp.lib.php index dac11e1dd1c..854244e53c7 100644 --- a/htdocs/mrp/lib/mrp.lib.php +++ b/htdocs/mrp/lib/mrp.lib.php @@ -55,5 +55,7 @@ function mrpAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp', 'remove'); + return $head; } diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php index 62046fec68c..abf8dcca63b 100644 --- a/htdocs/partnership/lib/partnership.lib.php +++ b/htdocs/partnership/lib/partnership.lib.php @@ -68,6 +68,8 @@ function partnershipAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'partnership'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'partnership', 'remove'); + return $head; } diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php index bda792abec4..95bcfcd1fe5 100644 --- a/htdocs/product/inventory/lib/inventory.lib.php +++ b/htdocs/product/inventory/lib/inventory.lib.php @@ -52,6 +52,8 @@ function inventoryAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory', 'remove'); + return $head; } diff --git a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php index 8460a6405bc..90fd3f25ba9 100644 --- a/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php +++ b/htdocs/product/stock/stocktransfer/lib/stocktransfer.lib.php @@ -63,5 +63,7 @@ function stocktransferAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'stocktransfer'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'stocktransfer', 'remove'); + return $head; } diff --git a/htdocs/recruitment/lib/recruitment.lib.php b/htdocs/recruitment/lib/recruitment.lib.php index cb1f0b7e2bc..acc7160f282 100644 --- a/htdocs/recruitment/lib/recruitment.lib.php +++ b/htdocs/recruitment/lib/recruitment.lib.php @@ -70,5 +70,7 @@ function recruitmentAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'recruitment'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'recruitment', 'remove'); + return $head; } diff --git a/htdocs/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php index 92ea28d8bfb..8250a85adda 100644 --- a/htdocs/workstation/lib/workstation.lib.php +++ b/htdocs/workstation/lib/workstation.lib.php @@ -61,5 +61,7 @@ function workstationAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'workstation'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'workstation', 'remove'); + return $head; } diff --git a/htdocs/zapier/lib/zapier.lib.php b/htdocs/zapier/lib/zapier.lib.php index dedec01ac71..5b6a3bd335a 100644 --- a/htdocs/zapier/lib/zapier.lib.php +++ b/htdocs/zapier/lib/zapier.lib.php @@ -54,5 +54,7 @@ function zapierAdminPrepareHead() //); // to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'zapier'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'zapier', 'remove'); + return $head; } From 77c0e1f5d0c9b77233157772b9ef8b6f401945ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 14:18:24 +0200 Subject: [PATCH 0401/1289] Autofill code from label when adding new extrafield --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 5995df64f21..dc4ef707a4e 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -134,6 +134,12 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con jQuery("#computed_value").keyup(function() { init_typeoffields(jQuery('#type').val()); }); + + /* Autofill the code with label */ + jQuery("#label").keyup(function() { + console.log("Update new field"); + $("#attrname").val( $(this).val().replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() ); + }); }); @@ -145,7 +151,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con
'.$langs->trans("Position"); @@ -60,11 +71,14 @@ print ''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("ComputedFormula").''.$langs->trans("Unique").''.$langs->trans("Required").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$langs->trans("Mandatory").''.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).''.$form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")).''.$form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")).''.$langs->trans("Entity").'".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."".dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key]))."".dol_escape_htmltag($key)."'.dol_escape_htmltag($key)."'; + print ''; print dol_escape_htmltag($typetoshow); print "'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['css'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['cssview'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['csslist'][$key])."'; if (empty($extrafields->attributes[$elementtype]['entityid'][$key])) { @@ -131,6 +152,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel } print ''; print ''.img_edit().''; print '  '.img_delete().''; @@ -138,7 +160,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel print "
- + From d3a90732c53937edb5dbc026235ce720162c3350 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 14:42:58 +0200 Subject: [PATCH 0402/1289] Fix css --- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/asset.lib.php | 2 +- htdocs/core/lib/contract.lib.php | 4 ++-- htdocs/core/lib/donation.lib.php | 2 +- htdocs/core/lib/ecm.lib.php | 4 ++-- htdocs/core/lib/product.lib.php | 4 ++-- htdocs/core/lib/project.lib.php | 4 ++-- htdocs/core/lib/propal.lib.php | 4 ++-- htdocs/core/lib/stock.lib.php | 6 +++--- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 4 ++-- htdocs/hrm/lib/hrm.lib.php | 6 +++--- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 87755969897..a6a24e056b9 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -402,7 +402,7 @@ function agenda_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['actioncomm']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index 117c564dc95..be31f995657 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -68,7 +68,7 @@ function assetAdminPrepareHead() $head[$h][1] = $langs->trans("ExtraFieldsAssetModel"); $nbExtrafields = $extrafields->attributes['asset_model']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'assetmodel_extrafields'; $h++; diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 7999db14f93..390de71fca8 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -134,7 +134,7 @@ function contract_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['contrat']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -143,7 +143,7 @@ function contract_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['contratdet']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributeslines'; $h++; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 100998a3ac9..52ab3df958b 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -51,7 +51,7 @@ function donation_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['don']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index cfcd4972a79..f61ec0e060c 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -181,7 +181,7 @@ function ecm_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles"); $nbExtrafields = $extrafields->attributes['ecm_files']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_ecm_files'; $h++; @@ -190,7 +190,7 @@ function ecm_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories"); $nbExtrafields = $extrafields->attributes['ecm_directories']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_ecm_directories'; $h++; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 8559cc275ac..983611120b0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -314,7 +314,7 @@ function product_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['product']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -323,7 +323,7 @@ function product_admin_prepare_head() $head[$h][1] = $langs->trans("ProductSupplierExtraFields"); $nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'supplierAttributes'; $h++; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a8d29794b9d..22668a16be4 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -511,7 +511,7 @@ function project_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsProject"); $nbExtrafields = $extrafields->attributes['projet']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -520,7 +520,7 @@ function project_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); $nbExtrafields = $extrafields->attributes['projet_task']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_task'; $h++; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 54c0614b147..0b91188b47f 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -148,7 +148,7 @@ function propal_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['propal']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -157,7 +157,7 @@ function propal_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['propaldet']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributeslines'; $h++; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index e2e8d7a63d2..131093659b9 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -115,7 +115,7 @@ function stock_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['entrepot']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -124,7 +124,7 @@ function stock_admin_prepare_head() $head[$h][1] = $langs->trans("StockMouvementExtraFields"); $nbExtrafields = $extrafields->attributes['stock_mouvement']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'stockMouvementAttributes'; $h++; @@ -133,7 +133,7 @@ function stock_admin_prepare_head() $head[$h][1] = $langs->trans("InventoryExtraFields"); $nbExtrafields = $extrafields->attributes['inventory']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'inventoryAttributes'; $h++; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 4bfeeb5a5bf..79cc5980c16 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -49,7 +49,7 @@ function ticketAdminPrepareHead() $head[$h][1] = $langs->trans("ExtraFieldsTicket"); $nbExtrafields = $extrafields->attributes['ticket']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 79648eddd87..6e7ad7ade3e 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -274,7 +274,7 @@ function user_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")"; $nbExtrafields = $extrafields->attributes['user']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -283,7 +283,7 @@ function user_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")"; $nbExtrafields = $extrafields->attributes['usergroup']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_group'; $h++; diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index d821c2f5216..2fef293784d 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -58,7 +58,7 @@ function hrmAdminPrepareHead() $head[$h][1] = $langs->trans("EvaluationsExtraFields"); $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'evaluationsAttributes'; $h++; @@ -67,7 +67,7 @@ function hrmAdminPrepareHead() $head[$h][1] = $langs->trans("JobsExtraFields"); $nbExtrafields = $extrafields->attributes['hrm_job']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'jobsAttributes'; $h++; @@ -76,7 +76,7 @@ function hrmAdminPrepareHead() $head[$h][1] = $langs->trans("SkillsExtraFields"); $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'skillsAttributes'; $h++; From a71be1a1219f37adc898a3f0b780016ed5597e19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 14:47:32 +0200 Subject: [PATCH 0403/1289] Fix missing test on multicurrency to show remain to pay vendor invoice --- htdocs/fourn/facture/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0c041a0c1be..7704466d939 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3518,8 +3518,7 @@ if ($action == 'create') { print ''; print ''; } - } else // Credit note - { + } else { // Credit note $cssforamountpaymentcomplete = 'amountpaymentneutral'; // Total already paid back @@ -3542,7 +3541,7 @@ if ($action == 'create') { print ''; // Remainder to pay back Multicurrency - if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; // Remainder to pay Multicurrency - if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; print ''; print ''; print ''; print ''; } else { print ''; - print ''; + print ''; // Will be approved by print ''; print ''; - print ''; // warning: date_valid is approval date on holiday module + print ''; // warning: date_valid is approval date on holiday module print ''; } if ($object->statut == Holiday::STATUS_CANCELED) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 102d37620bc..0125becd21c 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -421,6 +421,7 @@ class Holiday extends CommonObject $this->fk_validator = $obj->fk_validator; $this->date_valid = $this->db->jdate($obj->date_valid); $this->fk_user_valid = $obj->fk_user_valid; + $this->user_validation_id = $obj->fk_user_valid; $this->date_approval = $this->db->jdate($obj->date_approval); $this->fk_user_approve = $obj->fk_user_approve; $this->date_refuse = $this->db->jdate($obj->date_refuse); @@ -743,9 +744,12 @@ class Holiday extends CommonObject // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; + $sql .= " fk_user_valid = ".((int) $user->id).","; + $sql .= " date_valid = '".$this->db->idate(dol_now())."',"; if (!empty($this->statut) && is_numeric($this->statut)) { $sql .= " statut = ".((int) $this->statut).","; } else { + $this->error = 'Property status must be a numeric value'; $error++; } $sql .= " ref = '".$this->db->escape($num)."'"; @@ -868,7 +872,7 @@ class Holiday extends CommonObject $error++; } if (!empty($this->fk_validator)) { - $sql .= " fk_validator = '".$this->db->escape($this->fk_validator)."',"; + $sql .= " fk_validator = ".((int) $this->fk_validator).","; } else { $error++; } @@ -878,7 +882,7 @@ class Holiday extends CommonObject $sql .= " date_valid = NULL,"; } if (!empty($this->fk_user_valid)) { - $sql .= " fk_user_valid = '".$this->db->escape($this->fk_user_valid)."',"; + $sql .= " fk_user_valid = ".((int) $this->fk_user_valid).","; } else { $sql .= " fk_user_valid = NULL,"; } @@ -888,7 +892,7 @@ class Holiday extends CommonObject $sql .= " date_approval = NULL,"; } if (!empty($this->fk_user_approve)) { - $sql .= " fk_user_approve = '".$this->db->escape($this->fk_user_approve)."',"; + $sql .= " fk_user_approve = ".((int) $this->fk_user_approve).","; } else { $sql .= " fk_user_approve = NULL,"; } @@ -898,7 +902,7 @@ class Holiday extends CommonObject $sql .= " date_refuse = NULL,"; } if (!empty($this->fk_user_refuse)) { - $sql .= " fk_user_refuse = '".$this->db->escape($this->fk_user_refuse)."',"; + $sql .= " fk_user_refuse = ".((int) $this->fk_user_refuse).","; } else { $sql .= " fk_user_refuse = NULL,"; } @@ -908,7 +912,7 @@ class Holiday extends CommonObject $sql .= " date_cancel = NULL,"; } if (!empty($this->fk_user_cancel)) { - $sql .= " fk_user_cancel = '".$this->db->escape($this->fk_user_cancel)."',"; + $sql .= " fk_user_cancel = ".((int) $this->fk_user_cancel).","; } else { $sql .= " fk_user_cancel = NULL,"; } @@ -2289,12 +2293,6 @@ class Holiday extends CommonObject $auser->fetch($obj->fk_user_approval_done); $this->user_approve = $auser; } - } else { - if (!empty($obj->fk_user_approval_expected)) { - $auser = new User($this->db); - $auser->fetch($obj->fk_user_approval_expected); - $this->user_approve = $auser; - } } } $this->db->free($resql); From 0412c5a181c49a8bba1cd54fbf27c58a345bdfc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 21:06:35 +0200 Subject: [PATCH 0412/1289] Clean scrutinizer file and increase timeout --- .scrutinizer.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 67b4b346b6c..dc75fbc962e 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -7,6 +7,7 @@ build: tests: override: - php-scrutinizer-run + idle_timeout: 500 imports: - javascript @@ -39,9 +40,11 @@ tools: - build/* - dev/* - doc/* - - test/* + - documents/* - htdocs/includes/* - htdocs/core/class/lessc.class.php + - node_modules/* + - test/* paths: - htdocs/ - scripts/ @@ -181,8 +184,10 @@ tools: - 'build/*' - 'dev/*' - 'doc/*' - - 'test/*' + - 'documents/*' - 'htdocs/includes/*' + - 'node_modules/*' + - 'test/*' paths: { } # Similar code detection @@ -194,8 +199,10 @@ tools: - 'build/*' - 'dev/*' - 'doc/*' - - 'test/*' + - 'documents/*' - 'htdocs/includes/*' + - 'node_modules/*' + - 'test/*' paths: { } # Coding-Style / Bug Detection @@ -209,8 +216,10 @@ tools: - 'build/*' - 'dev/*' - 'doc/*' - - 'test/*' + - 'documents/*' - 'htdocs/includes/*' + - 'node_modules/*' + - 'test/*' paths: { } config: { } path_configs: { } From f9e247bd77bffed933330ea90a5a952beed4b6c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 21:18:35 +0200 Subject: [PATCH 0413/1289] Fix warning --- htdocs/takepos/admin/receipt.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index a4c2efa03e9..bcf0a853705 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -39,6 +39,7 @@ if (!$user->admin) { $langs->loadLangs(array("admin", "cashdesk", "commercial")); + /* * Actions */ @@ -68,7 +69,7 @@ if (GETPOST('action', 'alpha') == 'set') { } elseif (GETPOST('action', 'alpha') == 'setmethod') { dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity); // TakePOS connector require ReceiptPrinter module - if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && !isModEnabled('receiptprinter')) { + if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && !isModEnabled('receiptprinter')) { activateModule("modReceiptPrinter"); } } @@ -106,7 +107,7 @@ print $langs->trans('Browser'); print '\n"; -if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2); $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); $htmltext = ''.$langs->trans("AvailableVariables").':
'; @@ -190,7 +190,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; print '
\n"; print ''; // Customer information @@ -254,7 +254,7 @@ if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_v print "\n"; } -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { print '\n"; -if (!empty($conf->global->TAKEPOS_PRINT_WITHOUT_DETAILS)) { +if (getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS')) { print ''; if (!$i) { @@ -1519,7 +1519,7 @@ if ($resql) { } // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; if (!$i) { diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 862d3c733fc..67712178bd3 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -26,7 +26,6 @@ create table llx_commande entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (deprecated) ref_client varchar(255), -- reference for customer fk_soc integer NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_delivery.sql b/htdocs/install/mysql/tables/llx_delivery.sql index 8216b5cf145..d1e7f4b42c2 100644 --- a/htdocs/install/mysql/tables/llx_delivery.sql +++ b/htdocs/install/mysql/tables/llx_delivery.sql @@ -26,7 +26,6 @@ create table llx_delivery fk_soc integer NOT NULL, ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info) ref_customer varchar(255), -- customer number date_creation datetime, -- date de creation diff --git a/htdocs/install/mysql/tables/llx_expedition.sql b/htdocs/install/mysql/tables/llx_expedition.sql index 4214fef7f44..f61ab8224f0 100644 --- a/htdocs/install/mysql/tables/llx_expedition.sql +++ b/htdocs/install/mysql/tables/llx_expedition.sql @@ -29,7 +29,6 @@ create table llx_expedition fk_projet integer DEFAULT NULL, ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info) ref_customer varchar(255), -- customer number date_creation datetime, -- date de creation diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 3e8ac2b7a50..7377d7803a7 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -30,7 +30,6 @@ create table llx_facture entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info) ref_client varchar(255), -- reference for customer type smallint DEFAULT 0 NOT NULL, -- type of invoice diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index a8f0aa3e2c9..33df27f8fe4 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -26,7 +26,6 @@ create table llx_propal entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info) ref_client varchar(255), -- customer proposal number fk_soc integer, diff --git a/htdocs/install/mysql/tables/llx_reception.sql b/htdocs/install/mysql/tables/llx_reception.sql index 8de59edcb77..9256aaf6abe 100644 --- a/htdocs/install/mysql/tables/llx_reception.sql +++ b/htdocs/install/mysql/tables/llx_reception.sql @@ -29,7 +29,6 @@ create table llx_reception fk_projet integer DEFAULT NULL, ref_ext varchar(30), -- reference into an external system (not used by dolibarr) - ref_int varchar(30), -- reference into an internal system (deprecated) ref_supplier varchar(128), -- supplier number date_creation datetime, -- date de creation diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 3c2f8a67be1..7f198db6042 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -29,7 +29,6 @@ create table llx_societe entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(255), -- reference into an external system (not used by dolibarr) - ref_int varchar(255), -- reference into an internal system (deprecated) statut tinyint DEFAULT 0, -- statut parent integer, diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal.sql b/htdocs/install/mysql/tables/llx_supplier_proposal.sql index 0008f08642f..3be54f8e143 100644 --- a/htdocs/install/mysql/tables/llx_supplier_proposal.sql +++ b/htdocs/install/mysql/tables/llx_supplier_proposal.sql @@ -20,7 +20,6 @@ CREATE TABLE llx_supplier_proposal ( ref varchar(30) NOT NULL, entity integer NOT NULL DEFAULT 1, ref_ext varchar(255) DEFAULT NULL, - ref_int varchar(255) DEFAULT NULL, fk_soc integer DEFAULT NULL, fk_projet integer DEFAULT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 19f1c79565c..007c98f1840 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -700,12 +700,6 @@ class Societe extends CommonObject */ public $ref; - /** - * @var string Internal ref - * @deprecated - */ - public $ref_int; - /** * External user reference. * This is to allow external systems to store their id and make self-developed synchronizing functions easier to build. diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 73769d43cec..65357174019 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -183,7 +183,6 @@ $order_fields = array( 'ref' => array('name'=>'ref', 'type'=>'xsd:string'), 'ref_client' => array('name'=>'ref_client', 'type'=>'xsd:string'), 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'), - 'ref_int' => array('name'=>'ref_int', 'type'=>'xsd:string'), 'thirdparty_id' => array('name'=>'thirdparty_id', 'type'=>'xsd:int'), 'status' => array('name'=>'status', 'type'=>'xsd:int'), 'billed' => array('name'=>'billed', 'type'=>'xsd:string'), @@ -438,7 +437,6 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') 'ref' => $order->ref, 'ref_client' => $order->ref_client, 'ref_ext' => $order->ref_ext, - 'ref_int' => $order->ref_int, 'thirdparty_id' => $order->socid, 'status' => $order->statut, @@ -593,7 +591,6 @@ function getOrdersForThirdParty($authentication, $idthirdparty) 'ref' => $order->ref, 'ref_client' => $order->ref_client, 'ref_ext' => $order->ref_ext, - 'ref_int' => $order->ref_int, 'socid' => $order->socid, 'status' => $order->statut, From 724490b94de89a00620e73205bbc2b6453efa924 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Sep 2022 09:56:54 +0200 Subject: [PATCH 0421/1289] FIX wrong result check when update expensereport line --- htdocs/expensereport/class/expensereport.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ca8f1698767..e0799a46f73 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2069,6 +2069,7 @@ class ExpenseReport extends CommonObject if ($this->status == self::STATUS_DRAFT || $this->status == self::STATUS_REFUSED) { $this->db->begin(); + $error = 0; $type = 0; // TODO What if type is service ? // We don't know seller and buyer for expense reports @@ -2152,10 +2153,13 @@ class ExpenseReport extends CommonObject $this->applyOffset(); $this->checkRules(); - $error = 0; - $result = $this->line->update($user); - if ($result > 0 && !$notrigger) { + $result = $this->line->update($user); + if ($result < 0) { + $error++; + } + + if (!$error && !$notrigger) { // Call triggers $result = $this->call_trigger('EXPENSE_REPORT_DET_MODIFY', $user); if ($result < 0) { @@ -2164,7 +2168,7 @@ class ExpenseReport extends CommonObject // End call triggers } - if ($result > 0 && $error == 0) { + if (!$error) { $this->db->commit(); return 1; } else { From f36b8b062b6f9ae5322d0d56c091ed718ec09707 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:17:36 +0200 Subject: [PATCH 0422/1289] Update html.formticket.class.php --- htdocs/core/class/html.formticket.class.php | 96 +++++++++++---------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 176e2346c17..31482200b6c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -20,13 +20,14 @@ */ /** - * \file htdocs/core/class/html.formticket.class.php - * \ingroup ticket - * \brief File of class to generate the form for creating a new ticket. + * \file htdocs/core/class/html.formticket.class.php + * \ingroup ticket + * \brief File of class to generate the form for creating a new ticket. */ -require_once DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"; -require_once DOL_DOCUMENT_ROOT."/core/class/html.formmail.class.php"; -require_once DOL_DOCUMENT_ROOT."/core/class/html.formprojet.class.php"; + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; if (!class_exists('FormCompany')) { include DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -35,8 +36,8 @@ if (!class_exists('FormCompany')) { /** * Class to generate the form for creating a new ticket. * Usage: $formticket = new FormTicket($db) - * $formticket->proprietes=1 ou chaine ou tableau de valeurs - * $formticket->show_form() affiche le formulaire + * $formticket->proprietes = 1 or string or array of values + * $formticket->show_form() shows the form * * @package Ticket */ @@ -64,8 +65,8 @@ class FormTicket public $withtopic; public $withemail; + /** - * * @var int $withsubstit Show substitution array */ public $withsubstit; @@ -75,19 +76,19 @@ class FormTicket public $backtopage; - public $ispublic; // To show information or not into public form + public $ispublic; // to show information or not into public form public $withtitletopic; public $withtopicreadonly; public $withreadid; - public $withcompany; // affiche liste déroulante company + public $withcompany; // to show company drop-down list public $withfromsocid; public $withfromcontactid; public $withnotifytiersatcreate; - public $withusercreate; // Show name of creating user in form + public $withusercreate; // to show name of creating user in form public $withcreatereadonly; - public $withref; // Show ref field + public $withref; // to show ref field public $withcancel; @@ -132,7 +133,7 @@ class FormTicket $this->withcreatereadonly = 1; $this->withemail = 0; $this->withref = 0; - $this->withextrafields = 0; // Show extrafields or not + $this->withextrafields = 0; // to show extrafields or not //$this->withtopicreadonly=0; } @@ -316,12 +317,12 @@ class FormTicket print ''; } - // Type + // Type of Ticket print ''; - // Group + // Group => Category print ''; - // Severity + // Severity => Priority print ''; @@ -339,7 +340,7 @@ class FormTicket if ($this->withtitletopic) { print ''; @@ -669,14 +670,14 @@ class FormTicket /** * Return html list of tickets type * - * @param string $selected Id du type pre-selectionne - * @param string $htmlname Nom de la zone select - * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS + * @param string $selected Id du type pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS * @return void */ public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') @@ -707,7 +708,7 @@ class FormTicket continue; } - // We discard empty line if showempty is on because an empty line has already been output. + // If 'showempty' is enabled we discard empty line because an empty line has already been output. if ($empty && empty($arraytypes['code'])) { continue; } @@ -728,7 +729,7 @@ class FormTicket print '"; - // Severity + // Severity = Priority print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } } else { print ''; - print ''; + print ''; print ''; } print '
trans("LabelOrTranslationKey"); ?>
trans("LabelOrTranslationKey"); ?>
trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).' 
'.price($sign * $resteapayeraffiche).' 
'; print ''; print $langs->trans('RemainderToPayBackMulticurrency'); From 0f9dd0b04a98cef3c1835c28852204af78a449be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 14:53:34 +0200 Subject: [PATCH 0404/1289] Fix missing test on multicurrency to show remain to pay vendor invoice --- 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 7704466d939..33fac296f8d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3507,7 +3507,7 @@ if ($action == 'create') { print ''.price($resteapayeraffiche).' 
'; print ''; print $langs->trans('RemainderToPayMulticurrency'); From d4db4480d708bb1697dab8539aa0590735a0b07c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:15:15 +0200 Subject: [PATCH 0405/1289] FIX Warning php8 --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 4 ++-- .../mailings/thirdparties_services_expired.modules.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 14bb45f0687..c70416fec6e 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''.dol_print_date($objectlink->date, 'day').''; - if ($user->rights->facture->lire) { + if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) { $sign = 1; - if ($object->type == Facture::TYPE_CREDIT_NOTE) { + if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) { $sign = -1; } if ($objectlink->statut != 3) { diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index b5dec9cbbe0..979782e61a5 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets { global $langs; - $s .= ''; if (count($this->arrayofproducts)) { $s .= ''; } else { @@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets } $s .= ''; $s .= ajax_combobox("filter_services_expired"); + return $s; } From c5c85fad9d80bcc9881c6f4e52ce2d7dcb8ecb01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:18:10 +0200 Subject: [PATCH 0406/1289] Fix warning --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1b9b64ffb0f..04f1c6239be 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7988,7 +7988,7 @@ abstract class CommonObject switch ($mode) { case "view": - $value = $this->array_options["options_".$key.$keysuffix]; // Value may be clean or formated later + $value = ((!empty($this->array_options) && array_key_exists("options_".$key.$keysuffix, $this->array_options)) ? $this->array_options["options_".$key.$keysuffix] : null); // Value may be cleaned or formated later break; case "create": case "edit": From 4d0507b880cf690f947341a2229fc37f75ce4017 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 22 Sep 2022 15:33:01 +0200 Subject: [PATCH 0407/1289] Close #20215 : export label of extrafields --- .../modules/export/export_csv.modules.php | 25 +++++++-- .../export/export_excel2007.modules.php | 52 +++++++++++++++++-- .../modules/export/export_tsv.modules.php | 24 +++++++-- 3 files changed, 90 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 4b3ede2ae14..26f20378b23 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -220,12 +220,21 @@ class ExportCsv extends ModeleExports } else { $outputlangs->charset_output = 'ISO-8859-1'; } + $selectlabel = array(); foreach ($array_selected_sorted as $code => $value) { $newvalue = $outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded $newvalue = $this->csvClean($newvalue, $outputlangs->charset_output); fwrite($this->handle, $newvalue.$this->separator); + $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; + + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $selectlabel[$code."_label"] = $newvalue."_label"; + } + } + foreach ($selectlabel as $key => $value) { + fwrite($this->handle, $value.$this->separator); } fwrite($this->handle, "\n"); return 0; @@ -256,7 +265,7 @@ class ExportCsv extends ModeleExports $this->col = 0; $reg = array(); - + $selectlabelvalues = array(); foreach ($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) { $alias = str_replace(array('.', '-', '(', ')'), '_', $code); @@ -279,14 +288,22 @@ class ExportCsv extends ModeleExports $newvalue = $this->csvClean($newvalue, $outputlangs->charset_output); if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { - $array = json_decode($typefield, true); - $array = $array['options']; - $newvalue = $array[$newvalue]; + $array = jsonOrUnserialize($typefield); + if (is_array($array) && !empty($newvalue)) { + $array = $array['options']; + $selectlabelvalues[$code."_label"] = $array[$newvalue]; + } else { + $selectlabelvalues[$code."_label"] = ""; + } } fwrite($this->handle, $newvalue.$this->separator); $this->col++; } + foreach ($selectlabelvalues as $key => $value) { + fwrite($this->handle, $value.$this->separator); + $this->col++; + } fwrite($this->handle, "\n"); return 0; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 54842ff8278..13967843a08 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -253,6 +253,7 @@ class ExportExcel2007 extends ModeleExports // Create a format for the column headings $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); + $selectlabel = array(); $this->col = 1; if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { @@ -264,6 +265,11 @@ class ExportExcel2007 extends ModeleExports if (empty($alias)) { dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.'); } + $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; + + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $selectlabel[$code."_label"] = $alias."_label"; + } if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader); } else { @@ -274,6 +280,17 @@ class ExportExcel2007 extends ModeleExports } $this->col++; } + foreach ($selectlabel as $key => $value) { + if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($value), $formatheader); + } else { + $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($value)); + if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) { // Set autowidth for some types + $this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true); + } + } + $this->col++; + } $this->row++; return 0; } @@ -300,7 +317,7 @@ class ExportExcel2007 extends ModeleExports } $reg = array(); - + $selectlabelvalues = array(); foreach ($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) { $alias = str_replace(array('.', '-', '(', ')'), '_', $code); @@ -316,9 +333,13 @@ class ExportExcel2007 extends ModeleExports $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { - $array = json_decode($typefield, true); - $array = $array['options']; - $newvalue = $array[$newvalue]; + $array = jsonOrUnserialize($typefield); + if (is_array($array) && !empty($newvalue)) { + $array = $array['options']; + $selectlabelvalues[$code."_label"] = $array[$newvalue]; + } else { + $selectlabelvalues[$code."_label"] = ""; + } } // Traduction newvalue @@ -350,6 +371,29 @@ class ExportExcel2007 extends ModeleExports } $this->col++; } + foreach ($selectlabelvalues as $key => $newvalue) { + if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i', $newvalue)) { + $newvalue = dol_stringtotime($newvalue); + $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($newvalue)); + $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate(); + $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd'); + } elseif (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/i', $newvalue)) { + $newvalue = dol_stringtotime($newvalue); + $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($newvalue)); + $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate(); + $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss'); + } else { + if ($typefield == 'Text' || $typefield == 'TextAuto') { + $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, (string) $newvalue); + $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate(); + $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@'); + $this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); + } else { + $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue); + } + } + $this->col++; + } $this->row++; return 0; } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index 7718dd3e350..40ee75a1749 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -205,11 +205,20 @@ class ExportTsv extends ModeleExports public function write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types) { // phpcs:enable + $selectlabel = array(); foreach ($array_selected_sorted as $code => $value) { $newvalue = $outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded $newvalue = $this->tsv_clean($newvalue, $outputlangs->charset_output); fwrite($this->handle, $newvalue.$this->separator); + $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; + + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $selectlabel[$code."_label"] = $newvalue."_label"; + } + } + foreach ($selectlabel as $key => $value) { + fwrite($this->handle, $value.$this->separator); } fwrite($this->handle, "\n"); return 0; @@ -232,6 +241,7 @@ class ExportTsv extends ModeleExports global $conf; $this->col = 0; + $selectlabelvalues = array(); foreach ($array_selected_sorted as $code => $value) { if (strpos($code, ' as ') == 0) { $alias = str_replace(array('.', '-', '(', ')'), '_', $code); @@ -253,14 +263,22 @@ class ExportTsv extends ModeleExports $newvalue = $this->tsv_clean($newvalue, $outputlangs->charset_output); if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { - $array = json_decode($typefield, true); - $array = $array['options']; - $newvalue = $array[$newvalue]; + $array = jsonOrUnserialize($typefield); + if (is_array($array) && !empty($newvalue)) { + $array = $array['options']; + $selectlabelvalues[$code."_label"] = $array[$newvalue]; + } else { + $selectlabelvalues[$code."_label"] = ""; + } } fwrite($this->handle, $newvalue.$this->separator); $this->col++; } + foreach ($selectlabelvalues as $key => $value) { + fwrite($this->handle, $value.$this->separator); + $this->col++; + } fwrite($this->handle, "\n"); return 0; } From 9048c9947806388ff361468ecba3599e24bc1ec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 18:38:55 +0200 Subject: [PATCH 0408/1289] FIX User approver not visible on holiday --- htdocs/holiday/card.php | 14 ++++++++------ htdocs/main.inc.php | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 3cc05be2068..36dd86241f0 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1150,7 +1150,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $result = $object->fetch($id, $ref); $approverexpected = new User($db); - $approverexpected->fetch($object->fk_validator); + $approverexpected->fetch($object->fk_validator); // Use that should be the approver $userRequest = new User($db); $userRequest->fetch($object->fk_user); @@ -1364,21 +1364,23 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print ''; if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) { - $approverdone = new User($db); - $approverdone->fetch($object->fk_user_valid); - print $approverdone->getNomUrl(-1); + if ($object->fk_user_approve > 0) { + $approverdone = new User($db); + $approverdone->fetch($object->fk_user_approve); + print $approverdone->getNomUrl(-1); + } } else { print $approverexpected->getNomUrl(-1); } $include_users = $object->fetch_users_approver_holiday(); if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) { - print ''.img_edit($langs->trans("Edit")).''; + print ''.img_edit($langs->trans("Edit")).''; } print '
'.$langs->trans('ReviewedByCP').''.$langs->trans('ReviewedByCP').''; $include_users = $object->fetch_users_approver_holiday(); if (!in_array($object->fk_validator, $include_users)) { // Add the current validator to the list to not lose it when editing. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 870088efe93..16e3f006d3d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { From ecf599e4ad413cd400e6e5f36c16618bb3e945b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 18:42:17 +0200 Subject: [PATCH 0409/1289] Fix token --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 36dd86241f0..6224248dcb5 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1493,8 +1493,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { if ($object->statut == Holiday::STATUS_VALIDATED) { // If validated // Button Approve / Refuse if ($user->id == $object->fk_validator) { - print ''.$langs->trans("Approve").''; - print ''.$langs->trans("ActionRefuseCP").''; + print ''.$langs->trans("Approve").''; + print ''.$langs->trans("ActionRefuseCP").''; } else { print ''.$langs->trans("Approve").''; print ''.$langs->trans("ActionRefuseCP").''; From de210e62ff689ddf215a1edbf75f8d2236929768 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 18:45:29 +0200 Subject: [PATCH 0410/1289] Clean lang --- htdocs/langs/en_US/admin.lang | 2 -- htdocs/langs/en_US/main.lang | 4 +++- htdocs/langs/en_US/users.lang | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d6ca0c4d184..ce8b5bf20ce 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -51,8 +51,6 @@ ClientSortingCharset=Client collation WarningModuleNotActive=Module %s must be enabled WarningOnlyPermissionOfActivatedModules=Only permissions related to activated modules are shown here. You can activate other modules in the Home->Setup->Modules page. DolibarrSetup=Dolibarr install or upgrade -InternalUser=Internal user -ExternalUser=External user InternalUsers=Internal users ExternalUsers=External users UserInterface=User interface diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 1cc05709471..09745ec5eac 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1188,4 +1188,6 @@ UrlToCheck=Url to check Automation=Automation CreatedByEmailCollector=Created by Email collector CreatedByPublicPortal=Created from Public portal -UserAgent=User Agent \ No newline at end of file +UserAgent=User Agent +InternalUser=Internal user +ExternalUser=External user diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index c98c1f4902f..c6b5c2fe106 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -68,7 +68,6 @@ CreateDolibarrLogin=Create a user CreateDolibarrThirdParty=Create a third party LoginAccountDisableInDolibarr=Account disabled in Dolibarr. UsePersonalValue=Use personal value -InternalUser=Internal user ExportDataset_user_1=Users and their properties DomainUser=Domain user %s Reactivate=Reactivate From dc03355315f716fa01cdb079085cfad291e7a3e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 19:10:20 +0200 Subject: [PATCH 0411/1289] FIX Separation of date_valid and date approval for leaves --- htdocs/core/lib/functions2.lib.php | 4 ++-- htdocs/holiday/card.php | 4 ++-- htdocs/holiday/class/holiday.class.php | 20 +++++++++----------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index ba34b1283c9..5f497377798 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -439,7 +439,7 @@ function dol_print_object_info($object, $usetable = 0) } // Date approve - if (!empty($object->date_approve)) { + if (!empty($object->date_approve) || !empty($object->date_approval)) { if ($usetable) { print '
'; } @@ -449,7 +449,7 @@ function dol_print_object_info($object, $usetable = 0) } else { print ': '; } - print dol_print_date($object->date_approve, 'dayhour', 'tzserver'); + print dol_print_date($object->date_approve ? $object->date_approve : $object->date_approval, 'dayhour', 'tzserver'); if ($deltadateforuser) { print ' '.$langs->trans("CurrentHour").'   /   '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').'  '.$langs->trans("ClientHour").''; } diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 6224248dcb5..1443a92a113 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -439,7 +439,7 @@ if (empty($reshook)) { } } - // Action validate (+ send email for approval) + // Action validate (+ send email for approval to the expected approver) if ($action == 'confirm_send') { $object->fetch($id); @@ -1408,7 +1408,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) { print '
'.$langs->trans('DateValidCP').''.dol_print_date($object->date_valid, 'dayhour', 'tzuser').''.dol_print_date($object->date_approval, 'dayhour', 'tzuser').'
'; print $langs->trans('BrowserMethodDescription'); print ''; -if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -144,14 +145,14 @@ print "TakePOS Connector"; print ''; print $langs->trans('TakeposConnectorMethodDescription'); -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { print '
'; print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; print ' '; } print '
'; -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; @@ -174,10 +175,9 @@ print '
'; print $langs->trans('TicketVatGrouped'); print ''; print ajax_constantonoff("TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0); -//print $form->selectyesno("TAKEPOS_TICKET_VAT_GROUPPED", $conf->global->TAKEPOS_TICKET_VAT_GROUPPED, 1); print "
'; $variablename = 'TAKEPOS_HEADER'; - if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -203,7 +203,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; print '
'; $variablename = 'TAKEPOS_FOOTER'; - if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { print ''; } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -213,7 +213,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P print "
'; - print ''; + print ''; print '
'; print $langs->trans('CustomerDisplay'); print ''; @@ -268,7 +268,7 @@ print $langs->trans('PrintWithoutDetailsButton'); print ''; print ajax_constantonoff('TAKEPOS_PRINT_WITHOUT_DETAILS', array(), $conf->entity, 0, 0, 1, 0); print "
'; print $langs->trans('PrintWithoutDetailsLabelDefault'); print ''; From 9f98cfbefeab435b296a8b273671c206d78eb9f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Sep 2022 21:24:10 +0200 Subject: [PATCH 0414/1289] Try to change timeout of command --- .scrutinizer.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index dc75fbc962e..d224b20d1c6 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -6,9 +6,9 @@ build: analysis: tests: override: - - php-scrutinizer-run - idle_timeout: 500 - + - command: php-scrutinizer-run + idle_timeout: 500 + imports: - javascript - php From d2cd06cb8d21e38e7b08662fb2afefc8673cb8eb Mon Sep 17 00:00:00 2001 From: jpb Date: Thu, 22 Sep 2022 23:27:13 +0200 Subject: [PATCH 0415/1289] remove ntoe update --- htdocs/don/card.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 960ff7e7b2d..377352b81b5 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -181,8 +181,6 @@ if (empty($reshook)) { $object->date = $donation_date; $object->public = $public_donation; $object->fk_project = (int) GETPOST("fk_project", 'int'); - $object->note_private = (string) GETPOST("note_private", 'restricthtml'); - $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->modepaymentid = (int) GETPOST('modepayment', 'int'); // Fill array 'array_options' with data from add form From 3fdd34400ff56e922ef729135a917b9b38ad3f95 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 23 Sep 2022 05:12:21 +0200 Subject: [PATCH 0416/1289] FIX #22265 Accountancy - Account number expected in place of a rowid on export --- htdocs/core/modules/modAccounting.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index e0bf3a9bbc5..d294a470041 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -258,14 +258,16 @@ class modAccounting extends DolibarrModules $this->export_label[$r] = 'Chartofaccounts'; $this->export_icon[$r] = 'accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); - $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); - $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); - $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa.accountparent'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); + $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa2.account_number'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); + $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"List:accounting_account:account_number", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); + $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa2.account_number'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'accounting_account as aa'; $this->export_sql_end[$r] .= ' ,'.MAIN_DB_PREFIX.'accounting_system as ac'; - $this->export_sql_end[$r] .= ' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') '; + $this->export_sql_end[$r] .= ' ,'.MAIN_DB_PREFIX.'accounting_account as aa2'; + $this->export_sql_end[$r] .= ' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').')'; + $this->export_sql_end[$r] .= ' AND aa2.rowid = aa.account_parent AND aa2.active = 1 AND ac.pcg_version = aa2.fk_pcg_version AND aa2.entity IN ('.getEntity('accounting').')'; // Imports From 39e3162a81a9da6a07b2734c039ab47955b11ac3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 08:34:53 +0200 Subject: [PATCH 0417/1289] FIX use short unit in squille PDF --- .../modules/reception/doc/pdf_squille.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 1b4588e57bb..93c8f33cfd5 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -482,11 +482,11 @@ class pdf_squille extends ModelePdfReception $pdf->SetXY($this->posxweightvol, $curY); $weighttxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->weight) { - $weighttxt = round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->product->weight_units); + $weighttxt = round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->product->weight_units, 1); } $voltxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->volume) { - $voltxt = round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->product->volume_units ? $object->lines[$i]->product->volume_units : 0); + $voltxt = round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->product->volume_units ? $object->lines[$i]->product->volume_units : 0, 1); } $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt) ? '
' : '').$voltxt, 0, 0, false, true, 'C'); @@ -664,16 +664,16 @@ class pdf_squille extends ModelePdfReception } if ($totalWeight != '') { - $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); + $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } if ($totalVolume != '') { - $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); + $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if ($object->trueWeight) { - $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); + $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs, -1, 'no', 1); } if ($object->trueVolume) { - $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); + $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs, -1, 'no', 1); } $pdf->SetFillColor(255, 255, 255); From 3e246f4399ffb30f402c447586cfc69aea86cda1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 09:21:07 +0200 Subject: [PATCH 0418/1289] NEW Add option "Show price on the generated documents for receptions" --- htdocs/admin/pdf_other.php | 40 +++++++++++- htdocs/core/lib/functions.lib.php | 6 +- .../reception/doc/pdf_squille.modules.php | 62 ++++++++++++------- htdocs/langs/en_US/admin.lang | 2 + htdocs/reception/class/reception.class.php | 19 ++---- 5 files changed, 89 insertions(+), 40 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 645fff6adf1..f2f9f83f67c 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -104,7 +104,7 @@ print ''; print ''; if (isModEnabled('propal')) { - print load_fiche_titre($langs->trans("Proposal"), '', ''); + print load_fiche_titre($langs->trans("Proposal"), '', 'proposal'); print '
'; print ''; @@ -127,7 +127,7 @@ if (isModEnabled('propal')) { if (isModEnabled('facture')) { - print load_fiche_titre($langs->trans("Invoices"), '', ''); + print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); print '
'; print '
'; @@ -170,6 +170,42 @@ if (isModEnabled('facture')) { print ''; } + + +if (isModEnabled('reception')) { + print load_fiche_titre($langs->trans("Receptions"), '', 'reception'); + + print '
'; + print '
'; + print ''; + + print ''; + + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print $langs->trans("RECEPTION_PDF_HIDE_ORDERED"); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('RECEPTION_PDF_HIDE_ORDERED'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("RECEPTION_PDF_HIDE_ORDERED", $arrval, $conf->global->RECEPTION_PDF_HIDE_ORDERED); + } + print '
'; + print $langs->trans("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT"); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval, $conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT); + } + print '
'; + print '
'; +} + + print '
'; print ''; print '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a2675ed7bd..90bf079f687 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3977,7 +3977,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', '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', 'puce', + 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce', 'stock', 'resize', 'service', 'stats', 'trip', 'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench', 'github', 'google', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', @@ -4029,7 +4029,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'currency'=>'dollar-sign', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'other'=>'square', - 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', + 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'proposal'=>'file-signature', 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'puce'=>'angle-right', 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', @@ -4111,7 +4111,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande', 'knowledgemanagement'=>'infobox-contrat rotate90', 'loan'=>'infobox-bank_account', 'payment'=>'infobox-bank_account', 'payment_vat'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', - 'propal'=>'infobox-propal', 'private'=>'infobox-project', + 'propal'=>'infobox-propal', 'proposal'=>'infobox-propal','private'=>'infobox-project', 'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent', 'resource'=>'infobox-action', 'salary'=>'infobox-bank_account', 'shipment'=>'infobox-commande', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier', diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 93c8f33cfd5..fb0e59fcb3a 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -353,6 +353,8 @@ class pdf_squille extends ModelePdfReception $nexY = $tab_top + 7; $fk_commandefourndet = 0; $totalOrdered = 0; + $totalAmount = 0; + // Loop on each lines for ($i = 0; $i < $nblines; $i++) { $curY = $nexY; @@ -479,6 +481,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + // Description $pdf->SetXY($this->posxweightvol, $curY); $weighttxt = ''; if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->weight) { @@ -492,6 +495,7 @@ class pdf_squille extends ModelePdfReception $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt) ? '
' : '').$voltxt, 0, 0, false, true, 'C'); //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'
':'').$voltxt,'','C'); + // Qty ordered if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) { $pdf->SetXY($this->posxqtyordered, $curY); if ($object->lines[$i]->fk_commandefourndet != $fk_commandefourndet) { @@ -501,15 +505,20 @@ class pdf_squille extends ModelePdfReception $fk_commandefourndet = $object->lines[$i]->fk_commandefourndet; } + // Qty received $pdf->SetXY($this->posxqtytoship, $curY); $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty, '', 'C'); + // Amount if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) { $pdf->SetXY($this->posxpuht, $curY); $pdf->MultiCell(($this->posxtotalht - $this->posxpuht - 1), 3, price($object->lines[$i]->subprice, 0, $outputlangs), '', 'R'); + $amountreceived = price2num($object->lines[$i]->subprice * $object->lines[$i]->qty, 'MT'); $pdf->SetXY($this->posxtotalht, $curY); - $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 3, price($object->lines[$i]->total_ht, 0, $outputlangs), '', 'R'); + $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 3, price($amountreceived, 0, $outputlangs), '', 'R'); + + $totalAmount += $amountreceived; } $nexY += 3; @@ -568,7 +577,7 @@ class pdf_squille extends ModelePdfReception } // Affiche zone totaux - $posy = $this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs, $totalOrdered); + $posy = $this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs, $totalOrdered, $totalAmount); // Pied de page $this->_pagefoot($pdf, $object, $outputlangs); @@ -616,9 +625,10 @@ class pdf_squille extends ModelePdfReception * @param int $posy Position depart * @param Translate $outputlangs Objet langs * @param int $totalOrdered Total ordered + * @param int $totalAmount Total amount * @return int Position pour suite */ - protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $totalOrdered) + protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $totalOrdered, $totalAmount = 0) { // phpcs:enable global $conf, $mysoc; @@ -680,41 +690,46 @@ class pdf_squille extends ModelePdfReception $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); + $index2 = 0; + + // Total Weight + if ($totalWeighttoshow) { + $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2)); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); + $index2++; + } + if ($totalVolumetoshow) { + $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2)); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); + $index2++; + } + + // Total qty ordered if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) { $pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1); } + // Total received $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); + // Amount if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); - } - - // Total Weight - if ($totalWeighttoshow) { - $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); - - $index++; - } - if ($totalVolumetoshow) { - $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); - - $index++; - } - if (!$totalWeighttoshow && !$totalVolumetoshow) { - $index++; + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($totalAmount, 0, $outputlangs), 0, 'C', 1); } $pdf->SetTextColor(0, 0, 0); + $index++; + if ($index2) { + $index++; + } + return ($tab2_top + ($tab2_hl * $index)); } @@ -754,6 +769,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); + // Description if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); @@ -761,12 +777,14 @@ class pdf_squille extends ModelePdfReception $pdf->MultiCell($this->posxqtyordered - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); } + // Volume / Weight $pdf->line($this->posxweightvol - 1, $tab_top, $this->posxweightvol - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxweightvol - 1, $tab_top + 1); $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"), '', 'C'); } + // Qty ordered if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) { $pdf->line($this->posxqtyordered - 1, $tab_top, $this->posxqtyordered - 1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -775,6 +793,7 @@ class pdf_squille extends ModelePdfReception } } + // Qty reception $pdf->line($this->posxqtytoship - 1, $tab_top, $this->posxqtytoship - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqtytoship, $tab_top + 1); @@ -792,6 +811,7 @@ class pdf_squille extends ModelePdfReception } } + // Amount if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) { $pdf->line($this->posxpuht - 1, $tab_top, $this->posxpuht - 1, $tab_top + $tab_height); if (empty($hidetop)) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ce8b5bf20ce..46766e16b3f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2319,3 +2319,5 @@ CssOnList=Css on list pages HelpCssOnEditDesc=The Css used when editing the field.
Example: "minwiwdth100 maxwidth500 widthcentpercentminusx" HelpCssOnViewDesc=The Css used when viewing the field. HelpCssOnListDesc=The Css used when field is inside a list table.
Example: "tdoverflowmax200" +RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions +MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index dcfc3e64884..e7825407057 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -71,12 +71,6 @@ class Reception extends CommonObject public $socid; public $ref_supplier; - /** - * @var int Ref int - * @deprecated - */ - public $ref_int; - public $brouillon; public $entrepot_id; public $tracking_number; @@ -365,13 +359,10 @@ class Reception extends CommonObject * @param int $id Id of object to load * @param string $ref Ref of object * @param string $ref_ext External reference of object - * @param string $notused Internal reference of other object * @return int >0 if OK, 0 if not found, <0 if KO */ - public function fetch($id, $ref = '', $ref_ext = '', $notused = '') + public function fetch($id, $ref = '', $ref_ext = '') { - global $conf; - // Check parameters if (empty($id) && empty($ref) && empty($ref_ext)) { return -1; @@ -398,9 +389,6 @@ class Reception extends CommonObject if ($ref_ext) { $sql .= " AND e.ref_ext='".$this->db->escape($ref_ext)."'"; } - if ($notused) { - $sql .= " AND e.ref_int='".$this->db->escape($notused)."'"; - } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); @@ -1181,7 +1169,7 @@ class Reception extends CommonObject // TODO Remove or keep this ? $line->fetch_product(); - $sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent'; + $sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent, total_ht, total_ttc, total_tva'; $sql_commfourndet .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet'; $sql_commfourndet .= ' WHERE rowid = '.((int) $line->fk_commandefourndet); $sql_commfourndet .= ' ORDER BY rang'; @@ -1199,6 +1187,9 @@ class Reception extends CommonObject $line->remise_percent = $obj->remise_percent; $line->label = !empty($obj->label) ? $obj->label : $line->product->label; $line->ref_supplier = $obj->ref; + $line->total_ht = $obj->total_ht; + $line->total_ttc = $obj->total_ttc; + $line->total_tva = $obj->total_tva; } else { $line->qty_asked = 0; $line->description = ''; From 1f8327514bdd9ff511aa46fc9d4805925e6e566f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 09:21:19 +0200 Subject: [PATCH 0419/1289] css --- htdocs/theme/eldy/info-box.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index f1f82b757c0..29f1a229054 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -336,15 +336,15 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { color: #b06080 !important; } /* Color for customer object */ -.infobox-propal:not(.pictotitle):not(.error), -.infobox-facture:not(.pictotitle):not(.error), -.infobox-commande:not(.pictotitle):not(.error) { +.infobox-propal:not(.error), +.infobox-facture:not(.error), +.infobox-commande:not(.error) { color: #65953d !important; } /* Color for vendor object */ -.infobox-supplier_proposal:not(.pictotitle):not(.error), -.infobox-invoice_supplier:not(.pictotitle):not(.error), -.infobox-order_supplier:not(.pictotitle):not(.error) { +.infobox-supplier_proposal:not(.error), +.infobox-invoice_supplier:not(.error), +.infobox-order_supplier:not(.error) { color: #599caf !important; } .infobox-contrat, .infobox-ticket{ From e1b5e5033fae62df5e797d89c3629a7b587e4513 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 09:35:17 +0200 Subject: [PATCH 0420/1289] Clean code of deprecated field --- htdocs/api/class/api.class.php | 1 - htdocs/commande/class/commande.class.php | 16 ++-------------- htdocs/compta/facture/class/facture.class.php | 15 ++------------- htdocs/core/customreports.php | 4 ++-- htdocs/core/modules/modFacture.class.php | 2 -- ...terface_95_modZapier_ZapierTriggers.class.php | 1 - htdocs/expedition/card.php | 1 - htdocs/expedition/class/expedition.class.php | 14 +------------- htdocs/fourn/facture/list.php | 4 ++-- htdocs/install/mysql/tables/llx_commande.sql | 1 - htdocs/install/mysql/tables/llx_delivery.sql | 1 - htdocs/install/mysql/tables/llx_expedition.sql | 1 - htdocs/install/mysql/tables/llx_facture.sql | 1 - htdocs/install/mysql/tables/llx_propal.sql | 1 - htdocs/install/mysql/tables/llx_reception.sql | 1 - htdocs/install/mysql/tables/llx_societe.sql | 1 - .../mysql/tables/llx_supplier_proposal.sql | 1 - htdocs/societe/class/societe.class.php | 6 ------ htdocs/webservices/server_order.php | 3 --- 19 files changed, 9 insertions(+), 66 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index edfebdcf1b2..fa5e2ff1de8 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -127,7 +127,6 @@ class DolibarrApi unset($object->ref_previous); unset($object->ref_next); - unset($object->ref_int); unset($object->imgWidth); unset($object->imgHeight); unset($object->barcode_type_code); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index baa20d27c18..d409c2057ee 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -102,12 +102,6 @@ class Commande extends CommonOrder */ public $ref_client; - /** - * @var string Internal ref for order - * @deprecated - */ - public $ref_int; - /** * @var int Contact ID */ @@ -311,7 +305,6 @@ class Commande extends CommonOrder 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>26), - 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20), 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>25), @@ -945,7 +938,7 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande ("; - $sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int"; + $sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client"; $sql .= ", model_pdf, fk_cond_reglement, deposit_percent, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address"; $sql .= ", fk_shipping_method"; $sql .= ", fk_warehouse"; @@ -964,7 +957,6 @@ class Commande extends CommonOrder $sql .= ", '".$this->db->escape($this->note_public)."'"; $sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null"); $sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null"); - $sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null"); $sql .= ", '".$this->db->escape($this->model_pdf)."'"; $sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null"); $sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null"); @@ -1827,7 +1819,7 @@ class Commande extends CommonOrder $sql .= ', c.fk_shipping_method'; $sql .= ', c.fk_warehouse'; $sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; - $sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams'; + $sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams'; $sql .= ', c.fk_incoterms, c.location_incoterms'; $sql .= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc"; $sql .= ", c.module_source, c.pos_source"; @@ -1855,9 +1847,6 @@ class Commande extends CommonOrder if ($ref_ext) { $sql .= " AND c.ref_ext='".$this->db->escape($ref_ext)."'"; } - if ($notused) { - $sql .= " AND c.ref_int='".$this->db->escape($notused)."'"; - } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); @@ -1871,7 +1860,6 @@ class Commande extends CommonOrder $this->ref_client = $obj->ref_client; $this->ref_customer = $obj->ref_client; $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; $this->socid = $obj->fk_soc; $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 632c61b4449..1d2201bb979 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -147,12 +147,6 @@ class Facture extends CommonInvoice public $ref_client; // deprecated; use ref_customer instead public $ref_customer; - /** - * @var int Ref Int - * @deprecated - */ - public $ref_int; // deprecated - //Check constants for types public $type = self::TYPE_STANDARD; @@ -305,7 +299,6 @@ class Facture extends CommonInvoice 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>10), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>12), - //'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>0, 'position'=>30), // deprecated 'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), //'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50), @@ -664,7 +657,7 @@ class Facture extends CommonInvoice $sql .= ", date_pointoftax"; $sql .= ", note_private"; $sql .= ", note_public"; - $sql .= ", ref_client, ref_int"; + $sql .= ", ref_client"; $sql .= ", fk_account"; $sql .= ", module_source, pos_source, fk_fac_rec_source, fk_facture_source, fk_user_author, fk_projet"; $sql .= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf"; @@ -691,7 +684,6 @@ class Facture extends CommonInvoice $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); $sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null"); - $sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null"); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null"); $sql .= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null"); @@ -1926,7 +1918,7 @@ class Facture extends CommonInvoice return -1; } - $sql = 'SELECT f.rowid,f.entity,f.ref,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc'; + $sql = 'SELECT f.rowid, f.entity, f.ref, f.ref_client, f.ref_ext, f.type, f.fk_soc'; $sql .= ', f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc, f.revenuestamp'; $sql .= ', f.remise_percent, f.remise_absolue, f.remise'; $sql .= ', f.datef as df, f.date_pointoftax'; @@ -1961,9 +1953,6 @@ class Facture extends CommonInvoice if ($ref_ext) { $sql .= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; } - if ($notused) { - $sql .= " AND f.ref_int='".$this->db->escape($notused)."'"; // deprecated - } } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 8fe774df32d..fefdc5880c8 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -1096,7 +1096,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, foreach ($object->fields as $key => $val) { if (empty($val['measure'])) { if (in_array($key, array( - 'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams', + 'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams', 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } @@ -1217,7 +1217,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup foreach ($object->fields as $key => $val) { if (empty($val['isameasure'])) { if (in_array($key, array( - 'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams', + 'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams', 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index f7d902d22f1..339e02cf393 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -238,7 +238,6 @@ class modFacture extends DolibarrModules $this->import_fields_array[$r] = array( 'f.ref' => 'InvoiceRef*', 'f.ref_ext' => 'ExternalRef', - 'f.ref_int' => 'ExternalRef', 'f.ref_client' => 'CutomerRef', 'f.type' => 'Type*', 'f.fk_soc' => 'Customer*', @@ -292,7 +291,6 @@ class modFacture extends DolibarrModules $import_sample = array( 'f.ref' => '(PROV0001)', 'f.ref_ext' => '', - 'f.ref_int' => '', 'f.ref_client' => '', 'f.type' => '0', 'f.fk_soc' => '80LIMIT', diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index eca74045316..ccd7a607d3a 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -457,7 +457,6 @@ function cleanObjectDatas($toclean) unset($toclean->ref_previous); unset($toclean->ref_next); - unset($toclean->ref_int); unset($toclean->projet); // Should be fk_project unset($toclean->project); // Should be fk_project diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e46fea6790b..41727761027 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -874,7 +874,6 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; if (GETPOST('entrepot_id', 'int')) { print ''; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 500b2c7ba4a..b1f3df3bbaf 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -98,12 +98,6 @@ class Expedition extends CommonObject */ public $ref_customer; - /** - * @var string internal ref - * @deprecated - */ - public $ref_int; - public $brouillon; /** @@ -304,7 +298,6 @@ class Expedition extends CommonObject $sql .= "ref"; $sql .= ", entity"; $sql .= ", ref_customer"; - $sql .= ", ref_int"; $sql .= ", ref_ext"; $sql .= ", date_creation"; $sql .= ", fk_user_author"; @@ -329,7 +322,6 @@ class Expedition extends CommonObject $sql .= "'(PROV)'"; $sql .= ", ".((int) $conf->entity); $sql .= ", ".($this->ref_customer ? "'".$this->db->escape($this->ref_customer)."'" : "null"); - $sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null"); $sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null"); $sql .= ", '".$this->db->idate($now)."'"; $sql .= ", ".((int) $user->id); @@ -527,7 +519,7 @@ class Expedition extends CommonObject return -1; } - $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed"; + $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed"; $sql .= ", e.date_valid"; $sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; @@ -551,9 +543,6 @@ class Expedition extends CommonObject if ($ref_ext) { $sql .= " AND e.ref_ext='".$this->db->escape($ref_ext)."'"; } - if ($notused) { - $sql .= " AND e.ref_int='".$this->db->escape($notused)."'"; - } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); @@ -567,7 +556,6 @@ class Expedition extends CommonObject $this->socid = $obj->socid; $this->ref_customer = $obj->ref_customer; $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; $this->statut = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; $this->date_creation = $this->db->jdate($obj->date_creation); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index bde4e570be8..954d4fd5d75 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1510,7 +1510,7 @@ if ($resql) { // Payment condition if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print '
'; + print ''; $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); print ''; + print ''; $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); print '
'.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).'
'; $this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 1, 0, 0, 'minwidth200'); print '
'; $filter = ''; if ($public) { @@ -330,7 +331,7 @@ class FormTicket $this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', $filter, 2, 1, 0, 0, 'minwidth200'); print '
'; $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1); print '
'; - // Réponse à un ticket : affichage du titre du thread en readonly + // Answer to a ticket : display of the thread title in readonly if ($this->withtopicreadonly) { print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title; print '
'.$productstatic->getNomUrl(1, 'composition').''.$productstatic->label.''.$value['qty'].''.dol_escape_htmltag($productstatic->label).''.dol_escape_htmltag($value['qty']).'
'.$langs->trans("None").''.$langs->trans("None").'
'; @@ -571,7 +571,7 @@ if ($id > 0 || !empty($ref)) { } print ''; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } From b0d2aa6d9bbd5bc348ff9ece2d38cd53a507d9ea Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 23 Sep 2022 16:05:11 +0200 Subject: [PATCH 0427/1289] Fix : php 8.1 warnings --- htdocs/adherents/subscription/card.php | 4 ++-- htdocs/admin/system/security.php | 2 +- htdocs/compta/facture/class/facture.class.php | 6 +++--- htdocs/core/lib/usergroups.lib.php | 6 +++--- .../interface_50_modAgenda_ActionsAuto.class.php | 12 ++++++------ htdocs/partnership/partnership_agenda.php | 1 + htdocs/partnership/partnership_card.php | 5 ++++- htdocs/public/payment/newpayment.php | 1 + htdocs/ticket/list.php | 8 ++++---- htdocs/user/card.php | 1 + htdocs/user/param_ihm.php | 2 +- 11 files changed, 27 insertions(+), 21 deletions(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 6c477d46239..215635757c2 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -268,7 +268,7 @@ if ($rowid && $action != 'edit') { // Confirmation to delete subscription if ($action == 'delete') { - //$formquestion=array(); + $formquestion=array(); //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text = $langs->trans("ConfirmDeleteSubscription"); if (isModEnabled("banque") && !empty($conf->global->ADHERENT_BANK_USE)) { @@ -351,7 +351,7 @@ if ($rowid && $action != 'edit') { print '
'; if ($user->rights->adherent->cotisation->creer) { - if (!$bankline->rappro) { + if (!empty($bankline->rappro)) { print '"; } else { print '"; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b7074c51095..b0ea7571a2d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -357,7 +357,7 @@ print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? img_warning().' ' : img_picto('', 'tick').' '; print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1); if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { - print ' - '.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transcountrynoentities("Setup")." - ".$langs->transnoentitiesnoconv("Security")).''; + print ' - '.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transnoentitiesnoconv("Setup")." - ".$langs->transnoentitiesnoconv("Security")).''; } else { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1d2201bb979..53c7c0f6305 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1780,7 +1780,7 @@ class Facture extends CommonInvoice $url = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$this->id; } - if (!$user->rights->facture->lire) { + if (!$user->hasRight("facture", "read")) { $option = 'nolink'; } @@ -1811,7 +1811,7 @@ class Facture extends CommonInvoice } $label = ''; - if ($user->rights->facture->lire) { + if ($user->hasRight("facture", "read")) { $label = img_picto('', $picto).' '.$langs->trans("Invoice").''; if (isset($this->statut) && isset($this->alreadypaid)) { $label .= ' '.$this->getLibStatut(5, $this->alreadypaid); @@ -1847,7 +1847,7 @@ class Facture extends CommonInvoice } $linkclose = ($target ? ' target="'.$target.'"' : ''); - if (empty($notooltip) && $user->rights->facture->lire) { + if (empty($notooltip) && $user->hasRight("facture", "read")) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("Invoice"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 6e7ad7ade3e..f6690935416 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -1075,10 +1075,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; //print ajax_constantonoff("MAIN_OPTIMIZEFORTEXTBROWSER", array(), null, 0, 0, 1, 0); if ($edit) { - print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1); + print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', (isset($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER : 0), 1); } else { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - print yn($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER); + print yn(isset($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER : 0); } else { print yn(1); if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { @@ -1128,7 +1128,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) ); if ($edit) { - print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0); + print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, (isset($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND : 0), 0); } else { if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])) { print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND]; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 954949e427c..8af5736b63e 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -713,7 +713,7 @@ class InterfaceActionsAuto extends DolibarrTriggers // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); - $member = $this->context['member']; + $member = (isset($this->context['member']) ? $this->context['member'] : null); if (!is_object($member)) { // This should not happen dol_syslog("Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object"); include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; @@ -731,7 +731,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); $object->sendtoid = 0; - if ($object->fk_soc > 0) { + if ( isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } } elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY') { @@ -767,12 +767,12 @@ class InterfaceActionsAuto extends DolibarrTriggers } $object->actionmsg = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs)); $object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); - $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->type; - $object->actionmsg .= "\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; - $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start, 'day').' - '.dol_print_date($object->last_subscription_date_end, 'day'); + $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->fk_type; + $object->actionmsg .= "\n".$langs->transnoentities("Amount").': '.$object->amount; + $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); $object->sendtoid = 0; - if ($object->fk_soc > 0) { + if (isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } } elseif ($action == 'MEMBER_RESILIATE') { diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 02580c1f73a..3e62e6453de 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -37,6 +37,7 @@ $langs->loadLangs(array("partnership", "other")); // Get parameters $id = GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 279b72593da..969fea1673d 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'partnershipcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); // Initialize technical objects $object = new Partnership($db); @@ -434,6 +434,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } }*/ $morehtmlref .= '
'; + if (!isset($npfilter)) { + $npfilter = ""; + } if ($managedfor == 'member') $npfilter .= " AND te.fk_member > 0 "; else $npfilter .= " AND te.fk_soc > 0 "; $object->next_prev_filter = $npfilter; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 61bb3472c56..9d5fb5f122f 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1469,6 +1469,7 @@ if ($source == 'contractline') { if ($source == 'member' || $source == 'membersubscription') { $newsource = 'member'; + $tag=""; $found = true; $langs->load("members"); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0551532b00f..fd4d7f15f9e 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -814,19 +814,19 @@ foreach ($object->fields as $key => $val) { print ''; } elseif ($key == 'type_code') { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'category_code') { print ''; - $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'severity_code') { print ''; - $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; - print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth100')); + print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', (!empty($val['css']) ? $val['css'] : 'maxwidth100')); print ''; } elseif ($key == 'fk_statut') { $arrayofstatus = array(); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 2f5aa1cca30..524d4589c8e 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2583,6 +2583,7 @@ if ($action == 'create' || $action == 'adduserldap') { $cate_arbo = $form->select_all_categories(Categorie::TYPE_USER, null, null, null, null, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_USER); + $arrayselected = array(); foreach ($cats as $cat) { $arrayselected[] = $cat->id; } diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c25fe18f4ee..a056bbd30df 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -320,7 +320,7 @@ if ($action == 'edit') { print '> '; print ''."\n"; $tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); - print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, ''); + print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, (isset($object->conf->AGENDA_DEFAULT_VIEW) ? $object->conf->AGENDA_DEFAULT_VIEW : ''), 0, 0, 0, ''); print ''."\n"; // Max size of lists From 7d4b2a664e80b233e172625d3e137681763972fd Mon Sep 17 00:00:00 2001 From: Jean Date: Fri, 23 Sep 2022 16:47:54 +0200 Subject: [PATCH 0428/1289] FIX #22379 creating events on supplier order --- htdocs/user/class/user.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4b6ee860c74..dd02873489d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -689,6 +689,7 @@ class User extends CommonObject 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', + 'order_supplier' => 'fournisseur', 'knowledgerecord' => 'knowledgerecord@knowledgemanagement', 'skill@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" 'job@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" From 5534e95062c996aa6b79686911a9a8b0956f66ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:12:26 +0200 Subject: [PATCH 0429/1289] FIX #22360 --- htdocs/categories/class/categorie.class.php | 27 +++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b222f70110a..a0b4d9c20c8 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -636,23 +636,30 @@ class Categorie extends CommonObject } $arraydelete = array( - 'categorie_product' => 'fk_categorie', - 'categorie_fournisseur' => 'fk_categorie', - 'categorie_societe' => 'fk_categorie', - 'categorie_member' => 'fk_categorie', - 'categorie_contact' => 'fk_categorie', - 'categorie_user' => 'fk_categorie', - 'categorie_project' => 'fk_categorie', 'categorie_account' => 'fk_categorie', - 'categorie_website_page' => 'fk_categorie', - 'categorie_warehouse' => 'fk_categorie', 'categorie_actioncomm' => 'fk_categorie', - 'categorie_ticket' => 'fk_categorie', + 'categorie_contact' => 'fk_categorie', + 'categorie_fournisseur' => 'fk_categorie', + 'categorie_knowledgemanagement' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('knowledgemanagement')), + 'categorie_member' => 'fk_categorie', + 'categorie_user' => 'fk_categorie', + 'categorie_product' => 'fk_categorie', + 'categorie_project' => 'fk_categorie', + 'categorie_societe' => 'fk_categorie', + 'categorie_ticket' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('ticket')), + 'categorie_warehouse' => 'fk_categorie', + 'categorie_website_page' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('website')), 'bank_class' => 'fk_categ', 'categorie_lang' => 'fk_category', 'categorie' => 'rowid', ); foreach ($arraydelete as $key => $value) { + if (is_array($value)) { + if (empty($value['enabled'])) { + continue; + } + $value = $value['field']; + } $sql = "DELETE FROM ".MAIN_DB_PREFIX.$key; $sql .= " WHERE ".$value." = ".((int) $this->id); if (!$this->db->query($sql)) { From 87b74b3de75c4dd93dfb4ef69a7f9f67dbabcc51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:12:26 +0200 Subject: [PATCH 0430/1289] FIX #22360 --- htdocs/categories/class/categorie.class.php | 27 +++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8d26b5583d4..27a301776b8 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -636,23 +636,30 @@ class Categorie extends CommonObject } $arraydelete = array( - 'categorie_product' => 'fk_categorie', - 'categorie_fournisseur' => 'fk_categorie', - 'categorie_societe' => 'fk_categorie', - 'categorie_member' => 'fk_categorie', - 'categorie_contact' => 'fk_categorie', - 'categorie_user' => 'fk_categorie', - 'categorie_project' => 'fk_categorie', 'categorie_account' => 'fk_categorie', - 'categorie_website_page' => 'fk_categorie', - 'categorie_warehouse' => 'fk_categorie', 'categorie_actioncomm' => 'fk_categorie', - 'categorie_ticket' => 'fk_categorie', + 'categorie_contact' => 'fk_categorie', + 'categorie_fournisseur' => 'fk_categorie', + 'categorie_knowledgemanagement' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('knowledgemanagement')), + 'categorie_member' => 'fk_categorie', + 'categorie_user' => 'fk_categorie', + 'categorie_product' => 'fk_categorie', + 'categorie_project' => 'fk_categorie', + 'categorie_societe' => 'fk_categorie', + 'categorie_ticket' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('ticket')), + 'categorie_warehouse' => 'fk_categorie', + 'categorie_website_page' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('website')), 'bank_class' => 'fk_categ', 'categorie_lang' => 'fk_category', 'categorie' => 'rowid', ); foreach ($arraydelete as $key => $value) { + if (is_array($value)) { + if (empty($value['enabled'])) { + continue; + } + $value = $value['field']; + } $sql = "DELETE FROM ".MAIN_DB_PREFIX.$key; $sql .= " WHERE ".$value." = ".((int) $this->id); if (!$this->db->query($sql)) { From 59d610887fd6a2c3e092da8600dbd2952c21991b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:19:44 +0200 Subject: [PATCH 0431/1289] Update interface_50_modAgenda_ActionsAuto.class.php --- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 8af5736b63e..60ea49928c9 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -731,7 +731,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); $object->sendtoid = 0; - if ( isset($object->fk_soc) && $object->fk_soc > 0) { + if (isset($object->fk_soc) && $object->fk_soc > 0) { $object->socid = $object->fk_soc; } } elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY') { From 194d7a2110cdd8324e368bec2840fe7d45780a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:26:28 +0200 Subject: [PATCH 0432/1289] Update modAccounting.class.php --- htdocs/core/modules/modAccounting.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index d294a470041..6d1c6b1d876 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -259,7 +259,7 @@ class modAccounting extends DolibarrModules $this->export_icon[$r] = 'accounting'; $this->export_permission[$r] = array(array("accounting", "chartofaccount")); $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa2.account_number'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); - $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"List:accounting_account:account_number", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); + $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa2.account_number'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); $this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa2.account_number'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; From 2fb678523074128231bf4327542265be2b661d59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 18:39:40 +0200 Subject: [PATCH 0433/1289] Update member.lib.php --- htdocs/core/lib/member.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 64c0d429048..ca307db05ed 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -211,7 +211,7 @@ function member_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsMember"); $nbExtrafields = $extrafields->attributes['adherent']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -220,7 +220,7 @@ function member_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); $nbExtrafields = $extrafields->attributes['adherent_type']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_type'; $h++; From 84e0ab07e9f942d395e66454247ac4f57e65c02a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 18:40:16 +0200 Subject: [PATCH 0434/1289] Update order.lib.php --- htdocs/core/lib/order.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 174ec36834b..c0f852ebf59 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -165,7 +165,7 @@ function order_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['commande']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -174,7 +174,7 @@ function order_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['commandedet']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributeslines'; $h++; From 21413344230dbb61bf2aab42a1928492516c6935 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 18:40:34 +0200 Subject: [PATCH 0435/1289] Update order.lib.php --- htdocs/core/lib/order.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index c0f852ebf59..18c3d7580a2 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -165,7 +165,7 @@ function order_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['commande']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -174,7 +174,7 @@ function order_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['commandedet']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributeslines'; $h++; From ce48118bbb22011b0815ed212a579aa2ff59b617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 18:41:07 +0200 Subject: [PATCH 0436/1289] Update member.lib.php --- htdocs/core/lib/member.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index ca307db05ed..baf1012dfea 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -211,7 +211,7 @@ function member_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsMember"); $nbExtrafields = $extrafields->attributes['adherent']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes'; $h++; @@ -220,7 +220,7 @@ function member_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); $nbExtrafields = $extrafields->attributes['adherent_type']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_type'; $h++; From 0c76fe83578f59ede87de3b0fa143571d3b3ccef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 18:41:47 +0200 Subject: [PATCH 0437/1289] Update categories.lib.php --- htdocs/core/lib/categories.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 7d77b345d61..ee69ccf4a87 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -99,7 +99,7 @@ function categoriesadmin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsCategories"); $nbExtrafields = $extrafields->attributes['categorie']['count']; if ($nbExtrafields > 0) { - $head[$h][1] .= ' '.$nbExtrafields.''; + $head[$h][1] .= ''.$nbExtrafields.''; } $head[$h][2] = 'attributes_categories'; $h++; From 88ff4ad4bc4bf81c3fa7a8f95346423a71e807ed Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 09:13:19 +0200 Subject: [PATCH 0438/1289] FIX #22379 creating events on supplier order --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index dd02873489d..e57fc387bc7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -689,7 +689,7 @@ class User extends CommonObject 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', - 'order_supplier' => 'fournisseur', + 'order_supplier' => 'fournisseur', 'knowledgerecord' => 'knowledgerecord@knowledgemanagement', 'skill@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" 'job@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all" From a919618bf4b324355c15d6c1026c8d8c5d059793 Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 09:47:56 +0200 Subject: [PATCH 0439/1289] FIX #22382 Error on length of supplier reference --- htdocs/product/fournisseurs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 2fe78f11e99..f18cbc241e7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -508,9 +508,9 @@ if ($id > 0 || $ref) { print ''.$langs->trans("SupplierRef").''; if ($rowid) { print ''; - print ''; + print ''; } else { - print ''; + print ''; } print ''; print ''; From 5964485159461fc2a1ff9ede2ef76c2677586360 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 20 Sep 2022 18:24:26 +0200 Subject: [PATCH 0440/1289] Fix dispatch product --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b9120f1fceb..acb407a94f5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2094,7 +2094,7 @@ class CommandeFournisseur extends CommonOrder if (!empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN) && $qty < 0) { $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch); } else { - $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode); + $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); } if ($result < 0) { From 9a40bfdbfb915fa3bd1422e9da1e4fa4be331b63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:40:41 +0200 Subject: [PATCH 0441/1289] Fix missing inventorycode --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index acb407a94f5..d39620bdb3b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2092,7 +2092,7 @@ class CommandeFournisseur extends CommonOrder // Method change if qty < 0 if (!empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN) && $qty < 0) { - $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch); + $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); } else { $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); } From fe501f7214935f16a1a6358b6febfd9cd29e583b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:42:05 +0200 Subject: [PATCH 0442/1289] Fix inventorycode --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ad666573b18..c77b8284698 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2041,7 +2041,7 @@ class CommandeFournisseur extends CommonOrder // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) $mouv->origin = &$this; $mouv->setOrigin($this->element, $this->id); - $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, $inventorycode); + $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); if ($result < 0) { $this->error = $mouv->error; $this->errors = $mouv->errors; From 636b3e4eb1fbb5366a329578e648f7a58cc434ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:54:38 +0200 Subject: [PATCH 0443/1289] FIX #22334 --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 87f707081bb..847f4510536 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -379,7 +379,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $message = dol_nl2br($message); } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; From 0c2e349b89fb1603859f79c25c0b6359fc0cc1c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:54:38 +0200 Subject: [PATCH 0444/1289] FIX #22334 --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 298ad489764..55e2bf42c8b 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -379,7 +379,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $message = dol_nl2br($message); } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; From 3a7947e7835747b3f5ba9f53262492747c1a78dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 12:07:06 +0200 Subject: [PATCH 0445/1289] FIX #22334 --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index b5782835264..8d77119962d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1601,7 +1601,7 @@ class Ticket extends CommonObject $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$this->track_id; $message .= "\n".$langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$this->track_id.''."\n"; } else { - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; + $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; $message .= "\n".$langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$this->track_id.''."\n"; } From 7b4d43723f34ea088e35e2b0971eb042663a44ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 12:22:08 +0200 Subject: [PATCH 0446/1289] Update stocktransfer_card.php --- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 05133756e88..312054205b6 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -1027,7 +1027,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($object->status < $object::STATUS_TRANSFERED && $permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } /*else { From 9d01e07db9691d3d443851a3a7c9b5e79be4fd5a Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 12:43:24 +0200 Subject: [PATCH 0447/1289] FIX #22386 IBAN not mandatory for International Export Countries --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 873795c938e..b3f3ad95a1a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -125,6 +125,7 @@ if (empty($reshook)) { $action = 'edit'; $error++; } + $companybankaccount->fetch($id); if ($companybankaccount->needIBAN() == 1) { if (!GETPOST('iban')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); @@ -138,7 +139,6 @@ if (empty($reshook)) { } } - $companybankaccount->fetch($id); if (!$error) { $companybankaccount->socid = $object->id; From 4b2cd997357c0b9909a7882bcc6fd389ae765174 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 12:58:58 +0200 Subject: [PATCH 0448/1289] Doc --- .scrutinizer.yml | 2 +- build/makepack-howto.txt | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index d224b20d1c6..c1cb2e853f1 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -7,7 +7,7 @@ build: tests: override: - command: php-scrutinizer-run - idle_timeout: 500 + idle_timeout: 8000 imports: - javascript diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 988471e3c53..dd99621f479 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,13 +8,13 @@ of Dolibarr. There is a chapter for BETA version and a chapter for RELEASE versi Prerequisites to build tgz, debian and rpm packages: > apt-get install perl tar dpkg dpatch p7zip-full rpm zip php-cli -Prerequisites to build autoexe DoliWamp package: +Prerequisites to build autoexe DoliWamp package from Linux (solution seems broken since Ubuntu 20.04): > apt-get install wine q4wine > Launch "wine cmd" to check a drive Z: pointing to / exists. > Install InnoSetup For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/ > Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB - For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com). + For example by running wampserver3.2.6_x64.exe (https://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup. > Add path to ISCC into PATH windows var: Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH @@ -25,9 +25,13 @@ Prerequisites to build autoexe DoliWamp package: ***** Prerequisites For Windows ***** -Install Perl. -Install WampServer-3.2.*-64.exe -Install isetup-5.5.8.exe +Prerequisites to build autoexe DoliWamp package from Windows: + +Install Perl for Windwos (https://strawberryperl.com/) +Install isetup-5.5.8.exe (https://www.jrsoftware.org) +Install WampServer-3.2.*-64.exe (Apache 2.4.51, PHP 7.3.33, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss) +Install GIT for Windows (https://git-scm.com/) +Install Dolibarr verions: git clone https://github.com/dolibarr/dolibarr ***** Actions to do a BETA ***** From 452d114efbcae87c4e0cb96980950167bd5f705f Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 12:43:24 +0200 Subject: [PATCH 0449/1289] FIX #22386 IBAN not mandatory for International Export Countries --- htdocs/societe/paymentmodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 005c55c260a..f460b60f2d2 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -129,6 +129,7 @@ if (empty($reshook)) { $action = 'edit'; $error++; } + $companybankaccount->fetch($id); if ($companybankaccount->needIBAN() == 1) { if (!GETPOST('iban')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); @@ -142,7 +143,6 @@ if (empty($reshook)) { } } - $companybankaccount->fetch($id); if (!$error) { $companybankaccount->socid = $object->id; From 87cfff36900003090d61abf574f77eb59ecf5846 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sat, 24 Sep 2022 13:02:15 +0200 Subject: [PATCH 0450/1289] TakePOS Possibility to select subcategories to print on orders. --- htdocs/takepos/admin/orderprinters.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 2b4ac9e594c..d2fadf94c81 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -185,7 +185,7 @@ if ($nbofentries > 0) { } else { $checked = ''; } - if ($row["fk_menu"] == 0) { + if ($row["fk_menu"] >= 0) { print ''.$row["label"].'
'; } } @@ -219,7 +219,7 @@ if ($nbofentries > 0) { } else { $checked = ''; } - if ($row["fk_menu"] == 0) { + if ($row["fk_menu"] >= 0) { print ''.$row["label"].'
'; } } @@ -253,7 +253,7 @@ if ($nbofentries > 0) { } else { $checked = ''; } - if ($row["fk_menu"] == 0) { + if ($row["fk_menu"] >= 0) { print ''.$row["label"].'
'; } } From 67dd86ef83ded6b0d78514c20faae7e182490ca4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:34:05 +0200 Subject: [PATCH 0451/1289] update code toward php8 compliance --- htdocs/adherents/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b9e04015d7d..e0f6b693eb7 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1351,7 +1351,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1); print ''; @@ -1799,7 +1799,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').''; // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''.$langs->trans("DefaultLang").''; //$s=picto_from_langcode($object->default_lang); From e0ca87516fb55182074582b471640286012c99aa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:35:45 +0200 Subject: [PATCH 0452/1289] update code toward php8 compliance --- htdocs/adherents/class/adherent.class.php | 4 ++-- htdocs/adherents/class/adherent_type.class.php | 4 ++-- htdocs/admin/pdf.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ae26b84baa5..0aa1af68afc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1867,10 +1867,10 @@ class Adherent extends CommonObject $outputlangs = $langs; $newlang = ''; $lang_id = GETPOST('lang_id'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($lang_id)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($lang_id)) { $newlang = $lang_id; } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $customer->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 12735e70211..4516b132982 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -397,7 +397,7 @@ class AdherentType extends CommonObject $this->description = $this->db->escape($this->note_public); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { if ($this->setMultiLangs($user) < 0) { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; return -2; @@ -509,7 +509,7 @@ class AdherentType extends CommonObject $this->vote = $obj->vote; // multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->getMultiLangs(); } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 686d13e7e39..d59e2279435 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -472,7 +472,7 @@ print ''.$langs->trans("Parameter").''.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").''; -//if (!empty($conf->global->MAIN_MULTILANGS)) +//if (getDolGlobalInt('MAIN_MULTILANGS')) //{ $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); From 04f84ffd44a3b87a9450689a21a37976956d8b24 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:36:58 +0200 Subject: [PATCH 0453/1289] update code toward php8 compliance --- htdocs/admin/mails_templates.php | 2 +- htdocs/asset/class/asset.class.php | 8 +++--- htdocs/categories/class/categorie.class.php | 8 +++--- htdocs/comm/propal/card.php | 30 ++++++++++----------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 303e6f3cfec..fbdad9e379e 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1332,7 +1332,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; } elseif ($value == 'lang') { print ''; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang; if ($context == 'edit') { $selectedlang = $obj->{$value}; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 55d2bc07593..5c50b972c93 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1171,10 +1171,10 @@ class Asset extends CommonObject global $hidedetails, $hidedesc, $hideref; $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $this->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1234,10 +1234,10 @@ class Asset extends CommonObject global $hidedetails, $hidedesc, $hideref; $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $this->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a0b4d9c20c8..1d7901eca3f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -384,7 +384,7 @@ class Categorie extends CommonObject $this->db->free($resql); // multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->getMultiLangs(); } @@ -1000,7 +1000,7 @@ class Categorie extends CommonObject $categories[$i]['array_options'] = $category_static->array_options; // multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && isset($category_static->multilangs)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && isset($category_static->multilangs)) { $categories[$i]['multilangs'] = $category_static->multilangs; } } @@ -1128,11 +1128,11 @@ class Categorie extends CommonObject // Init $this->cats array $sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= ", t.label as label_trans, t.description as description_trans"; } $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c"; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'"; } $sql .= " WHERE c.entity IN (".getEntity('category').")"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 0f019c80f4b..5a92ff25695 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -256,7 +256,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -281,10 +281,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -326,8 +326,8 @@ if (empty($reshook)) { } elseif (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -347,8 +347,8 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -647,10 +647,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -746,7 +746,7 @@ if (empty($reshook)) { $ret = $deposit->fetch($deposit->id); // Reload to get new records $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($deposit->thirdparty->default_lang); $outputlangs->load('products'); @@ -877,7 +877,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -1133,7 +1133,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -1167,7 +1167,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -1268,7 +1268,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -1442,7 +1442,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); From fb9db96ecc77a5ff151daa4129e847219446c75e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:37:57 +0200 Subject: [PATCH 0454/1289] update code toward php8 compliance --- htdocs/comm/propal/class/propal.class.php | 6 +++--- htdocs/commande/card.php | 20 ++++++++++---------- htdocs/commande/class/commande.class.php | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 7d21f4db1b6..46474092448 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1901,7 +1901,7 @@ class Propal extends CommonObject $line->fetch_optionals(); // multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) { $tmpproduct = new Product($this->db); $tmpproduct->fetch($objp->fk_product); $tmpproduct->getMultiLangs(); @@ -2660,7 +2660,7 @@ class Propal extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -2753,7 +2753,7 @@ class Propal extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b02223691af..ead1d09b44b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -228,10 +228,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -591,7 +591,7 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -875,7 +875,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -909,7 +909,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -1008,7 +1008,7 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1183,10 +1183,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1351,10 +1351,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d409c2057ee..6d0693d6346 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2143,7 +2143,7 @@ class Commande extends CommonOrder $line->fetch_optionals(); // multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) { $tmpproduct = new Product($this->db); $tmpproduct->fetch($objp->fk_product); $tmpproduct->getMultiLangs(); From 76858ed60548ee5b2ff17d54b568b76a24d51c69 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:39:07 +0200 Subject: [PATCH 0455/1289] update code toward php8 compliance --- htdocs/compta/facture/card-rec.php | 12 +++---- htdocs/compta/facture/card.php | 36 +++++++++---------- htdocs/compta/facture/class/facture.class.php | 6 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 95073a83b9d..33b85f707e9 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -542,7 +542,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -567,7 +567,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -651,8 +651,8 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -858,9 +858,9 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1975bf9c8e2..3c407a834e6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -279,10 +279,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id')) { $newlang = GETPOST('lang_id'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -527,10 +527,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -611,10 +611,10 @@ if (empty($reshook)) { if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -666,10 +666,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -756,10 +756,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1963,10 +1963,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -2181,7 +2181,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -2216,7 +2216,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -2339,10 +2339,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -2598,10 +2598,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 19f6cdd9b88..a286e93b9d0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -602,10 +602,10 @@ class Facture extends CommonInvoice $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->thirdparty->default_lang)) { $newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ... } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->default_lang)) { $newlang = $this->default_lang; // for thirdparty } if (!empty($newlang)) { @@ -2193,7 +2193,7 @@ class Facture extends CommonInvoice $line->fetch_optionals(); // multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) { $tmpproduct = new Product($this->db); $tmpproduct->fetch($objp->fk_product); $tmpproduct->getMultiLangs(); From e0b16ac436748de14b87558a5fb8079d4f990c39 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:40:01 +0200 Subject: [PATCH 0456/1289] update code toward php8 compliance --- htdocs/compta/paiement/cheque/card.php | 12 ++++++------ htdocs/compta/paiement/class/paiement.class.php | 2 +- htdocs/contact/card.php | 6 +++--- htdocs/contrat/card.php | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 2591defbf7d..7b3eaceab3a 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -139,10 +139,10 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; + //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -190,10 +190,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque- // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; + //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -232,10 +232,10 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; + //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 310388b9e87..ec1392e9ea7 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -455,7 +455,7 @@ class Paiement extends CommonObject $newlang = ''; $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $invoice->fetch_thirdparty(); $newlang = $invoice->thirdparty->default_lang; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d751cbef511..11aebc8fc29 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -884,7 +884,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; //Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print ''; @@ -1171,7 +1171,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; //Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print ''; @@ -1398,7 +1398,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''.$langs->trans("DefaultLang").''; //$s=picto_from_langcode($object->default_lang); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9a1e4aed2e1..4e8c378b832 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -292,7 +292,7 @@ if (empty($reshook)) { $product_static = new Product($db); // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod = new Product($db); $prod->id = $lines[$i]->fk_product; $prod->getMultiLangs(); @@ -618,10 +618,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -795,10 +795,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { From d21e05d4e313086e76f25defae61abcff6311576 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:40:49 +0200 Subject: [PATCH 0457/1289] update code toward php8 compliance --- htdocs/contact/consumption.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 16 ++++++++-------- htdocs/core/actions_builddoc.inc.php | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 729c99f1186..ff18b06c44a 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -497,7 +497,7 @@ if ($sql_select) { // Product if ($objp->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod = new Product($db); $prod->fetch($objp->fk_product); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 29428ceb26d..f3b617a251a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -874,7 +874,7 @@ class Contrat extends CommonObject $line->fetch_optionals(); // multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) { $tmpproduct = new Product($this->db); $tmpproduct->fetch($objp->fk_product); $tmpproduct->getMultiLangs(); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f1fcdf4f0f8..78a2616058a 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -366,10 +366,10 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($object->thirdparty)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -405,10 +405,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -442,10 +442,10 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -486,10 +486,10 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 385b36bdbce..0a5f63de9aa 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -66,13 +66,13 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->thirdparty->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->thirdparty->default_lang)) { $newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ... } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->default_lang)) { $newlang = $object->default_lang; // for thirdparty } if (!empty($newlang)) { From accb4b6463790c2bb1014be7d5e275f29701a188 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:41:44 +0200 Subject: [PATCH 0458/1289] update code toward php8 compliance --- htdocs/core/actions_lineupdown.inc.php | 8 ++++---- htdocs/core/actions_massactions.inc.php | 14 +++++++------- htdocs/core/actions_setnotes.inc.php | 4 ++-- htdocs/core/boxes/box_produits_alerte_stock.php | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/actions_lineupdown.inc.php b/htdocs/core/actions_lineupdown.inc.php index d41f1f1932c..e43b0216cbe 100644 --- a/htdocs/core/actions_lineupdown.inc.php +++ b/htdocs/core/actions_lineupdown.inc.php @@ -34,10 +34,10 @@ if ($action == 'up' && $permissiontoedit) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -59,10 +59,10 @@ if ($action == 'down' && $permissiontoedit) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index aa73c9cdc8a..6ab6b6943a7 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -763,10 +763,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - //elseif (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty + //elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty // $newlang = $objecttmp->thirdparty->default_lang; //} if (!empty($newlang)) { @@ -965,10 +965,10 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $objecttmp->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1116,13 +1116,13 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) { $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) { $newlang = $objecttmp->default_lang; // for thirdparty } if (!empty($newlang)) { diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 7595daf1093..a731fac76de 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -45,10 +45,10 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 203d42c7eed..4be56eee072 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -126,7 +126,7 @@ class box_produits_alerte_stock extends ModeleBoxes $price_base_type = ''; // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sqld = "SELECT label"; $sqld .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sqld .= " WHERE fk_product = ".((int) $objp->rowid); From fdd79cfa14009229aef3e94c285dd9a721cae8e4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:42:35 +0200 Subject: [PATCH 0459/1289] update code toward php8 compliance --- htdocs/core/boxes/box_produits.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 10 +++++----- htdocs/core/class/html.formfile.class.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 19f9724cc98..f036628db3b 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -119,7 +119,7 @@ class box_produits extends ModeleBoxes $datem = $this->db->jdate($objp->tms); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sqld = "SELECT label"; $sqld .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sqld .= " WHERE fk_product = ".((int) $objp->rowid); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9e488b2eafa..7f30878d566 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4989,7 +4989,7 @@ abstract class CommonObject $text = $product_static->getNomUrl(1); // Define output language and label - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); return; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a241aa367cf..14236b5e332 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2562,7 +2562,7 @@ class Form } // Multilang : we add translation - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= ", pl.label as label_translated"; $sql .= ", pl.description as description_translated"; $selectFields .= ", label_translated"; @@ -2605,7 +2605,7 @@ class Form $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; } // Multilang : we add translation - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; @@ -2671,7 +2671,7 @@ class Form $sql .= " AND "; } $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; } if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { @@ -2679,7 +2679,7 @@ class Form } if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; } } @@ -2885,7 +2885,7 @@ class Form $outrefcust = empty($objp->custref) ? '' : $objp->custref; $outlabel = $objp->label; $outdesc = $objp->description; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outlabel_translated = $objp->label_translated; $outdesc_translated = $objp->description_translated; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a01f15c5479..675300169e4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -728,7 +728,7 @@ class FormFile } // Language code (if multilang) - if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) { + if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && getDolGlobalInt('MAIN_MULTILANGS') && !$forcenomultilang && (!empty($modellist) || $showempty)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); $defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang(); From 2a5b91e3a29f614d439b2d431f0083603c4724e8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:43:29 +0200 Subject: [PATCH 0460/1289] update code toward php8 compliance --- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 4 ++-- htdocs/core/lib/categories.lib.php | 2 +- htdocs/core/lib/doc.lib.php | 2 +- htdocs/core/lib/member.lib.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ff6147977f3..aa54b3f330c 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -401,7 +401,7 @@ class FormMail extends Form // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($this->param['langsmodels'])) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($this->param['langsmodels'])) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index bd881416fa9..ed944dec414 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1264,7 +1264,7 @@ class FormTicket // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -1311,7 +1311,7 @@ class FormTicket // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index ee69ccf4a87..5ee8ac517a8 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -49,7 +49,7 @@ function categories_prepare_head(Categorie $object, $type) $head[$h][2] = 'photos'; $h++; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type; $head[$h][1] = $langs->trans("Translation"); $head[$h][2] = 'translation'; diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index 92cc140f299..f71c4231038 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -57,7 +57,7 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu if ($idprod) { $prodser->fetch($idprod); // If a predefined product and multilang and on other lang, we renamed label with label translated - if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) { if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) { $label = $prodser->multilangs[$outputlangs->defaultlang]["label"]; } diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 5cad13a6e57..6e0dcb3b83a 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -149,7 +149,7 @@ function member_type_prepare_head(AdherentType $object) $h++; // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $head[$h][0] = DOL_URL_ROOT."/adherents/type_translation.php?rowid=".$object->id; $head[$h][1] = $langs->trans("Translation"); $head[$h][2] = 'translation'; From 1dc58f96849ba1a5a36b6a5d3a59a2dc53e86e34 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:44:16 +0200 Subject: [PATCH 0461/1289] update code toward php8 compliance --- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/core/modules/modProduct.class.php | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cf455968424..7007b49b65f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1420,7 +1420,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if ($idprod) { $prodser->fetch($idprod); // If a predefined product and multilang and on other lang, we renamed label with label translated - if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) { $translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it) // TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 983611120b0..0d2edb4805e 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -74,7 +74,7 @@ function product_prepare_head($object) } // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; $head[$h][1] = $langs->trans("Translation"); $head[$h][2] = 'translation'; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index df6e3231a0b..8e3c4f7112c 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -305,7 +305,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Description if ($objp->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $object = new $origin($db); $object->fetch($origin_id); $object->fetch_thirdparty(); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 604d96fd4cd..2023a5e2695 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -230,7 +230,7 @@ class modProduct extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote')); } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -261,7 +261,7 @@ class modProduct extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -280,7 +280,7 @@ class modProduct extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -295,7 +295,7 @@ class modProduct extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -309,7 +309,7 @@ class modProduct extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid'; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; @@ -905,7 +905,7 @@ class modProduct extends DolibarrModules 'pr.date_price'=>'2020-12-31'); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { // Import translations of product names and descriptions $r++; $this->import_code[$r] = $this->rights_class.'_languages'; From dde7bb63a78a9a6016a28de39b1ba41bd96a68f5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:45:52 +0200 Subject: [PATCH 0462/1289] update code toward php8 compliance --- .../core/modules/mailings/thirdparties.modules.php | 2 +- htdocs/core/modules/modService.class.php | 12 ++++++------ .../modules/movement/doc/pdf_standard.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- .../core/modules/stock/doc/pdf_standard.modules.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 335e3ac575a..71be0733fb2 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -316,7 +316,7 @@ class mailing_thirdparties extends MailingTargets $s .= ''; $s .= ajax_combobox("filter_status_thirdparties"); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index d2431d3e22c..a6bfdd47433 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -195,7 +195,7 @@ class modService extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote')); } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -224,7 +224,7 @@ class modService extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -243,7 +243,7 @@ class modService extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -258,7 +258,7 @@ class modService extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); } if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { @@ -272,7 +272,7 @@ class modService extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid'; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; } $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; @@ -834,7 +834,7 @@ class modService extends DolibarrModules 'pr.date_price'=>'2013-04-10'); } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { // Import translations of product names and descriptions $r++; $this->import_code[$r] = $this->rights_class.'_languages'; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index d93a7d99076..eb57e7c5453 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -491,7 +491,7 @@ class pdf_standard extends ModelePDFMovement $objp = $this->db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $objp->rowid); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index ea95036b280..8214b8243e9 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); } else { $filetomerge->fetch_by_product($line->fk_product); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index cdac495c393..049391450d8 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -918,7 +918,7 @@ class pdf_cyan extends ModelePDFPropales // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); } else { $filetomerge->fetch_by_product($line->fk_product); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index d3fa898d0a1..6231fb492b0 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -306,7 +306,7 @@ class pdf_standard extends ModelePDFStock $objp = $this->db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $objp->rowid); diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 07595012466..8f27d747fab 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -243,7 +243,7 @@ print ''."\n"; print ''."\n"; // Customer Default Langauge -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''.$langs->trans("DefaultLang"); if (!empty($array_query['cust_language'])) { print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); From 24d66f263ac8d61c82cd97a499537fae1d023258 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:47:45 +0200 Subject: [PATCH 0463/1289] update code toward php8 compliance --- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/datapolicy/admin/setupmail.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 888cb1d7026..24604388af1 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -63,7 +63,7 @@ if ($action == 'presend') { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; if (GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 81a1692c6a3..a7eb433a021 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -763,7 +763,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) { - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?> + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?> var proddesc = data.desc_trans; diff --git a/htdocs/datapolicy/admin/setupmail.php b/htdocs/datapolicy/admin/setupmail.php index f36a3dbc834..2ceaa3332e0 100644 --- a/htdocs/datapolicy/admin/setupmail.php +++ b/htdocs/datapolicy/admin/setupmail.php @@ -118,7 +118,7 @@ print '
'; print ''; print ''; print ''; -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; } print ''; - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { print ''; } print ''; @@ -1592,7 +1592,7 @@ if ($action == 'create') { } // Margin - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { print ''; } @@ -1749,7 +1749,7 @@ if ($action == 'create') { print ''; $colspan = 6; - if (!empty($conf->margin->enabled) && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { + if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { $colspan++; } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -2237,7 +2237,7 @@ $db->close(); ?> margin->enabled) && $action == 'editline') { +if (isModEnabled('margin') && $action == 'editline') { // TODO Why this ? To manage margin on contracts ? ?> '."\n"; + + if (count($listofpaths)) { + foreach ($listofpaths as $key => $val) { + $out .= '
'; + $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (!$this->withfilereadonly) { + $out .= ' '; + } + $out .= '
'; + } + } else { + //$out .= $langs->trans("NoAttachedFiles").'
'; + } + if ($this->withfile == 2) { // Can add other files + $out .= ''; + $out .= ' '; + $out .= ''; + } + $out .= "\n"; + + print $out; + } // MESSAGE @@ -1516,11 +1566,24 @@ class FormTicket $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage); } - print ''; + + + print ''; - // Signature + // Footer // External users can't send message email - if ($user->rights->ticket->write && !$user->socid) { + /*if ($user->rights->ticket->write && !$user->socid && !empty($conf->global->TICKET_MESSAGE_MAIL_SIGNATURE)) { $mail_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; - print ''; } - - // Attached files - if (!empty($this->withfile)) { - $out = ''; - $out .= ''; - $out .= '\n"; - - print $out; - } + */ print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"'); print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); From ed8962c09177cbd9c31662603dd76fc07e3a290b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:48:43 +0200 Subject: [PATCH 0464/1289] update code toward php8 compliance --- htdocs/delivery/card.php | 6 +++--- htdocs/don/card.php | 8 ++++---- htdocs/expedition/card.php | 12 ++++++------ htdocs/expedition/shipment.php | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index dc33073e978..8edac0d3538 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -143,10 +143,10 @@ if ($action == 'add') { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -547,7 +547,7 @@ if ($action == 'create') { $product->fetch($object->lines[$i]->fk_product); // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e8df10f2ee9..ae73fdfd15a 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -120,10 +120,10 @@ if (empty($reshook)) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -350,8 +350,8 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang=''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->thirdparty->default_lang; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("",$conf); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 41727761027..d83b5bd75f5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -437,10 +437,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -773,10 +773,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -2090,7 +2090,7 @@ if ($action == 'create') { $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $object->fetch_thirdparty(); $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -2169,7 +2169,7 @@ if ($action == 'create') { // Predefined product or service if ($lines[$i]->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod = new Product($db); $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 4aa9a9a7f54..33ee4a761bb 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -679,7 +679,7 @@ if ($id > 0 || !empty($ref)) { // Product label if ($objp->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $object->fetch_thirdparty(); $prod = new Product($db); From bb13074488befc6e02aa61cbdf33fc02764a2128 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:49:47 +0200 Subject: [PATCH 0465/1289] update code toward php8 compliance --- htdocs/expensereport/card.php | 42 +++++++++---------- htdocs/fichinter/card.php | 30 ++++++------- .../fourn/class/fournisseur.facture.class.php | 4 +- htdocs/fourn/class/paiementfourn.class.php | 2 +- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index a0d02e10bbd..c325aae4854 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -384,10 +384,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -494,10 +494,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -604,10 +604,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -718,10 +718,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -832,10 +832,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -944,10 +944,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -983,10 +983,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1012,10 +1012,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1186,7 +1186,7 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1230,10 +1230,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1322,10 +1322,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a090c8573c4..8b3868bf195 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -174,10 +174,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -199,10 +199,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -311,7 +311,7 @@ if (empty($reshook)) { $prod->id = $lines[$i]->fk_product; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod->getMultiLangs(); // We show if duration is present on service (so we get it) $prod->fetch($lines[$i]->fk_product); @@ -517,10 +517,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -613,10 +613,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -646,10 +646,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -666,10 +666,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -688,10 +688,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a875cf85a81..3015be37169 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -504,10 +504,10 @@ class FactureFournisseur extends CommonInvoice $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->thirdparty->default_lang)) { $newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ... } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->default_lang)) { $newlang = $this->default_lang; // for thirdparty } if (!empty($newlang)) { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index e0b3fcac0c6..bdf4f8aa457 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -349,7 +349,7 @@ class PaiementFourn extends Paiement if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $newlang = ''; $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $invoice->thirdparty->default_lang; } if (!empty($newlang)) { From 6d7a1c4f30e9dc5895672ad982a1a8b9f221af37 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:50:47 +0200 Subject: [PATCH 0466/1289] update code toward php8 compliance --- htdocs/fourn/commande/card.php | 24 ++++++++++++------------ htdocs/fourn/facture/card-rec.php | 4 ++-- htdocs/fourn/facture/card.php | 26 +++++++++++++------------- htdocs/mrp/mo_card.php | 4 ++-- htdocs/mrp/mo_movements.php | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 5125b758b9f..fc18302eab0 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -534,7 +534,7 @@ if (empty($reshook)) { $label = $productsupplier->label; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -685,7 +685,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; if (GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); @@ -861,10 +861,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -899,10 +899,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -941,10 +941,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1004,10 +1004,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1065,10 +1065,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index f9c955e5c82..71ba4f6928a 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -570,7 +570,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -595,7 +595,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 33fac296f8d..c2bef9b2904 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -230,10 +230,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -274,9 +274,9 @@ if (empty($reshook)) { // Define output language /*$outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -343,10 +343,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -502,10 +502,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1513,7 +1513,7 @@ if (empty($reshook)) { if ($idprod > 0) { $label = $productsupplier->label; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -1658,10 +1658,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1758,10 +1758,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index cda6088a982..c1869f755de 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -205,10 +205,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 19533e05c06..303f5516d72 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -808,7 +808,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $objp = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled // TODO Use a cache here $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; From 66360758aa09a902e1843b058603aea4e4725a4d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:51:39 +0200 Subject: [PATCH 0467/1289] update code toward php8 compliance --- htdocs/mrp/mo_production.php | 4 ++-- .../partnership/class/partnershiputils.class.php | 4 ++-- htdocs/partnership/partnership_card.php | 8 ++++---- htdocs/product/document.php | 14 +++++++------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 7b11ecd7e81..178858b718f 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -396,10 +396,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 13f5942ba70..366bee570df 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -157,7 +157,7 @@ class PartnershipUtils // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -323,7 +323,7 @@ class PartnershipUtils // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 969fea1673d..865888c69a3 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -129,10 +129,10 @@ if (empty($reshook)) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -161,10 +161,10 @@ if (empty($reshook)) { if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/product/document.php b/htdocs/product/document.php index ee5ba79a284..bfb5978406d 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -154,14 +154,14 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge_file_array = GETPOST('filetoadd'); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $lang_id = GETPOST('lang_id', 'aZ09'); } // Delete all file already associated $filetomerge = new Propalmergepdfproduct($db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $result = $filetomerge->delete_by_product($user, $object->id, $lang_id); } else { $result = $filetomerge->delete_by_product($user, $object->id); @@ -176,7 +176,7 @@ if ($action == 'filemerge' && $permissiontoadd) { $filetomerge->fk_product = $object->id; $filetomerge->file_name = $filetomerge_file; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $filetomerge->lang = $lang_id; } @@ -271,7 +271,7 @@ if ($object->id) { if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { $filetomerge = new Propalmergepdfproduct($db); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $lang_id = GETPOST('lang_id', 'aZ09'); $result = $filetomerge->fetch_by_product($object->id, $lang_id); } else { @@ -305,7 +305,7 @@ if ($object->id) { print ''; // Get language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $langs->load("languages"); print ''; */ // View product description in thirdparty language -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print ''; print '\n"; if ($mode && $mode != '-1') { foreach ($infoprod as $prodid => $vals) { // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $prodid); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 31a2060287f..f3ad55d526d 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -608,7 +608,7 @@ while ($i < $imaxinloop) { $objp = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active // TODO Use a cache $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; From 90c923a94b0e9e3ca87273825a0643c3b6be3a1e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:53:29 +0200 Subject: [PATCH 0469/1289] update code toward php8 compliance --- htdocs/product/ajax/products.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- .../class/propalmergepdfproduct.class.php | 16 ++++++++-------- htdocs/product/composition/card.php | 8 ++++---- htdocs/product/stock/card.php | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 1896c801c50..b2ce6e48c09 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -106,7 +106,7 @@ if ($action == 'fetch' && !empty($id)) { $thirdpartytemp->fetch($socid); //Load translation description and label - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $newlang = $thirdpartytemp->default_lang; if (!empty($newlang)) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ccc3a05c51f..0460642c746 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1203,7 +1203,7 @@ class Product extends CommonObject $this->id = $id; // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { if ($this->setMultiLangs($user) < 0) { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; return -2; @@ -2495,7 +2495,7 @@ class Product extends CommonObject $this->fetch_optionals(); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS) && empty($ignore_lang_load)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($ignore_lang_load)) { $this->getMultiLangs(); } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index b4b85c3852a..84b6cbe7123 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -107,7 +107,7 @@ class Propalmergepdfproduct extends CommonObject $sql = "INSERT INTO ".$this->db->prefix()."propal_merge_pdf_product("; $sql .= "fk_product,"; $sql .= "file_name,"; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= "lang,"; } $sql .= "fk_user_author,"; @@ -116,7 +116,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= ") VALUES ("; $sql .= " ".(!isset($this->fk_product) ? 'NULL' : ((int) $this->fk_product)).","; $sql .= " ".(!isset($this->file_name) ? 'NULL' : "'".$this->db->escape($this->file_name)."'").","; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " ".(!isset($this->lang) ? 'NULL' : "'".$this->db->escape($this->lang)."'").","; } $sql .= " ".((int) $user->id).","; @@ -186,7 +186,7 @@ class Propalmergepdfproduct extends CommonObject $this->fk_product = $obj->fk_product; $this->file_name = $obj->file_name; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->lang = $obj->lang; } $this->fk_user_author = $obj->fk_user_author; @@ -233,7 +233,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " FROM ".$this->db->prefix()."propal_merge_pdf_product as t"; $sql .= " WHERE t.fk_product = ".((int) $product_id); - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($lang)) { $sql .= " AND t.lang = '".$this->db->escape($lang)."'"; } @@ -248,7 +248,7 @@ class Propalmergepdfproduct extends CommonObject $line->fk_product = $obj->fk_product; $line->file_name = $obj->file_name; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $line->lang = $obj->lang; } $line->fk_user_author = $obj->fk_user_author; @@ -258,7 +258,7 @@ class Propalmergepdfproduct extends CommonObject $line->import_key = $obj->import_key; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->lines[$obj->file_name.'_'.$obj->lang] = $line; } else { $this->lines[$obj->file_name] = $line; @@ -311,7 +311,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " file_name=".(isset($this->file_name) ? "'".$this->db->escape($this->file_name)."'" : "null").","; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " lang=".(isset($this->lang) ? "'".$this->db->escape($this->lang)."'" : "null").","; } $sql .= " fk_user_mod=".$user->id; @@ -403,7 +403,7 @@ class Propalmergepdfproduct extends CommonObject $sql = "DELETE FROM ".$this->db->prefix()."propal_merge_pdf_product"; $sql .= " WHERE fk_product = ".((int) $product_id); - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang_id)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($lang_id)) { $sql .= " AND lang = '".$this->db->escape($lang_id)."'"; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 47cc741fb22..c10b5abe93e 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -157,12 +157,12 @@ if ($action == 'search') { $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type as type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql .= ' p.fk_product_type, p.tms as datem, p.tobatch'; $sql .= ', p.tosell as status, p.tobuy as status_buy'; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= ', pl.label as labelm, pl.description as descriptionm'; } $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON p.rowid = cp.fk_product'; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang)."'"; } $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; @@ -170,7 +170,7 @@ if ($action == 'search') { // For natural search $params = array('p.ref', 'p.label', 'p.description', 'p.note'); // multilang - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $params[] = 'pl.label'; $params[] = 'pl.description'; $params[] = 'pl.note'; @@ -682,7 +682,7 @@ if ($id > 0 || !empty($ref)) { print ''; $labeltoshow = $objp->label; - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->labelm)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->labelm)) { $labeltoshow = $objp->labelm; } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 999c1993a4f..095eaee313f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -692,7 +692,7 @@ if ($action == 'create') { $objp = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active + if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $objp->rowid); From 804f13fbe693b8351c9d51cd5063f2a8f9b2ad05 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:54:23 +0200 Subject: [PATCH 0470/1289] update code toward php8 compliance --- htdocs/product/stock/movement_list.php | 6 +++--- htdocs/product/stock/replenish.php | 6 +++--- htdocs/product/stock/stockatdate.php | 2 +- htdocs/reception/card.php | 20 +++++++++---------- .../class/recruitmentjobposition.class.php | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7c85bd3295b..7e34931f9a8 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -269,10 +269,10 @@ if (empty($reshook)) { // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - //elseif (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty + //elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty // $newlang = $objecttmp->thirdparty->default_lang; //} if (!empty($newlang)) { @@ -1319,7 +1319,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $userstatic->statut = $obj->user_status; // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled // TODO Use a cache $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 53f01d7899c..291fb2b7333 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -180,7 +180,7 @@ if ($action == 'order' && GETPOST('valid')) { //$product = new Product($db); //$product->fetch($obj->fk_product); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $productsupplier->getMultiLangs(); } @@ -191,7 +191,7 @@ if ($action == 'order' && GETPOST('valid')) { $desc = $productsupplier->description; } $line->desc = $desc; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { // TODO Get desc in language of thirdparty } @@ -803,7 +803,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $prod->load_stock('warehouseopen, warehouseinternal'.(!$usevirtualstock?', novirtual':''), $draftchecked); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = 'SELECT label,description'; $sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang'; $sql .= ' WHERE fk_product = '.((int) $objp->rowid); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 0571caeb6fb..d88355c6912 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -488,7 +488,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $prod->fetch($objp->rowid); // Multilangs - /*if (!empty($conf->global->MAIN_MULTILANGS)) + /*if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = 'SELECT label,description'; $sql .= ' FROM '.MAIN_DB_PREFIX.'product_lang'; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index a078cdaca15..da88e28fc6b 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -199,10 +199,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -437,10 +437,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -532,10 +532,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $reception->thirdparty->default_lang; } if (!empty($newlang)) { @@ -667,10 +667,10 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1738,7 +1738,7 @@ if ($action == 'create') { $var = false; - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $object->fetch_thirdparty(); $outputlangs = $langs; $newlang = ''; @@ -1813,7 +1813,7 @@ if ($action == 'create') { // Predefined product or service if ($lines[$i]->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod = new Product($db); $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index a6cd787b343..d5c109a5516 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -694,7 +694,7 @@ class RecruitmentJobPosition extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); From 32b37718c7d3d7565409ddceb01ae1201cdef2d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:55:10 +0200 Subject: [PATCH 0471/1289] update code toward php8 compliance --- htdocs/societe/canvas/actions_card_common.class.php | 4 ++-- htdocs/societe/canvas/company/tpl/card_create.tpl.php | 2 +- htdocs/societe/card.php | 6 +++--- htdocs/societe/consumption.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index e71ee255981..fc8794aa1a8 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -246,7 +246,7 @@ abstract class ActionsCardCommon } // Language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $this->tpl['select_lang'] = $formadmin->select_language(($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT), 'default_lang', 0, 0, 1); } @@ -306,7 +306,7 @@ abstract class ActionsCardCommon $arr = $formcompany->typent_array(1); $this->tpl['typent'] = $arr[$this->object->typent_code]; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; //$s=picto_from_langcode($this->default_lang); //print ($s?$s.' ':''); diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index 58752a1bc7b..d70277dc58d 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -189,7 +189,7 @@ for ($i = 1; $i <= 4; $i++) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 90aafe95f5d..b5a49e9e18d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1804,7 +1804,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } else { print ''.$langs->trans("Currency".$conf->currency).''; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; @@ -2554,7 +2554,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; @@ -3071,7 +3071,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ' -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index fb9a38ed442..22c46cb93b5 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -190,7 +190,7 @@ for ($i = 1; $i <= 4; $i++) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 1c8b51dac7c..1a574019948 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -156,7 +156,7 @@ if (isModEnabled('barcode')) { ?> -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 56192bbe4e7..adfd1d8363a 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -160,7 +160,7 @@ if ($this->control->tpl['fournisseur']) { -global->MAIN_MULTILANGS)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 369ef413fc1..11716519f16 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -131,7 +131,7 @@ if ($this->control->tpl['action_delete']) { -global->MAIN_MULTILANGS)) { ?> + From e10abd95f1ca287d1de7d36af4cfe0665a471e0c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:56:50 +0200 Subject: [PATCH 0473/1289] update code toward php8 compliance --- .../societe/class/api_thirdparties.class.php | 4 ++-- htdocs/supplier_proposal/card.php | 20 +++++++++---------- .../class/supplier_proposal.class.php | 2 +- htdocs/ticket/card.php | 4 ++-- htdocs/user/card.php | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 7fe72779c6c..c0401ce958f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1366,8 +1366,8 @@ class Thirdparties extends DolibarrApi $outputlangs = $langs; $newlang = ''; - //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { if (isset($this->company->thirdparty->default_lang)) { $newlang = $this->company->thirdparty->default_lang; // for proposal, order, invoice, ... } elseif (isset($this->company->default_lang)) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 7d2bf3c2eb0..da70aa005d9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -202,7 +202,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -222,10 +222,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -449,10 +449,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -527,7 +527,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); @@ -659,7 +659,7 @@ if (empty($reshook)) { $label = $productsupplier->label; // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -852,10 +852,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { @@ -1040,7 +1040,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 0e8789dc84a..7ecd6e0b3a5 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1721,7 +1721,7 @@ class SupplierProposal extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $outputlangs = new Translate("", $conf); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 862ea805a72..d12d84d00f1 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1474,9 +1474,9 @@ if ($action == 'create' || $action == 'presend') { $outputlangs = $langs; $newlang = ''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); - } elseif (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($object->thirdparty)) { + } elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 524d4589c8e..507240f352f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1179,7 +1179,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ""; } - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; print ''; From 15c6c8ba4223f6b95165e1d9d0394024d2e24773 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 15:04:40 +0200 Subject: [PATCH 0474/1289] update code toward php8 compliance --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index fbdad9e379e..0daf46c2588 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -583,7 +583,7 @@ if (!$user->admin) { $sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me $sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me } -if (empty($conf->global->MAIN_MULTILANGS)) { +if (!getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')"; } if ($search_label) { @@ -706,7 +706,7 @@ if ($action == 'add') { $valuetoshow = $langs->trans("Owner"); } if ($fieldlist[$field] == 'lang') { - $valuetoshow = (empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language")); + $valuetoshow = (!getDolGlobalInt('MAIN_MULTILANGS') ? ' ' : $langs->trans("Language")); } if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); From 4dd3b48a75328bdaa01841bd9817af0663945bc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 16:03:03 +0200 Subject: [PATCH 0475/1289] Fix detection of Edge --- build/exe/doliwamp/doliwamp.iss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 10cc1561011..beeec222c2a 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -582,6 +582,17 @@ begin end; end; + if browser = 'iexplore.exe' then + begin + if FileExists (pfPath+'/Microsoft/Edge/Application/msedge.exe') then + begin + if MsgBox(CustomMessage('MicrosoftEdgeDetected'),mbConfirmation,MB_YESNO) = IDYES then + begin + browser := pfPath+'/Microsoft/Edge/Application/msedge.exe'; + end; + end; + end; + if browser = 'iexplore.exe' then begin if FileExists (pfPath+'/Internet Explorer/iexplore.exe') then From 322d0955f20e6cbf7ed93e40649458ae8e197c2a Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Sat, 24 Sep 2022 17:58:58 +0300 Subject: [PATCH 0476/1289] FIX: Issue #16476 on massaction the pdf generation is not using the thirdparty language settings --- htdocs/core/actions_massactions.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index ddee2ad5fb4..c673111d0d7 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1388,6 +1388,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { + $objecttmp->fetch_thirdparty(); //load lang from thirdparty $outputlangs = $langs; $newlang = ''; From 33291b7cc791ed95ace0c565041607b43eae6303 Mon Sep 17 00:00:00 2001 From: priojk Date: Sat, 24 Sep 2022 17:19:52 +0200 Subject: [PATCH 0477/1289] FIX #21799 inactive companies cannot be selected --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cb7e512bc36..c737ea63ebe 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1585,7 +1585,7 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print '
'; @@ -316,7 +316,7 @@ if ($object->id) { print Form::selectarray('lang_id', $langs_available, $default_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''; } @@ -328,7 +328,7 @@ if ($object->id) { $checked = ''; $filename = $filetoadd['name']; - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { if (array_key_exists($filetoadd['name'].'_'.$default_lang, $filetomerge->lines)) { $filename = $filetoadd['name'].' - '.$langs->trans('Language_'.$default_lang); $checked = ' checked '; From afe918c76b75ce99b263cacec5160d29c048da45 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:52:21 +0200 Subject: [PATCH 0468/1289] update code toward php8 compliance --- htdocs/product/admin/product.php | 2 +- htdocs/product/index.php | 2 +- htdocs/product/list.php | 6 +++--- htdocs/product/popuprop.php | 2 +- htdocs/product/reassortlot.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 42f80906574..d530b57b125 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -716,7 +716,7 @@ print '
'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").''; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3ca5bfbc655..845c2e1012d 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -347,7 +347,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod } // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $objp->rowid); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7ffbfe814a8..7b6014c6bc1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -179,7 +179,7 @@ $fieldstosearchall = array( ); // multilang -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { $fieldstosearchall['pl.label'] = 'ProductLabelTranslated'; $fieldstosearchall['pl.description'] = 'ProductDescriptionTranslated'; $fieldstosearchall['pl.note'] = 'ProductNoteTranslated'; @@ -444,7 +444,7 @@ if (!empty($searchCategoryProductList) || !empty($catid)) { } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang -if (!empty($conf->global->MAIN_MULTILANGS)) { +if (getDolGlobalInt('MAIN_MULTILANGS')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$db->escape($langs->getDefaultLang())."'"; } @@ -1309,7 +1309,7 @@ if ($resql) { $obj = $db->fetch_object($resql); // Multilangs - if (!empty($conf->global->MAIN_MULTILANGS)) { // If multilang is enabled + if (getDolGlobalInt('MAIN_MULTILANGS')) { // If multilang is enabled $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product = ".((int) $obj->rowid); diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index f657eef99eb..4bde44f1892 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -214,7 +214,7 @@ print "
'.$productstatic->getNomUrl(1, '', 24).'control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1); print '
'.$langs->trans("DefaultLang").''; //$s=picto_from_langcode($object->default_lang); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0c1370f7440..0ff76102582 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -535,7 +535,7 @@ if ($sql_select) { // Product if ($objp->fk_product > 0) { // Define output language - if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $prod = new Product($db); $prod->fetch($objp->fk_product); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 22b9dc56fae..6110fc7a5e5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1548,7 +1548,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $allowgenifempty = 0; // Language code (if multilang) - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); $defaultlang = $langs->getDefaultLang(); From 7cca9f5c1440c545f206629ceb6db7acde888b08 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Sep 2022 14:56:01 +0200 Subject: [PATCH 0472/1289] update code toward php8 compliance --- htdocs/societe/canvas/company/tpl/card_edit.tpl.php | 2 +- htdocs/societe/canvas/company/tpl/card_view.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_create.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_view.tpl.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index eb300cfdd4e..c432f5a6d95 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -211,7 +211,7 @@ for ($i = 1; $i <= 4; $i++) { control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['effectif']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['typent']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone widthcentpercentminusx'); @@ -1636,7 +1636,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { $langs->load("languages"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print '
'; @@ -2596,7 +2596,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Default language - if (!empty($conf->global->MAIN_MULTILANGS)) { + if (getDolGlobalInt('MAIN_MULTILANGS')) { print '
'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->lang, 'default_lang', 0, null, '1', 0, 0, 'widthcentpercentminusx maxwidth300'); print ''; - print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'company').$form->select_company('', 'socid', '((s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ' stripe->enabled) && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) { dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning', 1); } @@ -535,7 +535,7 @@ $action_buttons = array( ), ); $numpad = $conf->global->TAKEPOS_NUMPAD; -if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { print ''; dol_htmloutput_mesg($langs->trans('ConnectingToStripeTerminal', 'Stripe'), '', 'warning', 1); print ''; @@ -646,7 +646,7 @@ while ($i < count($arrayOfValidPaymentModes)) { $i = $i + 1; } -if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { +if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && !empty($conf->global->STRIPE_CARD_PRESENT)) { $keyforstripeterminalbank = "CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$_SESSION["takeposterminal"]; print ''; if (!empty($conf->global->$keyforstripeterminalbank)) { From 277b81ce1bce0c3e0a30d27e0ca6ae3dfc64e0f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Sep 2022 22:08:06 +0200 Subject: [PATCH 0555/1289] Fix loop --- htdocs/core/class/html.formfile.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 675300169e4..80cd8bb79e2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1782,6 +1782,8 @@ class FormFile $result = 0; if (is_object($object_instance)) { + $object_instance->id = 0; + $object_instance->ref = ''; if ($id) { $result = $object_instance->fetch($id); } else { From ef94f2af70a40e8d5d3f4c059a20ade6b75ef8fd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 22:45:10 +0200 Subject: [PATCH 0556/1289] Use isModEnabled --- htdocs/comm/propal/card.php | 4 ++-- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/list.php | 14 +++++++------- htdocs/compta/facture/list.php | 8 ++++---- htdocs/contrat/card.php | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c478ff5a2c..44f7e00bdce 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -64,7 +64,7 @@ $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'pro if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $langs->load('margins'); } @@ -2737,7 +2737,7 @@ if ($action == 'create') { print '
'; // Margin Infos - if (!empty($conf->margin->enabled)) { + if (isModEnabled('margin')) { $formmargin->displayMarginInfos($object); } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 5b678a0f7ac..76c4a42ddce 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -536,7 +536,7 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = null; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); @@ -1573,7 +1573,7 @@ if ($resql) { $typenArray = null; $with_margin_info = false; - if (!empty($conf->margin->enabled) && ( + if (isModEnabled('margin') && ( !empty($arrayfields['total_pa']['checked']) || !empty($arrayfields['total_margin']['checked']) || !empty($arrayfields['total_margin_rate']['checked']) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5cde78cd09f..58a6ce70f0f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; } require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -199,10 +199,10 @@ $arrayfields = array( 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), - 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), @@ -778,7 +778,7 @@ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = null; -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); @@ -1850,7 +1850,7 @@ if ($resql) { $i = 0; $with_margin_info = false; - if (!empty($conf->margin->enabled) && ( + if (isModEnabled('margin') && ( !empty($arrayfields['total_pa']['checked']) || !empty($arrayfields['total_margin']['checked']) || !empty($arrayfields['total_margin_rate']['checked']) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ddfe7e5429f..1d6dbd9f03b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -245,10 +245,10 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>292), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>295), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>296), // Not enabled by default because slow - 'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), + 'total_pa' => array('label' => ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3509134c70f..b452b20154a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1476,7 +1476,7 @@ if ($action == 'create') { $productstatic = new Product($db); $usemargins = 0; - if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) { + if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) { $usemargins = 1; } @@ -1522,7 +1522,7 @@ if ($action == 'create') { print '
'.$langs->trans("Unit").''.$langs->trans("ReductionShort").''.$langs->trans("BuyingPrice").' '.price($objp->pa_ht).'
'; + print '
'; //$toolbarname = 'dolibarr_details'; $toolbarname = 'dolibarr_notes'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -1528,54 +1591,19 @@ class FormTicket $doleditor->Create(); print '
'.$langs->trans("MailFile").''; - // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out .= ''."\n"; - $out .= ''."\n"; - if (count($listofpaths)) { - foreach ($listofpaths as $key => $val) { - $out .= '
'; - $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (!$this->withfilereadonly) { - $out .= ' '; - } - $out .= '
'; - } - } else { - $out .= $langs->trans("NoAttachedFiles").'
'; - } - if ($this->withfile == 2) { // Can add other files - $out .= ''; - $out .= ' '; - $out .= ''; - } - $out .= "
'; diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index af52c1279e5..f34398abc4b 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -104,7 +104,7 @@ class modTicket extends DolibarrModules // List of particular constants to add when module is enabled // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) // Example: - $default_signature = $langs->trans('TicketMessageMailSignatureText', getDolGlobalString('MAIN_INFO_SOCIETE_NOM')); + $default_footer = $langs->trans('TicketMessageMailFooterText', getDolGlobalString('MAIN_INFO_SOCIETE_NOM')); $this->const = array( 1 => array('TICKET_ENABLE_PUBLIC_INTERFACE', 'chaine', '0', 'Enable ticket public interface', 0), 2 => array('TICKET_ADDON', 'chaine', 'mod_ticket_simple', 'Ticket ref module', 0), @@ -116,7 +116,7 @@ class modTicket extends DolibarrModules 8 => array('TICKET_PRODUCT_CATEGORY', 'chaine', 0, 'The category of product that is being used for ticket accounting', 0), 9 => array('TICKET_NOTIFICATION_EMAIL_FROM', 'chaine', getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), 'Email to use by default as sender for messages sent from Dolibarr', 0), 10 => array('TICKET_MESSAGE_MAIL_INTRO', 'chaine', $langs->trans('TicketMessageMailIntroText'), 'Introduction text of ticket replies sent from Dolibarr', 0), - 11 => array('TICKET_MESSAGE_MAIL_SIGNATURE', 'chaine', $default_signature, 'Signature to use by default for messages sent from Dolibarr', 0), + 11 => array('TICKET_MESSAGE_MAIL_SIGNATURE', 'chaine', $default_footer, 'Signature to use by default for messages sent from Dolibarr', 0), 12 => array('MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER', 'chaine', "1", 'Disable the rendering of headers in tickets', 0), 13 => array('MAIN_SECURITY_ENABLECAPTCHA_TICKET', 'chaine', getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET'), 'Enable captcha code by default', 0) ); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 1fe2e5b8a6e..3e917cc460d 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -221,18 +221,17 @@ SendMessageByEmail=Send message by email TicketNewMessage=New message ErrorMailRecipientIsEmptyForSendTicketMessage=Recipient is empty. No email send TicketGoIntoContactTab=Please go into "Contacts" tab to select them -TicketMessageMailIntro=Introduction +TicketMessageMailIntro=Message header TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved. -TicketMessageMailIntroLabelAdmin=Introduction text to all ticket answers TicketMessageMailIntroText=Hello,
A new answer has been added to a ticket that you follow. Here is the message:
TicketMessageMailIntroHelpAdmin=This text will be inserted before the answer when replying to a ticket from Dolibarr -TicketMessageMailSignature=Signature -TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. -TicketMessageMailSignatureText=Message sent by %s via Dolibarr -TicketMessageMailSignatureLabelAdmin=Signature of response email -TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message. +TicketMessageMailFooter=Message footer +TicketMessageMailFooterHelp=This text is added only at the end of the message sent by email and will not be saved. +TicketMessageMailFooterText=Message sent by %s via Dolibarr +TicketMessageMailFooterHelpAdmin=This text will be inserted after the response message. TicketMessageHelp=Only this text will be saved in the message list on ticket card. TicketMessageSubstitutionReplacedByGenericValues=Substitutions variables are replaced by generic values. +ForEmailMessageWillBeCompletedWith=For email messages sent to external users, the message will be completed with TimeElapsedSince=Time elapsed since TicketTimeToRead=Time elapsed before read TicketTimeElapsedBeforeSince=Time elapsed before / since diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 4981aec624e..d899f8e878c 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -437,7 +437,8 @@ if (empty($reshook)) { $action = 'view'; } - // Action to add an action (not a message) + // Action to add an action (not a message). + // This may also send an email (concatenated with email_intro and email footer if checkbox was selected) if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) { $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0)); @@ -594,7 +595,6 @@ if (empty($reshook)) { exit(); } } elseif ($action == "set_message" && $user->rights->ticket->manage) { - // altairis: manage cancel button if (!GETPOST('cancel')) { $object->fetch('', '', GETPOST('track_id', 'alpha')); $oldvalue_message = $object->message; @@ -689,7 +689,7 @@ if (empty($reshook)) { $upload_dir = $conf->ticket->dir_output; $permissiontoadd = $user->rights->ticket->write; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - +//var_dump($action);exit; // Actions to send emails $triggersendname = 'TICKET_SENTBYMAIL'; $paramname = 'id'; @@ -736,6 +736,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->withfile = 2; $formticket->withextrafields = 1; $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); + $formticket->trackid = 'tic'.$object->id; $formticket->withcancel = 1; @@ -862,9 +863,6 @@ if ($action == 'create' || $action == 'presend') { print dol_get_fiche_head($head, 'ticket', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project')); - /* - * Projet synthese pour rappel - */ print ''; $linkback = ''.$langs->trans("BackToList").''; @@ -1156,6 +1154,7 @@ if ($action == 'create' || $action == 'presend') { print ''; print ''; print ''; + print ''; print '
'; @@ -1507,6 +1506,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->track_id = $object->track_id; $formticket->ref = $object->ref; $formticket->id = $object->id; + $formticket->trackid = 'tic'.$object->id; $formticket->withfile = 2; $formticket->withcancel = 1; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 7242fdafa28..42ffa662246 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2495,7 +2495,8 @@ class Ticket extends CommonObject } /** - * Add new message on a ticket (private/public area). Can also send it be email if GETPOST('send_email', 'int') is set. + * Add new message on a ticket (private/public area). + * Can also send it be email if GETPOST('send_email', 'int') is set. For such email, header and footer is added. * * @param User $user User for action * @param string $action Action string @@ -2556,11 +2557,10 @@ class Ticket extends CommonObject //var_dump($_SESSION); //var_dump($listofpaths);exit; - /* - * Public area - */ if (!empty($public_area)) { /* + * Message created fromthe Public interface + * * Send emails to assigned users (public area notification) */ if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) { @@ -2629,9 +2629,8 @@ class Ticket extends CommonObject } } else { /* - * Private area - */ - /* + * Send from Backoffice / Private area + * * Send emails to internal users (linked contacts) */ if ($send_email > 0) { @@ -2645,7 +2644,7 @@ class Ticket extends CommonObject $subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); $message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id); - $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; + $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); $message = $langs->trans('TicketMessageMailIntroText'); $message .= '

'; @@ -2683,7 +2682,7 @@ class Ticket extends CommonObject // URL ticket $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id; - // altairis: make html link on url + // add html link on url $message .= '
'.$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$object->track_id.'
'; // Add global email address recipient @@ -2693,7 +2692,7 @@ class Ticket extends CommonObject } } - // altairis: dont try to send email if no recipient + // dont try to send email if no recipient if (!empty($sendto)) { $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); } @@ -2724,8 +2723,8 @@ class Ticket extends CommonObject $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; $subject = GETPOST('subject') ? GETPOST('subject') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); - $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : $conf->global->TICKET_MESSAGE_MAIL_INTRO; - $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature', 'restricthtml') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; + $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); + $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); if (!dol_textishtml($message_intro)) { $message_intro = dol_nl2br($message_intro); } From dfe5b4ae4914e25e0ce567e81113ec742a322e1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Sep 2022 12:51:46 +0200 Subject: [PATCH 0694/1289] Add picto/link for sending email on ticket --- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/ticket/agenda.php | 5 +++++ htdocs/ticket/card.php | 5 +++++ htdocs/ticket/messaging.php | 6 +++++- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index db48100867f..34942483751 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1737,7 +1737,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= ''; $out .= ''; $out .= ''; $out .= ''; $out .= '\n"; $i++; } + if (empty($histo)) { + $colspan = 9; + $out .= ''; + } + $out .= "
'; - $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1, 'minwidth200'); + $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, (empty($conf->global->AGENDA_USE_MULTISELECT_TYPE) ? 0 : 1), 1, 'minwidth100 maxwidth150'); $out .= ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3610a470118..34a760feef2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10660,7 +10660,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u } $class = 'btnTitle'; - if (in_array($iconClass, array('fa fa-plus-circle', 'fa fa-plus-circle size15x', 'fa fa-comment-dots'))) { + if (in_array($iconClass, array('fa fa-plus-circle', 'fa fa-plus-circle size15x', 'fa fa-comment-dots', 'fa fa-paper-plane'))) { $class .= ' btnTitlePlus'; } $useclassfortooltip = 1; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 51e4f3af382..6ebc791bfbf 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -86,7 +86,7 @@ function ticket_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id='.$object->track_id; + $head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?track_id='.$object->track_id; $head[$h][1] = $langs->trans("Ticket"); $head[$h][2] = 'tabTicket'; $h++; diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 6f1fa43b472..0f2a5fb3975 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -247,6 +247,11 @@ if (!empty($object->id)) { $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1, array('morecss'=>'btnTitleSelected')); + // Show link to send an email (if read and not closed) + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); + // Show link to add a message (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init'; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d899f8e878c..38f63534801 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1411,6 +1411,11 @@ if ($action == 'create' || $action == 'presend') { } if (empty($reshook)) { + // Email + if (isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&send_email=1&private_message=0&mode=init&token='.newToken().'&track_id='.$object->track_id, ''); + } + // Show link to add a message (if read and not closed) if (isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage") { print dolGetButtonAction('', $langs->trans('TicketAddMessage'), 'default', $_SERVER["PHP_SELF"].'?action=presend_addmessage&mode=init&token='.newToken().'&track_id='.$object->track_id, ''); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 6c8438b5ac0..444cb63eadc 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -244,8 +244,12 @@ if (!empty($object->id)) { $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); + // Show link to send an email (if read and not closed) + $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); - // Show link to add a message (if read and not closed) + // Show link to add a private message (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); From 2dd62444820a77a998a9d22703db55afd9d63303 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Sep 2022 13:49:15 +0200 Subject: [PATCH 0695/1289] Fix backlinks --- htdocs/ticket/agenda.php | 4 ++-- htdocs/ticket/card.php | 2 ++ htdocs/ticket/messaging.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 0f2a5fb3975..9adffdfd720 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -249,12 +249,12 @@ if (!empty($object->id)) { // Show link to send an email (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); // Show link to add a message (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init'; + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); // Show link to add event (if read and not closed) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 38f63534801..647bf2cec54 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1501,6 +1501,8 @@ if ($action == 'create' || $action == 'presend') { print '
'; + print '
'; + print load_fiche_titre($langs->trans('TicketAddMessage'), $morehtmlright, 'messages@ticket'); print '
'; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 444cb63eadc..88ac4ef686c 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -246,12 +246,12 @@ if (!empty($object->id)) { // Show link to send an email (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); // Show link to add a private message (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); // Show link to add event (if read and not closed) From 8929c663fd9e8949eebb8a2d2a19d5a95b0f8d33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Sep 2022 13:59:26 +0200 Subject: [PATCH 0696/1289] Clean code --- htdocs/core/lib/company.lib.php | 5 +++++ htdocs/core/lib/ticket.lib.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 34942483751..99b7a75f459 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1957,6 +1957,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= "
'.$langs->trans("NoRecordFound").'
\n"; $out .= "
\n"; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 6ebc791bfbf..9223c1c4dd8 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -878,6 +878,10 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } $out .= "\n"; + + if (empty($histo)) { + $out .= ''.$langs->trans("NoRecordFound").''; + } } if ($noprint) { From 4ef080dbe0602c3abc458fd7eb9bdae754bb570e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 1 Oct 2022 08:15:14 +0200 Subject: [PATCH 0697/1289] Update SQL with EXISTS --- htdocs/accountancy/class/lettering.class.php | 55 ++++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 989d591e403..857cd12115e 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -518,18 +518,18 @@ class Lettering extends BookKeeping // Get all bookkeeping lines $sql = "SELECT DISTINCT ab.doc_type, ab.fk_doc"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; - if (!empty($bookkeeping_ids)) { - // Get all bookkeeping lines of piece number - $sql .= " LEFT JOIN ("; - $sql .= " SELECT DISTINCT piece_num"; - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping"; - $sql .= " WHERE entity IN (" . getEntity('accountancy') . ")"; - $sql .= " AND rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")"; - $sql .= " ) AS pn ON pn.piece_num = ab.piece_num"; - } $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND ab.fk_doc > 0"; - if (!empty($bookkeeping_ids)) $sql .= " AND pn.piece_num IS NOT NULL"; + if (!empty($bookkeeping_ids)) { + // Get all bookkeeping lines of piece number + $sql .= " AND EXISTS ("; + $sql .= " SELECT rowid"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS pn"; + $sql .= " WHERE pn.entity IN (" . getEntity('accountancy') . ")"; + $sql .= " AND pn.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")"; + $sql .= " AND pn.piece_num = ab.piece_num"; + $sql .= " )"; + } if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG); @@ -583,28 +583,27 @@ class Lettering extends BookKeeping // Get all bookkeeping lines linked $sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.debit, ab.credit, ab.lettering_code"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; - if (!empty($bank_ids)) { - $sql .= " LEFT JOIN ("; - $sql .= " SELECT DISTINCT ab.piece_num"; - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; - $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; - $sql .= " AND ab.doc_type = 'bank'"; - $sql .= " AND ab.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")"; - $sql .= " ) AS bpn ON bpn.piece_num = ab.piece_num"; - } - $sql .= " LEFT JOIN ("; - $sql .= " SELECT DISTINCT ab.piece_num"; - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab"; - $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; - $sql .= " AND ab.doc_type = '" . $this->db->escape($doc_type) . "'"; - $sql .= " AND ab.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")"; - $sql .= " ) AS dpn ON dpn.piece_num = ab.piece_num"; $sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND ("; if (!empty($bank_ids)) { - $sql .= "bpn.piece_num IS NOT NULL OR "; + $sql .= " EXISTS ("; + $sql .= " SELECT bpn.rowid"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS bpn"; + $sql .= " WHERE bpn.entity IN (" . getEntity('accountancy') . ")"; + $sql .= " AND bpn.doc_type = 'bank'"; + $sql .= " AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")"; + $sql .= " AND bpn ON bpn.piece_num = ab.piece_num"; + $sql .= " ) OR "; } - $sql .= "dpn.piece_num IS NOT NULL)"; + $sql .= " EXISTS ("; + $sql .= " SELECT dpn.rowid"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS dpn"; + $sql .= " WHERE dpn.entity IN (" . getEntity('accountancy') . ")"; + $sql .= " AND dpn.doc_type = '" . $this->db->escape($doc_type) . "'"; + $sql .= " AND dpn.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")"; + $sql .= " AND dpn.piece_num = ab.piece_num"; + $sql .= " )"; + $sql .= ")"; if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG); From 51c299ffbb82c513629c0feb2db972c797fb0233 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Oct 2022 13:26:11 +0200 Subject: [PATCH 0698/1289] NEW Add hidden option MAIN_EMAIL_SUPPORT_ACK --- htdocs/comm/propal/card.php | 6 +----- htdocs/compta/facture/card.php | 1 + htdocs/core/class/html.formmail.class.php | 5 +++-- htdocs/core/lib/functions.lib.php | 17 +++++++++-------- htdocs/langs/en_US/ticket.lang | 4 ++-- htdocs/projet/card.php | 4 ++-- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c478ff5a2c..96acf0913f9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2855,11 +2855,7 @@ if ($action == 'create') { // Send if (empty($user->socid)) { if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($usercansend) { - print ''.$langs->trans('SendMail').''; - } else { - print ''.$langs->trans('SendMail').''; - } + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend); } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 072aa9e67b2..f4e4b932ed6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1385,6 +1385,7 @@ if (empty($reshook)) { $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); + $object->ref_customer = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a2abdbb7cc6..22b1b612a84 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,8 @@ class FormMail extends Form ))) { // If list of template is empty $out .= '
'."\n"; - $out .= $langs->trans('SelectMailModel').': '; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. + $out .= ''.$langs->trans('SelectMailModel').': '; + $out .= ''; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. if ($user->admin) { $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')), 1); } @@ -750,7 +751,7 @@ class FormMail extends Form } // Ask delivery receipt - if (!empty($this->withdeliveryreceipt)) { + if (!empty($this->withdeliveryreceipt) && getDolGlobalInt('MAIN_EMAIL_SUPPORT_ACK')) { $out .= $this->getHtmlForDeliveryReceipt(); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 34a760feef2..67f5de5c1fc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10461,14 +10461,14 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st /** * Function dolGetButtonAction * - * @param string $label label or tooltip of button. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. - * @param string $text optional : short label on button. Can be escaped HTML content or full simple text. - * @param string $actionType default, delete, danger - * @param string $url the url for link - * @param string $id attribute id of button - * @param int $userRight user action right + * @param string $label Label or tooltip of button. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. + * @param string $text Optional : short label on button. Can be escaped HTML content or full simple text. + * @param string $actionType 'default', 'delete', 'danger' + * @param string $url Url for link + * @param string $id Attribute id of button + * @param int|boolean $userRight User action right * // phpcs:disable - * @param array $params = [ // Various params for future : recommended rather than adding more function arguments + * @param array $params = [ // Various params for future : recommended rather than adding more function arguments * 'attr' => [ // to add or override button attributes * 'xxxxx' => '', // your xxxxx attribute you want * 'class' => '', // to add more css class to the button class attribute @@ -10485,7 +10485,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * ], * ] * // phpcs:enable - * @return string html button + * @return string html button */ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array()) { @@ -10517,6 +10517,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = if (empty($userRight)) { $attr['class'] = 'butActionRefused'; $attr['href'] = ''; + $attr['title'] = $langs->trans('NotEnoughPermissions'); } if (!empty($id)) { diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 3e917cc460d..3e1415c3625 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -206,8 +206,8 @@ TicketSeverity=Severity ShowTicket=See ticket RelatedTickets=Related tickets TicketAddIntervention=Create intervention -CloseTicket=Close|Solve ticket -AbandonTicket=Abandon ticket +CloseTicket=Close|Solve +AbandonTicket=Abandon CloseATicket=Close|Solve a ticket ConfirmCloseAticket=Confirm ticket closing ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned' diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 52092eb8b94..a308476ae50 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1286,7 +1286,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Send if (empty($user->socid)) { if ($object->statut != Project::STATUS_CLOSED) { - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } } @@ -1306,7 +1306,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Modify if ($object->statut != Project::STATUS_CLOSED && $user->rights->projet->creer) { if ($userWrite > 0) { - print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, ''); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } From 07966f5e6b7b69ddaf3718a3ff1c1abbc5c8b085 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Oct 2022 13:29:47 +0200 Subject: [PATCH 0699/1289] Clean code --- htdocs/asset/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 5 ++--- htdocs/contrat/card.php | 4 ++-- htdocs/core/lib/functions.lib.php | 2 +- .../conferenceorbooth_card.php | 6 +++--- .../conferenceorboothattendee_card.php | 8 ++++---- htdocs/hrm/evaluation_card.php | 8 ++++---- .../knowledgerecord_card.php | 10 +++++----- .../modulebuilder/template/myobject_card.php | 20 +++++++++---------- htdocs/partnership/partnership_card.php | 8 ++++---- htdocs/ticket/card.php | 6 ------ htdocs/user/card.php | 2 +- htdocs/webhook/target_card.php | 8 ++++---- 14 files changed, 42 insertions(+), 49 deletions(-) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 0f19bed4625..b5896f2817e 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -356,7 +356,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); } if ($object->status == $object::STATUS_DRAFT) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c41a4d47f76..4e1b47c598c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2793,7 +2793,7 @@ if ($action == 'create' && $usercancreate) { if (empty($user->socid)) { if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($usercansend) { - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } else { print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f4e4b932ed6..1fb53bb47bd 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5461,7 +5461,6 @@ if ($action == 'create') { if (empty($reshook)) { $params = array( 'attr' => array( - 'title' => '', 'class' => 'classfortooltip' ) ); @@ -5536,9 +5535,9 @@ if ($action == 'create') { print ''.$langs->trans('SendMail').''; } else { if ($usercansend) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); } else { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params); } } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3509134c70f..0d03a1f2d78 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2092,9 +2092,9 @@ if ($action == 'create') { if (empty($user->socid)) { if ($object->statut == 1) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params); } else { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params); } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 67f5de5c1fc..11a966695a2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10511,6 +10511,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $text = $label; $attr['title'] = ''; // if html not set, leave label on title is redundant } else { + $attr['title'] = $label; $attr['aria-label'] = $label; } @@ -10524,7 +10525,6 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $attr['id'] = $id; } - // Override attr if (!empty($params['attr']) && is_array($params['attr'])) { foreach ($params['attr'] as $key => $value) { diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 1e71af81492..46e41dec78e 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -565,13 +565,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit&token='.newToken().'', '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit&token='.newToken().'', '', $permissiontoadd); // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&action=delete&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 14a8c871232..20d7e588bf3 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -605,15 +605,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd); // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); } print '
'."\n"; } diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 5dda3b2ab7c..9f9b937a467 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -615,15 +615,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); - print dolGetButtonAction($langs->trans('Close'), '', 'close', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_CLOSED && $permissiontoclose)); + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Close'), 'close', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_CLOSED && $permissiontoclose)); } elseif ($object->status != $object::STATUS_CLOSED) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } if ($object->status == $object::STATUS_CLOSED) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index a5e1751172a..18f36c192c2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -442,20 +442,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - //print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + //print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); } // Back to draft if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd); } if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && $permissiontovalidate) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } // Validate if ($object->status == $object::STATUS_DRAFT) { if ((empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) && $permissiontovalidate) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&token='.newToken().'&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&token='.newToken().'&confirm=yes', '', $permissiontoadd); } else { $langs->load("errors"); //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0); @@ -464,7 +464,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); /* if ($permissiontoadd) { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2c12640a799..16a471ac51d 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -514,20 +514,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); @@ -535,27 +535,27 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print dolGetButtonAction($langs->trans('Disable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd); } else { - print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd); } } if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); } else { - print dolGetButtonAction($langs->trans('Re-Open'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); } } */ // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); } print ''."\n"; } diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 996506841c5..551794b5d4a 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -557,22 +557,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } // Back to draft if ($object->status != $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); } // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 647bf2cec54..44d260e3700 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1430,12 +1430,6 @@ if ($action == 'create' || $action == 'presend') { print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, ''); } - /* This is useless. We can already modify each field individually - if ($user->rights->ticket->write && $object->status < Ticket::STATUS_CLOSED) { - print ''; - } - */ - // Close ticket if statut is read if (isset($object->status) && $object->status > 0 && $object->status < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { print dolGetButtonAction('', $langs->trans('CloseTicket'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&track_id='.$object->track_id, ''); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 9ba58cd069b..3c65d018e6b 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1864,7 +1864,7 @@ if ($action == 'create' || $action == 'adduserldap') { $langs->load("mails"); $params['attr']['title'] = $langs->trans('NoEMail'); } - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params); } if ($caneditfield && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 83d0d4a1831..f7536cc15b0 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -460,20 +460,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); From 9727fac3d9f06e3f98e383172183b176b9057e9b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 1 Oct 2022 14:23:48 +0200 Subject: [PATCH 0700/1289] Fix token error --- htdocs/takepos/pay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 1222ccd1786..63347dcfe51 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -337,7 +337,7 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { function fetchPaymentIntentClientSecret(amount, invoiceid) { const bodyContent = JSON.stringify({ amount : amount, invoiceid : invoiceid }); return fetch('', { From eb6752de88b7c283e82ac21aa40a69eb9473a0fc Mon Sep 17 00:00:00 2001 From: mikygee Date: Sun, 2 Oct 2022 01:24:34 +0200 Subject: [PATCH 0701/1289] Correction bug #22469 Especes is only written with plurial --- htdocs/langs/fr_FR/bills.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index a764b511920..15a7901a2e9 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -448,8 +448,8 @@ PaymentTypeShortVIR=Virement bancaire PaymentTypePRE=Ordre de prélèvement PaymentTypePREdetails=(sur compte *-%s) PaymentTypeShortPRE=Ordre de prélèvement -PaymentTypeLIQ=Espèce -PaymentTypeShortLIQ=Espèce +PaymentTypeLIQ=Espèces +PaymentTypeShortLIQ=Espèces PaymentTypeCB=Carte bancaire PaymentTypeShortCB=Carte bancaire PaymentTypeCHQ=Chèque From b1ad4d858093d5b59a36e986652a35f6c8bbbca6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 13:40:50 +0200 Subject: [PATCH 0702/1289] Warning --- htdocs/user/home.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 96ca5428683..c93a22f5cfb 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -224,10 +224,10 @@ if ($canreadperms) { $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; - if (isModEnabled('multicompany') && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) { + if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) { $sql .= " WHERE g.entity IS NOT NULL"; } else { - $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; + $sql .= " WHERE g.entity IN (0, ".$conf->entity.")"; } $sql .= $db->order("g.datec", "DESC"); $sql .= $db->plimit($max); From dfc4543be21076590d4ebfc9afd9c765f0a5f92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 13:52:14 +0200 Subject: [PATCH 0703/1289] Fix warning --- htdocs/takepos/index.php | 4 +++- htdocs/ticket/index.php | 4 ++-- htdocs/user/group/list.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 2e4edc99da2..c43d0ec092f 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -397,7 +397,9 @@ function LoadProducts(position, issubcat) { function MoreProducts(moreorless) { console.log("MoreProducts"); - if ($('#search_pagination').val() != '') return Search2('', moreorless); + if ($('#search_pagination').val() != '') { + return Search2('', moreorless); + } var maxproduct = ; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 0128954989d..243084ec89f 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -109,8 +109,8 @@ if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) { } elseif (!empty($_COOKIE['DOLUSERCOOKIE_ticket_by_status'])) { $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticket_by_status'], true); $endyear = $tmparray['year']; - $shownb = $tmparray['shownb']; - $showtot = $tmparray['showtot']; + $shownb = empty($tmparray['shownb']) ? 0 : $tmparray['shownb']; + $showtot = empty($tmparray['showtot']) ? 0 : $tmparray['showtot']; } if (empty($shownb) && empty($showtot)) { $showtot = 1; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index ab49800a8e4..4c91bd041dd 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -129,7 +129,7 @@ $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; -if (isModEnabled('multicompany') && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) { +if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) { $sql .= " WHERE g.entity IS NOT NULL"; } else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; From c0dac5d5dbc88c858e507077f3e771ad64a157ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 22:32:05 +0200 Subject: [PATCH 0704/1289] Fix RUM number if customer account not defined --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a1dcdba6f58..fd9575dd982 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1709,7 +1709,7 @@ class BonPrelevement extends CommonObject { global $langs; $pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation) - return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); + return $pre.($row_code_client ? '-'.$row_code_client : '').'-'.$row_drum.'-'.date('U', $row_datec); } @@ -1823,8 +1823,8 @@ class BonPrelevement extends CommonObject $Rowing = sprintf("%010d", $row_idfac); // Define value for RUM - // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) - $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum; + // Example: RUM-CustomerCode-CustomerBankAccountId-01424448606 (note: Date is the timestamp of the date of creation of CustomerBankAccountId) + $Rum = (empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum); // Define date of RUM signature $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); From 65b5f002ea4ac2fdd7682a01c95d1f5c5fb654d6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 3 Oct 2022 08:22:27 +0200 Subject: [PATCH 0705/1289] FIX missing class "societe" when create another object with workflow --- htdocs/core/ajax/onlineSign.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 3ec4cfa0f20..7de590eb98e 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -28,9 +28,10 @@ if (!defined('NOREQUIREHTML')) { if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } -if (!defined('NOREQUIRESOC')) { +// Needed for create other object with workflow +/*if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); -} +}*/ if (!defined('NOCSRFCHECK')) { define('NOCSRFCHECK', '1'); } From b894136dd9b9d6f0edd604f669e0ea6d579600cb Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 3 Oct 2022 09:52:46 +0200 Subject: [PATCH 0706/1289] NEW parent company column and filter in order list --- htdocs/commande/list.php | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 86bead44380..0194fdf7b72 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -80,6 +80,7 @@ $search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_company_alias = GETPOST('search_company_alias', 'alpha'); +$search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml')); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST('search_state', 'alpha'); @@ -178,6 +179,7 @@ $arrayfields = array( 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>25), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), + 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), 's.zip'=>array('label'=>"Zip", 'checked'=>-1, 'position'=>40), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45), @@ -253,6 +255,7 @@ if (empty($reshook)) { $search_ref_customer = ''; $search_company = ''; $search_company_alias = ''; + $search_parent_name = ''; $search_town = ''; $search_zip = ""; $search_state = ""; @@ -782,6 +785,8 @@ if (!empty($conf->margin->enabled)) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); +$companyparent = new Societe($db); +$company_url_list = array(); $formcompany = new FormCompany($db); $projectstatic = new Project($db); @@ -793,6 +798,8 @@ if ($sall || $search_product_category > 0 || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client,'; +$sql .= " s.parent as fk_parent,"; +$sql .= " s2.nom as name2,"; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; @@ -820,6 +827,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; @@ -937,6 +945,9 @@ if ($search_company) { if ($search_company_alias) { $sql .= natural_search('s.name_alias', $search_company_alias); } +if ($search_parent_name) { + $sql .= natural_search('s2.nom', $search_parent_name); +} if ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } @@ -1121,6 +1132,9 @@ if ($resql) { if ($search_company_alias) { $param .= '&search_company_alias='.urlencode($search_company_alias); } + if ($search_parent_name != '') { + $param .= '&search_parent_name='.urlencode($search_parent_name); + } if ($search_ref_customer) { $param .= '&search_ref_customer='.urlencode($search_ref_customer); } @@ -1451,6 +1465,12 @@ if ($resql) { print ''; print ''; } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print ''; + print ''; + print ''; + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1707,6 +1727,9 @@ if ($resql) { if (!empty($arrayfields['s.name_alias']['checked'])) { print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s2.nom']['checked'])) { + print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER['PHP_SELF'], 's2.nom', '', $param, '', $sortfield, $sortorder, 'center '); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -2008,6 +2031,26 @@ if ($resql) { } } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print ''; + if ($obj->fk_parent > 0) { + if (!isset($company_url_list[$obj->fk_parent])) { + $res = $companyparent->fetch($obj->fk_parent); + if ($res > 0) { + $company_url_list[$obj->fk_parent] = $companyparent->getNomUrl(1); + } + } + if (isset($company_url_list[$obj->fk_parent])) { + print $company_url_list[$obj->fk_parent]; + } + } + print ""; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; From 97c20aa1c888c81a5dc83e3dbc1a0c5f872f1f07 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 10:18:48 +0200 Subject: [PATCH 0707/1289] update code towards php8 compliance --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 026bc1ba57e..914dfd114aa 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -243,8 +243,8 @@ class pdf_azur extends ModelePDFPropales } // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { - $this->watermark = $conf->global->PROPALE_DRAFT_WATERMARK; + if ($object->statut == $object::STATUS_DRAFT && getDolGlobalString('PROPALE_DRAFT_WATERMARK')) { + $this->watermark = getDolGlobalString('PROPALE_DRAFT_WATERMARK'); } $nblines = count($object->lines); From 6dea9332d1c47c9bc525892e593e61665aa09256 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 10:20:39 +0200 Subject: [PATCH 0708/1289] update code towards php8 compliance --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index d2aa3cf5390..360e0ceac35 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -217,8 +217,8 @@ class pdf_cyan extends ModelePDFPropales $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal")); // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK))) { - $this->watermark = $conf->global->PROPALE_DRAFT_WATERMARK; + if ($object->statut == $object::STATUS_DRAFT && getDolGlobalString('PROPALE_DRAFT_WATERMARK')) { + $this->watermark = getDolGlobalString('PROPALE_DRAFT_WATERMARK'); } global $outputlangsbis; From 328d7962b3ad905d96d479d27d5810766cc89423 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:27:31 +0200 Subject: [PATCH 0709/1289] update code towards php8 compliance --- htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php | 2 +- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 2 +- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 1e289930cf0..9f3bc424aa3 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -347,7 +347,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index bbbd82ec1c7..ddc65b1ff8c 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -170,7 +170,7 @@ class pdf_ban extends ModeleBankAccountDoc $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("BAN")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e09fef45bf0..245f1dafe5c 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -182,7 +182,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("SepaMandate")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 0da68641478c107f94ac4755bc79152852cf29f7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:28:44 +0200 Subject: [PATCH 0710/1289] update code towards php8 compliance --- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index f32b2306624..fa3f6e7a6b8 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -155,7 +155,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index ca8d5bd2a74..ff698a7566f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -323,7 +323,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 77854c9d091..50a4736fe24 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -365,7 +365,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 848b9f759355af0209ea49b4b043fa7eee436707 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:29:45 +0200 Subject: [PATCH 0711/1289] update code towards php8 compliance --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 2 +- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c395b51df7e..b3e8ccec7f5 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -256,7 +256,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("ContractCard")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index fe8ca423a2b..b21b4a79e3e 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -324,7 +324,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 0f0657f1e60..c3f9ecadfda 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -284,7 +284,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 7ef951a3a50d80e382b54db3be7c3ac924de7886 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:30:43 +0200 Subject: [PATCH 0712/1289] update code towards php8 compliance --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index c08beade8ec..f2b630d9b49 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -312,7 +312,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 1c457595e93..c9e32b0de6a 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -266,7 +266,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index c51dfd374a5..2685cfc09a7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -337,7 +337,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 30cdcf748bfc7d3a27aaa7cc77c7e6abf6c61ad5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:31:40 +0200 Subject: [PATCH 0713/1289] update code towards php8 compliance --- htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 411bc009b8e..d092614dc40 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -268,7 +268,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Trips")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 39fa07c638a..bf7cb64df77 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -373,7 +373,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($mysoc->name.($user->id > 0 ? ' - '.$outputlangs->convToOutputCharset($user->getFullName($outputlangs)) : '')); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 94b6011b817..1120819e03b 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -400,7 +400,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($mysoc->name.($user->id > 0 ? ' - '.$outputlangs->convToOutputCharset($user->getFullName($outputlangs)) : '')); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 8bdd2f284c6c6eb333029891f2af0b3dea8d8455 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:32:36 +0200 Subject: [PATCH 0714/1289] update code towards php8 compliance --- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/member/doc/pdf_standard.class.php | 2 +- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 097870e21bc..ff5470f248a 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -258,7 +258,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 91206c2dd9f..5a038e67c6d 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -412,7 +412,7 @@ class pdf_standard extends CommonStickerGenerator $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($keywords); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 596a29c1e2d..5c87d7ffbe7 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -447,7 +447,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Stock")." ".$outputlangs->convToOutputCharset($object->label)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 38ccbb40a99f03cea56e5a00b36c8ae0b4920875 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:33:30 +0200 Subject: [PATCH 0715/1289] update code towards php8 compliance --- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 2 +- htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php | 2 +- htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 20fd7b0472b..9c6987bddbb 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -286,7 +286,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Mo")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index c1b93be6653..0e9eefa1e45 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -294,7 +294,7 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($keywords); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 907b18daef3..0d380ce1537 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -317,7 +317,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($keywords); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 7ec37c5422595b86a17b06e780e0050be577350f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:34:24 +0200 Subject: [PATCH 0716/1289] update code towards php8 compliance --- htdocs/core/modules/product/doc/pdf_standard.modules.php | 2 +- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 2 +- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index df1122a5748..b099e6a45a4 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -213,7 +213,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 876249ba228..2858d035879 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -266,7 +266,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index c3e673abf25..19508f2993f 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -315,7 +315,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 78cea181184aa87c57181546cba3d779db4cccd9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:35:14 +0200 Subject: [PATCH 0717/1289] update code towards php8 compliance --- htdocs/core/modules/project/doc/pdf_timespent.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 02f728b5208..b4839598441 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -266,7 +266,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 914dfd114aa..1d51fb3dc88 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -373,7 +373,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfCommercialProposalTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 360e0ceac35..800c1038ad1 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -360,7 +360,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfCommercialProposalTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 95cb38b52faefd14349861ae57d9708130e58b40 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:36:06 +0200 Subject: [PATCH 0718/1289] update code towards php8 compliance --- htdocs/core/modules/rapport/pdf_paiement.class.php | 2 +- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 2 +- htdocs/core/modules/stock/doc/pdf_standard.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 8cb10e0a0f8..5440c8e1201 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -303,7 +303,7 @@ class pdf_paiement $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); //$pdf->SetKeyWords(); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index fb0e59fcb3a..65a12b1061d 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -251,7 +251,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Reception")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index c61fb5a5ff3..71030535a23 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -251,7 +251,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Stock")." ".$outputlangs->convToOutputCharset($object->label)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From d1f78b662abf4354ce7d9f625127bc3be461411d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:37:25 +0200 Subject: [PATCH 0719/1289] update code towards php8 compliance --- htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php | 4 +++- .../modules/stocktransfer/doc/pdf_eagle_proforma.modules.php | 4 +++- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index d658ee77069..daf4df94196 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -319,7 +319,9 @@ class pdf_eagle extends ModelePdfStockTransfer $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Shipment")); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { + $pdf->SetCompression(false); + } $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 8be1b5e0d9c..de027e2464a 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -326,7 +326,9 @@ class pdf_eagle_proforma extends ModelePDFCommandes $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfOrderTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { + $pdf->SetCompression(false); + } $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index dba1c61c7e9..d61e7343eb6 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -307,7 +307,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfInvoiceTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 9299b5fd054a433c85dd535baca730d29024236a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:38:10 +0200 Subject: [PATCH 0720/1289] update code towards php8 compliance --- htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php | 2 +- .../core/modules/supplier_payment/doc/pdf_standard.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 3b12747c924..1a4fb9c8754 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -335,7 +335,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 2ba9ae7f1ae..bf0bff7fb6a 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -350,7 +350,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PurchaseOrder")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 8b131c4e0f2..24b352a3ff8 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -272,7 +272,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From 5612f1dfeaf5a533c13c532614593c60feb8538a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Oct 2022 11:40:14 +0200 Subject: [PATCH 0721/1289] update code towards php8 compliance --- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- .../core/modules/mymodule/doc/pdf_standard_myobject.modules.php | 2 +- .../doc/pdf_standard_recruitmentjobposition.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 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 041a10c2f6d..96088735b97 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -337,7 +337,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialAsk")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 312f1215406..9bb21dd7322 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -312,7 +312,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("PdfTitle")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 007333dfd5d..a883cf8c144 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -327,7 +327,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$object->label." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); - if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } From ebeafa487a7778a7bbdb4d8ddd2063871dd45c71 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 3 Oct 2022 12:29:12 +0200 Subject: [PATCH 0722/1289] FIX cache on parent company list --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0194fdf7b72..61181101c5a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -785,7 +785,6 @@ if (!empty($conf->margin->enabled)) { $formmargin = new FormMargin($db); } $companystatic = new Societe($db); -$companyparent = new Societe($db); $company_url_list = array(); $formcompany = new FormCompany($db); $projectstatic = new Project($db); @@ -2036,6 +2035,7 @@ if ($resql) { print ''; if ($obj->fk_parent > 0) { if (!isset($company_url_list[$obj->fk_parent])) { + $companyparent = new Societe($db); $res = $companyparent->fetch($obj->fk_parent); if ($res > 0) { $company_url_list[$obj->fk_parent] = $companyparent->getNomUrl(1); From 3777b7dffe80ca80ca9f1a3ea28c8f95aab8f111 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 3 Oct 2022 13:38:15 +0200 Subject: [PATCH 0723/1289] fix: [AdvTargetEmailling] bad table from select and use of dict for prospect status --- .../mailing/class/advtargetemailing.class.php | 18 +++++++++++------- .../class/html.formadvtargetemailing.class.php | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index ea6ec241b16..72c9a0e4eb7 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -111,6 +111,8 @@ class AdvanceTargetingMailing extends CommonObject global $langs; $langs->load('customers'); + + $this->db = $db; $this->select_target_type = array( @@ -119,13 +121,15 @@ class AdvanceTargetingMailing extends CommonObject '3' => $langs->trans('ThirdParty'), '4' => $langs->trans('ContactsWithThirdpartyFilter') ); - $this->type_statuscommprospect = array( - -1 => $langs->trans("StatusProspect-1"), - 0 => $langs->trans("StatusProspect0"), - 1 => $langs->trans("StatusProspect1"), - 2 => $langs->trans("StatusProspect2"), - 3 => $langs->trans("StatusProspect3") - ); + + require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; + $customerStatic = new Client($this->db); + $customerStatic->loadCacheOfProspStatus(); + if (!empty($customerStatic->cacheprospectstatus)) { + foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) { + $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; + } + } } /** diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 9e10d51031e..50169438baa 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -355,7 +355,7 @@ class FormAdvTargetEmailing extends Form $out = ''; $sql = "SELECT c.rowid, c.name, c.fk_element"; - $sql .= " FROM ".MAIN_DB_PREFIX."advtargetemailing as c"; + $sql .= " FROM ".MAIN_DB_PREFIX."mailing_advtarget as c"; $sql .= " WHERE type_element = '".$this->db->escape($type_element)."'"; $sql .= " ORDER BY c.name"; From 7ac0168397e1a8e911b4f6b10ae4985956cff2ea Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 3 Oct 2022 13:40:33 +0200 Subject: [PATCH 0724/1289] travais --- htdocs/comm/mailing/class/advtargetemailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 72c9a0e4eb7..35412193c50 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -111,8 +111,6 @@ class AdvanceTargetingMailing extends CommonObject global $langs; $langs->load('customers'); - - $this->db = $db; $this->select_target_type = array( @@ -129,6 +127,8 @@ class AdvanceTargetingMailing extends CommonObject foreach ($customerStatic->cacheprospectstatus as $dataProspectSt) { $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; } + } else { + $this->type_statuscommprospect = array(); } } From 83fa90eef794a34252897f70893b9c990282136e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 3 Oct 2022 13:41:07 +0200 Subject: [PATCH 0725/1289] travais --- htdocs/comm/mailing/class/advtargetemailing.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 35412193c50..7b4e06c897f 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -128,7 +128,13 @@ class AdvanceTargetingMailing extends CommonObject $this->type_statuscommprospect[$dataProspectSt['id']]=$dataProspectSt['label']; } } else { - $this->type_statuscommprospect = array(); + $this->type_statuscommprospect = array( + -1 => $langs->trans("StatusProspect-1"), + 0 => $langs->trans("StatusProspect0"), + 1 => $langs->trans("StatusProspect1"), + 2 => $langs->trans("StatusProspect2"), + 3 => $langs->trans("StatusProspect3") + ); } } From 787de2fd8a83b1f261ef3b7002bf998edea2a5f5 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:16:41 +0200 Subject: [PATCH 0726/1289] FIX: contact deletion: execute trigger before really deleting --- htdocs/contact/class/contact.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index db99a8203bc..89d84df9426 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1208,6 +1208,15 @@ class Contact extends CommonObject $this->db->begin(); + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('CONTACT_DELETE', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + if (!$error) { // Get all rowid of element_contact linked to a type that is link to llx_socpeople $sql = "SELECT ec.rowid"; @@ -1298,15 +1307,6 @@ class Contact extends CommonObject } } - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('CONTACT_DELETE', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - if (!$error) { $this->db->commit(); return 1; From 2801dd6221515320873ef49511de717108ba5e20 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 3 Oct 2022 16:42:00 +0200 Subject: [PATCH 0727/1289] Update lines.php --- htdocs/accountancy/expensereport/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 926d03f9235..aef45ae3ce1 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -417,7 +417,7 @@ if ($result) { print ''.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).''; // Accounting account affected - print ''; + print ''; print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1); print ' '; print img_edit(); From 5ccc5c9e1a59939478e53ecb33664f2dc201e6d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Oct 2022 17:30:47 +0200 Subject: [PATCH 0728/1289] Fix error message --- htdocs/api/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index afb0289aa32..a87edf8166c 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -120,7 +120,7 @@ if (empty($conf->global->MAIN_MODULE_API)) { // Test if explorer is not disabled if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) { $langs->load("admin"); - dol_syslog("Call Dolibarr API interfaces with module REST disabled"); + dol_syslog("Call Dolibarr API interfaces with module API REST disabled"); print $langs->trans("WarningAPIExplorerDisabled").'.

'; //session_destroy(); exit(0); @@ -153,6 +153,10 @@ preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg); $refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false); if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache = true; + if (!is_writable($conf->api->dir_temp)) { + print 'Erreur temp dir api/temp not writable'; + exit(0); + } } $api = new DolibarrApi($db, '', $refreshcache); From bb624dd0a1950b36413c5172558911a750024b16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Oct 2022 19:30:00 +0200 Subject: [PATCH 0729/1289] NEW Can send an email on scheduled job error --- htdocs/cron/card.php | 28 +++++++++++++++++++----- htdocs/cron/class/cronjob.class.php | 34 ++++++++++++++++++++++++----- htdocs/langs/en_US/cron.lang | 3 +++ 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index ac28bc631a4..87a054c699f 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -141,6 +141,7 @@ if ($action == 'add') { $object->unitfrequency = GETPOST('unitfrequency', 'int'); $object->frequency = GETPOST('nbfrequency', 'int'); $object->maxrun = GETPOST('maxrun', 'int'); + $object->email_alert = GETPOST('email_alert'); // Add cron task $result = $object->create($user); @@ -175,6 +176,7 @@ if ($action == 'update') { $object->unitfrequency = GETPOST('unitfrequency', 'int'); $object->frequency = GETPOST('nbfrequency', 'int'); $object->maxrun = GETPOST('maxrun', 'int'); + $object->email_alert = GETPOST('email_alert'); // Add cron task $result = $object->update($user); @@ -415,6 +417,15 @@ if (($action == "create") || ($action == "edit")) { print ""; print "\n"; + print ''; + print $langs->trans('EmailIfError').""; + print ' '; + print ""; + print ""; + //print $form->textwithpicto('', $langs->trans("CronCommandHelp"), 1, 'help'); + print ""; + print "\n"; + print ''; print $langs->trans('CronEvery').""; print ""; @@ -578,32 +589,32 @@ if (($action == "create") || ($action == "edit")) { print ''; print $langs->trans('CronModule').""; - print $object->module_name; + print dol_escape_htmltag($object->module_name); print ""; print ''; print $langs->trans('CronClassFile').""; - print $object->classesname; + print dol_escape_htmltag($object->classesname); print ""; print ''; print $langs->trans('CronObject').""; - print $object->objectname; + print dol_escape_htmltag($object->objectname); print ""; print ''; print $langs->trans('CronMethod').""; - print $object->methodename; + print dol_escape_htmltag($object->methodename); print ""; print ''; print $langs->trans('CronArgs').""; - print $object->params; + print dol_escape_htmltag($object->params); print ""; print ''; print $langs->trans('CronCommand').""; - print $object->command; + print dol_escape_htmltag($object->command); print ""; print ''; @@ -613,6 +624,11 @@ if (($action == "create") || ($action == "edit")) { } print ""; + print ''; + print $langs->trans('EmailIfError').""; + print dol_escape_htmltag($object->email_alert); + print ""; + if (isModEnabled('multicompany')) { print ''; print $langs->trans('Entity').""; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 033e6512bd8..afbaa06aa6a 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -142,6 +142,11 @@ class Cronjob extends CommonObject */ public $pid; + /** + * @var string Email when an error occurs + */ + public $email_alert; + /** * @var int User ID of creation */ @@ -428,6 +433,7 @@ class Cronjob extends CommonObject $sql .= " t.status,"; $sql .= " t.processing,"; $sql .= " t.pid,"; + $sql .= " t.email_alert,"; $sql .= " t.fk_user_author,"; $sql .= " t.fk_user_mod,"; $sql .= " t.note as note_private,"; @@ -477,6 +483,7 @@ class Cronjob extends CommonObject $this->status = $obj->status; $this->processing = $obj->processing; $this->pid = $obj->pid; + $this->email_alert = $obj->email_alert; $this->fk_user_author = $obj->fk_user_author; $this->fk_user_mod = $obj->fk_user_mod; $this->note_private = $obj->note_private; @@ -538,6 +545,7 @@ class Cronjob extends CommonObject $sql .= " t.status,"; $sql .= " t.processing,"; $sql .= " t.pid,"; + $sql .= " t.email_alert,"; $sql .= " t.fk_user_author,"; $sql .= " t.fk_user_mod,"; $sql .= " t.note as note_private,"; @@ -615,6 +623,7 @@ class Cronjob extends CommonObject $line->status = $obj->status; $line->processing = $obj->processing; $line->pid = $obj->pid; + $line->email_alert = $obj->email_alert; $line->fk_user_author = $obj->fk_user_author; $line->fk_user_mod = $obj->fk_user_mod; $line->note_private = $obj->note_private; @@ -716,10 +725,12 @@ class Cronjob extends CommonObject if (empty($this->processing)) { $this->processing = 0; } - if (empty($this->pid)) { $this->pid = null; } + if (empty($this->email_alert)) { + $this->email_alert = ''; + } // Check parameters // Put here code to add a control on parameters values @@ -764,7 +775,7 @@ class Cronjob extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."cronjob SET"; - $sql .= " entity=".(isset($this->entity) ? $this->db->escape($this->entity) : $conf->entity).","; + $sql .= " entity=".(isset($this->entity) ? ((int) $this->entity) : $conf->entity).","; $sql .= " label=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " jobtype=".(isset($this->jobtype) ? "'".$this->db->escape($this->jobtype)."'" : "null").","; $sql .= " command=".(isset($this->command) ? "'".$this->db->escape($this->command)."'" : "null").","; @@ -774,7 +785,7 @@ class Cronjob extends CommonObject $sql .= " params=".(isset($this->params) ? "'".$this->db->escape($this->params)."'" : "null").","; $sql .= " md5params=".(isset($this->md5params) ? "'".$this->db->escape($this->md5params)."'" : "null").","; $sql .= " module_name=".(isset($this->module_name) ? "'".$this->db->escape($this->module_name)."'" : "null").","; - $sql .= " priority=".(isset($this->priority) ? $this->priority : "null").","; + $sql .= " priority=".(isset($this->priority) ? ((int) $this->priority) : "null").","; $sql .= " datelastrun=".(dol_strlen($this->datelastrun) != 0 ? "'".$this->db->idate($this->datelastrun)."'" : 'null').","; $sql .= " datenextrun=".(dol_strlen($this->datenextrun) != 0 ? "'".$this->db->idate($this->datenextrun)."'" : 'null').","; $sql .= " dateend=".(dol_strlen($this->dateend) != 0 ? "'".$this->db->idate($this->dateend)."'" : 'null').","; @@ -786,8 +797,9 @@ class Cronjob extends CommonObject $sql .= " frequency=".(isset($this->frequency) ? $this->frequency : "null").","; $sql .= " status=".(isset($this->status) ? $this->status : "null").","; $sql .= " processing=".((isset($this->processing) && $this->processing > 0) ? $this->processing : "0").","; - $sql .= " pid=".(isset($this->pid) ? $this->pid : "null").","; - $sql .= " fk_user_mod=".$user->id.","; + $sql .= " pid=".(isset($this->pid) ? ((int) $this->pid) : "null").","; + $sql .= " email_alert = ".(isset($this->email_alert) ? "'".$this->db->escape($this->email_alert)."'" : "null").","; + $sql .= " fk_user_mod = ".((int) $user->id).","; $sql .= " note=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " nbrun=".((isset($this->nbrun) && $this->nbrun > 0) ? $this->nbrun : "null").","; $sql .= " maxrun=".((isset($this->maxrun) && $this->maxrun > 0) ? $this->maxrun : "0").","; @@ -940,6 +952,7 @@ class Cronjob extends CommonObject $this->status = 0; $this->processing = 0; $this->pid = null; + $this->email_alert = ''; $this->fk_user_author = 0; $this->fk_user_mod = 0; $this->note_private = ''; @@ -1130,6 +1143,7 @@ class Cronjob extends CommonObject @set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64 error_reporting($err); } + $MemoryLimit = 0; if (!empty($MemoryLimit)) { @ini_set('memory_limit', $MemoryLimit); } @@ -1341,6 +1355,16 @@ class Cronjob extends CommonObject } $conf->setEntityValues($this->db, $savcurrententity); + + if ($error && !empty($this->email_alert)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $subject = $langs->trans("ErrorInBatch", $this->label); + $msg = $langs->trans("ErrorInBatch", $this->label); + $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); + $cmailfile = new CMailFile($subject, $this->email_alert, $from, $msg); + $result = $cmailfile->sendfile(); // Do not test result + } + return $error ?-1 : 1; } diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index d9bdd2691eb..70fb9e387b9 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -89,6 +89,9 @@ CleanUnfinishedCronjob=Clean cronjob stuck in processing when the process is no WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. DATAPOLICYJob=Data cleaner and anonymizer JobXMustBeEnabled=Job %s must be enabled +EmailIfError=Email for warning on error +ErrorInBatch=Error when running the job %s + # Cron Boxes LastExecutedScheduledJob=Last executed scheduled job NextScheduledJobExecute=Next scheduled job to execute From 4e88c5e292e1d623d41637ad4df80aa1f3d0ac36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Oct 2022 19:41:04 +0200 Subject: [PATCH 0730/1289] Fix warnings --- htdocs/cron/class/cronjob.class.php | 11 +++++++++-- htdocs/partnership/class/partnershiputils.class.php | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index afbaa06aa6a..9aae70d0d6d 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -173,10 +173,16 @@ class Cronjob extends CommonObject public $libname; /** - * @var string A test condition to know if job is visible/qualified + * @var string A test condition to know if job is visible/qualified */ public $test; + /** + * @var string Autodelete + */ + public $autodelete; + + const STATUS_DISABLED = 0; const STATUS_ENABLED = 1; const STATUS_ARCHIVED = 2; @@ -1221,7 +1227,8 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG); // Create Object for the called module - $object = new $this->objectname($this->db); + $nameofclass = $this->objectname; + $object = new $nameofclass($this->db); if ($this->entity > 0) { $object->entity = $this->entity; // We work on a dedicated entity } diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 366bee570df..647d1492ced 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -41,6 +41,8 @@ class PartnershipUtils public $error; //!< To return error code (or message) public $errors = array(); //!< To return several error codes (or messages) + public $output; // To store output of some cron methods + /** * Constructor From 49163de473acc73b5c9d6c3ac4b974edae779b48 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 3 Oct 2022 22:01:04 +0200 Subject: [PATCH 0731/1289] Fix better fix for php 8 --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5fb9ba38588..2f3eb754b48 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4812,7 +4812,7 @@ class Product extends CommonObject $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens $sql.= " ORDER BY pa.rang"; - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.implode(',', $parents), LOG_DEBUG); + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents)?implode(',', $parents):$parents), LOG_DEBUG); if ($level == 1) { $alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly From 5e93a09f6a9668e865e680d26e99d97555938a33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 08:44:43 +0200 Subject: [PATCH 0732/1289] css --- htdocs/salaries/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ab4ba4cd4b8..9ee2e52a226 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -711,7 +711,7 @@ if ($id) { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), 'value' => -1); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250); } if ($action == 'paid') { From dcf1f0bdeab7c079cf9051e8f8491a010d441064 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 13:50:02 +0200 Subject: [PATCH 0733/1289] FIX bad closing select --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 6c45982a929..8fbc763bd64 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1217,7 +1217,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; } print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list'); - print ''; + print ''; } // Prospect level if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) { From 013d136bf7debe3611f6fe4699190dcec2c6969e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 13:57:42 +0200 Subject: [PATCH 0734/1289] FIX @ must be allowed into dol_eval --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f5206c700d0..3ea1a741ed2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8232,7 +8232,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // Test dangerous char (used for RCE), we allow only PHP variable testing. if ($onlysimplestring == '1') { //print preg_quote('$_->&|', '/'); - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*/>&|=!?():"\',/', '/').']/i', $s)) { + if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*/>&|=!?():"\',/@', '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; } else { @@ -8242,11 +8242,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' } } elseif ($onlysimplestring == '2') { //print preg_quote('$_->&|', '/'); - if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*/>&|=!?():"\',/;[]', '/').']/i', $s)) { + if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*/>&|=!?():"\',/@;[]', '/').']/i', $s)) { if ($returnvalue) { - return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; + return 'Bad string syntax to evaluate (found chars that are not chars for simplestring 2): '.$s; } else { - dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); + dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring 2): '.$s); return ''; } } From 68c018896995b578383873ace77a265e3e14962f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 14:17:57 +0200 Subject: [PATCH 0735/1289] Revert "FIX: Preview button position on documents list (case when the file is too long)" This reverts commit 88b5594af31f54bed54d0c89e61930f78c48404e. --- htdocs/core/class/html.formfile.class.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 78e54731f05..4bcf742d461 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -884,7 +884,6 @@ class FormFile // Show file name with link to download $out .= ''; - $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param, 'paddingright')."\n"; $out .= '
trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); - $out .= ''; + $out .= ''."\n"; + $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); $out .= ''; // Show file size @@ -1341,11 +1341,6 @@ class FormFile // File name print ''; - // Preview link - if (!$editline) { - print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity), 'paddingright') . "\n"; - } - // Show file name with link to download //print "XX".$file['name']; //$file['name'] must be utf8 print '\n"; @@ -2145,10 +2144,9 @@ class FormFile * @param string $relativepath Relative path of docs * @param integer $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file) * @param string $param More param on http links - * @param string $moreclass Add more class to class style * @return string $out Output string with HTML */ - public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '', $moreclass = '') + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '') { global $langs, $conf; @@ -2156,7 +2154,7 @@ class FormFile if ($conf->browser->layout != 'phone' && !empty($conf->use_javascript_ajax)) { $urladvancedpreview = getAdvancedPreviewUrl($modulepart, $relativepath, 1, $param); // Return if a file is qualified for preview. if (count($urladvancedpreview)) { - $out .= ''; + $out .= ''; //$out.= ''; if (empty($ruleforpicto)) { //$out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); From 8c46207f3243af36e20efe3d219c7c3ab805c4fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 14:25:21 +0200 Subject: [PATCH 0736/1289] Use the fast count method --- htdocs/societe/list.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8fbc763bd64..735149947e3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -691,11 +691,20 @@ $sql .= $hookmanager->resPrint; // Count total nb of records with no order and no limits $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); + /*$resql = $db->query($sql); if ($resql) { $nbtotalofrecords = $db->num_rows($resql); } else { dol_print_error($db); + }*/ + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); } if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 From b5c745a573b9b3e99bb9d65f3971e2d8ee858725 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Oct 2022 19:41:04 +0200 Subject: [PATCH 0737/1289] Fix warnings --- htdocs/cron/class/cronjob.class.php | 11 +++++++++-- htdocs/partnership/class/partnershiputils.class.php | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index a84fa3109df..b18c7146795 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -163,10 +163,16 @@ class Cronjob extends CommonObject public $libname; /** - * @var string A test condition to know if job is visible/qualified + * @var string A test condition to know if job is visible/qualified */ public $test; + /** + * @var string Autodelete + */ + public $autodelete; + + const STATUS_DISABLED = 0; const STATUS_ENABLED = 1; const STATUS_ARCHIVED = 2; @@ -1191,7 +1197,8 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG); // Create Object for the called module - $object = new $this->objectname($this->db); + $nameofclass = $this->objectname; + $object = new $nameofclass($this->db); if ($this->entity > 0) { $object->entity = $this->entity; // We work on a dedicated entity } diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 9ad2e5b7ca2..c73068e17a4 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -41,6 +41,8 @@ class PartnershipUtils public $error; //!< To return error code (or message) public $errors = array(); //!< To return several error codes (or messages) + public $output; // To store output of some cron methods + /** * Constructor From 85a764afc608163499ffead9efdb5789384abcce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 13:50:02 +0200 Subject: [PATCH 0738/1289] FIX bad closing select --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1222e9f7ffc..413137ec0b0 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1207,7 +1207,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) { print ''; } print $formcompany->selectProspectCustomerType($search_type, 'search_type', 'search_type', 'list'); - print ''; + print ''; } // Prospect level if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) { From 946c79ced021fc7937551e4caec0d99f96a3be37 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 4 Oct 2022 17:43:24 +0200 Subject: [PATCH 0739/1289] NEW set thirdparty type with company modify trigger --- htdocs/societe/class/societe.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 586f955c1e0..c01f83401cf 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4932,15 +4932,16 @@ class Societe extends CommonObject */ public function setThirdpartyType($typent_id) { + global $user; + + dol_syslog(__METHOD__, LOG_DEBUG); + if ($this->id) { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; - $sql .= " SET fk_typent = ".($typent_id > 0 ? $typent_id : "null"); - $sql .= " WHERE rowid = ".((int) $this->id); - dol_syslog(get_class($this).'::setThirdpartyType', LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { + $result = $this->setValueFrom('fk_typent', $typent_id, '', null, '', '', $user, 'COMPANY_MODIFY'); + + if ($result > 0) { $this->typent_id = $typent_id; - $this->typent_code = dol_getIdFromCode($this->db, $this->$typent_id, 'c_typent', 'id', 'code'); + $this->typent_code = dol_getIdFromCode($this->db, $this->typent_id, 'c_typent', 'id', 'code'); return 1; } else { return -1; From 959aef914e66fe17199f5585f866f14747d8b09d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Oct 2022 23:53:17 +0200 Subject: [PATCH 0740/1289] Clean code --- htdocs/admin/mails_templates.php | 50 +++++++++++++-------------- htdocs/core/class/html.form.class.php | 31 ++++++++++++----- htdocs/user/class/user.class.php | 5 ++- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 02eef8a00d3..1b5f8353f12 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -56,7 +56,7 @@ if (isModEnabled('eventorganization')) { $langs->loadLangs($langsArray); $toselect = GETPOST('toselect', 'array'); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $mode = GETPOST('mode', 'aZ09'); @@ -350,7 +350,7 @@ if (empty($reshook)) { } setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); - $action = 'add'; + $action = 'create'; } } @@ -424,7 +424,7 @@ if (empty($reshook)) { } else { dol_print_error($db); } - $action = 'add'; + $action = 'create'; } } @@ -654,7 +654,7 @@ $linkback = ''; $titlepicto = 'title_setup'; -$url = DOL_URL_ROOT.'/admin/mails_templates.php?action=add&token='.newToken(); +$url = DOL_URL_ROOT.'/admin/mails_templates.php?action=create'; $newcardbutton = dolGetButtonTitle($langs->trans('NewEMailTemplate'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); @@ -685,10 +685,11 @@ if ($action == 'delete') { $fieldlist = explode(',', $tabfield[$id]); -if ($action == 'add') { +if ($action == 'create') { // Form to add a new line print ''; print ''; + print ''; print ''; print '
'; @@ -739,7 +740,6 @@ if ($action == 'add') { if ($fieldlist[$field] == 'content_lines') { $valuetoshow = ''; } - if ($valuetoshow != '') { print ''; if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { @@ -820,16 +820,15 @@ if ($action == 'add') { // Input field if ($tmpfieldlist == 'topic') { - print ''; + print ''; } elseif ($tmpfieldlist == 'joinfiles') { - print ''; + print $form->selectyesno($tmpfieldlist, (isset($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '0'), 1, false, 0, 1); } else { - // print ''; $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $okforextended = false; } - $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 180, 'dolibarr_mailings', 'In', 0, true, $okforextended, ROWS_4, '90%'); + $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : ''), '', 180, 'dolibarr_mailings', 'In', 0, true, $okforextended, ROWS_4, '90%'); print $doleditor->Create(1); } print ''; @@ -917,7 +916,7 @@ foreach ($fieldlist as $field => $value) { print ''; } elseif ($value == 'fk_user') { print ''; - print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150'); + print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150', 1); print ''; } elseif ($value == 'topic') { print ''; @@ -1024,7 +1023,7 @@ if ($num) { $reshook = $hookmanager->executeHooks('editEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; - // Show fields + // Show main fields if (empty($reshook)) { fieldList($fieldlist, $obj, $tabname[$id], 'edit'); } @@ -1045,7 +1044,7 @@ if ($num) { foreach ($fieldsforcontent as $tmpfieldlist) { $showfield = 1; $align = "left"; - $valuetoshow = $obj->{$tmpfieldlist}; + $valuetoshow = $obj->$tmpfieldlist; $class = 'tddict'; // Show value for field @@ -1059,7 +1058,7 @@ if ($num) { } if ($tmpfieldlist == 'joinfiles') { print ''.$form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).' '; - print ''; + print $form->selectyesno($tmpfieldlist.'-'.$rowid, (isset($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '0'), 1, false, 0, 1); } // If $acceptlocallinktomedia is true, we can add link media files int email templates (we already can do this into HTML editor of an email). @@ -1204,7 +1203,7 @@ if ($num) { if ($value == 'joinfiles') { $align = "center"; if ($valuetoshow) { - $valuetoshow = 1; + $valuetoshow = yn(1); } else { $valuetoshow = ''; } @@ -1311,7 +1310,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($value == 'fk_user') { print ''; if ($user->admin) { - print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300'); + print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth200'); } else { if ($context == 'add') { // I am not admin and we show the add form print $user->getNomUrl(1); // Me @@ -1335,29 +1334,29 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (getDolGlobalInt('MAIN_MULTILANGS')) { $selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang; if ($context == 'edit') { - $selectedlang = $obj->{$value}; + $selectedlang = $obj->lang; } print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } else { - if (!empty($obj->{$value})) { - print $obj->{$value}.' - '.$langs->trans('Language_'.$obj->{$value}); + if (!empty($obj->lang)) { + print $obj->lang.' - '.$langs->trans('Language_'.$obj->lang); } $keyname = $value; if ($keyname == 'lang') { $keyname = 'langcode'; // Avoid conflict with lang param } - print ''; + print ''; } print ''; } elseif ($value == 'type_template') { // Le type de template print ''; - if ($context == 'edit' && !empty($obj->{$value}) && !in_array($obj->{$value}, array_keys($elementList))) { + if ($context == 'edit' && !empty($obj->type_template) && !in_array($obj->type_template, array_keys($elementList))) { // Current template type is an unknown type, so we must keep it as it is. - print ''; - print $obj->{$value}; + print ''; + print $obj->type_template; } else { - print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1); + print $form->selectarray('type_template', $elementList, (!empty($obj->type_template) ? $obj->type_template:''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1); } print ''; } elseif ($context == 'add' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { @@ -1378,7 +1377,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $class = 'maxwidth50'; $classtd = 'center'; } if ($value == 'position') { - $class = 'maxwidth50'; $classtd = 'center'; + $class = 'maxwidth50 center'; $classtd = 'center'; } if ($value == 'libelle') { $class = 'quatrevingtpercent'; @@ -1395,7 +1394,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (empty($user->admin)) { print $form->selectyesno($value, '1', 1); } else { - //print ''; print $form->selectyesno($value, (isset($obj->{$value}) ? $obj->{$value}:''), 1); } } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6c7f60fc98f..dc7d8439cad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1929,14 +1929,14 @@ class Form * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css - * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int $notdisabled Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). * @param int $outputmode 0=HTML select string, 1=Array * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @param int $forcecombo Force the component to be a simple combo box without ajax * @return string HTML select string * @see select_dolgroups() */ - public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false, $forcecombo = 0) + public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $notdisabled = 0, $outputmode = 0, $multiple = false, $forcecombo = 0) { // phpcs:enable global $conf, $user, $langs, $hookmanager; @@ -2005,7 +2005,7 @@ class Form if ($includeUsers) { $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; } - if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) { + if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) { $sql .= " AND u.statut <> 0"; } if (!empty($morefilter)) { @@ -2065,7 +2065,7 @@ class Form $disableline = ($enableonlytext ? $enableonlytext : '1'); } - $labeltoshow = ''; + $labeltoshow = ''; $labeltoshowhtml = ''; // $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0) $fullNameMode = 0; @@ -2073,37 +2073,50 @@ class Form $fullNameMode = 1; //Firstname+lastname } $labeltoshow .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); + $labeltoshowhtml .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); if (empty($obj->firstname) && empty($obj->lastname)) { $labeltoshow .= $obj->login; + $labeltoshowhtml .= $obj->login; } - // Complete name with more info - $moreinfo = ''; + // Complete name with a more info string like: ' (info1 - info2 - ...)' + $moreinfo = ''; $moreinfohtml = ''; if (!empty($conf->global->MAIN_SHOW_LOGIN)) { - $moreinfo .= ($moreinfo ? ' - ' : ' (').$obj->login; + $moreinfo .= ($moreinfo ? ' - ' : ' ('); + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' ('); + $moreinfo .= $obj->login; + $moreinfohtml .= $obj->login; } if ($showstatus >= 0) { if ($obj->status == 1 && $showstatus == 1) { $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' (').$langs->trans('Enabled'); } if ($obj->status == 0 && $showstatus == 1) { $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' (').$langs->trans('Disabled'); } } if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { if (!$obj->entity) { $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' (').$langs->trans("AllEntities"); } else { if ($obj->entity != $conf->entity) { $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); } } } $moreinfo .= ($moreinfo ? ')' : ''); + $moreinfohtml .= ($moreinfohtml ? ')' : ''); if ($disableline && $disableline != '1') { - $moreinfo .= ' - '.$disableline; // This is text from $enableonlytext parameter + // Add text from $enableonlytext parameter + $moreinfo .= ' - '.$disableline; + $moreinfohtml .= ' - '.$disableline; } $labeltoshow .= $moreinfo; + $labeltoshowhtml .= $moreinfohtml; $out .= '
\n"; print "\n"; -if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction == 'replace') { +if ($mode == 'replacesite' || $massaction == 'replace') { print '
'; print ''; print ''; + print ''; print ''; @@ -4364,7 +4402,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print ''; - if ($action == 'replacesiteconfirm') { + if ($mode == 'replacesite') { print ''."\n"; print '
'; @@ -4376,18 +4414,21 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $param = ''; $nbtotalofrecords = count($listofpages['list']); $num = $limit; - $permissiontodelete = $user->rights->website->delete; + $permissiontodelete = $user->hasRight('website', 'delete'); // List of mass actions available $arrayofmassactions = array(); - if ($user->rights->website->writephp && $searchkey) { - $arrayofmassactions['replace'] = $langs->trans("Replace"); + if ($user->hasRight('website', 'writephp') && $searchkey) { + $arrayofmassactions['replace'] = img_picto('', 'replacement', 'class="pictofixedwidth"').$langs->trans("Replace"); } - if ($user->rights->website->write) { - $arrayofmassactions['setcategory'] = $langs->trans("ClassifyInCategory"); + if ($user->hasRight('website', 'write')) { + $arrayofmassactions['setcategory'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("ClassifyInCategory"); + } + if ($user->hasRight('website', 'write')) { + $arrayofmassactions['delcategory'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("RemoveCategory"); } if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); @@ -4398,8 +4439,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $massactionbutton .= $langs->trans("ReplaceString"); $massactionbutton .= ' '; $massactionbutton .= '
'; - $massactionbutton .= '
__N__ __N____N__ __N____N__ __N____N__ __N__
__N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__
__N__
__N__ __N__
__N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N____N__ __N__
__N____N__
__N__ __N__
__N__
__N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N____N__', '', 0); --- Page ID 154 -> 2__+MAX_llx_website_page__ - Aliases contact --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'contact', '', '', '', '', '1', '2022-08-16 14:40:51', '2022-08-23 13:17:02', null, '', 'page', '__N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ Template 04__N__ ', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Say Hi

__N____N__ We are happy to get in touch with you__N__
__N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

Leave a message

__N__
__N____N__
__N__ __N__
__N__
__N____N__
__N__ Phone Number__N____N__ __N__
__N____N__
__N__ Email__N____N__ __N____N__ Message__N____N__ __N__
__N____N__
__N__ __N__
__N__ __N__
__N____N__
__N__
Weekdays
__N____N__
__N__ $day : \" .getDolGlobalString(\"MAIN_INFO_OPENINGHOURS_$day\") .\"

\"; __N__ }__N__ ?>__N__
__N____N__
Weekends
__N____N__
__N__

Saturday and Sunday

__N____N__

to be determined !

__N__
__N__
__N____N__
__N__

__N__ getFullAddress() ?>__N__

__N____N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__ __N__ __N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__ __N__
__N__ __N__ \" />__N__ __N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N__ __N__ __N____N__
__N__', '', 0); --- Page ID 151 -> 3__+MAX_llx_website_page__ - Aliases index --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'index', '', 'index', '', '', '', '', '1', '2022-08-09 16:34:54', '2022-09-26 14:52:09', null, '', 'page', '__N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ Template 04__N__ ', '__N____N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__
__N__

__N__ Delicious Steaks__N__

__N____N__ __N__ __N__

__N__ 4.7/5__N__

__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N____N__

__N__ From 1,206+ Customer__N__ Reviews__N__

__N__
__N__
__N__
__N____N__
__N__ __N__
__N__
__N__
__N__ __N__
__N____N__
__N__

__N__ Fine Dining Restaurant__N__

__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

Steak

__N____N__ 26.50__N__
__N____N__ __N__ __N__ 3.8/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

__N__ Sausage Pasta__N__

__N____N__ 18.25__N__
__N____N__ __N__ __N__ 4.2/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__ __N__ __N__ __N____N__ __N__ __N__ Previous__N__ __N____N__ __N__ __N__ Next__N__ __N__ __N__ __N__ __N__ __N____N__
__N__ __N__ __N__ Your browser does not support the video tag.__N__ __N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

__N__ Special Menus__N__

__N__
__N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Morning Fresh

__N____N__ 12.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

DoliCloud Soup

__N____N__ 24.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 50 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Premium Steak

__N____N__ 45__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 86 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Seafood Set

__N____N__ 86__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 44 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Burger Set

__N____N__ 20.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

Healthy Soup

__N____N__ 34.20__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__ __N__ __N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N__ __N__ __N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- Page ID 169 -> 1__+MAX_llx_website_page__ - Aliases about --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'about', '', 'About us', '', '', '', '', '1', '2022-08-09 16:40:13', '2022-10-08 19:22:45', null, '', 'page', '', '__N__
__N__ __N____N__
__N____N__
__N__
__N__
__N____N__
__N__

About Us

__N____N__ Get to know us more__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N____N__
__N__

Team Members

__N__
__N____N__
__N__
__N__ \"\"__N__ __N__
__N__

Sophia

__N____N__

CEO & Founder

__N__
__N__
__N__
__N____N__
__N__
__N__ \"\"__N____N__

Benjamin W.

__N____N__

Restaurant Manager

__N__
__N__
__N____N__
__N__
__N__ \"\"__N__ __N__

Muchen Jack

__N____N__

Senior Chef

__N__
__N__
__N____N__
__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- Page ID 170 -> 2__+MAX_llx_website_page__ - Aliases contact --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'Contact us', '', '', '', '', '1', '2022-08-16 14:40:51', '2022-10-08 19:30:28', null, '', 'page', '', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Say Hi

__N____N__ We are happy to get in touch with you__N__
__N__
__N__
__N____N__
__N__
__N____N__ __N__ __N__
__N__
__N__
__N__
__N__

Leave a message

__N__
__N____N__
__N__ __N__
__N__
__N____N__
__N__ Phone Number__N____N__ __N__
__N____N__
__N__ Email__N____N__ __N____N__ Message__N____N__ __N__
__N____N__
__N__ __N__
__N__ __N__
__N____N__
__N__
Weekdays
__N____N__
__N__ $day : \" .getDolGlobalString(\"MAIN_INFO_OPENINGHOURS_$day\") .\"

\"; __N__ }__N__ ?>__N__
__N____N__
Weekends
__N____N__
__N__

Saturday and Sunday

__N____N__

to be determined !

__N__
__N__
__N____N__
__N__

__N__ getFullAddress() ?>__N__

__N____N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N____N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__ __N__
__N__ __N__ \" />__N__ __N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N__ __N__ __N____N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- Page ID 171 -> 3__+MAX_llx_website_page__ - Aliases index --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'index', '', 'index', '', '', '', '', '1', '2022-08-09 16:34:54', '2022-10-08 19:28:42', null, '', 'page', '', '__N____N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__
__N__

__N__ Delicious Steaks__N__

__N____N__ __N__ __N__

__N__ 4.7/5__N__

__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N____N__

__N__ From 1,206+ Customer__N__ Reviews__N__

__N__
__N__
__N__
__N____N__
__N__ __N__
__N__
__N__
__N__ __N__
__N____N__
__N__

__N__ Fine Dining Restaurant__N__

__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

Steak

__N____N__ 26.50__N__
__N____N__ __N__ __N__ 3.8/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

__N__ Sausage Pasta__N__

__N____N__ 18.25__N__
__N____N__ __N__ __N__ 4.2/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__ __N__ __N__ __N____N__ __N__ __N__ Previous__N__ __N____N__ __N__ __N__ Next__N__ __N__ __N__ __N__ __N__ __N____N__
__N__ __N__ __N__ Your browser does not support the video tag.__N__ __N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

__N__ Special Menus__N__

__N__
__N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Morning Fresh

__N____N__ 12.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

DoliCloud Soup

__N____N__ 24.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 50 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Premium Steak

__N____N__ 45__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 86 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Seafood Set

__N____N__ 86__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 44 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Burger Set

__N____N__ 20.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

Healthy Soup

__N____N__ 34.20__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__
__N__', '', 0); UPDATE llx_website SET fk_default_home = 3__+MAX_llx_website_page__ WHERE rowid = __WEBSITE_ID__; --- Page ID 153 -> 4__+MAX_llx_website_page__ - Aliases menu --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(4__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'menu', '', 'menu', '', '', '', '', '1', '2022-08-16 14:37:03', '2022-08-23 13:11:56', null, '', 'page', '__N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ Template 04__N__ ', '__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Our Menus

__N____N__ Perfect for all Breakfast, Lunch and__N__ Dinner__N__
__N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

Breakfast Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Fresh Start

__N____N__ $24.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 128 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Baked Creamy

__N____N__ $16.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Burger Set

__N____N__ $24.50__N____N__ $36.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 32 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Lunch Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Super Steak Set

__N____N__ $32.75__N____N__ $55__N____N__ __N__
__N__ 4.2/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 66 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Bread & Steak Set

__N____N__ $42.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 84 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Dinner Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Seafood Set

__N____N__ $65.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Premium Steak

__N____N__ $74.25__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 56 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Salmon Set

__N____N__ $60__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 76 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__ __N__ __N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N__ __N__ __N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- Page ID 172 -> 4__+MAX_llx_website_page__ - Aliases menu --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(4__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'menu', '', 'Our menus', '', '', '', '', '1', '2022-08-16 14:37:03', '2022-10-08 19:23:06', null, '', 'page', '', '__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Our Menus

__N____N__ Perfect for all Breakfast, Lunch and__N__ Dinner__N__
__N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

Breakfast Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Fresh Start

__N____N__ $24.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 128 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Baked Creamy

__N____N__ $16.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Burger Set

__N____N__ $24.50__N____N__ $36.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 32 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Lunch Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Super Steak Set

__N____N__ $32.75__N____N__ $55__N____N__ __N__
__N__ 4.2/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 66 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Bread & Steak Set

__N____N__ $42.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 84 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Dinner Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Seafood Set

__N____N__ $65.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Premium Steak

__N____N__ $74.25__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 56 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Salmon Set

__N____N__ $60__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 76 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__
__N__', '', 0); -- For Dolibarr v14+ --; UPDATE llx_website SET lang = 'en' WHERE rowid = __WEBSITE_ID__; From 4a9181b5bc7dd82221a2958c6745f33363d2f567 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Oct 2022 20:22:27 +0200 Subject: [PATCH 0837/1289] Clean code --- .../website_template-style04/containers/index.php | 14 ++++++++++---- .../website_template-style04/website_pages.sql | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/index.php b/htdocs/install/doctemplates/websites/website_template-style04/containers/index.php index 5e54402d84d..dc10e0099f4 100644 --- a/htdocs/install/doctemplates/websites/website_template-style04/containers/index.php +++ b/htdocs/install/doctemplates/websites/website_template-style04/containers/index.php @@ -1,5 +1,11 @@ ref.'/page171.tpl.php'; -?> +// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper. +$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; +if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded +if (!empty($_GET['pageref']) || !empty($_GET['pagealiasalt']) || !empty($_GET['pageid'])) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; + redirectToContainer($_GET['pageref'], $_GET['pagealiasalt'], $_GET['pageid']); +} +include_once './page171.tpl.php'; +// END PHP diff --git a/htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql index 40163d781b0..822117f86cb 100644 --- a/htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql +++ b/htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql @@ -1,14 +1,14 @@ --- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:18:50 UTC --; -- Page ID 169 -> 1__+MAX_llx_website_page__ - Aliases about --; INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'about', '', 'About us', '', '', '', '', '1', '2022-08-09 16:40:13', '2022-10-08 19:22:45', null, '', 'page', '', '__N__
__N__ __N____N__
__N____N__
__N__
__N__
__N____N__
__N__

About Us

__N____N__ Get to know us more__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N____N__
__N__

Team Members

__N__
__N____N__
__N__
__N__ \"\"__N__ __N__
__N__

Sophia

__N____N__

CEO & Founder

__N__
__N__
__N__
__N____N__
__N__
__N__ \"\"__N____N__

Benjamin W.

__N____N__

Restaurant Manager

__N__
__N__
__N____N__
__N__
__N__ \"\"__N__ __N__

Muchen Jack

__N____N__

Senior Chef

__N__
__N__
__N____N__
__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__', '', 0); --- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:18:50 UTC --; -- Page ID 170 -> 2__+MAX_llx_website_page__ - Aliases contact --; INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'Contact us', '', '', '', '', '1', '2022-08-16 14:40:51', '2022-10-08 19:30:28', null, '', 'page', '', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Say Hi

__N____N__ We are happy to get in touch with you__N__
__N__
__N__
__N____N__
__N__
__N____N__ __N__ __N__
__N__
__N__
__N__
__N__

Leave a message

__N__
__N____N__
__N__ __N__
__N__
__N____N__
__N__ Phone Number__N____N__ __N__
__N____N__
__N__ Email__N____N__ __N____N__ Message__N____N__ __N__
__N____N__
__N__ __N__
__N__ __N__
__N____N__
__N__
Weekdays
__N____N__
__N__ $day : \" .getDolGlobalString(\"MAIN_INFO_OPENINGHOURS_$day\") .\"

\"; __N__ }__N__ ?>__N__
__N____N__
Weekends
__N____N__
__N__

Saturday and Sunday

__N____N__

to be determined !

__N__
__N__
__N____N__
__N__

__N__ getFullAddress() ?>__N__

__N____N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N____N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__
__N__

Reserve a table

__N____N__ __N__
__N____N__ __N__
__N__ __N__ \" />__N__ __N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__
__N____N__
__N__ __N__
__N__ __N__
__N__
__N____N__
__N__
__N__ __N__ __N____N__
__N__', '', 0); --- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:18:50 UTC --; -- Page ID 171 -> 3__+MAX_llx_website_page__ - Aliases index --; INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'index', '', 'index', '', '', '', '', '1', '2022-08-09 16:34:54', '2022-10-08 19:28:42', null, '', 'page', '', '__N____N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__
__N__

__N__ Delicious Steaks__N__

__N____N__ __N__ __N__

__N__ 4.7/5__N__

__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N____N__

__N__ From 1,206+ Customer__N__ Reviews__N__

__N__
__N__
__N__
__N____N__
__N__ __N__
__N__
__N__
__N__ __N__
__N____N__
__N__

__N__ Fine Dining Restaurant__N__

__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

Steak

__N____N__ 26.50__N__
__N____N__ __N__ __N__ 3.8/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N__
__N____N__
__N__ __N__

__N__ Sausage Pasta__N__

__N____N__ 18.25__N__
__N____N__ __N__ __N__ 4.2/5__N__ __N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N__
__N__ __N__ __N__ __N____N__ __N__ __N__ Previous__N__ __N____N__ __N__ __N__ Next__N__ __N__ __N__ __N__ __N__ __N____N__
__N__ __N__ __N__ Your browser does not support the video tag.__N__ __N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

__N__ Special Menus__N__

__N__
__N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Morning Fresh

__N____N__ 12.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

DoliCloud Soup

__N____N__ 24.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 50 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Premium Steak

__N____N__ 45__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 86 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Dinner__N__
__N____N__ __N__

Seafood Set

__N____N__ 86__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 44 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Breakfast__N__
__N____N__ __N__

Burger Set

__N____N__ 20.50__N____N__ __N__
__N__ 4.3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__
__N__ __N____N__ Lunch__N__
__N____N__ __N__

Healthy Soup

__N____N__ 34.20__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__
__N__', '', 0); UPDATE llx_website SET fk_default_home = 3__+MAX_llx_website_page__ WHERE rowid = __WEBSITE_ID__; --- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:08:31 UTC --; +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:18:50 UTC --; -- Page ID 172 -> 4__+MAX_llx_website_page__ - Aliases menu --; INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(4__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'menu', '', 'Our menus', '', '', '', '', '1', '2022-08-16 14:37:03', '2022-10-08 19:23:06', null, '', 'page', '', '__N__
__N__ __N____N__
__N__
__N__
__N__
__N__
__N__

Our Menus

__N____N__ Perfect for all Breakfast, Lunch and__N__ Dinner__N__
__N__
__N__
__N____N__
__N__
__N____N__
__N__
__N__
__N__
__N__

Breakfast Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Fresh Start

__N____N__ $24.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 128 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Baked Creamy

__N____N__ $16.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 64 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Burger Set

__N____N__ $24.50__N____N__ $36.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 32 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Lunch Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Super Steak Set

__N____N__ $32.75__N____N__ $55__N____N__ __N__
__N__ 4.2/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 66 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Bread & Steak Set

__N____N__ $42.50__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 84 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N____N__
__N__
__N__
__N__
__N__

Dinner Menu

__N__
__N____N__
__N__
__N__ __N____N__ __N__

Seafood Set

__N____N__ $65.50__N____N__ __N__
__N__ 4.4/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 102 Reviews__N__

__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ __N____N__ __N__

Premium Steak

__N____N__ $74.25__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 56 Reviews__N__

__N__
__N__
__N__ __N__ __N____N__
__N__
__N__ __N____N__ __N__

Salmon Set

__N____N__ $60__N____N__ __N__
__N__ 3/5__N__
__N____N__
__N__ __N__ __N__ __N__ __N__ __N__
__N____N__

__N__ 76 Reviews__N__

__N__
__N__
__N__ __N__ __N__ __N__ __N__
__N__
__N____N__ __N____N__
__N__', '', 0); From fb24a1ee552e0dcb2d0935733eea52efaef3b681 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Oct 2022 20:41:45 +0200 Subject: [PATCH 0838/1289] Clean code --- dev/setup/codesniffer/ruleset.xml | 3 +- .../website_template-corporate/LICENSE | 1 + .../website_template-corporate/README.md | 1 + .../containers/LICENSE | 1 + .../blog-our-company-is-now-on-dolibarr.php | 3 +- ...log-our-new-web-site-has-been-launched.php | 3 +- .../containers/blog.php | 3 +- .../containers/careers.php | 3 +- .../containers/carriere.php | 3 +- .../containers/clients-testimonials.php | 3 +- .../containers/contact.php | 3 +- .../containers/faq.php | 3 +- .../containers/footer.php | 3 +- .../containers/header.php | 3 +- .../containers/home.php | 3 +- .../containers/index.php | 6 +- .../containers/master.inc.php | 5 +- .../containers/our-team.php | 3 +- .../containers/page1.tpl.php | 98 --- .../containers/page10.tpl.php | 134 ---- .../containers/page11.tpl.php | 575 ----------------- .../containers/page12.tpl.php | 113 ---- .../containers/page13.tpl.php | 110 ---- .../containers/page14.tpl.php | 186 ------ .../containers/page17.tpl.php | 104 ---- .../containers/page179.tpl.php | 99 +++ .../containers/page180.tpl.php | 84 +++ .../{page3.tpl.php => page181.tpl.php} | 70 +-- .../containers/page182.tpl.php | 129 ++++ .../{page5.tpl.php => page183.tpl.php} | 56 +- .../{page6.tpl.php => page184.tpl.php} | 64 +- .../containers/page185.tpl.php | 84 +++ .../{page8.tpl.php => page186.tpl.php} | 56 +- .../containers/page187.tpl.php | 132 ++++ .../containers/page188.tpl.php | 134 ++++ .../containers/page189.tpl.php | 576 ++++++++++++++++++ .../containers/page190.tpl.php | 115 ++++ .../containers/page191.tpl.php | 110 ++++ .../containers/page192.tpl.php | 186 ++++++ .../{page15.tpl.php => page193.tpl.php} | 62 +- .../{page16.tpl.php => page194.tpl.php} | 56 +- .../containers/page195.tpl.php | 112 ++++ .../{page18.tpl.php => page196.tpl.php} | 54 +- .../containers/page2.tpl.php | 84 --- .../containers/page4.tpl.php | 128 ---- .../containers/page7.tpl.php | 84 --- .../containers/page9.tpl.php | 132 ---- .../containers/partners.php | 3 +- .../containers/pricing.php | 3 +- .../containers/privacy-policies.php | 3 +- .../containers/product-p.php | 3 +- .../containers/search.php | 3 +- .../containers/service-s.php | 3 +- .../website_pages.sql | 90 +-- 54 files changed, 2071 insertions(+), 2017 deletions(-) create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/LICENSE create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/README.md create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/LICENSE delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page1.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page10.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page11.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page12.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page13.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page14.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page17.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page180.tpl.php rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page3.tpl.php => page181.tpl.php} (52%) create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page182.tpl.php rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page5.tpl.php => page183.tpl.php} (56%) rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page6.tpl.php => page184.tpl.php} (54%) create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page185.tpl.php rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page8.tpl.php => page186.tpl.php} (60%) create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page187.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page188.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page189.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page190.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page191.tpl.php create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page192.tpl.php rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page15.tpl.php => page193.tpl.php} (76%) rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page16.tpl.php => page194.tpl.php} (56%) create mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page195.tpl.php rename htdocs/install/doctemplates/websites/website_template-corporate/containers/{page18.tpl.php => page196.tpl.php} (56%) delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page2.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page4.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page7.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-corporate/containers/page9.tpl.php diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 752a9271e59..e286450f73b 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -15,9 +15,10 @@ htdocs/install/doctemplates/websites htdocs/conf.php */nltechno* - */htdocs/includes source .git + htdocs/includes + htdocs/install/doctemplates/websites diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/LICENSE b/htdocs/install/doctemplates/websites/website_template-corporate/LICENSE new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/LICENSE @@ -0,0 +1 @@ + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/README.md b/htdocs/install/doctemplates/websites/website_template-corporate/README.md new file mode 100644 index 00000000000..12ac388316c --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/README.md @@ -0,0 +1 @@ +This template has been developed by DoliCloud (https://www.dolicloud.com) for Dolibarr ERP CRM. diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/LICENSE b/htdocs/install/doctemplates/websites/website_template-corporate/containers/LICENSE new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/LICENSE @@ -0,0 +1 @@ + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php index 11b7fe4a1ca..99c4f10314b 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php @@ -1,4 +1,5 @@ ref.'/page2.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page180.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page180.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php index 8067c9c839e..248bb708f48 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php @@ -1,4 +1,5 @@ ref.'/page3.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page181.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page181.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php index e26af460c55..43a0212d3f6 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php @@ -1,4 +1,5 @@ ref.'/page1.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page179.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page179.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php index 298215818ad..a2c8a7165a7 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php @@ -1,4 +1,5 @@ ref.'/page4.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page182.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page182.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php index 34fa5b81d47..f32f4818ac4 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php @@ -1,4 +1,5 @@ ref.'/page5.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page183.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page183.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php index c7ca6c827c9..2c01e32e135 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php @@ -1,4 +1,5 @@ ref.'/page6.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page184.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page184.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php index 8a7eb0364b7..2c9c69905fa 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php @@ -1,4 +1,5 @@ ref.'/page7.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page185.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page185.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php index 1b08e2b2c62..94f01880f4e 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php @@ -1,4 +1,5 @@ ref.'/page8.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page186.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page186.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php index ffb16dfb696..533ddc027a2 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php @@ -1,4 +1,5 @@ ref.'/page9.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page187.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page187.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php index 532d10735c2..831c7ded51a 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php @@ -1,4 +1,5 @@ ref.'/page10.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page188.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page188.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php index 6edd1d887b2..86a6639e327 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php @@ -1,4 +1,5 @@ ref.'/page11.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page189.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page189.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php index 5d3ad606acc..5ac34065524 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php @@ -2,10 +2,10 @@ // BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper. $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded -if (! empty($_GET['pageref']) || ! empty($_GET['pagealiasalt']) || ! empty($_GET['pageid'])) { +if (!empty($_GET['pageref']) || !empty($_GET['pagealiasalt']) || !empty($_GET['pageid'])) { require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; redirectToContainer($_GET['pageref'], $_GET['pagealiasalt'], $_GET['pageid']); } -include_once './page11.tpl.php'; -// END PHP +include_once './page189.tpl.php' +// END PHP ?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/master.inc.php index 852e9270884..bd25ba5895d 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/master.inc.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/master.inc.php @@ -1,6 +1,7 @@ diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php index 21d1a69e407..1afe5d1523d 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php @@ -1,4 +1,5 @@ ref.'/page12.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page190.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page190.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page1.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page1.tpl.php deleted file mode 100644 index ff5758e9a71..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page1.tpl.php +++ /dev/null @@ -1,98 +0,0 @@ - - - -Blog - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
The latest news... -
-
-
-
-
-
-
-
- - -
-

- - load("main"); - $fuser = new User($db); - $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', 5, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); - foreach ($arrayofblogs as $blog) { - print ''; - } - ?> -
-
- -

- - - -
- - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page10.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page10.tpl.php deleted file mode 100644 index f2cb27fb04a..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page10.tpl.php +++ /dev/null @@ -1,134 +0,0 @@ - - - -Header and Top Menu - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - - - - - -
-
-
- -
-
-
- - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page11.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page11.tpl.php deleted file mode 100644 index ccab676d783..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page11.tpl.php +++ /dev/null @@ -1,575 +0,0 @@ - - - -Home - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - - - -
-
-
-
-
-
-
-
-
Boost your business -
-
-

We provide powerful solutions for all businesses

-
- -
-
-
-
-
-
-
-
-
-
-
 Best prices on the market  -
-
-

Our optimized processes allows us to provide you very competitive prices

-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
-
-
-
-
-
- -
-
-

Our sales representative are also technicians.

-
-
-
-
-
- -
-

Take a look at our offers...

-
-
-
-
-
- -
-

Our customer-supplier relationship is very appreciated by our customers

-
-
-
-
-
-
-
- -
-
-

We continue to follow and assist you after the sale. Contact us at any time.

-
-
-
-
-
- - - -
-
-

Looking for

-

a high quality service?

-

With a lot of experience, hiring us is a security for your business!

-
-
-
11
-
Years of Experience
-
-
-
- query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?> -
-
Experts
-
-
-
- query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?> -
-
Trusted Clients
-
-
-
- -
-
-
- - - - -
-
- -
-
- - - -
-
-

our team

-
-
- -
-
-
-
- - - -
-
-
-
-
-

Request a callback

-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-
- - - -
-
-
-
-
-

successful cases

- -
-
-
-
-
- - - -
-
-

Latest News

-
- fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); - foreach ($arrayofblogs as $blog) { - ?> - - - -
-
-
- - - - - -
- - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page12.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page12.tpl.php deleted file mode 100644 index 44f07e3b225..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page12.tpl.php +++ /dev/null @@ -1,113 +0,0 @@ - - - -Our team - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
Our team -
-
-
-
-
-
-
-
- - -
-

-

The crew...




- query($sql); - if (! $resql) dol_print_error($db); - while ($obj = $db->fetch_object($resql)) { - $arrayofusers[]=$obj->rowid; - } - - print '
'; - foreach ($arrayofusers as $id) { - $fuser->fetch($id); - - print '
'; - print '
'; - print '
'; - if ($fuser->photo) print Form::showphoto('userphoto', $fuser, 100, 0, 0, 'photowithmargin', '', 0); - //print ''; - else print ''; - print '
'; - print '
'; - print '
'.$fuser->firstname.'
'; - print '
    '; - //print '
  • September 24, 2018
  • '; - if ($fuser->job) print '
  • '.$fuser->job.'
  • '; - else print '
  • '; - print '
'; - print '
'; - print '
'; - print '
'; - } - print '
'; - - ?> -
-
- -

- - - -
- - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page13.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page13.tpl.php deleted file mode 100644 index 87fcf436b8e..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page13.tpl.php +++ /dev/null @@ -1,110 +0,0 @@ - - - -Partners - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
Partners -
-
-
-
-
-
-
-
- - -
-
-

Our partners...

-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
- - -

- - - -
- - - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page14.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page14.tpl.php deleted file mode 100644 index 3051eb4473a..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page14.tpl.php +++ /dev/null @@ -1,186 +0,0 @@ - - - -Pricing - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
Our plans -
-
-
-
-
-
-
-
- - - - - -
-
- -
-
- - - -

- - - -
- - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page17.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page17.tpl.php deleted file mode 100644 index 69149e39ba9..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page17.tpl.php +++ /dev/null @@ -1,104 +0,0 @@ - - - -Search Page - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
Search -
-
-
-
-
-
-
-
- -


- -
- -
- -
-
- - load("main"); - - if (function_exists('getPagesFromSearchCriterias')) { - if (GETPOSTISSET('s')) { - $listofpages = getPagesFromSearchCriterias('page', 'meta', GETPOST('s', 'alphanohtml')); - if ($listofpages['code'] == 'OK') { - foreach ($listofpages['list'] as $websitepagefound) { - print '
'.$websitepagefound->title.' - '.$websitepagefound->description.'
'; - } - } else { - // If error, show message - print $listofpages['message']; - } - } - } else { - print $weblangs->trans("FeatureNotYetAvailable"); - } - ?> - -





-
- - - -
- - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php new file mode 100644 index 00000000000..7a474b5595e --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php @@ -0,0 +1,99 @@ + + + +Blog + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
The latest news... +
+
+
+
+
+
+
+
+ + +
+

+ + load("main"); + $fuser = new User($db); + $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', 5, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); + foreach($arrayofblogs as $blog) + { + print ''; + } + ?> +
+
+ +

+ + + +
+ + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page180.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page180.tpl.php new file mode 100644 index 00000000000..538fc1764e4 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page180.tpl.php @@ -0,0 +1,84 @@ + + + +Our company is now on Dolibarr ERP CRM + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
title; ?> +
+
+
+
+
+
+
+
+ +
+


+ Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated. + This is an important step in improving all of our services. + +


+ +
+ +

+
Screenshot of our new Open Source solution
+
+ + + +





+
+ + + + + + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page3.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page181.tpl.php similarity index 52% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page3.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page181.tpl.php index 6c81fb82c36..a8a484ccf44 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page3.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page181.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,43 +34,43 @@ ob_start(); -
-
-
-
-
-
-
-
-
title; ?> -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
title; ?> +
+
+
+
+
+
+
+
-
-





+
+





- Our new website, based on Dolibarr CMS, has been launched.
- Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers... + Our new website, based on Dolibarr CMS, has been launched.
+ Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers... - -


- -
- -

-
Theme of our new web site
-
- + +


+ +
+ +

+
Theme of our new web site
+
+ -





-
+





+
@@ -81,5 +81,5 @@ ob_start(); diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page182.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page182.tpl.php new file mode 100644 index 00000000000..49735b4f21a --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page182.tpl.php @@ -0,0 +1,129 @@ + + + +Careers + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + + + + + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page5.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page183.tpl.php similarity index 56% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page5.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page183.tpl.php index 4d7bb42e594..bf4d4c92682 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page5.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page183.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,29 +34,29 @@ ob_start();
- + -
-
-
-
-
-
-
-
-
Offres d'emploi -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Offres d'emploi +
+
+
+
+
+
+
+
-
-
+
+



@@ -65,20 +65,20 @@ Nous n'avons pas d'offres d'emploi ouvertes en ce moment...



-
-
+
+
-

+

- +
- + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page6.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page184.tpl.php similarity index 54% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page6.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page184.tpl.php index c8c9f0e61ae..fca2346bede 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page6.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page184.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,45 +34,45 @@ ob_start();
- + -
-
-
-
-
-
-
-
-
Testimonials -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Testimonials +
+
+
+
+
+
+
+
-
-

-

What they say about us

-



- Send us your testimonial (by email to email; ?>) -



-

-
+
+

+

What they say about us

+



+ Send us your testimonial (by email to email; ?>) +



+

+
-

+

- +
- + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page185.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page185.tpl.php new file mode 100644 index 00000000000..f478da7021f --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page185.tpl.php @@ -0,0 +1,84 @@ + + + +Contact + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
Contact +
+
+
+
+
+
+
+
+ + +
+
+

Contact us:



+ email ?>
+ getFullAddress() ?>
+
+
+ + + +
+
+ +
+ +


+ + + +
+ + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page8.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page186.tpl.php similarity index 60% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page8.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page186.tpl.php index 759d1bd8e9a..111e4615774 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page8.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page186.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,29 +34,29 @@ ob_start();
- + -
-
-
-
-
-
-
-
-
FAQs -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
FAQs +
+
+
+
+
+
+
+
-
-
+
+


Frequently Asked Questions



@@ -72,20 +72,20 @@ You may find information about our privacy policy on diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page187.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page187.tpl.php new file mode 100644 index 00000000000..615a2214885 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page187.tpl.php @@ -0,0 +1,132 @@ + + + +Footer + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page188.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page188.tpl.php new file mode 100644 index 00000000000..99e9ddd3e9f --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page188.tpl.php @@ -0,0 +1,134 @@ + + + +Header and Top Menu + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+ + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page189.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page189.tpl.php new file mode 100644 index 00000000000..8e0d8fbbea5 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page189.tpl.php @@ -0,0 +1,576 @@ + + + +Home + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + + + +
+
+
+
+
+
+
+
+
Boost your business +
+
+

We provide powerful solutions for all businesses

+
+ +
+
+
+
+
+
+
+
+
+
+
 Best prices on the market  +
+
+

Our optimized processes allows us to provide you very competitive prices

+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+ +
+
+

Our sales representative are also technicians.

+
+
+
+
+
+ +
+

Take a look at our offers...

+
+
+
+
+
+ +
+

Our customer-supplier relationship is very appreciated by our customers

+
+
+
+
+
+
+
+ +
+
+

We continue to follow and assist you after the sale. Contact us at any time.

+
+
+
+
+
+ + + +
+
+

Looking for

+

a high quality service?

+

With a lot of experience, hiring us is a security for your business!

+
+
+
11
+
Years of Experience
+
+
+
+ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?> +
+
Experts
+
+
+
+ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?> +
+
Trusted Clients
+
+
+
+ +
+
+
+ + + + +
+
+ +
+
+ + + +
+
+

our team

+
+
+ +
+
+
+
+ + + +
+
+
+
+
+

Request a callback

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ + + +
+
+
+
+
+

successful cases

+ +
+
+
+
+
+ + + +
+
+

Latest News

+
+ fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); + foreach($arrayofblogs as $blog) + { + ?> + + + +
+
+
+ + + + + +
+ + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page190.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page190.tpl.php new file mode 100644 index 00000000000..63255c34db5 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page190.tpl.php @@ -0,0 +1,115 @@ + + + +Our team + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
Our team +
+
+
+
+
+
+
+
+ + +
+

+

The crew...




+ query($sql); + if (! $resql) dol_print_error($db); + while ($obj = $db->fetch_object($resql)) + { + $arrayofusers[]=$obj->rowid; + } + + print '
'; + foreach($arrayofusers as $id) + { + $fuser->fetch($id); + + print '
'; + print '
'; + print '
'; + if ($fuser->photo) print Form::showphoto('userphoto', $fuser, 100, 0, 0, 'photowithmargin', '', 0); + //print ''; + else print ''; + print '
'; + print '
'; + print '
'.$fuser->firstname.'
'; + print '
    '; + //print '
  • September 24, 2018
  • '; + if ($fuser->job) print '
  • '.$fuser->job.'
  • '; + else print '
  • '; + print '
'; + print '
'; + print '
'; + print '
'; + } + print '
'; + + ?> +
+
+ +

+ + + +
+ + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page191.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page191.tpl.php new file mode 100644 index 00000000000..b52ee75825e --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page191.tpl.php @@ -0,0 +1,110 @@ + + + +Partners + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
Partners +
+
+
+
+
+
+
+
+ + +
+
+

Our partners...

+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + +

+ + + +
+ + + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page192.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page192.tpl.php new file mode 100644 index 00000000000..4f17f5da805 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page192.tpl.php @@ -0,0 +1,186 @@ + + + +Pricing + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
Our plans +
+
+
+
+
+
+
+
+ + + + + +
+
+ +
+
+ + + +

+ + + +
+ + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page15.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page193.tpl.php similarity index 76% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page15.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page193.tpl.php index cd3372604c5..4e6f65e80a5 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page15.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page193.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -33,33 +33,33 @@ ob_start();
- - - + + + -
-
-
-
-
-
-
-
-
Privacy Policy -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Privacy Policy +
+
+
+
+
+
+
+



-
-
+
+

Information collected and used


* Your customer information (email, phone, business name, first and last name of contact, address, postal code, country and VAT number) are stored when you become a customer. This information allows us to bill you.

* If you paid using our online service, we also store the last 4 digits of your card. The full details of your credit card is stored by our payment provider Stripe (the world leader in online payment).

@@ -83,18 +83,18 @@ ob_start();

Data theft


* In case of suspicion of a theft of the data we have collected (see first point 'Information collected and used'), customers will be informed by email, at email corresponding to their customer account

 

-
-
+
+
- - - + + +
- + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page16.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page194.tpl.php similarity index 56% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page16.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page194.tpl.php index 6f69135aab8..e4aa79e1291 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page16.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page194.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,29 +34,29 @@ ob_start();
- + -
-
-
-
-
-
-
-
-
Product P -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Product P +
+
+
+
+
+
+
+
-
-
+
+



@@ -65,20 +65,20 @@ This is a description page of our product P...



-
-
+
+
-

+

- +
- + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page195.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page195.tpl.php new file mode 100644 index 00000000000..0e1774d931b --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page195.tpl.php @@ -0,0 +1,112 @@ + + + +Search Page + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
Search +
+
+
+
+
+
+
+
+ +


+ +
+ +
+ +
+
+ + load("main"); + + if (function_exists('getPagesFromSearchCriterias')) + { + if (GETPOSTISSET('s')) + { + $listofpages = getPagesFromSearchCriterias('page', 'meta', GETPOST('s', 'alphanohtml')); + if ($listofpages['code'] == 'OK') + { + foreach($listofpages['list'] as $websitepagefound) + { + print '
'.$websitepagefound->title.' - '.$websitepagefound->description.'
'; + } + } + else + { + // If error, show message + print $listofpages['message']; + } + } + } + else + { + print $weblangs->trans("FeatureNotYetAvailable"); + } + ?> + +





+
+ + + +
+ + + + diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page18.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page196.tpl.php similarity index 56% rename from htdocs/install/doctemplates/websites/website_template-corporate/containers/page18.tpl.php rename to htdocs/install/doctemplates/websites/website_template-corporate/containers/page196.tpl.php index 71aeee5a87e..d52718bcfc8 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page18.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page196.tpl.php @@ -2,7 +2,7 @@ $websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; - require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; + require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; } // Not already loaded require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; @@ -19,7 +19,7 @@ ob_start(); - + use_manifest) { print ''."\n"; } ?> @@ -34,29 +34,29 @@ ob_start();
- + -
-
-
-
-
-
-
-
-
Service S -
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
Service S +
+
+
+
+
+
+
+
-
-
+
+



@@ -65,18 +65,18 @@ This is a description page of our service S...



-
-
+
+
-

+

- +
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page2.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page2.tpl.php deleted file mode 100644 index d233bd1e9c9..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page2.tpl.php +++ /dev/null @@ -1,84 +0,0 @@ - - - -Our company is now on Dolibarr ERP CRM - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
title; ?> -
-
-
-
-
-
-
-
- -
-


- Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated. - This is an important step in improving all of our services. - -


- -
- -

-
Screenshot of our new Open Source solution
-
- - - -





-
- - - - - - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page4.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page4.tpl.php deleted file mode 100644 index b8e9d53f96b..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page4.tpl.php +++ /dev/null @@ -1,128 +0,0 @@ - - - -Careers - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - - - - - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page7.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page7.tpl.php deleted file mode 100644 index fdb2d2e831e..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page7.tpl.php +++ /dev/null @@ -1,84 +0,0 @@ - - - -Contact - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - -
- - - -
-
-
-
-
-
-
-
-
Contact -
-
-
-
-
-
-
-
- - -
-
-

Contact us:



- email ?>
- getFullAddress() ?>
-
-
- - - -
-
- -
- -


- - - -
- - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page9.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page9.tpl.php deleted file mode 100644 index fa2e4953317..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page9.tpl.php +++ /dev/null @@ -1,132 +0,0 @@ - - - -Footer - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - - -
- -
-
-
-
-
-
- -
- -
-
- -
-
- -
-
-
- -
- -
-
- -
-
- - componentSelectLang('auto', $weblangs, 'margin-top-10'); ?> -
-
-
- -
- -
-
-
- -
-
-
- -
-
-
-
getFullAddress(1, '
', 1); ?>
-
-
-
-

Follow Us:

-
    - socialnetworks as $key => $value) { - print '
  • '; - } ?> -
-
-
-
-
-
-
-
- -
-
- Website generated and powered by Dolibarr ERP & CRM -
-
- -
- - - -
- - - - - - - diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/partners.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/partners.php index f1481ddd6f4..44e501d9f4d 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/partners.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/partners.php @@ -1,4 +1,5 @@ ref.'/page13.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page191.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page191.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/pricing.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/pricing.php index e6a777fc474..d2866cadf43 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/pricing.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/pricing.php @@ -1,4 +1,5 @@ ref.'/page14.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page192.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page192.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/privacy-policies.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/privacy-policies.php index d411af8a52c..59dc87944fe 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/privacy-policies.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/privacy-policies.php @@ -1,4 +1,5 @@ ref.'/page15.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page193.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page193.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/product-p.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/product-p.php index cab6b9ec753..beac94b27c8 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/product-p.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/product-p.php @@ -1,4 +1,5 @@ ref.'/page16.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page194.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page194.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/search.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/search.php index a55611dcf38..359c5bf3b26 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/search.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/search.php @@ -1,4 +1,5 @@ ref.'/page17.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page195.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page195.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/service-s.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/service-s.php index 60a440b63f8..f69f6e7a13e 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/service-s.php +++ b/htdocs/install/doctemplates/websites/website_template-corporate/containers/service-s.php @@ -1,4 +1,5 @@ ref.'/page18.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page196.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page196.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-corporate/website_pages.sql index dfe8fb39c31..c1dd181d8d9 100644 --- a/htdocs/install/doctemplates/websites/website_template-corporate/website_pages.sql +++ b/htdocs/install/doctemplates/websites/website_template-corporate/website_pages.sql @@ -1,40 +1,58 @@ --- Page ID 1 -> 1__+MAX_llx_website_page__ - Aliases blog --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog', '', 'Blog', 'Blog', 'en', '', 'blog', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
The latest news...__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__
__N____N__

__N____N__ __N____N__
__N__', '', '0'); --- Page ID 2 -> 2__+MAX_llx_website_page__ - Aliases blog-our-company-is-now-on-dolibarr --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog-our-company-is-now-on-dolibarr', '', 'Our company is now on Dolibarr ERP CRM', 'Our company has moved on Dolibarr ERP CRM. This is an important step in improving all of our services.', 'en', 'image/template-corporate/background_dolibarr.jpg', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'blogpost', '', '__N____N__ __N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
title; ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__


__N__ Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated.__N__ This is an important step in improving all of our services.__N__ __N__


__N__ __N__
__N__ __N__

__N__
Screenshot of our new Open Source solution
__N__
__N__ __N__ __N__ __N__





__N__
__N____N____N____N____N____N__', '', '0'); --- Page ID 3 -> 3__+MAX_llx_website_page__ - Aliases blog-our-new-web-site-has-been-launched --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog-our-new-web-site-has-been-launched', '', 'Our new web site has been launched', 'Our new website, based on Dolibarr CMS, has been launched. Modern and directly integrated with the internal management tools of the company, many new online services for our customers will be able to see the day...', 'en', 'image/template-corporate/background_rough-horn.jpg', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'blogpost', '', '__N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
title; ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__





__N____N____N__ Our new website, based on Dolibarr CMS, has been launched.
__N__ Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers...__N____N__ __N__


__N__ __N__
__N__ __N__

__N__
Theme of our new web site
__N__
__N__ __N____N__





__N__
__N____N____N____N____N____N____N__', '', '0'); --- Page ID 4 -> 4__+MAX_llx_website_page__ - Aliases careers --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(4__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'careers', '', 'Careers', 'Our job opportunities', 'en', '', 'career', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Job opportunities__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N____N__

We are recruiting the following profiles...



__N__ __N__
__N__ fetchAll(\'DESC\', \'date_creation\', 5, 0, array(\'status\'=>\'1,3,9\'));__N__ $weblangs->load(\"main\");__N__ foreach($arrayofrecord as $jobrecord)__N__ {__N__ print \'\';__N__ }__N__ ?>__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', '0'); --- Page ID 5 -> 5__+MAX_llx_website_page__ - Aliases carriere --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(5__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'carriere', '', 'Carrière', 'Nos opportunités professionnelles', 'fr', '', 'career', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Offres d\'emploi__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__Nous n\'avons pas d\'offres d\'emploi ouvertes en ce moment...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', '0'); --- Page ID 6 -> 6__+MAX_llx_website_page__ - Aliases clients-testimonials --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(6__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'clients-testimonials', '', 'Clients Testimonials', 'Client Testimonials', 'en', '', 'testimonials, use cases, success story', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Testimonials__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__

What they say about us

__N__



__N__ Send us your testimonial (by email to email; ?>\">email; ?>)__N__



__N__

__N__
__N____N__

__N____N__ __N____N__
__N__ __N__', '', '0'); --- Page ID 7 -> 7__+MAX_llx_website_page__ - Aliases contact --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(7__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'Contact', 'Privacy Policies', 'en', '', 'Contact', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Contact__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__

Contact us:



__N__ email ?>
__N__ getFullAddress() ?>
__N__
__N__
__N____N____N__ __N__
__N__
__N__ __N__
__N____N__


__N____N__ __N____N__
__N__ __N__', '', '0'); --- Page ID 8 -> 8__+MAX_llx_website_page__ - Aliases faq --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(8__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'faq', '', 'FAQ', 'Frequently Asked Questions', 'en', '', 'faq', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
FAQs__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__


Frequently Asked Questions

__N__
__N__
__N__
__N__

How can I contact you ?


__N__You can contact us by using this page.__N__
__N__
__N__
__N__

What is your privacy policy ?


__N__You may find information about our privacy policy on this page.__N____N____N__



__N____N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', '0'); --- Page ID 9 -> 9__+MAX_llx_website_page__ - Aliases footer --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(9__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'footer', '', 'Footer', 'Footer', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-06 23:50:25', null, '', 'other', '', '__N__
__N____N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__

Product and Services

__N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__
__N____N__
__N__

Quick links

__N__
__N__
__N__ __N__
__N__
__N__ __N__ componentSelectLang(\'auto\', $weblangs, \'margin-top-10\'); ?>__N__
__N__
__N__
__N__ __N__
__N__

Contact us

__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
getFullAddress(1, \'
\', 1); ?>
__N__
__N__
__N__
__N__

Follow Us:

__N__
    __N__ socialnetworks as $key => $value) {__N__ print \'
  • \';__N__ } ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ Website generated and powered by Dolibarr ERP & CRM__N__
__N__
__N__ __N__
__N__ __N__ __N____N__
__N____N____N____N__', '', '0'); --- Page ID 10 -> 10__+MAX_llx_website_page__ - Aliases header --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(10__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'header', '', 'Header and Top Menu', 'Header with menu', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-06 23:50:25', null, '', 'other', '', '__N____N____N____N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__', '', '0'); --- Page ID 11 -> 11__+MAX_llx_website_page__ - Aliases home --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(11__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'home', '', 'Home', 'Welcome', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N__ __N__ __N__ __N____N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Boost your business__N__
__N__
__N__

We provide powerful solutions for all businesses

__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
 Best prices on the market __N__
__N__
__N__

Our optimized processes allows us to provide you very competitive prices

__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N____N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

A competent team

__N__
__N__
__N__
__N__

Our sales representative are also technicians.

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__

Take a look at our offers...

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__

Our customer-supplier relationship is very appreciated by our customers

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

After Sale service

__N__
__N__
__N__
__N__

We continue to follow and assist you after the sale. Contact us at any time.

__N__
__N__
__N__
__N__
__N__
__N____N____N__ __N__
__N__
__N__

Looking for

__N__

a high quality service?

__N__

With a lot of experience, hiring us is a security for your business!

__N__
__N__
__N__
11
__N__
Years of Experience
__N__
__N__
__N__
__N__ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>__N__
__N__
Experts
__N__
__N__
__N__
__N__ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>__N__
__N__
Trusted Clients
__N__
__N__
__N__
__N__
Contact us__N__   or  __N__ See our pricing
__N__
__N__
__N__
__N____N__ __N__ __N__ __N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__

our plans

__N____N__ __N__
__N__ __N__
__N__
__N__
__N__
FREE
__N__
The best choice for personal use
__N__
The service 1 for free
__N__
__N__ 0/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1 __N__
  • __N__
__N__
__N__
__N__ Subcribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
STARTER
__N__
For small companiess
__N__
The service 1 and product 1 at low price
__N__
__N__ 29/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1__N__
  • __N__
  • __N__ __N__ Product 1__N__
  • __N__
__N__
__N__
__N__ Subscribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
PREMIUM
__N__
For large companies
__N__
The full option package for a one shot price__N__
__N__
__N__ 2499__N__
__N__
__N__ Available features are :__N__
    __N__
  • __N__ __N__ Service 1
  • __N__
  • __N__ __N__ Service 2
  • __N__
  • __N__ __N__ Product 1
  • __N__
__N__
__N__
__N__ Buy__N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__ __N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__

our team

__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N____N____N__ __N__
__N__
__N__
__N__
__N__
__N__

Request a callback

__N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
__N__
__N__

successful cases

__N__
__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Albert Einstein__N__
__N__
Scientist, www.emc2.org
__N__
__N__
__N__
__N__
__N__
-20%
__N__
Expenses
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ They did everything, with almost no time or effort for me. The best part was that I could trust their team to represent our company professionally with our clients.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Pierre Curie__N__
__N__
CEO “Cyclonic”
__N__
__N__
__N__
__N__
__N__
-30%
__N__
Expenses
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ Their course gave me the confidence to implement new techniques in my work. I learn “how” to write – “what” and “why” also became much clearer.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Marie Curie__N__
__N__
CTO \"Cyclonic\"
__N__
__N__
__N__
__N__
__N__
+22%
__N__
Turnover
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ We were skeptical to work with a consultant to optimize our sales emails, but they were highly recommended by many other startups we knew. They helped us to reach our objective of 20% turnover increase, in 4 monthes.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ John Doe__N__
__N__
Sale representative
__N__
__N__
__N__
__N__
__N__
+40%
__N__
Quotes
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ Their work on our website and Internet marketing has made a significant different to our business. We’ve seen a +40% increase in quote requests from our website.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N____N__ __N__
__N__
__N__

Latest News

__N__ __N__
__N__
__N____N____N__ __N____N____N__
__N__', '', '0'); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 179 -> 1__+MAX_llx_website_page__ - Aliases blog --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog', '', 'Blog', 'Blog', 'en', '', 'blog', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
The latest news...__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__
__N____N__

__N____N__ __N____N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 180 -> 2__+MAX_llx_website_page__ - Aliases blog-our-company-is-now-on-dolibarr --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog-our-company-is-now-on-dolibarr', '', 'Our company is now on Dolibarr ERP CRM', 'Our company has moved on Dolibarr ERP CRM. This is an important step in improving all of our services.', 'en', 'image/template-corporate/background_dolibarr.jpg', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'blogpost', '', '__N____N__ __N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
title; ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__


__N__ Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated.__N__ This is an important step in improving all of our services.__N__ __N__


__N__ __N__
__N__ __N__

__N__
Screenshot of our new Open Source solution
__N__
__N__ __N__ __N__ __N__





__N__
__N____N____N____N____N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 181 -> 3__+MAX_llx_website_page__ - Aliases blog-our-new-web-site-has-been-launched --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'blog-our-new-web-site-has-been-launched', '', 'Our new web site has been launched', 'Our new website, based on Dolibarr CMS, has been launched. Modern and directly integrated with the internal management tools of the company, many new online services for our customers will be able to see the day...', 'en', 'image/template-corporate/background_rough-horn.jpg', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'blogpost', '', '__N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
title; ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__





__N____N____N__ Our new website, based on Dolibarr CMS, has been launched.
__N__ Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers...__N____N__ __N__


__N__ __N__
__N__ __N__

__N__
Theme of our new web site
__N__
__N__ __N____N__





__N__
__N____N____N____N____N____N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 182 -> 4__+MAX_llx_website_page__ - Aliases careers --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(4__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'careers', '', 'Careers', 'Our job opportunities', 'en', '', 'career', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Job opportunities__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N____N__

We are recruiting the following profiles...



__N__ __N__
__N__ fetchAll(\'DESC\', \'date_creation\', 5, 0, array(\'status\'=>\'1,3,9\'));__N__ $weblangs->load(\"main\");__N__ foreach($arrayofrecord as $jobrecord)__N__ {__N__ print \'\';__N__ }__N__ ?>__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 183 -> 5__+MAX_llx_website_page__ - Aliases carriere --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(5__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'carriere', '', 'Carrière', 'Nos opportunités professionnelles', 'fr', '', 'career', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Offres d\'emploi__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__Nous n\'avons pas d\'offres d\'emploi ouvertes en ce moment...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 184 -> 6__+MAX_llx_website_page__ - Aliases clients-testimonials --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(6__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'clients-testimonials', '', 'Clients Testimonials', 'Client Testimonials', 'en', '', 'testimonials, use cases, success story', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Testimonials__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__

What they say about us

__N__



__N__ Send us your testimonial (by email to email; ?>\">email; ?>)__N__



__N__

__N__
__N____N__

__N____N__ __N____N__
__N__ __N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 185 -> 7__+MAX_llx_website_page__ - Aliases contact --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(7__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'Contact', 'Privacy Policies', 'en', '', 'Contact', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Contact__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__

Contact us:



__N__ email ?>
__N__ getFullAddress() ?>
__N__
__N__
__N____N____N__ __N__
__N__
__N__ __N__
__N____N__


__N____N__ __N____N__
__N__ __N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 186 -> 8__+MAX_llx_website_page__ - Aliases faq --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(8__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'faq', '', 'FAQ', 'Frequently Asked Questions', 'en', '', 'faq', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
FAQs__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__


Frequently Asked Questions

__N__
__N__
__N__
__N__

How can I contact you ?


__N__You can contact us by using this page.__N__
__N__
__N__
__N__

What is your privacy policy ?


__N__You may find information about our privacy policy on this page.__N____N____N__



__N____N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 187 -> 9__+MAX_llx_website_page__ - Aliases footer --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(9__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'footer', '', 'Footer', 'Footer', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-06 23:50:25', null, '', 'other', '', '__N__
__N____N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__

Product and Services

__N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__
__N____N__
__N__

Quick links

__N__
__N__
__N__ __N__
__N__
__N__ __N__ componentSelectLang(\'auto\', $weblangs, \'margin-top-10\'); ?>__N__
__N__
__N__
__N__ __N__
__N__

Contact us

__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
getFullAddress(1, \'
\', 1); ?>
__N__
__N__
__N__
__N__

Follow Us:

__N__
    __N__ socialnetworks as $key => $value) {__N__ print \'
  • \';__N__ } ?>__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__
__N__
__N__ Website generated and powered by Dolibarr ERP & CRM__N__
__N__
__N__ __N__
__N__ __N__ __N____N__
__N____N____N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 188 -> 10__+MAX_llx_website_page__ - Aliases header --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(10__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'header', '', 'Header and Top Menu', 'Header with menu', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-06 23:50:25', null, '', 'other', '', '__N____N____N____N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 189 -> 11__+MAX_llx_website_page__ - Aliases home --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(11__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'home', '', 'Home', 'Welcome', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N__ __N__ __N__ __N____N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Boost your business__N__
__N__
__N__

We provide powerful solutions for all businesses

__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
 Best prices on the market __N__
__N__
__N__

Our optimized processes allows us to provide you very competitive prices

__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N____N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

A competent team

__N__
__N__
__N__
__N__

Our sales representative are also technicians.

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__

Take a look at our offers...

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__

Our customer-supplier relationship is very appreciated by our customers

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

After Sale service

__N__
__N__
__N__
__N__

We continue to follow and assist you after the sale. Contact us at any time.

__N__
__N__
__N__
__N__
__N__
__N____N____N__ __N__
__N__
__N__

Looking for

__N__

a high quality service?

__N__

With a lot of experience, hiring us is a security for your business!

__N__
__N__
__N__
11
__N__
Years of Experience
__N__
__N__
__N__
__N__ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>__N__
__N__
Experts
__N__
__N__
__N__
__N__ query($sql); $obj = $db->fetch_object($resql); print $obj->nb; ?>__N__
__N__
Trusted Clients
__N__
__N__
__N__
__N__
Contact us__N__   or  __N__ See our pricing
__N__
__N__
__N__
__N____N__ __N__ __N__ __N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__

our plans

__N____N__ __N__
__N__ __N__
__N__
__N__
__N__
FREE
__N__
The best choice for personal use
__N__
The service 1 for free
__N__
__N__ 0/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1 __N__
  • __N__
__N__
__N__
__N__ Subcribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
STARTER
__N__
For small companiess
__N__
The service 1 and product 1 at low price
__N__
__N__ 29/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1__N__
  • __N__
  • __N__ __N__ Product 1__N__
  • __N__
__N__
__N__
__N__ Subscribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
PREMIUM
__N__
For large companies
__N__
The full option package for a one shot price__N__
__N__
__N__ 2499__N__
__N__
__N__ Available features are :__N__
    __N__
  • __N__ __N__ Service 1
  • __N__
  • __N__ __N__ Service 2
  • __N__
  • __N__ __N__ Product 1
  • __N__
__N__
__N__
__N__ Buy__N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__ __N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__

our team

__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N____N____N__ __N__
__N__
__N__
__N__
__N__
__N__

Request a callback

__N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
__N__
__N__

successful cases

__N__
__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
\"\"__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Albert Einstein__N__
__N__
Scientist, www.emc2.org
__N__
__N__
__N__
__N__
__N__
-20%
__N__
Expenses
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ They did everything, with almost no time or effort for me. The best part was that I could trust their team to represent our company professionally with our clients.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Pierre Curie__N__
__N__
CEO “Cyclonic”
__N__
__N__
__N__
__N__
__N__
-30%
__N__
Expenses
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ Their course gave me the confidence to implement new techniques in my work. I learn “how” to write – “what” and “why” also became much clearer.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ Marie Curie__N__
__N__
CTO \"Cyclonic\"
__N__
__N__
__N__
__N__
__N__
+22%
__N__
Turnover
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ We were skeptical to work with a consultant to optimize our sales emails, but they were highly recommended by many other startups we knew. They helped us to reach our objective of 20% turnover increase, in 4 monthes.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ John Doe__N__
__N__
Sale representative
__N__
__N__
__N__
__N__
__N__
+40%
__N__
Quotes
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__ Their work on our website and Internet marketing has made a significant different to our business. We’ve seen a +40% increase in quote requests from our website.__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N____N__ __N__
__N__
__N__

Latest News

__N__ __N__
__N__
__N____N____N__ __N____N____N__
__N__', '', 0); UPDATE llx_website SET fk_default_home = 11__+MAX_llx_website_page__ WHERE rowid = __WEBSITE_ID__; --- Page ID 12 -> 12__+MAX_llx_website_page__ - Aliases our-team --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(12__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'our-team', '', 'Our team', 'Our team', 'en', '', 'team', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Our team__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__

The crew...




__N__ query($sql);__N__ if (! $resql) dol_print_error($db);__N__ while ($obj = $db->fetch_object($resql))__N__ {__N__ $arrayofusers[]=$obj->rowid;__N__ }__N__ __N__ print \'
\';__N__ foreach($arrayofusers as $id)__N__ {__N__ $fuser->fetch($id);__N____N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ if ($fuser->photo) print Form::showphoto(\'userphoto\', $fuser, 100, 0, 0, \'photowithmargin\', \'\', 0);__N__ //print \'photo.\'\" width=\"129\" height=\"129\" alt=\"\">\';__N__ else print \'\"\"\';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\'.$fuser->firstname.\'
\';__N__ print \'
    \';__N__ //print \'
  • September 24, 2018
  • \';__N__ if ($fuser->job) print \'
  • \'.$fuser->job.\'
  • \';__N__ else print \'
  • \';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ }__N__ print \'
\';__N____N__ ?>__N__
__N__
__N____N__

__N____N__ __N____N__
__N__ __N__', '', '0'); --- Page ID 13 -> 13__+MAX_llx_website_page__ - Aliases partners --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(13__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'partners', '', 'Partners', 'Partners', 'en', '', 'partners', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Partners__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__

Our partners...

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', '0'); --- Page ID 14 -> 14__+MAX_llx_website_page__ - Aliases pricing --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(14__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'pricing', '', 'Pricing', 'All the prices of our offers', 'en', '', 'pricing', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Our plans__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N____N____N__ __N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N____N__ __N__
__N__ __N__
__N__
__N__
__N__
FREE
__N__
The best choice for personal use
__N__
The service 1 for free
__N__
__N__ 0/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1 __N__
  • __N__
__N__
__N__
__N__ Subcribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
STARTER
__N__
For small companiess
__N__
The service 1 and product 1 at low price
__N__
__N__ 29/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1__N__
  • __N__
  • __N__ __N__ Product 1__N__
  • __N__
__N__
__N__
__N__ Subscribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
PREMIUM
__N__
For large companies
__N__
The full option package for a one shot price__N__
__N__
__N__ 2499__N__
__N__
__N__ Available features are :__N__
    __N__
  • __N__ __N__ Service 1
  • __N__
  • __N__ __N__ Service 2
  • __N__
  • __N__ __N__ Product 1
  • __N__
__N__
__N__
__N__ Buy__N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__ __N__
__N__
__N__
__N__ __N__ __N__ __N__

__N____N__ __N____N__
__N__ __N__', '', '0'); --- Page ID 15 -> 15__+MAX_llx_website_page__ - Aliases privacy-policies --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(15__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'privacy-policies', '', 'Privacy Policies', 'Privacy Policies', 'en', '', 'Privacy policies, GDPR', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N__ __N__ __N__ __N____N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Privacy Policy__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__


__N____N__
__N__
__N__

Information collected and used


__N__

* Your customer information (email, phone, business name, first and last name of contact, address, postal code, country and VAT number) are stored when you become a customer. This information allows us to bill you. __N__

* If you paid using our online service, we also store the last 4 digits of your card. The full details of your credit card is stored by our payment provider Stripe (the world leader in online payment).

__N__

* You have the option to request the deletion of your data and the above information at any time (except data required y fiscal tracking rules, like your invoices).

__N__

* The Privacy Policies and GDPR referral contact for our services is: global->MAIN_INFO_GDPR; ?>

__N__


__N__

Data Storage and Backups


__N__

* The storage of collected data (see \'Information collected and used\') is done in a database.

__N__

* We made one backup every week. Only 4 weeks are kept.

__N__


__N__

Subcontractor


__N__

* Our services relies on the following subcontractors and service:
__N__** The host of computer servers, which is ABC company. These servers are hosted in US. No customer information is communicated to this subcontractor who only provides the hardware and network layer, the installation and operation being carried out by us directly.
__N__** The online payment service Stripe, which is used, to ensure regular payment of subscription or your invoices paid online.

__N__


__N__

Software Protection


__N__

* Our services runs on Linux Ubuntu systems and software. They benefit from regular security updates when the operating system editor (Ubuntu Canonical) publishes them.

__N__

* Our services are accessible in HTTPS (HTTP encrypted) only, encrypted with SHA256 certificates.

__N__

* Our technical platform are protected by various solutions.

__N__


__N__

Data theft


__N__

* In case of suspicion of a theft of the data we have collected (see first point \'Information collected and used\'), customers will be informed by email, at email corresponding to their customer account

__N__

 

__N__
__N__
__N____N____N__ __N__ __N__ __N__
__N__ __N__', '', '0'); --- Page ID 16 -> 16__+MAX_llx_website_page__ - Aliases product-p --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(16__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'product-p', '', 'Product P', 'Product P', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Product P__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__This is a description page of our product P...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', '0'); --- Page ID 17 -> 17__+MAX_llx_website_page__ - Aliases search --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(17__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'search', '', 'Search Page', 'Search Page', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Search__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__


__N____N__
__N__ __N__
__N__
__N__ \" />__N__
__N__ \">__N__
__N__
__N__ __N__
__N__
__N__
__N__ __N__ load(\"main\");__N__ __N__ if (function_exists(\'getPagesFromSearchCriterias\'))__N__ {__N__ if (GETPOSTISSET(\'s\'))__N__ {__N__ $listofpages = getPagesFromSearchCriterias(\'page\', \'meta\', GETPOST(\'s\', \'alphanohtml\'));__N__ if ($listofpages[\'code\'] == \'OK\')__N__ {__N__ foreach($listofpages[\'list\'] as $websitepagefound)__N__ {__N__ print \'
ref.\'.php\">\'.$websitepagefound->title.\' - \'.$websitepagefound->description.\'
\';__N__ }__N__ }__N__ else__N__ {__N__ // If error, show message__N__ print $listofpages[\'message\'];__N__ }__N__ }__N__ }__N__ else__N__ {__N__ print $weblangs->trans(\"FeatureNotYetAvailable\");__N__ }__N__ ?>__N__ __N__





__N__
__N____N__ __N____N__
__N__', '', '0'); --- Page ID 18 -> 18__+MAX_llx_website_page__ - Aliases service-s --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(18__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'service-s', '', 'Service S', 'Service S', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Service S__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__This is a description page of our service S...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__', '', '0'); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 190 -> 12__+MAX_llx_website_page__ - Aliases our-team --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(12__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'our-team', '', 'Our team', 'Our team', 'en', '', 'team', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Our team__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__

__N__

The crew...




__N__ query($sql);__N__ if (! $resql) dol_print_error($db);__N__ while ($obj = $db->fetch_object($resql))__N__ {__N__ $arrayofusers[]=$obj->rowid;__N__ }__N__ __N__ print \'
\';__N__ foreach($arrayofusers as $id)__N__ {__N__ $fuser->fetch($id);__N____N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ if ($fuser->photo) print Form::showphoto(\'userphoto\', $fuser, 100, 0, 0, \'photowithmargin\', \'\', 0);__N__ //print \'photo.\'\" width=\"129\" height=\"129\" alt=\"\">\';__N__ else print \'\"\"\';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\'.$fuser->firstname.\'
\';__N__ print \'
    \';__N__ //print \'
  • September 24, 2018
  • \';__N__ if ($fuser->job) print \'
  • \'.$fuser->job.\'
  • \';__N__ else print \'
  • \';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ print \'
\';__N__ }__N__ print \'
\';__N____N__ ?>__N__
__N__
__N____N__

__N____N__ __N____N__
__N__ __N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 191 -> 13__+MAX_llx_website_page__ - Aliases partners --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(13__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'partners', '', 'Partners', 'Partners', 'en', '', 'partners', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Partners__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__

Our partners...

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 192 -> 14__+MAX_llx_website_page__ - Aliases pricing --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(14__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'pricing', '', 'Pricing', 'All the prices of our offers', 'en', '', 'pricing', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Our plans__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N____N____N__ __N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N____N__ __N__
__N__ __N__
__N__
__N__
__N__
FREE
__N__
The best choice for personal use
__N__
The service 1 for free
__N__
__N__ 0/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1 __N__
  • __N__
__N__
__N__
__N__ Subcribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
STARTER
__N__
For small companiess
__N__
The service 1 and product 1 at low price
__N__
__N__ 29/ month__N__
__N__
__N__ Available features are : __N__
    __N__
  • __N__ __N__ Service 1__N__
  • __N__
  • __N__ __N__ Product 1__N__
  • __N__
__N__
__N__
__N__ Subscribe__N__
__N__
__N__
__N__ __N__ __N__ __N__
__N__
__N__
__N__
PREMIUM
__N__
For large companies
__N__
The full option package for a one shot price__N__
__N__
__N__ 2499__N__
__N__
__N__ Available features are :__N__
    __N__
  • __N__ __N__ Service 1
  • __N__
  • __N__ __N__ Service 2
  • __N__
  • __N__ __N__ Product 1
  • __N__
__N__
__N__
__N__ Buy__N__
__N__
__N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__
__N__ __N__ __N__
__N__
__N__
__N__ __N__ __N__ __N__

__N____N__ __N____N__
__N__ __N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 193 -> 15__+MAX_llx_website_page__ - Aliases privacy-policies --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(15__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'privacy-policies', '', 'Privacy Policies', 'Privacy Policies', 'en', '', 'Privacy policies, GDPR', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N__ __N__ __N__ __N____N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Privacy Policy__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__


__N____N__
__N__
__N__

Information collected and used


__N__

* Your customer information (email, phone, business name, first and last name of contact, address, postal code, country and VAT number) are stored when you become a customer. This information allows us to bill you. __N__

* If you paid using our online service, we also store the last 4 digits of your card. The full details of your credit card is stored by our payment provider Stripe (the world leader in online payment).

__N__

* You have the option to request the deletion of your data and the above information at any time (except data required y fiscal tracking rules, like your invoices).

__N__

* The Privacy Policies and GDPR referral contact for our services is: global->MAIN_INFO_GDPR; ?>

__N__


__N__

Data Storage and Backups


__N__

* The storage of collected data (see \'Information collected and used\') is done in a database.

__N__

* We made one backup every week. Only 4 weeks are kept.

__N__


__N__

Subcontractor


__N__

* Our services relies on the following subcontractors and service:
__N__** The host of computer servers, which is ABC company. These servers are hosted in US. No customer information is communicated to this subcontractor who only provides the hardware and network layer, the installation and operation being carried out by us directly.
__N__** The online payment service Stripe, which is used, to ensure regular payment of subscription or your invoices paid online.

__N__


__N__

Software Protection


__N__

* Our services runs on Linux Ubuntu systems and software. They benefit from regular security updates when the operating system editor (Ubuntu Canonical) publishes them.

__N__

* Our services are accessible in HTTPS (HTTP encrypted) only, encrypted with SHA256 certificates.

__N__

* Our technical platform are protected by various solutions.

__N__


__N__

Data theft


__N__

* In case of suspicion of a theft of the data we have collected (see first point \'Information collected and used\'), customers will be informed by email, at email corresponding to their customer account

__N__

 

__N__
__N__
__N____N____N__ __N__ __N__ __N__
__N__ __N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 194 -> 16__+MAX_llx_website_page__ - Aliases product-p --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(16__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'product-p', '', 'Product P', 'Product P', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Product P__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__This is a description page of our product P...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__ __N____N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 195 -> 17__+MAX_llx_website_page__ - Aliases search --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(17__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'search', '', 'Search Page', 'Search Page', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Search__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N__


__N____N__
__N__ __N__
__N__
__N__ \" />__N__
__N__ \">__N__
__N__
__N__ __N__
__N__
__N__
__N__ __N__ load(\"main\");__N__ __N__ if (function_exists(\'getPagesFromSearchCriterias\'))__N__ {__N__ if (GETPOSTISSET(\'s\'))__N__ {__N__ $listofpages = getPagesFromSearchCriterias(\'page\', \'meta\', GETPOST(\'s\', \'alphanohtml\'));__N__ if ($listofpages[\'code\'] == \'OK\')__N__ {__N__ foreach($listofpages[\'list\'] as $websitepagefound)__N__ {__N__ print \'
ref.\'.php\">\'.$websitepagefound->title.\' - \'.$websitepagefound->description.\'
\';__N__ }__N__ }__N__ else__N__ {__N__ // If error, show message__N__ print $listofpages[\'message\'];__N__ }__N__ }__N__ }__N__ else__N__ {__N__ print $weblangs->trans(\"FeatureNotYetAvailable\");__N__ }__N__ ?>__N__ __N__





__N__
__N____N__ __N____N__
__N__', '', 0); +-- File generated by Dolibarr 17.0.0-alpha -- 2022-10-08 18:23:16 UTC --; +-- Page ID 196 -> 18__+MAX_llx_website_page__ - Aliases service-s --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(18__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'service-s', '', 'Service S', 'Service S', 'en', '', '', '1', '2020-10-07 13:13:26', '2022-07-12 11:17:55', null, '', 'page', '', '
__N____N__ __N____N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
Service S__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__
__N__
__N__
__N__
__N__
__N__This is a description page of our service S...
__N__
__N__
__N__
__N__
__N__
__N__
__N____N____N__

__N____N__ __N____N__
__N__', '', 0); -- For Dolibarr v14+ --; UPDATE llx_website SET lang = 'en' WHERE rowid = __WEBSITE_ID__; From 6549bcaf77368aac028010f5ca0ffee0afa13884 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 12:38:09 +0200 Subject: [PATCH 0839/1289] Rename templates --- ...3.jpg => website_template-homesubmenu.jpg} | Bin .../website_template-homesubmenu/LICENSE | 4 + .../README.md | 0 .../containers/.dolibarr | 0 .../containers/.htaccess | 0 .../containers/LICENSE | 1 + .../containers/README.md | 0 .../containers/htmlheader.html | 0 .../containers/index.php | 3 +- .../containers/javascript.js.php | 0 .../containers/manifest.json.php | 0 .../containers/master.inc.php | 0 .../containers/page202.tpl.php | 315 +++++++++++++++++ .../containers/robots.txt | 0 .../containers/styles.css.php | 53 +-- .../containers/wrapper.php | 0 .../medias/image/websitekey/article.png | Bin .../medias/image/websitekey/bg.png | Bin .../medias/image/websitekey/happy-man.png | Bin .../website_pages.sql | 9 + ...style01.jpg => website_template-noimg.jpg} | Bin .../websites/website_template-noimg/LICENSE | 4 + .../README.md | 0 .../containers/.dolibarr | 0 .../containers/.htaccess | 0 .../containers}/README.md | 0 .../containers/htmlheader.html | 0 .../containers/index.php | 0 .../containers/javascript.js.php | 0 .../containers/manifest.json.php | 0 .../containers/master.inc.php | 0 .../containers/page80.tpl.php | 0 .../containers/robots.txt | 0 .../containers/styles.css.php | 0 .../containers/wrapper.php | 0 .../website_pages.sql | 0 ...> website_template-onepageblackpurple.jpg} | Bin .../LICENSE | 4 + .../README.md | 0 .../containers/.dolibarr | 0 .../containers/.htaccess | 0 .../containers/README.md | 1 + .../containers/htmlheader.html | 0 .../containers/index.php | 0 .../containers/javascript.js.php | 0 .../containers/manifest.json.php | 0 .../containers/master.inc.php | 0 .../containers/page148.tpl.php | 0 .../containers/robots.txt | 0 .../containers/styles.css.php | 0 .../containers/wrapper.php | 0 .../medias/image/websitekey/bg.webp | Bin .../medias/image/websitekey/icon.webp | Bin .../website_pages.sql | 0 ...04.jpg => website_template-restaurant.jpg} | Bin .../website_template-restaurant/LICENSE | 8 + .../website_template-restaurant/README.md | 1 + .../containers/.dolibarr | 0 .../containers/.htaccess | 0 .../containers}/LICENSE | 0 .../containers/README.md | 1 + .../containers/about.php | 0 .../containers/contact.php | 0 .../containers/htmlheader.html | 6 + .../containers/index.php | 0 .../containers/javascript.js.php | 0 .../containers/manifest.json.php | 2 +- .../containers/master.inc.php | 5 +- .../containers/menu.php | 0 .../containers/page169.tpl.php | 0 .../containers/page170.tpl.php | 0 .../containers/page171.tpl.php | 0 .../containers/page172.tpl.php | 0 .../containers/robots.txt | 0 .../containers/styles.css.php | 0 .../containers/wrapper.php | 0 .../alex-haney-CAhjZmVk5H4-unsplash.jpg | Bin .../brett-jordan-8xt8-HIFqc8-unsplash.jpg | Bin .../louis-hansel-dphM2U1xq0U-unsplash.jpg | Bin .../lucas-swennen-1W_MyJSRLuQ-unsplash.jpg | Bin .../luisa-brimble-aFzg83dvnAI-unsplash.jpg | Bin ...riscilla-du-preez-W3SEyZODn8U-unsplash.jpg | Bin .../rod-long-I79Pgmhmy5M-unsplash.jpg | Bin .../charles-deluvio-FdDkfYFHqe4-unsplash.jpg | Bin .../daan-evers-tKN1WXrzQ3s-unsplash.jpg | Bin ...arhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg | Bin ...arhad-ibrahimzade-isHUj3N0194-unsplash.jpg | Bin .../dinner/keriliwi-c3mFafsFz2w-unsplash.jpg | Bin .../briana-tozour-V_Nkf1E-vYA-unsplash.jpg | Bin .../luisa-brimble-aFzg83dvnAI-unsplash.jpg | Bin ...riscilla-du-preez-W3SEyZODn8U-unsplash.jpg | Bin .../header/rod-long-I79Pgmhmy5M-unsplash.jpg | Bin ...arhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg | Bin ...arhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg | Bin .../louis-hansel-cH5IPjaAYyo-unsplash.jpg | Bin .../louis-hansel-rheOvfxOlOA-unsplash.jpg | Bin .../ivan-torres-MQUqbmszGGM-unsplash.jpg | Bin .../jason-leung-O67LZfeyYBk-unsplash.jpg | Bin .../jay-wennington-N_Y88TWmGwA-unsplash.jpg | Bin .../website_pages.sql | 0 .../websites/website_template-stellar/LICENSE | 4 + .../website_template-stellar/README.md | 1 + .../containers/htmlheader.html | 6 - .../containers/page149.tpl.php | 329 ------------------ .../website_pages.sql | 9 - .../containers/LICENSE | 2 - 106 files changed, 370 insertions(+), 398 deletions(-) rename htdocs/install/doctemplates/websites/{website_template-style03.jpg => website_template-homesubmenu.jpg} (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-homesubmenu/LICENSE rename htdocs/install/doctemplates/websites/{website_template-style01/containers => website_template-homesubmenu}/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-homesubmenu}/containers/.dolibarr (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-homesubmenu}/containers/.htaccess (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/LICENSE rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-homesubmenu}/containers/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-homesubmenu}/containers/htmlheader.html (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-homesubmenu}/containers/index.php (68%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-homesubmenu}/containers/javascript.js.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-homesubmenu}/containers/manifest.json.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-homesubmenu}/containers/master.inc.php (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/page202.tpl.php rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-homesubmenu}/containers/robots.txt (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-homesubmenu}/containers/styles.css.php (99%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-homesubmenu}/containers/wrapper.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-homesubmenu}/medias/image/websitekey/article.png (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-homesubmenu}/medias/image/websitekey/bg.png (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-homesubmenu}/medias/image/websitekey/happy-man.png (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-homesubmenu/website_pages.sql rename htdocs/install/doctemplates/websites/{website_template-style01.jpg => website_template-noimg.jpg} (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-noimg/LICENSE rename htdocs/install/doctemplates/websites/{website_template-style03/containers => website_template-noimg}/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-noimg}/containers/.dolibarr (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-noimg}/containers/.htaccess (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-noimg/containers}/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/htmlheader.html (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/index.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-noimg}/containers/javascript.js.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/manifest.json.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/master.inc.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/page80.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-noimg}/containers/robots.txt (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/containers/styles.css.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-noimg}/containers/wrapper.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style01 => website_template-noimg}/website_pages.sql (100%) rename htdocs/install/doctemplates/websites/{website_template-style02.jpg => website_template-onepageblackpurple.jpg} (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE rename htdocs/install/doctemplates/websites/{website_template-style04/containers => website_template-onpageblackpurple}/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-onpageblackpurple}/containers/.dolibarr (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-onpageblackpurple}/containers/.htaccess (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/htmlheader.html (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/index.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-onpageblackpurple}/containers/javascript.js.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/manifest.json.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/master.inc.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/page148.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-onpageblackpurple}/containers/robots.txt (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/containers/styles.css.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-onpageblackpurple}/containers/wrapper.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/medias/image/websitekey/bg.webp (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/medias/image/websitekey/icon.webp (100%) rename htdocs/install/doctemplates/websites/{website_template-style02 => website_template-onpageblackpurple}/website_pages.sql (100%) rename htdocs/install/doctemplates/websites/{website_template-style04.jpg => website_template-restaurant.jpg} (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-restaurant/LICENSE create mode 100644 htdocs/install/doctemplates/websites/website_template-restaurant/README.md rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/.dolibarr (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/.htaccess (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant/containers}/LICENSE (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-restaurant/containers/README.md rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/about.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/contact.php (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-restaurant/containers/htmlheader.html rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/index.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/javascript.js.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-restaurant}/containers/manifest.json.php (97%) rename htdocs/install/doctemplates/websites/{website_template-style03 => website_template-restaurant}/containers/master.inc.php (51%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/menu.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/page169.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/page170.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/page171.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/page172.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/robots.txt (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/styles.css.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/containers/wrapper.php (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/alex-haney-CAhjZmVk5H4-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/brett-jordan-8xt8-HIFqc8-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/louis-hansel-dphM2U1xq0U-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/lucas-swennen-1W_MyJSRLuQ-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/luisa-brimble-aFzg83dvnAI-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/breakfast/rod-long-I79Pgmhmy5M-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/charles-deluvio-FdDkfYFHqe4-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/daan-evers-tKN1WXrzQ3s-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/dinner/farhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/dinner/farhad-ibrahimzade-isHUj3N0194-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/dinner/keriliwi-c3mFafsFz2w-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/header/briana-tozour-V_Nkf1E-vYA-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/header/luisa-brimble-aFzg83dvnAI-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/header/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/header/rod-long-I79Pgmhmy5M-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/lunch/farhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/lunch/farhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/lunch/louis-hansel-cH5IPjaAYyo-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/lunch/louis-hansel-rheOvfxOlOA-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/slide/ivan-torres-MQUqbmszGGM-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/slide/jason-leung-O67LZfeyYBk-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/medias/image/websitekey/slide/jay-wennington-N_Y88TWmGwA-unsplash.jpg (100%) rename htdocs/install/doctemplates/websites/{website_template-style04 => website_template-restaurant}/website_pages.sql (100%) create mode 100644 htdocs/install/doctemplates/websites/website_template-stellar/LICENSE create mode 100644 htdocs/install/doctemplates/websites/website_template-stellar/README.md delete mode 100644 htdocs/install/doctemplates/websites/website_template-style03/containers/htmlheader.html delete mode 100644 htdocs/install/doctemplates/websites/website_template-style03/containers/page149.tpl.php delete mode 100644 htdocs/install/doctemplates/websites/website_template-style03/website_pages.sql delete mode 100644 htdocs/install/doctemplates/websites/website_template-style04/containers/LICENSE diff --git a/htdocs/install/doctemplates/websites/website_template-style03.jpg b/htdocs/install/doctemplates/websites/website_template-homesubmenu.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03.jpg rename to htdocs/install/doctemplates/websites/website_template-homesubmenu.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-homesubmenu/LICENSE b/htdocs/install/doctemplates/websites/website_template-homesubmenu/LICENSE new file mode 100644 index 00000000000..871ef743662 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-homesubmenu/LICENSE @@ -0,0 +1,4 @@ +LICENSE +------- + +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/README.md b/htdocs/install/doctemplates/websites/website_template-homesubmenu/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/README.md rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/.dolibarr b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/.dolibarr similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/.dolibarr rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/.dolibarr diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/.htaccess b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/.htaccess similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/.htaccess rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/.htaccess diff --git a/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/LICENSE b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/LICENSE new file mode 100644 index 00000000000..6ee68185103 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/LICENSE @@ -0,0 +1 @@ +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/README.md b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/README.md rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/htmlheader.html similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/htmlheader.html rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/htmlheader.html diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/index.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/index.php similarity index 68% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/index.php rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/index.php index 993c0627c00..967c5deb878 100644 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/index.php +++ b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/index.php @@ -1,4 +1,5 @@ ref.'/page149.tpl.php'; +if (empty($dolibarr_main_data_root)) require './page202.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page202.tpl.php'; +?> diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/javascript.js.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/javascript.js.php rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/javascript.js.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/manifest.json.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/manifest.json.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/manifest.json.php rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/manifest.json.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/master.inc.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/master.inc.php rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/master.inc.php diff --git a/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/page202.tpl.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/page202.tpl.php new file mode 100644 index 00000000000..f0c564c2d61 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/page202.tpl.php @@ -0,0 +1,315 @@ + + + +Home page + + + + + + + + + +use_manifest) { print ''."\n"; } ?> + + + + + + + + + + + + +email; + $message = GETPOST('message', 'alpha'); + $cmail = new CMailFile('Contact from website', $to, $from, $message); + if ($cmail->sendfile()) { + ?> + + trans("ErrorFailedToSendMail", $from, $to).'. '.$cmail->error; + } +} +?> +
+ + +
+
+
+
+

Get Productive

+

+ Lorem ipsum dolor, sit amet consectetur adipisicing + elit. Ab fuga nobis omnis alias, aliquid iste cumque + tempora nam reprehenderit quia itaque debitis, + nostrum labore rerum reiciendis laboriosam unde, + tempore corporis. +

+ landing-img +
+ + Learn More + +
+
+
+
+
+
+
+

+ LOREM IPSUM DOLOR SIT AMET EZAJB +

+ article +
+
+

Our Company

+

+ Lorem ipsum dolor, sit amet consectetur adipisicing + elit. Ab fuga nobis omnis alias, aliquid iste cumque + tempora nam reprehenderit quia itaque debitis, + nostrum labore rerum reiciendis laboriosam unde, + tempore corporis. +

+
+
+
+
+
+
+
+
+

Founders

+
    +
  • +

    Author One

    +
  • +
  • +

    Author Two

    +
  • +
  • +

    Author Three

    +
  • +
  • +

    Author Four

    +
  • +
+
+
+

About

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis accusantium earum sed odit velit laudantium ex libero quisquam consectetur, + dolorem vero ipsam perferendis quibusdam itaque omnis a consequatur error repellat. +

+
+
+
+
+ +
+

Contact us

+ +

Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within + a matter of hours to help you.

+ +
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + +
+
+
    +
  • +

    getFullAddress() ?>

    +
  • + +
  • +

    phone ?>

    +
  • + +
  • +

    email ?>

    +
  • +
+
+ +
+ + +
+
+ +
+ + + + diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/robots.txt b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/robots.txt similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/robots.txt rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/robots.txt diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/styles.css.php b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/styles.css.php similarity index 99% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/styles.css.php rename to htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/styles.css.php index 81e4826e445..d194541d6ea 100644 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/styles.css.php +++ b/htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/styles.css.php @@ -4,51 +4,13 @@ if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_ require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; ob_start(); -if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ - header('Cache-Control: max-age=3600, public, must-revalidate'); - header('Content-type: text/css'); +if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ +header('Cache-Control: max-age=3600, public, must-revalidate'); +header('Content-type: text/css'); } // END PHP ?> @charset "UTF-8"; -.bodywebsite { - /*! - * Bootstrap v5.2.1 (https://getbootstrap.com/) - * Copyright 2011-2022 The Bootstrap Authors - * Copyright 2011-2022 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ - /* rtl:raw: -[type="tel"], -[type="url"], -[type="email"], -[type="number"] { - direction: ltr; -} -*/ - /* rtl:begin:ignore */ - /* rtl:end:ignore */ - /* rtl:begin:ignore */ - /* rtl:end:ignore */ - /* rtl:begin:ignore */ - /* rtl:end:ignore */ - /* rtl:begin:ignore */ - /* rtl:end:ignore */ - /* rtl:begin:ignore */ - /* rtl:end:ignore */ - /* rtl:options: { - "autoRename": true, - "stringMap":[ { - "name" : "prev-next", - "search" : "prev", - "replace" : "next" - } ] -} */ - /* rtl:begin:remove */ - /* rtl:end:remove */ - /*# sourceMappingURL=bootstrap.css.map */; -} - .bodywebsite :root { --bs-blue: #0d6efd; --bs-indigo: #6610f2; @@ -12468,7 +12430,6 @@ if (! headers_sent()) { /* because file is included inline when in edit mode and /*# sourceMappingURL=bootstrap.css.map */ .bodywebsite #mysection1 { - font-family: Gulzar; font-size: 1.2rem; font-weight: bold; } @@ -12485,10 +12446,6 @@ if (! headers_sent()) { /* because file is included inline when in edit mode and font-weight: 900; } -.bodywebsite section{ - min-height: 100vh; -} - .bodywebsite .btn-perso { background-color: #50759e; padding-left: 20px; @@ -12543,8 +12500,8 @@ if (! headers_sent()) { /* because file is included inline when in edit mode and } .bodywebsite .container { - padding-top: 10%; - padding-bottom: 10%; + padding-top: 5%; + padding-bottom: 5%; } 1__+MAX_llx_website_page__ - Aliases index --; +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'index', '', 'Home page', '', '', '', '', '1', '2022-07-27 00:42:00', '2022-10-09 12:36:07', null, '', 'page', '', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__

__N__ LOREM IPSUM DOLOR SIT AMET EZAJB__N__

__N__ __N__
__N__
__N__

Our Company

__N__

__N__ Lorem ipsum dolor, sit amet consectetur adipisicing__N__ elit. Ab fuga nobis omnis alias, aliquid iste cumque__N__ tempora nam reprehenderit quia itaque debitis,__N__ nostrum labore rerum reiciendis laboriosam unde,__N__ tempore corporis.__N__

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

Founders

__N__
    __N__
  • __N__

    Author One

    __N__
  • __N__
  • __N__

    Author Two

    __N__
  • __N__
  • __N__

    Author Three

    __N__
  • __N__
  • __N__

    Author Four

    __N__
  • __N__
__N__
__N__
__N__

About

__N__

__N__ Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis accusantium earum sed odit velit laudantium ex libero quisquam consectetur, __N__ dolorem vero ipsam perferendis quibusdam itaque omnis a consequatur error repellat.__N__

__N__
__N__
__N__
__N__
__N____N__
__N__

Contact us

__N__ __N__

Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within__N__ a matter of hours to help you.

__N__ __N__
__N__ __N__ __N__
__N__
__N__ \" />__N__ __N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__ __N__
__N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__
    __N__
  • __N__

    getFullAddress() ?>

    __N__
  • __N__ __N__
  • __N__

    phone ?>

    __N__
  • __N__ __N__
  • __N__

    email ?>

    __N__
  • __N__
__N__
__N____N__
__N__ __N__ __N__
__N__
__N__ __N__
__N__', '', 0); +UPDATE llx_website SET fk_default_home = 1__+MAX_llx_website_page__ WHERE rowid = __WEBSITE_ID__; + +-- For Dolibarr v14+ --; +UPDATE llx_website SET lang = 'en' WHERE rowid = __WEBSITE_ID__; +UPDATE llx_website SET otherlang = '' WHERE rowid = __WEBSITE_ID__; + diff --git a/htdocs/install/doctemplates/websites/website_template-style01.jpg b/htdocs/install/doctemplates/websites/website_template-noimg.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01.jpg rename to htdocs/install/doctemplates/websites/website_template-noimg.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-noimg/LICENSE b/htdocs/install/doctemplates/websites/website_template-noimg/LICENSE new file mode 100644 index 00000000000..871ef743662 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-noimg/LICENSE @@ -0,0 +1,4 @@ +LICENSE +------- + +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/README.md b/htdocs/install/doctemplates/websites/website_template-noimg/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/README.md rename to htdocs/install/doctemplates/websites/website_template-noimg/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/.dolibarr b/htdocs/install/doctemplates/websites/website_template-noimg/containers/.dolibarr similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/.dolibarr rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/.dolibarr diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/.htaccess b/htdocs/install/doctemplates/websites/website_template-noimg/containers/.htaccess similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/.htaccess rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/.htaccess diff --git a/htdocs/install/doctemplates/websites/website_template-style04/README.md b/htdocs/install/doctemplates/websites/website_template-noimg/containers/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/README.md rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-noimg/containers/htmlheader.html similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/htmlheader.html rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/htmlheader.html diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/index.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/index.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/index.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/index.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/javascript.js.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/javascript.js.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/javascript.js.php diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/manifest.json.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/manifest.json.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/manifest.json.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/manifest.json.php diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/master.inc.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/master.inc.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/master.inc.php diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/page80.tpl.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/page80.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/page80.tpl.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/page80.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/robots.txt b/htdocs/install/doctemplates/websites/website_template-noimg/containers/robots.txt similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/robots.txt rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/robots.txt diff --git a/htdocs/install/doctemplates/websites/website_template-style01/containers/styles.css.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/styles.css.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/containers/styles.css.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/styles.css.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/wrapper.php b/htdocs/install/doctemplates/websites/website_template-noimg/containers/wrapper.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/wrapper.php rename to htdocs/install/doctemplates/websites/website_template-noimg/containers/wrapper.php diff --git a/htdocs/install/doctemplates/websites/website_template-style01/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-noimg/website_pages.sql similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style01/website_pages.sql rename to htdocs/install/doctemplates/websites/website_template-noimg/website_pages.sql diff --git a/htdocs/install/doctemplates/websites/website_template-style02.jpg b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02.jpg rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE new file mode 100644 index 00000000000..871ef743662 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE @@ -0,0 +1,4 @@ +LICENSE +------- + +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/README.md b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/README.md rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/.dolibarr b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.dolibarr similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/.dolibarr rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.dolibarr diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/.htaccess b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.htaccess similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/.htaccess rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.htaccess diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md new file mode 100644 index 00000000000..3a656b8ddaf --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md @@ -0,0 +1 @@ +Website generated by Dolibarr ERP CRM diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/htmlheader.html similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/htmlheader.html rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/htmlheader.html diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/index.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/index.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/index.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/index.php diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/javascript.js.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/javascript.js.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/javascript.js.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/manifest.json.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/manifest.json.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/manifest.json.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/manifest.json.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/master.inc.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/master.inc.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/master.inc.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/page148.tpl.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/page148.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/page148.tpl.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/page148.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/robots.txt b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/robots.txt similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/robots.txt rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/robots.txt diff --git a/htdocs/install/doctemplates/websites/website_template-style02/containers/styles.css.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/styles.css.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/containers/styles.css.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/styles.css.php diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/wrapper.php b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/wrapper.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/wrapper.php rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/wrapper.php diff --git a/htdocs/install/doctemplates/websites/website_template-style02/medias/image/websitekey/bg.webp b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/bg.webp similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/medias/image/websitekey/bg.webp rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/bg.webp diff --git a/htdocs/install/doctemplates/websites/website_template-style02/medias/image/websitekey/icon.webp b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/icon.webp similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/medias/image/websitekey/icon.webp rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/icon.webp diff --git a/htdocs/install/doctemplates/websites/website_template-style02/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/website_pages.sql similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style02/website_pages.sql rename to htdocs/install/doctemplates/websites/website_template-onpageblackpurple/website_pages.sql diff --git a/htdocs/install/doctemplates/websites/website_template-style04.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/LICENSE b/htdocs/install/doctemplates/websites/website_template-restaurant/LICENSE new file mode 100644 index 00000000000..1143fd7823a --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/LICENSE @@ -0,0 +1,8 @@ +LICENSE +------- + +Images are provided under the license: +Unsplash+ License + +Rest of templates (HTML and PHP code) content are under license +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/README.md b/htdocs/install/doctemplates/websites/website_template-restaurant/README.md new file mode 100644 index 00000000000..3a656b8ddaf --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/README.md @@ -0,0 +1 @@ +Website generated by Dolibarr ERP CRM diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/.dolibarr b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/.dolibarr similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/.dolibarr rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/.dolibarr diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/.htaccess b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/.htaccess similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/.htaccess rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/.htaccess diff --git a/htdocs/install/doctemplates/websites/website_template-style04/LICENSE b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/LICENSE similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/LICENSE rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/LICENSE diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/README.md b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/README.md new file mode 100644 index 00000000000..3a656b8ddaf --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/README.md @@ -0,0 +1 @@ +Website generated by Dolibarr ERP CRM diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/about.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/about.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/about.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/about.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/contact.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/contact.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/contact.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/contact.php diff --git a/htdocs/install/doctemplates/websites/website_template-restaurant/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/htmlheader.html new file mode 100644 index 00000000000..0de0b36283f --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/htmlheader.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/index.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/index.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/index.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/javascript.js.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/javascript.js.php diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/manifest.json.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/manifest.json.php similarity index 97% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/manifest.json.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/manifest.json.php index b61531d6c11..8f844114e48 100644 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/manifest.json.php +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/manifest.json.php @@ -10,4 +10,4 @@ header('Content-type: application/manifest+json'); diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/master.inc.php similarity index 51% rename from htdocs/install/doctemplates/websites/website_template-style03/containers/master.inc.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/master.inc.php index 7d9d6af3776..bd25ba5895d 100644 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/master.inc.php +++ b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/master.inc.php @@ -1,6 +1,7 @@ diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/menu.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/menu.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/menu.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/page169.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page169.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/page169.tpl.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/page169.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/page170.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page170.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/page170.tpl.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/page170.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/page171.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page171.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/page171.tpl.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/page171.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/page172.tpl.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/page172.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/page172.tpl.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/page172.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/robots.txt b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/robots.txt similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/robots.txt rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/robots.txt diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/styles.css.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/styles.css.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/styles.css.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/styles.css.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/wrapper.php b/htdocs/install/doctemplates/websites/website_template-restaurant/containers/wrapper.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/containers/wrapper.php rename to htdocs/install/doctemplates/websites/website_template-restaurant/containers/wrapper.php diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/alex-haney-CAhjZmVk5H4-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/alex-haney-CAhjZmVk5H4-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/alex-haney-CAhjZmVk5H4-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/alex-haney-CAhjZmVk5H4-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/brett-jordan-8xt8-HIFqc8-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/brett-jordan-8xt8-HIFqc8-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/brett-jordan-8xt8-HIFqc8-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/brett-jordan-8xt8-HIFqc8-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/louis-hansel-dphM2U1xq0U-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/louis-hansel-dphM2U1xq0U-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/louis-hansel-dphM2U1xq0U-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/louis-hansel-dphM2U1xq0U-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/lucas-swennen-1W_MyJSRLuQ-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/lucas-swennen-1W_MyJSRLuQ-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/lucas-swennen-1W_MyJSRLuQ-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/lucas-swennen-1W_MyJSRLuQ-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/luisa-brimble-aFzg83dvnAI-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/luisa-brimble-aFzg83dvnAI-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/luisa-brimble-aFzg83dvnAI-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/luisa-brimble-aFzg83dvnAI-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/rod-long-I79Pgmhmy5M-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/rod-long-I79Pgmhmy5M-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/breakfast/rod-long-I79Pgmhmy5M-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/breakfast/rod-long-I79Pgmhmy5M-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/charles-deluvio-FdDkfYFHqe4-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/charles-deluvio-FdDkfYFHqe4-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/charles-deluvio-FdDkfYFHqe4-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/charles-deluvio-FdDkfYFHqe4-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/daan-evers-tKN1WXrzQ3s-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/daan-evers-tKN1WXrzQ3s-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/daan-evers-tKN1WXrzQ3s-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/daan-evers-tKN1WXrzQ3s-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/farhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/farhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/farhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/farhad-ibrahimzade-ZipYER3NLhY-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/farhad-ibrahimzade-isHUj3N0194-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/farhad-ibrahimzade-isHUj3N0194-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/farhad-ibrahimzade-isHUj3N0194-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/farhad-ibrahimzade-isHUj3N0194-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/keriliwi-c3mFafsFz2w-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/keriliwi-c3mFafsFz2w-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/dinner/keriliwi-c3mFafsFz2w-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/dinner/keriliwi-c3mFafsFz2w-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/briana-tozour-V_Nkf1E-vYA-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/briana-tozour-V_Nkf1E-vYA-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/briana-tozour-V_Nkf1E-vYA-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/briana-tozour-V_Nkf1E-vYA-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/luisa-brimble-aFzg83dvnAI-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/luisa-brimble-aFzg83dvnAI-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/luisa-brimble-aFzg83dvnAI-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/luisa-brimble-aFzg83dvnAI-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/priscilla-du-preez-W3SEyZODn8U-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/rod-long-I79Pgmhmy5M-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/rod-long-I79Pgmhmy5M-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/header/rod-long-I79Pgmhmy5M-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/header/rod-long-I79Pgmhmy5M-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/farhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/farhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/farhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/farhad-ibrahimzade-D5c9ZciQy_I-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/farhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/farhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/farhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/farhad-ibrahimzade-MGKqxm6u2bc-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/louis-hansel-cH5IPjaAYyo-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/louis-hansel-cH5IPjaAYyo-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/louis-hansel-cH5IPjaAYyo-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/louis-hansel-cH5IPjaAYyo-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/louis-hansel-rheOvfxOlOA-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/louis-hansel-rheOvfxOlOA-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/lunch/louis-hansel-rheOvfxOlOA-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/lunch/louis-hansel-rheOvfxOlOA-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/ivan-torres-MQUqbmszGGM-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/ivan-torres-MQUqbmszGGM-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/ivan-torres-MQUqbmszGGM-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/ivan-torres-MQUqbmszGGM-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/jason-leung-O67LZfeyYBk-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/jason-leung-O67LZfeyYBk-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/jason-leung-O67LZfeyYBk-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/jason-leung-O67LZfeyYBk-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/jay-wennington-N_Y88TWmGwA-unsplash.jpg b/htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/jay-wennington-N_Y88TWmGwA-unsplash.jpg similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/medias/image/websitekey/slide/jay-wennington-N_Y88TWmGwA-unsplash.jpg rename to htdocs/install/doctemplates/websites/website_template-restaurant/medias/image/websitekey/slide/jay-wennington-N_Y88TWmGwA-unsplash.jpg diff --git a/htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-restaurant/website_pages.sql similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-style04/website_pages.sql rename to htdocs/install/doctemplates/websites/website_template-restaurant/website_pages.sql diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/LICENSE b/htdocs/install/doctemplates/websites/website_template-stellar/LICENSE new file mode 100644 index 00000000000..871ef743662 --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-stellar/LICENSE @@ -0,0 +1,4 @@ +LICENSE +------- + +CC-BY-SA - https://creativecommons.org/licenses/by/4.0/ diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/README.md b/htdocs/install/doctemplates/websites/website_template-stellar/README.md new file mode 100644 index 00000000000..3a656b8ddaf --- /dev/null +++ b/htdocs/install/doctemplates/websites/website_template-stellar/README.md @@ -0,0 +1 @@ +Website generated by Dolibarr ERP CRM diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-style03/containers/htmlheader.html deleted file mode 100644 index a58ea695524..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/htmlheader.html +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/htdocs/install/doctemplates/websites/website_template-style03/containers/page149.tpl.php b/htdocs/install/doctemplates/websites/website_template-style03/containers/page149.tpl.php deleted file mode 100644 index 860441d88a0..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-style03/containers/page149.tpl.php +++ /dev/null @@ -1,329 +0,0 @@ - - - -index - - - - - - - - - -use_manifest) { print ''."\n"; } ?> - - - - - - - - - - - - - - - - - - - - - Template - - - - - -email; - $message = GETPOST('message', 'alpha'); - $cmail = new CMailFile('Contact from website', $to, $from, $message); - if ($cmail->sendfile()) { - ?> - - trans("ErrorFailedToSendMail", $from, $to).'. '.$cmail->error; - } -} -?> -
- - -
-
-
-
-

Get Productive

-

- Lorem ipsum dolor, sit amet consectetur adipisicing - elit. Ab fuga nobis omnis alias, aliquid iste cumque - tempora nam reprehenderit quia itaque debitis, - nostrum labore rerum reiciendis laboriosam unde, - tempore corporis. -

- landing-img -
- - Learn More - -
-
-
-
-
-
-
-

- LOREM IPSUM DOLOR SIT AMET EZAJB -

- article -
-
-

Our Company

-

- Lorem ipsum dolor, sit amet consectetur adipisicing - elit. Ab fuga nobis omnis alias, aliquid iste cumque - tempora nam reprehenderit quia itaque debitis, - nostrum labore rerum reiciendis laboriosam unde, - tempore corporis. -

-
-
-
-
-
-
-
-
-

Founders

-
    -
  • -

    Author One

    -
  • -
  • -

    Author Two

    -
  • -
  • -

    Author Three

    -
  • -
  • -

    Author Four

    -
  • -
-
-
-

About

-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis accusantium earum sed odit velit laudantium ex libero quisquam consectetur, - dolorem vero ipsam perferendis quibusdam itaque omnis a consequatur error repellat. -

-
-
-
-
- -
-

Contact us

- -

Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within - a matter of hours to help you.

- -
- - -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
-
- -
-
-
-
- - -
-
-
    -
  • -

    getFullAddress() ?>

    -
  • - -
  • -

    phone ?>

    -
  • - -
  • -

    email ?>

    -
  • -
-
- -
- - -
-
- -
- - - - diff --git a/htdocs/install/doctemplates/websites/website_template-style03/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-style03/website_pages.sql deleted file mode 100644 index 353c6bde37a..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-style03/website_pages.sql +++ /dev/null @@ -1,9 +0,0 @@ --- File generated by Dolibarr 17.0.0-alpha -- 2022-09-26 11:51:21 UTC --; --- Page ID 149 -> 1__+MAX_llx_website_page__ - Aliases index --; -INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(1__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'index', '', 'index', '', '', '', '', '1', '2022-07-27 00:42:00', '2022-09-26 13:50:58', null, '', 'page', '__N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N__ __N____N____N__ Template__N__ ', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__
__N__
__N__

__N__ LOREM IPSUM DOLOR SIT AMET EZAJB__N__

__N__ __N__
__N__
__N__

Our Company

__N__

__N__ Lorem ipsum dolor, sit amet consectetur adipisicing__N__ elit. Ab fuga nobis omnis alias, aliquid iste cumque__N__ tempora nam reprehenderit quia itaque debitis,__N__ nostrum labore rerum reiciendis laboriosam unde,__N__ tempore corporis.__N__

__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__
__N__

Founders

__N__
    __N__
  • __N__

    Author One

    __N__
  • __N__
  • __N__

    Author Two

    __N__
  • __N__
  • __N__

    Author Three

    __N__
  • __N__
  • __N__

    Author Four

    __N__
  • __N__
__N__
__N__
__N__

About

__N__

__N__ Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis accusantium earum sed odit velit laudantium ex libero quisquam consectetur, __N__ dolorem vero ipsam perferendis quibusdam itaque omnis a consequatur error repellat.__N__

__N__
__N__
__N__
__N__
__N____N__
__N__

Contact us

__N__ __N__

Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within__N__ a matter of hours to help you.

__N__ __N__
__N__ __N__ __N__
__N__
__N__ \" />__N__ __N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__ __N__
__N__
__N__ __N__ __N__
__N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__
__N__
__N__ __N__
__N__
__N__
__N__
__N__ __N__ __N__
__N__
__N__
    __N__
  • __N__

    getFullAddress() ?>

    __N__
  • __N__ __N__
  • __N__

    phone ?>

    __N__
  • __N__ __N__
  • __N__

    email ?>

    __N__
  • __N__
__N__
__N____N__
__N__ __N__ __N__
__N__
__N__ __N__
__N__', '', 0); -UPDATE llx_website SET fk_default_home = 1__+MAX_llx_website_page__ WHERE rowid = __WEBSITE_ID__; - --- For Dolibarr v14+ --; -UPDATE llx_website SET lang = 'en' WHERE rowid = __WEBSITE_ID__; -UPDATE llx_website SET otherlang = '' WHERE rowid = __WEBSITE_ID__; - diff --git a/htdocs/install/doctemplates/websites/website_template-style04/containers/LICENSE b/htdocs/install/doctemplates/websites/website_template-style04/containers/LICENSE deleted file mode 100644 index 83294e71b2e..00000000000 --- a/htdocs/install/doctemplates/websites/website_template-style04/containers/LICENSE +++ /dev/null @@ -1,2 +0,0 @@ -Image are provided under the Unsplash+ License -Rest of templates (HTML and PHP code) content are GPLv3 From fe40875aa9e1feca49870ea47f37ff0c59f7b013 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 13:00:34 +0200 Subject: [PATCH 0840/1289] Enahnce web site templates --- htdocs/core/lib/website2.lib.php | 50 +++++++++--------- .../LICENSE | 0 .../README.md | 0 .../containers/.dolibarr | 0 .../containers/.htaccess | 0 .../containers/README.md | 0 .../containers/htmlheader.html | 0 .../containers/index.php | 0 .../containers/javascript.js.php | 0 .../containers/manifest.json.php | 0 .../containers/master.inc.php | 0 .../containers/page148.tpl.php | 0 .../containers/robots.txt | 0 .../containers/styles.css.php | 0 .../containers/wrapper.php | 0 .../medias/image/websitekey/bg.webp | Bin .../medias/image/websitekey/icon.webp | Bin .../website_pages.sql | 0 18 files changed, 26 insertions(+), 24 deletions(-) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/LICENSE (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/.dolibarr (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/.htaccess (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/README.md (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/htmlheader.html (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/index.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/javascript.js.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/manifest.json.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/master.inc.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/page148.tpl.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/robots.txt (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/styles.css.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/containers/wrapper.php (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/medias/image/websitekey/bg.webp (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/medias/image/websitekey/icon.webp (100%) rename htdocs/install/doctemplates/websites/{website_template-onpageblackpurple => website_template-onepageblackpurple}/website_pages.sql (100%) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 74e6bc4d9e8..17021ab25db 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -592,7 +592,7 @@ function showWebsiteTemplates(Website $website) print ''; - print ''; print ''; @@ -645,6 +649,9 @@ function showWebsiteTemplates(Website $website) print $subdir; print '
'; print ''.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).' - '.dol_print_date(dol_filemtime($templatedir), 'dayhour', 'tzuserrel').''; + if ($user->hasRight('website', 'delete')) { + print ' ref).'&templateuserfile='.urlencode($subdir).'">'.img_picto('', 'delete').''; + } print '
ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").''; print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 514c24db164..16985c511e1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -449,6 +449,36 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && !$searc $massaction = ''; } +if ($action == 'deletetemplate') { + $dirthemes = array('/doctemplates/websites'); + if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application + foreach ($conf->modules_parts['websitetemplates'] as $reldir) { + $dirthemes = array_merge($dirthemes, (array) ($reldir.'doctemplates/websites')); + } + } + $dirthemes = array_unique($dirthemes); + + + // Delete template files and dir + $mode = 'importsite'; + $action = 'importsite'; + + if (count($dirthemes)) { + $i = 0; + foreach ($dirthemes as $dir) { + //print $dirroot.$dir;exit; + $dirtheme = DOL_DATA_ROOT.$dir; // This include loop on $conf->file->dol_document_root + if (is_dir($dirtheme)) { + $templateuserfile = GETPOST('templateuserfile'); + $imguserfile = preg_replace('/\.zip$/', '', $templateuserfile).'.jpg'; + dol_delete_file($dirtheme.'/'.$templateuserfile); + dol_delete_file($dirtheme.'/'.$imguserfile); + } + } + } +} + + // Set category if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { $error = 0; From fa651f756679d17731fd3195b40df956825cd41f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 17:49:44 +0200 Subject: [PATCH 0846/1289] Enhance website CMS toolbar --- htdocs/core/class/html.formwebsite.class.php | 11 +- htdocs/langs/en_US/website.lang | 3 +- htdocs/theme/eldy/global.inc.php | 7 +- htdocs/theme/md/style.css.php | 2 +- htdocs/website/class/website.class.php | 8 +- htdocs/website/class/websitepage.class.php | 8 +- htdocs/website/index.php | 110 ++++++++++++------- 7 files changed, 94 insertions(+), 55 deletions(-) diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index c6a6826251f..ed4b56be831 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -231,6 +231,8 @@ class FormWebsite */ public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null) { + global $conf, $langs; + $this->num = 0; $atleastonepage = (is_array($website->lines) && count($website->lines) > 0); @@ -239,13 +241,18 @@ class FormWebsite if ($atleastonepage && $action != 'editsource') { $out .= ''; + $out .= ''; if (empty($object->records)) { $out .= ''; } + + /* if (!empty($conf->use_javascript_ajax)) { $valueoption = ''.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddWebsite").''; $out .= ''; - } + }*/ + // Loop on each sites $i = 0; foreach ($object->records as $key => $valwebsite) { @@ -2826,6 +2830,10 @@ if (!GETPOST('hide_websitemenu')) { print ''; } + print ''; + + print ''; + if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) { print '   '; @@ -2852,10 +2860,15 @@ if (!GETPOST('hide_websitemenu')) { // Delete website if ($website->status == $website::STATUS_VALIDATED) { - print ''; + $disabled = ' disabled="disabled"'; + $title = $langs->trans("WebsiteMustBeDisabled", $langs->transnoentitiesnoconv($website->LibStatut(0, 0))); + $url = '#'; } else { - print ''; + $disabled = ''; + $title = $langs->trans("Delete"); + $url = $_SERVER["PHP_SELF"].'?action=deletesite&token='.newToken().'&website='.urlencode($website->ref); } + print ''.img_picto('', 'delete', 'class=""').''.$langs->trans("Delete").''; // Regenerate all pages print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'">'; @@ -2863,6 +2876,7 @@ if (!GETPOST('hide_websitemenu')) { // Generate site map print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; + // Find / replace tool print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; } @@ -2970,53 +2984,53 @@ if (!GETPOST('hide_websitemenu')) { print ''; print '
'; - print ''; + print '
'; print $langs->trans("PageContainer").': '; - print ''; + print '
'; - print ''; - print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; + print ''; + print 'ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; print ''; //print ''; - if ($action != 'addcontainer') { + //if ($action != 'addcontainer') { $out = ''; - $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone'); + $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone'); - if ($formwebsite->num > 0) { - $out .= ''; - $out .= $s; - $out .= ''; + if ($formwebsite->num >= 0) { + $out .= ''; + $out .= $s; + $out .= ''; - $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); + $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); - if (!empty($conf->use_javascript_ajax)) { - $out .= ''; - } + if (!empty($conf->use_javascript_ajax)) { + $out .= ''; } + } print $out; - } else { + /*} else { print $langs->trans("New"); - } + }*/ print ''; - print ''; + print ''; // Print nav arrows $pagepreviousid = 0; @@ -3240,7 +3254,19 @@ if (!GETPOST('hide_websitemenu')) { print 'ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'">'; } print ''; - print ''; + + // Delete + //print ''; + if ($websitepage->status == $websitepage::STATUS_DRAFT || !$atleastonepage) { + $disabled = ' disabled="disabled"'; + $title = $langs->trans("WebpageMustBeDisabled", $langs->transnoentitiesnoconv($websitepage->LibStatut(0, 0))); + $url = '#'; + } else { + $disabled = ''; + $title = ''; + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&website='.urlencode($website->ref); + } + print ''.img_picto('', 'delete', 'class=""').''.$langs->trans("Delete").''; } } @@ -3881,7 +3907,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $pageusermodifid = $objectpage->fk_user_modif; $pageauthoralias = $objectpage->author_alias; $pagestatus = $objectpage->status; - } else { + } else { // $action = 'createcontainer' $type_container = 'page'; $pageurl = ''; $pagealiasalt = ''; @@ -4179,6 +4205,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print ''; print '
'; + print '\n"; $resqlUpd = $db->query($sqlUpd); if (!$resqlUpd) { From b6452bd2c7398b832bcc0691f641126d1aa9a78e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sun, 9 Oct 2022 14:52:15 +0200 Subject: [PATCH 0842/1289] fix travis (website template) --- .../website_template-stellar/containers/page23.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php index 37ea0bf165d..43664b7984b 100644 --- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php @@ -39,7 +39,7 @@ ob_start(); @@ -101,7 +101,7 @@ ob_start();

Ipsum consequat

-

Donec imperdiet consequat consequat. Suspendisse feugiat congue
+

Donec imperdiet consequat consequat. Suspendisse feugiat congue
posuere. Nulla massa urna, fermentum eget quam aliquet.

    @@ -138,7 +138,7 @@ ob_start();

    Congue imperdiet

    -

    Donec imperdiet consequat consequat. Suspendisse feugiat congue
    +

    Donec imperdiet consequat consequat. Suspendisse feugiat congue
    posuere. Nulla massa urna, fermentum eget quam aliquet.

    From f85b129cbc3d190ba220e5a46ad97c95301aaa0e Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 9 Oct 2022 15:16:58 +0200 Subject: [PATCH 0843/1289] =?UTF-8?q?NEW=C2=A0#22527:=20can=20now=20view?= =?UTF-8?q?=20actions=20in=20messaging=20list=20for=20projets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/lib/functions.lib.php | 717 ++++++++++++++++++++++++++++++ htdocs/core/lib/ticket.lib.php | 716 ----------------------------- htdocs/projet/info.php | 34 +- htdocs/projet/messaging.php | 221 +++++++++ htdocs/ticket/card.php | 2 +- htdocs/ticket/messaging.php | 2 +- 6 files changed, 968 insertions(+), 724 deletions(-) create mode 100644 htdocs/projet/messaging.php diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d771c75ba48..b9ebe2b35e7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11259,3 +11259,720 @@ function dolForgeCriteriaCallback($matches) return $db->escape($operand).' '.$db->escape($operator)." ".$tmpescaped; } + + + +/** + * Get timeline icon + * @param ActionComm $actionstatic actioncomm + * @param array $histo histo + * @param int $key key + * @return string + */ +function getTimelineIcon($actionstatic, &$histo, $key) +{ + global $conf, $langs; + $out = ''."\n"; + $iconClass = 'fa fa-comments'; + $img_picto = ''; + $colorClass = ''; + $pictoTitle = ''; + + if ($histo[$key]['percent'] == -1) { + $colorClass = 'timeline-icon-not-applicble'; + $pictoTitle = $langs->trans('StatusNotApplicable'); + } elseif ($histo[$key]['percent'] == 0) { + $colorClass = 'timeline-icon-todo'; + $pictoTitle = $langs->trans('StatusActionToDo').' (0%)'; + } elseif ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100) { + $colorClass = 'timeline-icon-in-progress'; + $pictoTitle = $langs->trans('StatusActionInProcess').' ('.$histo[$key]['percent'].'%)'; + } elseif ($histo[$key]['percent'] >= 100) { + $colorClass = 'timeline-icon-done'; + $pictoTitle = $langs->trans('StatusActionDone').' (100%)'; + } + + if ($actionstatic->code == 'AC_TICKET_CREATE') { + $iconClass = 'fa fa-ticket'; + } elseif ($actionstatic->code == 'AC_TICKET_MODIFY') { + $iconClass = 'fa fa-pencilxxx'; + } elseif ($actionstatic->code == 'TICKET_MSG') { + $iconClass = 'fa fa-comments'; + } elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') { + $iconClass = 'fa fa-mask'; + } elseif (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if ($actionstatic->type_picto) { + $img_picto = img_picto('', $actionstatic->type_picto); + } else { + if ($actionstatic->type_code == 'AC_RDV') { + $iconClass = 'fa fa-handshake'; + } elseif ($actionstatic->type_code == 'AC_TEL') { + $iconClass = 'fa fa-phone'; + } elseif ($actionstatic->type_code == 'AC_FAX') { + $iconClass = 'fa fa-fax'; + } elseif ($actionstatic->type_code == 'AC_EMAIL') { + $iconClass = 'fa fa-envelope'; + } elseif ($actionstatic->type_code == 'AC_INT') { + $iconClass = 'fa fa-shipping-fast'; + } elseif ($actionstatic->type_code == 'AC_OTH_AUTO') { + $iconClass = 'fa fa-robot'; + } elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) { + $iconClass = 'fa fa-robot'; + } + } + } + + $out .= ''.$img_picto.''."\n"; + return $out; +} + +/** + * getActionCommEcmList + * + * @param ActionComm $object Object ActionComm + * @return array Array of documents in index table + */ +function getActionCommEcmList($object) +{ + global $conf, $db; + + $documents = array(); + + $sql = 'SELECT ecm.rowid as id, ecm.src_object_type, ecm.src_object_id, ecm.filepath, ecm.filename'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'ecm_files ecm'; + $sql .= " WHERE ecm.filepath = 'agenda/".((int) $object->id)."'"; + //$sql.= " ecm.src_object_type = '".$db->escape($object->element)."' AND ecm.src_object_id = ".((int) $object->id); // Old version didn't add object_type during upload + $sql .= ' ORDER BY ecm.position ASC'; + + $resql = $db->query($sql); + if ($resql) { + if ($db->num_rows($resql)) { + while ($obj = $db->fetch_object($resql)) { + $documents[$obj->id] = $obj; + } + } + } + + return $documents; +} + + +/** + * Show html area with actions in messaging format. + * Note: Global parameter $param must be defined. + * + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Object db + * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object + * @param Contact $objcon Filter on object contact to filter events on a contact + * @param int $noprint Return string but does not output it + * @param string $actioncode Filter on actioncode + * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all). + * @param array $filters Filter on other fields + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @return string|void Return html part or void if noprint is 1 + */ +function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC') +{ + global $user, $conf; + global $form; + + global $param, $massactionbutton; + + dol_include_once('/comm/action/class/actioncomm.class.php'); + + // Check parameters + if (!is_object($filterobj) && !is_object($objcon)) { + dol_print_error('', 'BadParameter'); + } + + $histo = array(); + $numaction = 0; + $now = dol_now(); + + $sortfield_list = explode(',', $sortfield); + $sortfield_label_list = array('a.id' => 'id', 'a.datep' => 'dp', 'a.percent' => 'percent'); + $sortfield_new_list = array(); + foreach ($sortfield_list as $sortfield_value) { + $sortfield_new_list[] = $sortfield_label_list[trim($sortfield_value)]; + } + $sortfield_new = implode(',', $sortfield_new_list); + + if (isModEnabled('agenda')) { + // Search histo on actioncomm + if (is_object($objcon) && $objcon->id > 0) { + $sql = "SELECT DISTINCT a.id, a.label as label,"; + } else { + $sql = "SELECT a.id, a.label as label,"; + } + $sql .= " a.datep as dp,"; + $sql .= " a.note as message,"; + $sql .= " a.datep2 as dp2,"; + $sql .= " a.percent as percent, 'action' as type,"; + $sql .= " a.fk_element, a.elementtype,"; + $sql .= " a.fk_contact,"; + $sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; + $sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') { + $sql .= ", sp.lastname, sp.firstname"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { + $sql .= ", m.lastname, m.firstname"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { + $sql .= ", o.ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { + $sql .= ", o.ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { + $sql .= ", o.ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { + $sql .= ", o.ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { + $sql .= ", o.ref"; + } + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; + + $force_filter_contact = false; + if (is_object($objcon) && $objcon->id > 0) { + $force_filter_contact = true; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); + } + + if (is_object($filterobj) && get_class($filterobj) == 'Societe') { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; + $sql .= " ON er.resource_type = 'dolresource'"; + $sql .= " AND er.element_id = a.id"; + $sql .= " AND er.resource_id = ".((int) $filterobj->id); + } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { + $sql .= ", ".MAIN_DB_PREFIX."adherent as m"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { + $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { + $sql .= ", ".MAIN_DB_PREFIX."product as o"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { + $sql .= ", ".MAIN_DB_PREFIX."ticket as o"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { + $sql .= ", ".MAIN_DB_PREFIX."bom_bom as o"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { + $sql .= ", ".MAIN_DB_PREFIX."contrat as o"; + } + + $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; + if ($force_filter_contact === false) { + if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) { + $sql .= " AND a.fk_soc = ".((int) $filterobj->id); + } elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) { + $sql .= " AND a.fk_project = ".((int) $filterobj->id); + } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { + $sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'"; + if ($filterobj->id) { + $sql .= " AND a.fk_element = ".((int) $filterobj->id); + } + } + } + + // Condition on actioncode + if (!empty($actioncode)) { + if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if ($actioncode == 'AC_NON_AUTO') { + $sql .= " AND c.type != 'systemauto'"; + } elseif ($actioncode == 'AC_ALL_AUTO') { + $sql .= " AND c.type = 'systemauto'"; + } else { + if ($actioncode == 'AC_OTH') { + $sql .= " AND c.type != 'systemauto'"; + } elseif ($actioncode == 'AC_OTH_AUTO') { + $sql .= " AND c.type = 'systemauto'"; + } + } + } else { + if ($actioncode == 'AC_NON_AUTO') { + $sql .= " AND c.type != 'systemauto'"; + } elseif ($actioncode == 'AC_ALL_AUTO') { + $sql .= " AND c.type = 'systemauto'"; + } else { + $sql .= " AND c.code = '".$db->escape($actioncode)."'"; + } + } + } + if ($donetodo == 'todo') { + $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; + } elseif ($donetodo == 'done') { + $sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; + } + if (is_array($filters) && $filters['search_agenda_label']) { + $sql .= natural_search('a.label', $filters['search_agenda_label']); + } + } + + // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. + if (isModEnabled('mailing') && !empty($objcon->email) + && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) { + $langs->load("mails"); + + $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; + $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; + $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; + $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action + if (is_object($filterobj) && get_class($filterobj) == 'Societe') { + $sql2 .= ", '' as lastname, '' as firstname"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { + $sql2 .= ", '' as lastname, '' as firstname"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { + $sql2 .= ", '' as ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { + $sql2 .= ", '' as ref"; + } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { + $sql2 .= ", '' as ref"; + } + $sql2 .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u"; + $sql2 .= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email. + $sql2 .= " AND mc.statut = 1"; + $sql2 .= " AND u.rowid = m.fk_user_valid"; + $sql2 .= " AND mc.fk_mailing=m.rowid"; + } + + if (!empty($sql) && !empty($sql2)) { + $sql = $sql." UNION ".$sql2; + } elseif (empty($sql) && !empty($sql2)) { + $sql = $sql2; + } + + // TODO Add limit in nb of results + if ($sql) { // May not be defined if module Agenda is not enabled and mailing module disabled too + $sql .= $db->order($sortfield_new, $sortorder); + + dol_syslog("function.lib::show_actions_messaging", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) { + $i = 0; + $num = $db->num_rows($resql); + + while ($i < $num) { + $obj = $db->fetch_object($resql); + + if ($obj->type == 'action') { + $contactaction = new ActionComm($db); + $contactaction->id = $obj->id; + $result = $contactaction->fetchResources(); + if ($result < 0) { + dol_print_error($db); + setEventMessage("actions.lib::show_actions_messaging Error fetch ressource", 'errors'); + } + + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; + //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; + $tododone = ''; + if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) { + $tododone = 'todo'; + } + + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>$tododone, + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'message'=>$obj->message, + 'percent'=>$obj->percent, + + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo, + + 'contact_id'=>$obj->fk_contact, + 'socpeopleassigned' => $contactaction->socpeopleassigned, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'fk_element'=>$obj->fk_element, + 'elementtype'=>$obj->elementtype, + // Type of event + 'acode'=>$obj->acode, + 'alabel'=>$obj->alabel, + 'libelle'=>$obj->alabel, // deprecated + 'apicto'=>$obj->apicto + ); + } else { + $histo[$numaction] = array( + 'type'=>$obj->type, + 'tododone'=>'done', + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'message'=>$obj->message, + 'percent'=>$obj->percent, + 'acode'=>$obj->acode, + + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo + ); + } + + $numaction++; + $i++; + } + } else { + dol_print_error($db); + } + } + + // Set $out to sow events + $out = ''; + + if (!isModEnabled('agenda')) { + $langs->loadLangs(array("admin", "errors")); + $out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning'); + } + + if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) { + $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; + + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + + $formactions = new FormActions($db); + + $actionstatic = new ActionComm($db); + $userstatic = new User($db); + $contactstatic = new Contact($db); + $userGetNomUrlCache = array(); + + $out .= '
    '; + $out .= '
    '; + $out .= ''; + + if ($objcon && get_class($objcon) == 'Contact' && + (is_null($filterobj) || get_class($filterobj) == 'Societe')) { + $out .= ''; + } else { + $out .= ''; + } + if ($filterobj && get_class($filterobj) == 'Societe') { + $out .= ''; + } + + $out .= "\n"; + + $out .= '
    '; + $out .= '
'; if (count($dirthemes)) { $i = 0; @@ -603,11 +603,10 @@ function showWebsiteTemplates(Website $website) $handle = opendir($dirtheme); if (is_resource($handle)) { while (($subdir = readdir($handle)) !== false) { - if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' - && substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir)) { - $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir); + if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir)) { + $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir); - // Disable not stable themes (dir ends with _exp or _dev) + // Disable not stable themes (dir ends with _exp or _dev) if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { continue; } @@ -615,38 +614,41 @@ function showWebsiteTemplates(Website $website) continue; } - print '
'; + print '
'; - $file = $dirtheme."/".$subdirwithoutzip.".jpg"; - $url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg"; + $templatedir = $dirtheme."/".$subdir; + $file = $dirtheme."/".$subdirwithoutzip.".jpg"; + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg"; if (!file_exists($file)) { $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png'; } - $originalfile = basename($file); - $entity = $conf->entity; - $modulepart = 'doctemplateswebsite'; - $cache = ''; - $title = $file; + $originalfile = basename($file); + $entity = $conf->entity; + $modulepart = 'doctemplateswebsite'; + $cache = ''; + $title = $file; - $ret = ''; - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 1, '&entity='.$entity); + $ret = ''; + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 1, '&entity='.$entity); if (!empty($urladvanced)) { $ret .= ''; } else { - $ret .= ''; + $ret .= ''; } - print $ret; - print ''.$title.''; - print ''; + print $ret; + print ''.$title.''; + print ''; - print '
'; - print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')'; - print '
ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").''; - print '
'; + print '
'; + print $subdir; + print '
'; + print ''.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).' - '.dol_print_date(dol_filemtime($templatedir), 'dayhour', 'tzuserrel').''; + print '
ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").''; + print '
'; - $i++; + $i++; } } } diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/LICENSE similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/LICENSE rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/LICENSE diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/README.md b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/README.md rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.dolibarr b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/.dolibarr similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.dolibarr rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/.dolibarr diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.htaccess b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/.htaccess similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/.htaccess rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/.htaccess diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/README.md similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/README.md rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/README.md diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/htmlheader.html b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/htmlheader.html similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/htmlheader.html rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/htmlheader.html diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/index.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/index.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/index.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/index.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/javascript.js.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/javascript.js.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/javascript.js.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/javascript.js.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/manifest.json.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/manifest.json.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/manifest.json.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/manifest.json.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/master.inc.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/master.inc.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/master.inc.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/master.inc.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/page148.tpl.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/page148.tpl.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/page148.tpl.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/page148.tpl.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/robots.txt b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/robots.txt similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/robots.txt rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/robots.txt diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/styles.css.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/styles.css.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/styles.css.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/styles.css.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/wrapper.php b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/wrapper.php similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/containers/wrapper.php rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/wrapper.php diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/bg.webp b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/medias/image/websitekey/bg.webp similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/bg.webp rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/medias/image/websitekey/bg.webp diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/icon.webp b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/medias/image/websitekey/icon.webp similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/medias/image/websitekey/icon.webp rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/medias/image/websitekey/icon.webp diff --git a/htdocs/install/doctemplates/websites/website_template-onpageblackpurple/website_pages.sql b/htdocs/install/doctemplates/websites/website_template-onepageblackpurple/website_pages.sql similarity index 100% rename from htdocs/install/doctemplates/websites/website_template-onpageblackpurple/website_pages.sql rename to htdocs/install/doctemplates/websites/website_template-onepageblackpurple/website_pages.sql From 28b69f5cd9ede6f677b92d8b2616a3b5bbedb549 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sun, 9 Oct 2022 14:15:43 +0200 Subject: [PATCH 0841/1289] chore: travis --- htdocs/install/upgrade2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 57727e6f92f..463c2b2df4c 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5161,8 +5161,8 @@ function migrate_contractdet_rank() $db->begin(); print '
'; - $sql = 'SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM '.$db->prefix().'contratdet as cd INNER JOIN '.$db->prefix().'contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0'; - $sql .=' ORDER BY c.rowid,cd.rowid'; + $sql = "SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM ".$db->prefix()."contratdet as cd INNER JOIN ".$db->prefix()."contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0"; + $sql .=" ORDER BY c.rowid,cd.rowid"; $resql = $db->query($sql); if ($resql) { @@ -5175,7 +5175,7 @@ function migrate_contractdet_rank() $currentRank=1; } - $sqlUpd = 'UPDATE '.$db->prefix().'contratdet SET rang='.(int) $currentRank.' WHERE rowid='.(int) $obj->cdid; + $sqlUpd = "UPDATE ".$db->prefix()."contratdet SET rang=".(int) $currentRank." WHERE rowid=".(int) $obj->cdid; $resultstring .= '
'.$sqlUpd."
'; + + $out .= ''; + + $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, '')."\n"; + + $out .= ''; + if ($donetodo) { + $out .= ''; + } + $out .= ''; + $out .= ''; + + $out .= ''; + $out .= ''; + + + $out .= '
'.$langs->trans("Search").' : '; + $out .= ''; + //$out .= img_picto($langs->trans("Type"), 'type'); + $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, 0, 1, 'minwidth200imp'); + $out .= ''; + $out .= ''; + $out .= ''; + $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1); + $out .= $searchpicto; + $out .= '
'; + + $out .= ''; + $out .= '
'; + + $out .= "\n"; + + $out .= '\n"; + + if (empty($histo)) { + $out .= ''.$langs->trans("NoRecordFound").''; + } + } + + if ($noprint) { + return $out; + } else { + print $out; + } +} diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 9223c1c4dd8..5d0d691228e 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -268,719 +268,3 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; } - - - -/** - * Show html area with actions for ticket messaging. - * Note: Global parameter $param must be defined. - * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Object db - * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object - * @param Contact $objcon Filter on object contact to filter events on a contact - * @param int $noprint Return string but does not output it - * @param string $actioncode Filter on actioncode - * @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all). - * @param array $filters Filter on other fields - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @return string|void Return html part or void if noprint is 1 - */ -function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC') -{ - global $user, $conf; - global $form; - - global $param, $massactionbutton; - - dol_include_once('/comm/action/class/actioncomm.class.php'); - - // Check parameters - if (!is_object($filterobj) && !is_object($objcon)) { - dol_print_error('', 'BadParameter'); - } - - $histo = array(); - $numaction = 0; - $now = dol_now(); - - $sortfield_list = explode(',', $sortfield); - $sortfield_label_list = array('a.id' => 'id', 'a.datep' => 'dp', 'a.percent' => 'percent'); - $sortfield_new_list = array(); - foreach ($sortfield_list as $sortfield_value) { - $sortfield_new_list[] = $sortfield_label_list[trim($sortfield_value)]; - } - $sortfield_new = implode(',', $sortfield_new_list); - - if (isModEnabled('agenda')) { - // Search histo on actioncomm - if (is_object($objcon) && $objcon->id > 0) { - $sql = "SELECT DISTINCT a.id, a.label as label,"; - } else { - $sql = "SELECT a.id, a.label as label,"; - } - $sql .= " a.datep as dp,"; - $sql .= " a.note as message,"; - $sql .= " a.datep2 as dp2,"; - $sql .= " a.percent as percent, 'action' as type,"; - $sql .= " a.fk_element, a.elementtype,"; - $sql .= " a.fk_contact,"; - $sql .= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; - $sql .= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; - if (is_object($filterobj) && get_class($filterobj) == 'Societe') { - $sql .= ", sp.lastname, sp.firstname"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { - $sql .= ", m.lastname, m.firstname"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { - $sql .= ", o.ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { - $sql .= ", o.ref"; - } - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; - - $force_filter_contact = false; - if (is_object($objcon) && $objcon->id > 0) { - $force_filter_contact = true; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); - } - - if (is_object($filterobj) && get_class($filterobj) == 'Societe') { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; - $sql .= " ON er.resource_type = 'dolresource'"; - $sql .= " AND er.element_id = a.id"; - $sql .= " AND er.resource_id = ".((int) $filterobj->id); - } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { - $sql .= ", ".MAIN_DB_PREFIX."adherent as m"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { - $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { - $sql .= ", ".MAIN_DB_PREFIX."product as o"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { - $sql .= ", ".MAIN_DB_PREFIX."ticket as o"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { - $sql .= ", ".MAIN_DB_PREFIX."bom_bom as o"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { - $sql .= ", ".MAIN_DB_PREFIX."contrat as o"; - } - - $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; - if ($force_filter_contact === false) { - if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) { - $sql .= " AND a.fk_soc = ".((int) $filterobj->id); - } elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) { - $sql .= " AND a.fk_project = ".((int) $filterobj->id); - } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { - $sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } elseif (is_object($filterobj) && get_class($filterobj) == 'BOM') { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'bom'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = 'contract'"; - if ($filterobj->id) { - $sql .= " AND a.fk_element = ".((int) $filterobj->id); - } - } - } - - // Condition on actioncode - if (!empty($actioncode)) { - if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($actioncode == 'AC_NON_AUTO') { - $sql .= " AND c.type != 'systemauto'"; - } elseif ($actioncode == 'AC_ALL_AUTO') { - $sql .= " AND c.type = 'systemauto'"; - } else { - if ($actioncode == 'AC_OTH') { - $sql .= " AND c.type != 'systemauto'"; - } elseif ($actioncode == 'AC_OTH_AUTO') { - $sql .= " AND c.type = 'systemauto'"; - } - } - } else { - if ($actioncode == 'AC_NON_AUTO') { - $sql .= " AND c.type != 'systemauto'"; - } elseif ($actioncode == 'AC_ALL_AUTO') { - $sql .= " AND c.type = 'systemauto'"; - } else { - $sql .= " AND c.code = '".$db->escape($actioncode)."'"; - } - } - } - if ($donetodo == 'todo') { - $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; - } elseif ($donetodo == 'done') { - $sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; - } - if (is_array($filters) && $filters['search_agenda_label']) { - $sql .= natural_search('a.label', $filters['search_agenda_label']); - } - } - - // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. - if (isModEnabled('mailing') && !empty($objcon->email) - && (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) { - $langs->load("mails"); - - $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; - $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id"; - $sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; - $sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action - if (is_object($filterobj) && get_class($filterobj) == 'Societe') { - $sql2 .= ", '' as lastname, '' as firstname"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { - $sql2 .= ", '' as lastname, '' as firstname"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { - $sql2 .= ", '' as ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Product') { - $sql2 .= ", '' as ref"; - } elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') { - $sql2 .= ", '' as ref"; - } - $sql2 .= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u"; - $sql2 .= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email. - $sql2 .= " AND mc.statut = 1"; - $sql2 .= " AND u.rowid = m.fk_user_valid"; - $sql2 .= " AND mc.fk_mailing=m.rowid"; - } - - if (!empty($sql) && !empty($sql2)) { - $sql = $sql." UNION ".$sql2; - } elseif (empty($sql) && !empty($sql2)) { - $sql = $sql2; - } - - // TODO Add limit in nb of results - if ($sql) { // May not be defined if module Agenda is not enabled and mailing module disabled too - $sql .= $db->order($sortfield_new, $sortorder); - - dol_syslog("ticket.lib::show_ticket_messaging", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) { - $i = 0; - $num = $db->num_rows($resql); - - while ($i < $num) { - $obj = $db->fetch_object($resql); - - if ($obj->type == 'action') { - $contactaction = new ActionComm($db); - $contactaction->id = $obj->id; - $result = $contactaction->fetchResources(); - if ($result < 0) { - dol_print_error($db); - setEventMessage("ticket.lib::show_ticket_messaging Error fetch ressource", 'errors'); - } - - //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; - //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; - $tododone = ''; - if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) { - $tododone = 'todo'; - } - - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>$tododone, - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'message'=>$obj->message, - 'percent'=>$obj->percent, - - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo, - - 'contact_id'=>$obj->fk_contact, - 'socpeopleassigned' => $contactaction->socpeopleassigned, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'fk_element'=>$obj->fk_element, - 'elementtype'=>$obj->elementtype, - // Type of event - 'acode'=>$obj->acode, - 'alabel'=>$obj->alabel, - 'libelle'=>$obj->alabel, // deprecated - 'apicto'=>$obj->apicto - ); - } else { - $histo[$numaction] = array( - 'type'=>$obj->type, - 'tododone'=>'done', - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'message'=>$obj->message, - 'percent'=>$obj->percent, - 'acode'=>$obj->acode, - - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo - ); - } - - $numaction++; - $i++; - } - } else { - dol_print_error($db); - } - } - - // Set $out to sow events - $out = ''; - - if (!isModEnabled('agenda')) { - $langs->loadLangs(array("admin", "errors")); - $out = info_admin($langs->trans("WarningModuleXDisabledSoYouMayMissEventHere", $langs->transnoentitiesnoconv("Module2400Name")), 0, 0, 'warning'); - } - - if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) { - $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; - - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - - $formactions = new FormActions($db); - - $actionstatic = new ActionComm($db); - $userstatic = new User($db); - $contactstatic = new Contact($db); - $userGetNomUrlCache = array(); - - $out .= '
'; - $out .= '
'; - $out .= ''; - - if ($objcon && get_class($objcon) == 'Contact' && - (is_null($filterobj) || get_class($filterobj) == 'Societe')) { - $out .= ''; - } else { - $out .= ''; - } - if ($filterobj && get_class($filterobj) == 'Societe') { - $out .= ''; - } - - $out .= "\n"; - - $out .= '
'; - $out .= ''; - - $out .= ''; - - $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, '')."\n"; - - $out .= ''; - if ($donetodo) { - $out .= ''; - } - $out .= ''; - $out .= ''; - - $out .= ''; - $out .= ''; - - - $out .= '
'.$langs->trans("Search").' : '; - $out .= ''; - //$out .= img_picto($langs->trans("Type"), 'type'); - $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, 0, 1, 'minwidth200imp'); - $out .= ''; - $out .= ''; - $out .= ''; - $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1); - $out .= $searchpicto; - $out .= '
'; - - $out .= ''; - $out .= '
'; - - $out .= "\n"; - - $out .= '\n"; - - if (empty($histo)) { - $out .= ''.$langs->trans("NoRecordFound").''; - } - } - - if ($noprint) { - return $out; - } else { - print $out; - } -} - -/** - * Get timeline icon - * @param ActionComm $actionstatic actioncomm - * @param array $histo histo - * @param int $key key - * @return string - */ -function getTicketTimelineIcon($actionstatic, &$histo, $key) -{ - global $conf, $langs; - $out = ''."\n"; - $iconClass = 'fa fa-comments'; - $img_picto = ''; - $colorClass = ''; - $pictoTitle = ''; - - if ($histo[$key]['percent'] == -1) { - $colorClass = 'timeline-icon-not-applicble'; - $pictoTitle = $langs->trans('StatusNotApplicable'); - } elseif ($histo[$key]['percent'] == 0) { - $colorClass = 'timeline-icon-todo'; - $pictoTitle = $langs->trans('StatusActionToDo').' (0%)'; - } elseif ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100) { - $colorClass = 'timeline-icon-in-progress'; - $pictoTitle = $langs->trans('StatusActionInProcess').' ('.$histo[$key]['percent'].'%)'; - } elseif ($histo[$key]['percent'] >= 100) { - $colorClass = 'timeline-icon-done'; - $pictoTitle = $langs->trans('StatusActionDone').' (100%)'; - } - - if ($actionstatic->code == 'AC_TICKET_CREATE') { - $iconClass = 'fa fa-ticket'; - } elseif ($actionstatic->code == 'AC_TICKET_MODIFY') { - $iconClass = 'fa fa-pencilxxx'; - } elseif ($actionstatic->code == 'TICKET_MSG') { - $iconClass = 'fa fa-comments'; - } elseif ($actionstatic->code == 'TICKET_MSG_PRIVATE') { - $iconClass = 'fa fa-mask'; - } elseif (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($actionstatic->type_picto) { - $img_picto = img_picto('', $actionstatic->type_picto); - } else { - if ($actionstatic->type_code == 'AC_RDV') { - $iconClass = 'fa fa-handshake'; - } elseif ($actionstatic->type_code == 'AC_TEL') { - $iconClass = 'fa fa-phone'; - } elseif ($actionstatic->type_code == 'AC_FAX') { - $iconClass = 'fa fa-fax'; - } elseif ($actionstatic->type_code == 'AC_EMAIL') { - $iconClass = 'fa fa-envelope'; - } elseif ($actionstatic->type_code == 'AC_INT') { - $iconClass = 'fa fa-shipping-fast'; - } elseif ($actionstatic->type_code == 'AC_OTH_AUTO') { - $iconClass = 'fa fa-robot'; - } elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) { - $iconClass = 'fa fa-robot'; - } - } - } - - $out .= ''.$img_picto.''."\n"; - return $out; -} - -/** - * getTicketActionCommEcmList - * - * @param ActionComm $object Object ActionComm - * @return array Array of documents in index table - */ -function getTicketActionCommEcmList($object) -{ - global $conf, $db; - - $documents = array(); - - $sql = 'SELECT ecm.rowid as id, ecm.src_object_type, ecm.src_object_id, ecm.filepath, ecm.filename'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'ecm_files ecm'; - $sql .= " WHERE ecm.filepath = 'agenda/".((int) $object->id)."'"; - //$sql.= " ecm.src_object_type = '".$db->escape($object->element)."' AND ecm.src_object_id = ".((int) $object->id); // Old version didn't add object_type during upload - $sql .= ' ORDER BY ecm.position ASC'; - - $resql = $db->query($sql); - if ($resql) { - if ($db->num_rows($resql)) { - while ($obj = $db->fetch_object($resql)) { - $documents[$obj->id] = $obj; - } - } - } - - return $documents; -} diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index bef020d9a38..ed8b87c9791 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -166,18 +166,40 @@ if ($permok) { } -//print '
'; -$morehtmlcenter = ''; -if (isModEnabled('agenda')) { - $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); - $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); -} //print '
'; if (!empty($object->id)) { print '
'; + //print '
'; + $morehtmlcenter = ''; + + // Show link to change view in message + $messagingUrl = DOL_URL_ROOT.'/projet/messaging.php?id='.$object->id; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + + // Show link to change view in agenda + $messagingUrl = DOL_URL_ROOT.'/projet/info.php?id='.$object->id; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); + + + // // Show link to send an email (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); + + // // Show link to add a private message (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); + + // Show link to add event + if (isModEnabled('agenda')) { + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); + } + $param = '&id='.$object->id; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.$contextpage; diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php new file mode 100644 index 00000000000..9200d802794 --- /dev/null +++ b/htdocs/projet/messaging.php @@ -0,0 +1,221 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/projet/messaging.php + * \ingroup project + * \brief Page with events on project + */ + +// Load Dolibarr environment +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// Load translation files required by the page +$langs->load("projects"); + +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = is_numeric($page) ? $page : 0; +$page = $page == -1 ? 0 : $page; +if (!$sortfield) { + $sortfield = "a.datep,a.id"; +} +if (!$sortorder) { + $sortorder = "DESC"; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +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)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + +$hookmanager->initHooks(array('projectcardinfo')); + +// Security check +$id = GETPOST("id", 'int'); +$socid = 0; +//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +$result = restrictedArea($user, 'projet', $id, 'projet&project'); + +if (!$user->rights->projet->lire) { + accessforbidden(); +} + + + +/* + * Actions + */ + +$parameters = array('id'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Purge search criteria +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; +} + + + +/* + * View + */ + +$form = new Form($db); +$object = new Project($db); + +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); + $object->fetch_thirdparty(); + if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) { + $object->fetchComments(); + } + $object->info($object->id); +} +$agenda = (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; +$title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name; +if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { + $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); +} +$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; +llxHeader("", $title, $help_url); + +$head = project_prepare_head($object); + +print dol_get_fiche_head($head, 'agenda', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); + + +// Project card + +$linkback = ''.$langs->trans("BackToList").''; + +$morehtmlref = '
'; +// Title +$morehtmlref .= $object->title; +// Thirdparty +if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { + $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); +} +$morehtmlref .= '
'; + +// Define a complementary filter for search of next/prev ref. +if (empty($user->rights->projet->all->lire)) { + $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); + $object->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")"; +} + +dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + +print '
'; +print '
'; + +dol_print_object_info($object, 1); + +print '
'; + +print '
'; + +print dol_get_fiche_end(); + + +// Actions buttons + +$out = ''; +$permok = $user->rights->agenda->myactions->create; +if ($permok) { + $out .= '&projectid='.$object->id; +} + + + +//print '
'; + +if (!empty($object->id)) { + print '
'; + + //print '
'; + $morehtmlcenter = ''; + + // Show link to change view in message + $messagingUrl = DOL_URL_ROOT.'/projet/messaging.php?id='.$object->id; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); + + // Show link to change view in agenda + $messagingUrl = DOL_URL_ROOT.'/projet/info.php?id='.$object->id; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); + + + // // Show link to send an email (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); + + // // Show link to add a private message (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); + + // Show link to add event + if (isModEnabled('agenda')) { + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); + } + + $param = '&id='.$object->id; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.$contextpage; + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.$limit; + } + + print_barre_liste($langs->trans("ActionsOnProject"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 841f810e5ec..0bd6a98cab9 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1564,7 +1564,7 @@ if ($action == 'create' || $action == 'presend') { // List of all actions $filters = array(); $filters['search_agenda_label'] = $search_agenda_label; - show_ticket_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } if ($action != 'presend' && $action != 'presend_addmessage' && $action != 'add_message') { diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 88ac4ef686c..fb95c5a66f1 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -265,7 +265,7 @@ if (!empty($object->id)) { // List of all actions $filters = array(); $filters['search_agenda_label'] = $search_agenda_label; - show_ticket_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } // End of page From 797d866d0a88839b5d88e49264fac8863f0ea98d Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 9 Oct 2022 15:37:04 +0200 Subject: [PATCH 0844/1289] =?UTF-8?q?NEW=C2=A0#22527:=20can=20now=20view?= =?UTF-8?q?=20actions=20in=20messaging=20list=20for=20third=20parties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/societe/agenda.php | 24 +++- htdocs/societe/messaging.php | 211 +++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 4 deletions(-) create mode 100644 htdocs/societe/messaging.php diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 550d8ca772d..9e6c10a0ccd 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -160,10 +160,26 @@ if ($socid > 0) { $out .= '&datep='.dol_print_date(dol_now(), 'dayhourlog'); } - $newcardbutton = ''; + $morehtmlright = ''; + + $messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; + $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + $messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); + + // // Show link to send an email (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); + + // // Show link to add a private message (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $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)) { - $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } @@ -178,8 +194,8 @@ if ($socid > 0) { $param .= '&limit='.urlencode($limit); } - print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, ''); - //print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 1); + // print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, ''); + print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); // List of all actions $filters = array(); diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php new file mode 100644 index 00000000000..c73d6ffe0b1 --- /dev/null +++ b/htdocs/societe/messaging.php @@ -0,0 +1,211 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2019 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/messaging.php + * \ingroup societe + * \brief Page of third party events + */ + +// Load Dolibarr environment +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array('agenda', 'bills', 'companies', 'orders', 'propal')); + + +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)); +} + +$search_agenda_label = GETPOST('search_agenda_label'); + +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'societe', $socid, '&societe'); + +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('agendathirdparty')); + + +/* + * Actions + */ + +$parameters = array('id'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($socid > 0) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $object = new Societe($db); + $result = $object->fetch($socid); + + $title = $langs->trans("Agenda"); + if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { + $title = $object->name." - ".$title; + } + llxHeader('', $title); + + if (isModEnabled('notification')) { + $langs->load("mails"); + } + $head = societe_prepare_head($object); + + print dol_get_fiche_head($head, 'agenda', $langs->trans("ThirdParty"), -1, 'company'); + + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); + + print '
'; + + print '
'; + + $object->info($socid); + dol_print_object_info($object, 1); + + print '
'; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = ''; + $permok = $user->hasRight('agenda', 'myactions', 'create'); + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + 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 .= '&datep='.dol_print_date(dol_now(), 'dayhourlog'); + } + + $morehtmlright = ''; + + $messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; + $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); + $messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); + + // // Show link to send an email (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $morehtmlright .= dolGetButtonTitle($langs->trans('SendMail'), '', 'fa fa-paper-plane', $url, 'email-title-button', $btnstatus); + + // // Show link to add a private message (if read and not closed) + // $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + // $url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id).'#formmailbeforetitle'; + // $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)) { + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + } + } + + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + print '
'; + + $param = '&socid='.urlencode($socid); + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + // print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, ''); + print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + } +} + +// End of page +llxFooter(); +$db->close(); From 496973996d2f8542773766ef3c7599866dc15897 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 15:52:37 +0200 Subject: [PATCH 0845/1289] NEW Can remove a website template --- htdocs/core/lib/website2.lib.php | 11 +++++++++-- htdocs/website/index.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 17021ab25db..0b836399f43 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -563,7 +563,7 @@ function dolSaveLicense($file, $content) */ function showWebsiteTemplates(Website $website) { - global $conf, $langs, $db, $form; + global $conf, $langs, $db, $form, $user; $dirthemes = array('/doctemplates/websites'); if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application @@ -582,11 +582,15 @@ function showWebsiteTemplates(Website $website) // Title print '
'; print $form->textwithpicto($langs->trans("Templates"), $langs->trans("ThemeDir").' : '.join(", ", $dirthemes)); + print ' '; + print ''; + print img_picto('', 'refresh'); + print ''; print ''; $url = 'https://www.dolistore.com/43-web-site-templates'; print ''; - print $langs->trans('DownloadMoreSkins'); + print img_picto('', 'globe', 'class="pictofixedwidth"').$langs->trans('DownloadMoreSkins'); print ''; print '
'; + if ($action == 'createcontainer') { print '
'; @@ -4207,7 +4234,10 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage")); print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; - print ''; + + print ''; + print ''; + print ''; print ''; } From a1e5e754db3c6f499d47434e0496031278e42e3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 17:57:48 +0200 Subject: [PATCH 0847/1289] Doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 54b721ff443..0c9e93454f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -281,6 +281,7 @@ Following changes may create regressions for some external modules, but were nec * Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions. * The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced. * The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier' +* Because the module Resources highly linked to the Agenda module, the menu for Resources module has been moved into top menu Agenda. ***** ChangeLog for 15.0.3 compared to 15.0.2 ***** From 2053ad8f49efc8febc115b3d71e9f553ec526b85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Oct 2022 20:52:50 +0200 Subject: [PATCH 0848/1289] NEW Can switch status of website and page from the website toolbar --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/ajax.lib.php | 33 ++-- htdocs/langs/en_US/website.lang | 1 + htdocs/website/index.php | 190 ++++++++++++++--------- 4 files changed, 137 insertions(+), 89 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8eb357a3908..7224949a70b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4345,7 +4345,7 @@ abstract class CommonObject } /** - * Set status of an object + * Set status of an object. * * @param int $status Status to set * @param int $elementId Id of element to force (use this->id by default if null) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8098fa7a16e..b6ec08da434 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -644,36 +644,41 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof * This is called when MAIN_DIRECT_STATUS_UPDATE is set and it use tha ajax service objectonoff.php * * @param Object $object Object to set - * @param string $code Name of constant : status or status_buy for product by example + * @param string $code Name of property in object : 'status' or 'status_buy' for product by example * @param string $field Name of database field : 'tosell' or 'tobuy' for product by example * @param string $text_on Text if on * @param string $text_off Text if off * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @param string $morecss More CSS + * @param string $htmlname Name of HTML component. Keep '' or use a different value if you need to use this component several time on same page for same property. * @return string html for button on/off */ -function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '') +function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '', $htmlname = '') { global $langs; + if (empty($htmlname)) { + $htmlname = $code; + } + $out = ''; - $out .= ''.img_picto($langs->trans($text_off), 'switch_off').''; - $out .= ''.img_picto($langs->trans($text_on), 'switch_on').''; + $out .= ''.img_picto($langs->trans($text_off), 'switch_off').''; + $out .= ''.img_picto($langs->trans($text_on), 'switch_on').''; return $out; } diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 298f7c6ab51..8644becdd8c 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -152,3 +152,4 @@ NextContainer=Next page/container PreviousContainer=Previous page/container WebsiteMustBeDisabled=The website must have the status "%s" WebpageMustBeDisabled=The web page must have the status "%s" +SetWebsiteOnlineBefore=When website is offline, all pages are offline. Change status of website first. diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 7cf58a81971..55c2b8f31a8 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -420,6 +420,18 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core $action = 'file_manager'; } +if ($action == 'setwebsiteonline') { + $website->setStatut($website::STATUS_VALIDATED, null, '', 'WEBSITE_MODIFY', 'status'); + + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + exit; +} +if ($action == 'setwebsiteoffline') { + $result = $website->setStatut($website::STATUS_DRAFT, null, '', 'WEBSITE_MODIFY', 'status'); + + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + exit; +} if ($action == 'seteditinline') { dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings'); @@ -478,7 +490,6 @@ if ($action == 'deletetemplate') { } } - // Set category if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { $error = 0; @@ -517,7 +528,8 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us // Now we reload list $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1); } -// Set category + +// Del category if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { $error = 0; $nbupdate = 0; @@ -2750,6 +2762,11 @@ if (!GETPOST('hide_websitemenu')) { } $atleastonepage = (is_array($array) && count($array) > 0); + $websitepage = new WebSitePage($db); + if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) { + $websitepage->fetch($pageid); + } + //var_dump($objectpage);exit; print '
'; @@ -2764,15 +2781,14 @@ if (!GETPOST('hide_websitemenu')) { print $langs->trans("Website").': '; print '
'; + // Button Add new website $urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite'; - //if (empty($conf->use_javascript_ajax)) { - print ''; - print ''; - print ''; - //} + print ''; + print ''; + print ''; // List of website - print ''; + print ''; $out = ''; $out .= ''; + print ''; + + // Switch offline/onine + if (!empty($conf->use_javascript_ajax)) { + print ''; + // Do not use ajax, we need a refresh of full page when we change status of a website + //print '
'; + //print ajax_object_onoff($object, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsite'); + //print '
'; + if ($website->status == $website::STATUS_DRAFT) { + $text_off = 'Offline'; + print 'ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_off').''; + } else { + $text_off = 'Online'; + print 'ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_on').''; + } + print '
'; + } + + // Refresh / Reload web site (for non javascript browers) + if (empty($conf->use_javascript_ajax)) { + print ''; + print ''; + print ''; } - print '
'; print ''; if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) { - print '   '; - - //print ''; - print ''.dol_escape_htmltag($langs->trans("EditCss")).''; + // Edit website properties + print ''.dol_escape_htmltag($langs->trans("EditCss")).''; + // Import web site $importlabel = $langs->trans("ImportSite"); $exportlabel = $langs->trans("ExportSite"); if (!empty($conf->dol_optimize_smallscreen)) { @@ -2853,9 +2883,10 @@ if (!GETPOST('hide_websitemenu')) { print ''; } - //print ''; + // Export web site print ''; + // Clone web site print ''; // Delete website @@ -2988,46 +3019,57 @@ if (!GETPOST('hide_websitemenu')) { print $langs->trans("PageContainer").': '; print '
'; + // Button Add new web page print ''; print 'ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; print ''; - //print ''; - //if ($action != 'addcontainer') { - $out = ''; + $out = ''; - $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone'); + $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone'); - if ($formwebsite->num >= 0) { - $out .= ''; - $out .= $s; - $out .= ''; + $out .= ''; + $out .= $s; + $out .= ''; - $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); + $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); - if (!empty($conf->use_javascript_ajax)) { - $out .= ''; - } + if (!empty($conf->use_javascript_ajax)) { + $out .= ''; } - print $out; - /*} else { - print $langs->trans("New"); - }*/ + print $out; + if (!empty($conf->use_javascript_ajax)) { + print ''; + //print '
'; + if ($object->status == $object::STATUS_DRAFT) { // website is off, we do not allow to change status of page + $text_off = 'SetWebsiteOnlineBefore'; + if ($objectpage->status == $objectpage::STATUS_DRAFT) { + print ''.img_picto($langs->trans($text_off), 'switch_off').''; + } else { + print ''.img_picto($langs->trans($text_off), 'switch_on').''; + } + } else { + print ajax_object_onoff($objectpage, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsitepage'); + } + //print '
'; + print '
'; + } + print ''; print ''; @@ -3059,23 +3101,18 @@ if (!GETPOST('hide_websitemenu')) { } if ($pagepreviousid) { - print ''.img_previous($langs->trans("PreviousContainer")).''; + print ''.img_previous($langs->trans("PreviousContainer")).''; } else { print ''.img_previous($langs->trans("PreviousContainer")).''; } if ($pagenextid) { - print ''.img_next($langs->trans("NextContainer")).''; + print ''.img_next($langs->trans("NextContainer")).''; } else { print ''.img_next($langs->trans("NextContainer")).''; } print ''; - $websitepage = new WebSitePage($db); - if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) { - $websitepage->fetch($pageid); - } - if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite') { $disabled = ''; if (empty($user->rights->website->write)) { @@ -3153,15 +3190,15 @@ if (!GETPOST('hide_websitemenu')) { print ''; - print '   '; - - //print ''; + // Edit web page properties print ''.dol_escape_htmltag($langs->trans("EditPageMeta")).''; - //print ''; + // Edit HTML content print ''.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).''; print ''; + + // Switch include dynamic content / edit inline print ''."\n"; print '
'; @@ -3522,13 +3559,16 @@ if ($action == 'editcss') { print ''; // Status of web site - print ''."\n"; - print ''; - print $langs->trans('Status'); - print ''; - print ajax_object_onoff($object, 'status', 'status', 'Enabled', 'Disabled'); - //print dol_print_date($pagedatecreation, 'dayhour'); - print ''; + if ($action != 'createcontainer') { + if (empty($conf->use_javascript_ajax)) { + print ''."\n"; + print ''; + print $langs->trans('Status'); + print ''; + print $form->selectyesno('status', $object->status); + print ''; + } + } // Main language print ''; @@ -3954,13 +3994,14 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties } if ($action != 'createcontainer') { - print ''."\n"; - print ''; - print $langs->trans('Status'); - print ''; - print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled'); - //print dol_print_date($pagedatecreation, 'dayhour'); - print ''; + if (empty($conf->use_javascript_ajax)) { + print ''."\n"; + print ''; + print $langs->trans('Status'); + print ''; + print $form->selectyesno('status', $objectpage->status); + print ''; + } } // Type of container @@ -3971,6 +4012,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1); print ''; + // Example/templates of page if ($action == 'createcontainer') { print ''; print $langs->trans('WEBSITE_PAGE_EXAMPLE'); From 7e8073735848513d7d9a9be133ee78f9882da3ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 00:57:50 +0200 Subject: [PATCH 0849/1289] css --- htdocs/compta/bank/various_payment/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 3bb6435be0d..15cc3faf7bc 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -405,7 +405,7 @@ if ($action == 'create') { // Amount print ''; print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; - print ''; + print ''; print ''; // Bank From fca09f7a1a3677919bacc8b8538f112395b4ace2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 01:08:22 +0200 Subject: [PATCH 0850/1289] Debug v17 --- htdocs/admin/bank_extrafields.php | 9 ++++++--- htdocs/admin/bankline_extrafields.php | 6 ++++-- htdocs/core/lib/bank.lib.php | 4 ++-- htdocs/langs/en_US/banks.lang | 1 - 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 3626eec4455..d01ac5a93e9 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -65,18 +65,21 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv("Bank"); +$help_url = ''; +$page_name = "BankSetupModule"; llxHeader('', $langs->trans("BankSetupModule"), $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); -print dol_get_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"), -1, 'account'); +print dol_get_fiche_head($head, 'attributes', $langs->trans($page_name), -1, 'account'); + +$textobject = $langs->transnoentitiesnoconv("Bank"); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/bankline_extrafields.php b/htdocs/admin/bankline_extrafields.php index 06f1267343a..7e451275f8d 100644 --- a/htdocs/admin/bankline_extrafields.php +++ b/htdocs/admin/bankline_extrafields.php @@ -22,7 +22,7 @@ */ /** - * \file admin/bankline_extrafields.php + * \file htdocs/admin/bankline_extrafields.php * \ingroup bank * \brief Page to setup extra fields of bankline */ @@ -41,7 +41,7 @@ $form = new Form($db); // List of supported format $tmptype2label = ExtraFields::$type2label; -$type2label = []; +$type2label = array(); foreach ($tmptype2label as $key => $val) { $type2label[$key] = $langs->transnoentitiesnoconv($val); } @@ -80,6 +80,8 @@ $head = bank_admin_prepare_head(null); print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account'); +$textobject = $langs->transnoentitiesnoconv("BankTransaction"); + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; print dol_get_fiche_end(); diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 1792de89a60..8920808766a 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -153,12 +153,12 @@ function bank_admin_prepare_head($object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin'); $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php'; - $head[$h][1] = $langs->trans("ExtraFields"); + $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')'; $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; - $head[$h][1] = $langs->trans("BanklineExtraFields"); + $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')'; $head[$h][2] = 'bankline_extrafields'; $h++; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 71a80406ae4..10ba859e71f 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -185,4 +185,3 @@ AlreadyOneBankAccount=Already one bank account defined SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA transfer: 'Payment Type' at 'Credit Transfer' level SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=When generatin a SEPA XML file for Credit transfers, the section "PaymentTypeInformation" can now be placed inside the "CreditTransferTransactionInformation" section (instead of "Payment" section). We strongly recommend to keep this unchecked to place PaymentTypeInformation at Payment level, as all banks will not necessarily accept it at CreditTransferTransactionInformation level. Contact your bank before placing PaymentTypeInformation at CreditTransferTransactionInformation level. ToCreateRelatedRecordIntoBank=To create missing related bank record -BanklineExtraFields=Bank Line Extrafields From 69c5f5df207f8a7ff01f5c635a3c0d0e6afff580 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 04:23:25 +0200 Subject: [PATCH 0851/1289] Add language de_LU --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 4e4b2cfafe7..78378c6c5d3 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -23,6 +23,7 @@ Language_da_DK=Danish Language_de_DE=German Language_de_AT=German (Austria) Language_de_CH=German (Switzerland) +Language_de_LU=German (Luxembourg) Language_el_GR=Greek Language_el_CY=Greek (Cyprus) Language_en_AE=English (United Arab Emirates) From 96117ec52b7080013020adf44b7b4fe234823f06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 10:01:27 +0200 Subject: [PATCH 0852/1289] Fix no need to enter creation date when creation job application --- htdocs/langs/en_US/recruitment.lang | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang index 1f80ecf1082..686722a48c5 100644 --- a/htdocs/langs/en_US/recruitment.lang +++ b/htdocs/langs/en_US/recruitment.lang @@ -66,7 +66,7 @@ ContractRefused=Contract refused RecruitmentCandidature=Application JobPositions=Job positions RecruitmentCandidatures=Applications -InterviewToDo=Interview to do +InterviewToDo=Contacts to follow AnswerCandidature=Application answer YourCandidature=Your application YourCandidatureAnswerMessage=Thanks you for your application.
... diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 5aab9d1b391..2ece5dbe217 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -127,7 +127,7 @@ class RecruitmentCandidature extends CommonObject 'remuneration_requested' => array('type'=>'integer', 'label'=>'RequestedRemuneration', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1,), 'remuneration_proposed' => array('type'=>'integer', 'label'=>'ProposedRemuneration', 'enabled'=>'1', 'position'=>81, 'notnull'=>0, 'visible'=>-1,), 'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>300, 'notnull'=>0, 'visible'=>3, 'cssview'=>'wordbreak'), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>1, 'csslist'=>'nowraponall'), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-4, 'csslist'=>'nowraponall'), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2, 'csslist'=>'nowraponall'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), From 221b2dc2882ffdea666ca7850dc9a372dbecf9a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 10:46:46 +0200 Subject: [PATCH 0853/1289] Standardize code --- htdocs/bom/bom_card.php | 9 +++------ htdocs/modulebuilder/template/myobject_card.php | 9 ++++++--- htdocs/mrp/mo_card.php | 10 +++------- htdocs/product/inventory/card.php | 15 +++++---------- .../stock/stocktransfer/stocktransfer_card.php | 14 ++++---------- .../recruitment/recruitmentcandidature_card.php | 12 ++++-------- .../recruitment/recruitmentjobposition_card.php | 10 +++------- htdocs/workstation/workstation_card.php | 13 ++++--------- 8 files changed, 32 insertions(+), 60 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 09d2b2bcb9d..926797d1f07 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -704,7 +704,7 @@ if (empty($reshook)) { // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd); } // Close / Cancel @@ -726,11 +726,8 @@ if (empty($reshook)) { } */ - if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print '
'."\n"; } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 16a471ac51d..d7d91414788 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -535,7 +535,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + if ($permissiontoadd) { + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + } /* if ($permissiontoadd) { @@ -554,8 +556,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + // Delete + $params = array(); + print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params); } print '
'."\n"; } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index fde5811547a..4142693b172 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -678,7 +678,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=mo', 'clone', $permissiontoadd); } // Cancel - Reopen @@ -703,12 +703,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 6e1bb1e8a2e..fb9803dd23b 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -417,17 +417,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - /*if ($permissiontoadd) - { - print ''.$langs->trans("ToClone").''."\n"; - }*/ - - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; + if ($permissiontoadd) { + //print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=inventory', 'clone', $permissiontoadd); } + + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index ce8b045a6cd..54384ae0b3f 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -84,7 +84,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $permissiontoread = $user->rights->stocktransfer->stocktransfer->read; $permissiontoadd = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissionnote = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_setnotes.inc.php -$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset($object->status) && $object->status < $object::STATUS_TRANSFERED); $permissiondellink = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $object->entity : 1]; @@ -964,7 +964,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=stocktransfer', 'clone', $permissiontoadd); } /* @@ -992,14 +992,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($object->status < $object::STATUS_TRANSFERED && $permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; - } - /*else - { - print ''.$langs->trans('Delete').''."\n"; - }*/ + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index b5b32fc26db..4226e016e73 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -526,7 +526,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Back to draft if ($object->status == $object::STATUS_VALIDATED) { if ($permissiontoadd) { - print ''.$langs->trans("SetToDraft").''; + print ''.$langs->trans("SetToDraft").''; } } @@ -565,7 +565,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentcandidature', 'clone', $permissiontoadd); } // Button to convert into a user @@ -592,12 +592,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index a23888fd8a9..88424f1b06d 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -435,7 +435,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentjobposition', 'clone', $permissiontoadd); } /* @@ -452,12 +452,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 280478c2977..87ee470dce7 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -451,10 +451,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=workstation', 'clone', $permissiontoadd); } - + // Disable / Enable if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { print ''.$langs->trans("Disable").''."\n"; @@ -463,13 +463,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - - // Delete (need delete permission, or if draft, just need create/modify permission) - if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''."\n"; } From 460ecddaca67ea978a9db76477046bcea3a85a56 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 10 Oct 2022 10:49:19 +0200 Subject: [PATCH 0854/1289] update code towards php8 compliance --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 50071b029e0..e0dff278f96 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -871,7 +871,7 @@ class pdf_einstein extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank From 1d7b6a084dbd8e20a48563cd9cae0dcd9a282363 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 10 Oct 2022 11:00:54 +0200 Subject: [PATCH 0855/1289] update code towards php8 compliance --- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index d1683f91ee7..131e159196b 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1088,7 +1088,7 @@ class pdf_eratosthene extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4ce7b3b3aa5..3d7da995e6f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1134,10 +1134,10 @@ class pdf_crabe extends ModelePDFFactures // Check a payment mode is defined if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) { + && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1247,7 +1247,7 @@ class pdf_crabe extends ModelePDFFactures // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index e8269039aa8..da278cb45ac 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1242,10 +1242,10 @@ class pdf_sponge extends ModelePDFFactures // Check a payment mode is defined if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) { + && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1358,7 +1358,7 @@ class pdf_sponge extends ModelePDFFactures // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank From 731ff10bedd4ceeec6fc76397db4cf0665e3b964 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 10 Oct 2022 11:03:54 +0200 Subject: [PATCH 0856/1289] update code towards php8 compliance --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- .../modules/stocktransfer/doc/pdf_eagle_proforma.modules.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3d507f816dc..231d8c1ddff 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1053,7 +1053,7 @@ class pdf_azur extends ModelePDFPropales // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if (!empty($object->fk_bank)) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 0da947cdd95..9bffe9009fb 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1172,7 +1172,7 @@ class pdf_cyan extends ModelePDFPropales // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 381710e2697..ef73d526ed6 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -978,7 +978,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if (!empty($object->fk_bank)) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank $account = new Account($this->db); From 5a1716f62569b5fdedbb7d222def655d0bcf2099 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 10 Oct 2022 11:05:09 +0200 Subject: [PATCH 0857/1289] update code towards php8 compliance --- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5ed82f597fb..fe439ea0790 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -872,7 +872,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_bank) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_bank); $account = new Account($this->db); $account->fetch($bankid); From 1aa2427fd20331bce6f5fbfcbf6a104ba7d10e96 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 10 Oct 2022 11:26:20 +0200 Subject: [PATCH 0858/1289] Fix: Not load project title when sending email from project --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dec6565be80..479b8b30977 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -17,6 +17,7 @@ * Copyright (C) 2019 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2022 Ferran Marcet * * 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 @@ -7110,6 +7111,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__PROJECT_REF__'] = (is_object($object->projet) ? $object->projet->ref : ''); $substitutionarray['__PROJECT_NAME__'] = (is_object($object->projet) ? $object->projet->title : ''); } + if (is_object($object) && $object->element == 'project') { + $substitutionarray['__PROJECT_NAME__'] = $object->title; + } if (is_object($object) && $object->element == 'shipping') { $substitutionarray['__SHIPPINGTRACKNUM__'] = $object->tracking_number; From ae4f8b23d5945adbbaddf77d7dc71620838a3a88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 11:39:50 +0200 Subject: [PATCH 0859/1289] Standardize code for action buttons Delete --- htdocs/accountancy/admin/card.php | 8 +++----- htdocs/accountancy/admin/fiscalyear_card.php | 2 +- .../default/tpl/adherentcard_view.tpl.php | 2 +- htdocs/comm/propal/card.php | 5 +---- htdocs/commande/card.php | 2 +- htdocs/compta/deplacement/card.php | 7 ++----- htdocs/compta/facture/card-rec.php | 6 ++---- htdocs/compta/facture/card.php | 3 +-- htdocs/compta/paiement/card.php | 8 +------- htdocs/compta/paiement/cheque/card.php | 3 ++- htdocs/compta/payment_sc/card.php | 4 ++-- htdocs/compta/payment_vat/card.php | 4 ++-- htdocs/contact/card.php | 2 +- htdocs/contrat/card.php | 12 +++--------- htdocs/don/payment/card.php | 4 ++-- htdocs/ecm/dir_add_card.php | 9 ++++----- htdocs/ecm/dir_card.php | 17 ++--------------- htdocs/ecm/file_card.php | 13 +++---------- htdocs/expensereport/payment/card.php | 5 +++-- htdocs/fichinter/card-rec.php | 8 +++----- htdocs/fichinter/card.php | 6 ++---- htdocs/fourn/facture/card-rec.php | 6 ++---- htdocs/fourn/paiement/card.php | 4 ++-- htdocs/hrm/establishment/card.php | 7 ++++++- htdocs/loan/payment/card.php | 4 ++-- htdocs/opensurvey/card.php | 19 +++++++++++-------- htdocs/product/stock/productlot_card.php | 5 +---- htdocs/projet/card.php | 2 +- htdocs/projet/tasks/task.php | 9 +++++---- htdocs/resource/card.php | 9 ++------- htdocs/salaries/payment_salary/card.php | 4 ++-- htdocs/societe/price.php | 2 +- htdocs/supplier_proposal/card.php | 5 +---- htdocs/webhook/target_card.php | 2 +- htdocs/website/websiteaccount_card.php | 15 +++++++++------ 35 files changed, 88 insertions(+), 135 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 36b9f3a8b93..e70bc39bfd0 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -426,11 +426,9 @@ if ($action == 'create') { print ''.$langs->trans('Modify').''; } - if ($user->hasRight('accounting', 'chartofaccount')) { - print 'id.'">'.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } + // Delete + $permissiontodelete = $user->hasRight('accounting', 'chartofaccount'); + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); print ''; } diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 89ed7b538ba..38330a37e13 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -305,7 +305,7 @@ if ($action == 'create') { print ''.$langs->trans('Modify').''; - // print '' . $langs->trans('Delete') . ''; + //print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); print ''; } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 4b0eed154c0..14da758457f 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -133,7 +133,7 @@ if (empty($user->socid)) { } if ($user->rights->adherent->supprimer) { - echo ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas, 'delete', $user->rights->adherent->supprimer); } echo '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 76cc9b23f27..f835ae3ae29 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2933,10 +2933,7 @@ if ($action == 'create') { } // Delete - if ($usercandelete) { - print ''.$langs->trans('Delete').''; - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete); } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 9428f76dd8e..2afc01914e0 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2899,7 +2899,7 @@ if ($action == 'create' && $usercancreate) { // Delete order if ($usercandelete) { if ($numshipping == 0) { - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index f8e5f3ba03b..e7929a12697 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -492,11 +492,8 @@ if ($action == 'create') { } } - if ($user->rights->deplacement->supprimer) { - print ''.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } + $permissiontodelete = $user->rights->deplacement->supprimer; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); print ''; } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 33b85f707e9..2a15c74c948 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1677,10 +1677,8 @@ if ($action == 'create') { } } - //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) - if ($user->rights->facture->supprimer) { - print ''; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->supprimer); print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b5e756ebb19..3e3ada6e8cf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5744,8 +5744,7 @@ if ($action == 'create') { } print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params); } else { - $params['attr']['title'] = $langs->trans('NotAllowed'); - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false, $params); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false); } } print ''; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 89ee368b7d5..58a27c94974 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -520,13 +520,7 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { } if ($user->socid == 0 && $action == '') { - if ($user->rights->facture->paiement) { - if (!$disable_delete) { - print ''.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete); } print ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 7b3eaceab3a..f28ebf2ebcf 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -82,6 +82,7 @@ $usercanread = $user->rights->banque->cheque; $usercancreate = $user->rights->banque->cheque; $usercandelete = $user->rights->banque->cheque; +$permissiontodelete = $user->rights->banque->cheque; /* @@ -750,7 +751,7 @@ if ($user->socid == 0 && !empty($object->id) && $object->statut == 0 && $user->r } if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print ''; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 1d93075bc5b..39bac75ba0c 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -253,9 +253,9 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) if ($action == '') { if ($user->rights->tax->charges->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } } diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 8beeaa1f229..6089f9dbcb5 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -308,9 +308,9 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) if ($action == '') { if ($user->rights->tax->charges->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("CantRemovePaymentVATPaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 11aebc8fc29..fbe8b4d0c04 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1579,7 +1579,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Delete if ($user->rights->societe->contact->supprimer) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($backtopage ? '&backtopage='.urlencode($backtopage) : ''), 'delete', $user->rights->societe->contact->supprimer); } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 93d33565143..0b8ec8d1ad6 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -97,6 +97,7 @@ $extralabelslines = $extrafields->fetch_name_optionals_label($object->table_elem $permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php +$permissiontodelete = ($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer; $error = 0; @@ -2172,15 +2173,8 @@ if ($action == 'create') { print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', true, $params); } - // On peut supprimer entite si - // - Droit de creer + mode brouillon (erreur creation) - // - Droit de supprimer - if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) { - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', true, $params); - } else { - $params['attr']['title'] = $langs->trans("NotAllowed"); - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', false, $params); - } + // Delete + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete, $params); } print ""; diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index f5507e5e6c7..19f40bc984e 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -214,9 +214,9 @@ print '
'; if (empty($action)) { if ($user->rights->don->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1); } } } diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 01a1cfb63a9..3f20188db56 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -283,11 +283,10 @@ if (empty($action) || $action == 'delete_section') { // Actions buttons print '
'; - if ($user->rights->ecm->setup) { - print ''.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } + + // Delete + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', $user->rights->ecm->setup); + print '
'; } diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index c36cebfc80c..42607aa0dab 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -464,21 +464,8 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') { print ''.$langs->trans('ECMAddSection').''; } - //if (count($filearrayall) == 0) - //{ - if ($permtoadd) { - print ''.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } - /*} - else - { - if (count($filearray) > 0) - print ''.$langs->trans('Delete').''; - else - print ''.$langs->trans('Delete').''; - }*/ + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($module ? '&module='.urlencode($module) : '').'§ion='.urlencode($section).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), '', $permtoadd); + print '
'; } diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 1b572e44eb8..8202335fbc3 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -424,16 +424,9 @@ if ($action != 'edit') { if ($user->rights->ecm->setup) { print ''.$langs->trans('Edit').''; } - /* - if ($user->rights->ecm->setup) - { - print ''.$langs->trans('Delete').''; - } - else - { - print ''.$langs->trans('Delete').''; - } - */ + + //print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ecm->setup); + print ''; } diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 316dccd91d8..db6c21e202f 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -238,12 +238,13 @@ if ($resql) { */ print '
'; +// Delete if ($action == '') { if ($user->rights->expensereport->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($title_button, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 6c07ec6837d..2f82b16e1ad 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -741,11 +741,9 @@ if ($action == 'create') { print $langs->trans("AddIntervention").'
'; } - if ($user->rights->ficheinter->supprimer) { - print ''; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->ficheinter->supprimer); + print ''; } else { print $langs->trans("ErrorRecordNotFound"); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 8b3868bf195..cef3f737c53 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -104,6 +104,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php +$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer); /* @@ -1688,10 +1689,7 @@ if ($action == 'create') { } // Delete - if (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) { - print ''; - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } } } diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 71ba4f6928a..ead5a5f8ea8 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1621,10 +1621,8 @@ if ($action == 'create') { } } - //if ($object->statut == Facture::STATUS_DRAFT && ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer)) - if (($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer)) { - print ''; - } + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteinvoice&token='.newToken(), 'delete', ($user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer)); print ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index c7c1297e0e8..a11cf769204 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -374,9 +374,9 @@ if ($result > 0) { if ($user->socid == 0 && $action == '') { if ($user->rights->fournisseur->facture->supprimer) { if ($allow_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($title_button, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } } diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index f1bddce44e4..8e00473bca2 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -420,8 +420,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Action bar */ print '
'; + + // Modify print ''.$langs->trans('Modify').''; - print ''.$langs->trans('Delete').''; + + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); + print '
'; } diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 6c302feddac..309e0d99f4a 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -223,9 +223,9 @@ print '
'; if (empty($action) && !empty($user->rights->loan->delete)) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 2fa2f6d9f31..b243b8c8342 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -61,6 +61,10 @@ $hookmanager->initHooks(array('surveycard', 'globalcard')); $expiredate = dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear')); +$permissiontoread = $user->rights->opensurvey->read; +$permissiontoadd = $user->rights->opensurvey->write; +// permission delete doesn't exists +$permissiontodelete = $user->rights->opensurvey->write; /* @@ -364,26 +368,25 @@ print ''."\n"; -/* - * Action bar - */ +// Action bar + print '
'; if ($action != 'edit' && $user->rights->opensurvey->write) { - //Modify button + // Modify button print ''.$langs->trans("Modify").''; if ($object->status == Opensurveysondage::STATUS_VALIDATED) { - //Close button + // Close button print ''.$langs->trans("Close").''; } if ($object->status == Opensurveysondage::STATUS_CLOSED) { - //Opened button + // Re-Open print ''.$langs->trans("ReOpen").''; } - //Delete button - print ''.$langs->trans('Delete').''; + // Delete + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?suppressionsondage=1&id='.urlencode($numsondage).'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } print '
'; diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 5219897ed61..acf2f526773 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -540,10 +540,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; } - if ($user->rights->stock->supprimer) - { - print ''."\n"; - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->stock->supprimer); */ } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index a308476ae50..17d5c042389 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1401,7 +1401,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Delete if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) { - print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); + print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); } else { print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index ef00a85a0d4..77cd9f09c9e 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -674,14 +674,15 @@ if ($id > 0 || !empty($ref)) { } // Delete - if ($user->rights->projet->supprimer) { + $permissiontodelete = $user->hasRight('projet', 'supprimer'); + if ($permissiontodelete) { if (!$object->hasChildren() && !$object->hasTimeSpent()) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', $permissiontodelete); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("TaskHasChild"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', 0); } } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&withproject='.((int) $withproject), 'delete', $permissiontodelete); } print '
'; diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index cf4b4b8e110..1816528b854 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -63,7 +63,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $result = restrictedArea($user, 'resource', $object->id, 'resource'); $permissiontoadd = $user->rights->resource->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php - +$permissiontodelete = $user->rights->resource->delete; /* @@ -349,12 +349,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) { } } if ($action != "delete" && $action != "create" && $action != "edit") { - // Delete resource - if ($user->rights->resource->delete) { - print '
'; - print ''.$langs->trans('Delete').''; - print '
'; - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } } print ''; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 2d295a23131..c9f0a151901 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -251,9 +251,9 @@ print '
'; if ($action == '') { if ($user->rights->salaries->delete) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 1); } else { - print ''.$langs->trans('Delete').''; + print dolGetButtonAction($langs->trans("CantRemovePaymentSalaryPaid"), $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', 0); } } } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a75a194a0e8..b4e60cf0051 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -158,7 +158,7 @@ if (empty($reshook)) { if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'mesgs'); } else { - setEventMessages($langs->trans('Delete'), null, 'errors'); + setEventMessages($langs->trans('RecordDeleted'), null, 'errors'); } $action = ''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 49f0fc408ce..76c4784b013 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -2003,10 +2003,7 @@ if ($action == 'create') { } // Delete - if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) { - print ''; - } + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete); } } diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index f7536cc15b0..35e18a9cdbc 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -501,7 +501,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); } print '
'."\n"; } diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 39e6e10e3d7..a9fabffba3c 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -63,19 +63,22 @@ if (empty($action) && empty($id) && empty($ref)) { $action = 'view'; } +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'website', $id); +if (empty($user->rights->websiteaccount->read)) { + accessforbidden('NotAllowed'); +} // Permissions $permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php - -// Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - +$permissiontodelete = $user->rights->websiteaccount->delete; /* @@ -320,8 +323,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->website->delete) { - print ''."\n"; + if ($permissiontodelete) { + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); } } print ''."\n"; From d9f1435cea9e9f9aa5c5c29b72d9a4156d18d416 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 12:05:03 +0200 Subject: [PATCH 0860/1289] Fix phpunits --- test/phpunit/CodingPhpTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 6af80a304ae..e0f36279437 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -178,6 +178,9 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase if (preg_match('/\/htdocs\/includes\//', $file['fullname'])) { continue; } + if (preg_match('/\/htdocs\/install\/doctemplates\/websites\//', $file['fullname'])) { + continue; + } if (preg_match('/\/htdocs\/custom\//', $file['fullname'])) { continue; } From a8dd29de85aa3c82536cf4eb7f605a635527d959 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 10 Oct 2022 14:10:02 +0200 Subject: [PATCH 0861/1289] review --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 685059d2e37..fead4e4f29d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5155,11 +5155,11 @@ class Facture extends CommonInvoice if (!empty($recipient->email)) { $to = $recipient->email; } else { - $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->thirdparty->id.". No email defined for user."; + $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user."; $error++; } } else { - $errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->thirdparty->id; + $errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid; $error++; } From b6dbdd675795eb7ff52aff2cfb4a5113554abeca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 14:23:02 +0200 Subject: [PATCH 0862/1289] Work on php 8.1 compatibility and adodb removal --- htdocs/bookmarks/bookmarks.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 90 +++++++++++++++++--- htdocs/includes/adodbtime/adodb-time.inc.php | 6 +- test/phpunit/DateLibTest.php | 6 ++ 4 files changed, 89 insertions(+), 15 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 797bffa187a..d5258ba26f1 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -60,7 +60,7 @@ function printDropdownBookmarksList() if ($sortorder) { $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder); } - if (is_array($_POST)) { + if (!empty($_POST) && is_array($_POST)) { foreach ($_POST as $key => $val) { if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var)) && $val != '' diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d771c75ba48..61871f8b891 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2535,8 +2535,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = if ($tzoutput == 'tzserver') { $to_gmt = false; $offsettzstring = @date_default_timezone_get(); // Example 'Europe/Berlin' or 'Indian/Reunion' - $offsettz = 0; // Timezone offset with server timezone, so 0 - $offsetdst = 0; // Dst offset with server timezone, so 0 + $offsettz = 0; // Timezone offset with server timezone (because to_gmt is false), so 0 + $offsetdst = 0; // Dst offset with server timezone (because to_gmt is false), so 0 } elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') { $to_gmt = true; $offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' @@ -2546,8 +2546,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $user_dt = new DateTime(); $user_dt->setTimezone($user_date_tz); $user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time); - $offsettz = $user_dt->getOffset(); - } else { // old method (The 'tzuser' was processed like the 'tzuserrel') + $offsettz = $user_dt->getOffset(); // should include dst ? + } else { // with old method (The 'tzuser' was processed like the 'tzuserrel') $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore } @@ -2628,6 +2628,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $format = str_replace('%A', '__A__', $format); } + $noadodb = getDolGlobalInt('MAIN_NO_ADODB_FOR_DATE'); + //$noadodb = 1; // To force test // Analyze date $reg = array(); @@ -2647,23 +2649,76 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $ssec = (!empty($reg[6]) ? $reg[6] : ''); $time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); - $ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt); + if ($noadodb) { + if ($to_gmt) { + $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC + } else { + $tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server + } + $dtts = new DateTime(); + $dtts->setTimestamp($time); + $dtts->setTimezone($tzo); + $newformat = str_replace( + array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + $format); + $ret = $dtts->format($newformat); + $ret = str_replace( + array('__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('T', 'Z', '__a__', '__A__', '__b__', '__B__'), + $ret); + } else { + $ret = adodb_strftime($format, $time + $offsettz + $offsetdst, $to_gmt); + } } else { // Date is a timestamps if ($time < 100000000000) { // Protection against bad date values - $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. + $timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring. - $ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + if ($noadodb) { + if ($to_gmt) { + $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC + } else { + $tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server + } + $dtts = new DateTime(); + $dtts->setTimestamp($timetouse); + $dtts->setTimezone($tzo); + $newformat = str_replace( + array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + $format); + $ret = $dtts->format($newformat); + $ret = str_replace( + array('__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('T', 'Z', '__a__', '__A__', '__b__', '__B__'), + $ret); + } else { + $ret = adodb_strftime($format, $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + } + //var_dump($ret);exit; } else { $ret = 'Bad value '.$time.' for date'; } } if (preg_match('/__b__/i', $format)) { - $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. + $timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring. - // Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs. - $month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + if ($noadodb) { + if ($to_gmt) { + $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC + } else { + $tzo = new DateTimeZone(date_default_timezone_get()); // when to_gmt is false, base for offsettz and offsetdst (so timetouse) is PHP server + } + $dtts = new DateTime(); + $dtts->setTimestamp($timetouse); + $dtts->setTimezone($tzo); + $month = $dtts->format("m"); + } else { + // After this ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs. + $month = adodb_strftime('%m', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + } $month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. if ($encodetooutput) { $monthtext = $outputlangs->transnoentities('Month'.$month); @@ -2682,8 +2737,21 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = //print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring"; $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. - $w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + if ($noadodb) { + if ($to_gmt) { + $tzo = new DateTimeZone('UTC'); + } else { + $tzo = new DateTimeZone(date_default_timezone_get()); + } + $dtts = new DateTime(); + $dtts->setTimestamp($timetouse); + $dtts->setTimezone($tzo); + $w = $dtts->format("w"); + } else { + $w = adodb_strftime('%w', $timetouse, $to_gmt); // If to_gmt = false then adodb_strftime use TZ of server + } $dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w); + $ret = str_replace('__A__', $dayweek, $ret); $ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret); } diff --git a/htdocs/includes/adodbtime/adodb-time.inc.php b/htdocs/includes/adodbtime/adodb-time.inc.php index 030196db275..1dfa97929a2 100644 --- a/htdocs/includes/adodbtime/adodb-time.inc.php +++ b/htdocs/includes/adodbtime/adodb-time.inc.php @@ -1,8 +1,8 @@ savlangs; $db=$this->savdb; + // Check %Y-%m-%d %H:%M:%S format + $result=dol_print_date('1970-01-01', '%Y-%m-%d %H:%M:%S', true); // A case for compatibility check + print __METHOD__." result=".$result."\n"; + $this->assertEquals('1970-01-01 00:00:00', $result); + + // Check %Y-%m-%d %H:%M:%S format $result=dol_print_date(0, '%Y-%m-%d %H:%M:%S', true); print __METHOD__." result=".$result."\n"; From f4dc43914d53a483d1df41a638c1244d61d44f1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 14:46:29 +0200 Subject: [PATCH 0863/1289] Remove php8.1 warnings --- htdocs/conf/conf.php.example | 1 - htdocs/core/lib/functions.lib.php | 15 +++++++-------- .../debugbar/src/DebugBar/JavascriptRenderer.php | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 05c29459ee2..1cc028ff137 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -409,7 +409,6 @@ $dolibarr_cron_allow_cli='0'; //################################# // Value to overwrite path to use shared libraries instead of embedded one -//$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$dolibarr_lib_TCPDF_PATH='/usr/share/php/tcpdf'; //$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 61871f8b891..d145358d62f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Christophe Combelles @@ -2628,8 +2628,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $format = str_replace('%A', '__A__', $format); } - $noadodb = getDolGlobalInt('MAIN_NO_ADODB_FOR_DATE'); - //$noadodb = 1; // To force test + $useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0); + //$useadodb = 1; // To switch to adodb // Analyze date $reg = array(); @@ -2649,7 +2649,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $ssec = (!empty($reg[6]) ? $reg[6] : ''); $time = dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); - if ($noadodb) { + if (empty($useadodb)) { if ($to_gmt) { $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC } else { @@ -2675,7 +2675,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = if ($time < 100000000000) { // Protection against bad date values $timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring. - if ($noadodb) { + if (empty($useadodb)) { if ($to_gmt) { $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC } else { @@ -2705,7 +2705,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = if (preg_match('/__b__/i', $format)) { $timetouse = $time + $offsettz + $offsetdst; // TODO We could be able to disable use of offsettz and offsetdst to use only offsettzstring. - if ($noadodb) { + if (empty($useadodb)) { if ($to_gmt) { $tzo = new DateTimeZone('UTC'); // when to_gmt is true, base for offsettz and offsetdst (so timetouse) is UTC } else { @@ -2737,7 +2737,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = //print "time=$time offsettz=$offsettz offsetdst=$offsetdst offsettzstring=$offsettzstring"; $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. - if ($noadodb) { + if (empty($useadodb)) { if ($to_gmt) { $tzo = new DateTimeZone('UTC'); } else { @@ -2782,7 +2782,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = */ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') { - //$datetimeobj = new DateTime('@'.$timestamp); $datetimeobj = new DateTime(); $datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone if ($forcetimezone) { diff --git a/htdocs/includes/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php b/htdocs/includes/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php index 16689992c4c..7f7ed84e0dd 100644 --- a/htdocs/includes/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php +++ b/htdocs/includes/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php @@ -762,7 +762,7 @@ class JavascriptRenderer return $uris; } - if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) { + if ($uri && (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri))) { return $uri; } return rtrim($root, '/') . "/$uri"; @@ -778,7 +778,7 @@ class JavascriptRenderer protected function filterAssetArray($array, $type = null) { $types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head'); - $typeIndex = array_search(strtolower($type), $types); + $typeIndex = is_null($type) ? false : array_search(strtolower($type), $types); return $typeIndex !== false ? $array[$typeIndex] : $array; } From fea1b2ef14a333704bae12c415fc9d51ff0457b7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 10 Oct 2022 15:00:51 +0200 Subject: [PATCH 0864/1289] review --- htdocs/compta/facture/class/facture.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 32798f3724d..42be01bcc13 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5526,7 +5526,7 @@ class Facture extends CommonInvoice $sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1); // Recipient - $to = ''; + $to = array(); $res = $tmpinvoice->fetch_thirdparty(); $recipient = $tmpinvoice->thirdparty; if ($res > 0) { @@ -5534,13 +5534,12 @@ class Facture extends CommonInvoice if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { foreach ($tmparraycontact as $data_email) { if (!empty($data_email['email'])) { - $to = $data_email['email']; - break; + $to[] = $data_email['firstname'] . ' '. $data_email['lastname']. '<'.$data_email['email'].'>'; } } } if (empty($to) && !empty($recipient->email)) { - $to = $recipient->email; + $to[] = $recipient->email; } else { $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user."; $error++; @@ -5557,9 +5556,11 @@ class Facture extends CommonInvoice $error++; } - if (!$error && $to) { + if (!$error && !empty($to)) { $this->db->begin(); + $to = implode(',', $to); + // Errors Recipient $errors_to = $conf->global->MAIN_MAIL_ERRORS_TO; From 26a1825411f0c0a81b1bb7b13f211587679d66c5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 10 Oct 2022 15:54:03 +0200 Subject: [PATCH 0865/1289] review --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 42be01bcc13..69bfb73e867 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5534,7 +5534,7 @@ class Facture extends CommonInvoice if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { foreach ($tmparraycontact as $data_email) { if (!empty($data_email['email'])) { - $to[] = $data_email['firstname'] . ' '. $data_email['lastname']. '<'.$data_email['email'].'>'; + $to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email'); } } } From bc413ee8a91784368816e7f340e58a4070b52cf8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 16:06:19 +0200 Subject: [PATCH 0866/1289] Fix warnings --- htdocs/contact/list.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d165a0a4cc1..572bf85da3f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1222,7 +1222,7 @@ while ($i < min($num, $limit)) { if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { - print ''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''; + print ''.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d145358d62f..bb8e2e3b77b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3256,7 +3256,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli global $conf, $user, $langs, $mysoc, $hookmanager; // Clean phone parameter - $phone = preg_replace("/[\s.-]/", "", trim($phone)); + $phone = is_null($phone) ? '' : preg_replace("/[\s.-]/", "", trim($phone)); if (empty($phone)) { return ''; } diff --git a/htdocs/index.php b/htdocs/index.php index 97b82fb93ba..f9ca18f530a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -558,7 +558,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); - $textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; + $textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil(empty($board->warning_delay) ? 0 : $board->warning_delay) >= 0 ? '+' : '').ceil(empty($board->warning_delay) ? 0 : $board->warning_delay).' '.$langs->trans("days").')'; if ($board->id == 'bank_account') { $textLateTitle .= '
'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).''; From 201b774d6d2f13a52d77f5a0ea00d3a6cd7cf72e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 20:14:51 +0200 Subject: [PATCH 0867/1289] Clean code --- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/compta/facture/list.php | 4 ++-- htdocs/contrat/list.php | 2 +- htdocs/core/actions_massactions.inc.php | 10 ++++++---- htdocs/core/class/stats.class.php | 6 ++++-- htdocs/core/lib/functions.lib.php | 9 +++++++++ htdocs/core/modules/societe/mod_codeclient_monkey.php | 2 +- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/user/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- 21 files changed, 38 insertions(+), 25 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 45f90101adc..5e00c2d2433 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -307,7 +307,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 1d85a982e5d..aa80b4e5426 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -307,7 +307,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $db->num_rows($result); */ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index a5aca966530..4532e49b622 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -573,7 +573,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1d6dbd9f03b..02517537bdf 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -869,9 +869,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { */ /* The fast and low memory method to get and count full list converts the sql into a sql count */ if ($sall || $search_product_category > 0 || $search_user > 0) { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql); } else { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid/', '', $sqlforcount); } $sqlforcount = preg_replace('/GROUP BY.*$/', '', $sqlforcount); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8c24c4e65ee..e8267f85d58 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -376,7 +376,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } } } else { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'contratdet as cd ON c.rowid = cd.fk_contrat/', '', $sqlforcount); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product/', '', $sqlforcount); $sqlforcount = preg_replace('/AND cp.fk_categorie = '.((int) $search_product_category).'/', '', $sqlforcount); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index de586e80e9f..9a2eda2df8e 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -41,6 +41,9 @@ if (empty($objectclass) || empty($uploaddir)) { dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined'); exit; } +if (empty($massaction)) { + $massaction = ''; +} // For backward compatibility if (!empty($permtoread) && empty($permissiontoread)) { @@ -53,14 +56,13 @@ if (!empty($permtodelete) && empty($permissiontodelete)) { $permissiontodelete = $permtodelete; } - // Mass actions. Controls on number of lines checked. $maxformassaction = (empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS) ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); -if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) { +if ($massaction && is_array($toselect) && count($toselect) < 1) { $error++; setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); } -if (!$error && is_array($toselect) && count($toselect) > $maxformassaction) { +if (!$error && isset($toselect) && is_array($toselect) && count($toselect) > $maxformassaction) { setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors'); $error++; } @@ -1564,7 +1566,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday } } -$parameters['toselect'] = $toselect; +$parameters['toselect'] = (empty($toselect) ? array() : $toselect); $parameters['uploaddir'] = $uploaddir; $parameters['massaction'] = $massaction; $parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 63125fffd9f..990bdaf107e 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -103,7 +103,8 @@ abstract class Stats $data[$i][] = $datay[$endyear][($i + $sm) % 12][0]; $year = $startyear; while ($year <= $endyear) { - $data[$i][] = $datay[$year - (1 - ((int) ($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; + // floor(($i + $sm) / 12)) is 0 if we are after the month start $sm and same year, become 1 when we reach january of next year + $data[$i][] = $datay[$year - (1 - floor(($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; $year++; } } @@ -204,7 +205,8 @@ abstract class Stats $data[$i][] = isset($datay[$endyear][($i + $sm) % 12]['label']) ? $datay[$endyear][($i + $sm) % 12]['label'] : $datay[$endyear][($i + $sm) % 12][0]; // set label $year = $startyear; while ($year <= $endyear) { - $data[$i][] = $datay[$year - (1 - ((int) ($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; // set yval for x=i + // floor(($i + $sm) / 12)) is 0 if we are after the month start $sm and same year, become 1 when we reach january of next year + $data[$i][] = $datay[$year - (1 - floor(($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; // set yval for x=i $year++; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bb8e2e3b77b..2a4bbf9f6f3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5753,6 +5753,11 @@ function price2num($amount, $rounding = '', $option = 0) { global $langs, $conf; + // Clean parameters + if (is_null($amount)) { + $amount = ''; + } + // Round PHP function does not allow number like '1,234.56' nor '1.234,56' nor '1 234,56' // Numbers must be '1234.56' // Decimal delimiter for PHP and database SQL requests must be '.' @@ -6784,6 +6789,10 @@ function picto_required() */ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0, $removedoublespaces = 1) { + if (is_null($stringtoclean)) { + return ''; + } + if ($removelinefeed == 2) { $stringtoclean = preg_replace('/]*>(\n|\r)+/ims', '
', $stringtoclean); } diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index a7ae44323a1..19a5309a374 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -151,7 +151,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode } $date = dol_now(); - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m", 'tzuserrel'); if ($max >= (pow(10, 5) - 1)) { $num = $max + 1; // If counter > 99999, we do not format on 5 chars, we take number as it is diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 656b5b263aa..8a8222101ee 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -285,7 +285,7 @@ if ($massaction == 'preapproveleave') { // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( - 'toselect' => $toselect, + 'toselect' => isset($toselect) ? $toselect : array(), 'uploaddir' => isset($uploaddir) ? $uploaddir : null ); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 731442695d2..cbaab666767 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -328,7 +328,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); /* The fast and low memory method to get and count full list converts the sql into a sql count */ - /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 8ab14a190c1..009b7b7de3a 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -378,7 +378,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index bc99655efa3..b2eb15563ed 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -401,7 +401,7 @@ $sql=preg_replace('/,\s*$/','', $sql); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7e34931f9a8..171ee79be9d 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -730,7 +730,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index c15479b1f4f..8981d1cff56 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -315,7 +315,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 34b852574f6..0489d68bffb 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -303,7 +303,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 5b1bee43e56..b2edac8dd4d 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -300,7 +300,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ /* - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); print $sqlforcount; $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 96e22d4d0b7..fbdaff3041a 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -698,7 +698,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { dol_print_error($db); }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index fd4d7f15f9e..c989d6f1c4d 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -452,7 +452,7 @@ $sql .= $hookmanager->resPrint; $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 04f8e5679fd..dfc8fdb3568 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -470,7 +470,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 37f4740b463..5d81bec967f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -328,7 +328,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; From 9660e9f0e08bf88cc9979b9d41fc5055683020a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 23:08:25 +0200 Subject: [PATCH 0868/1289] Fix warning --- htdocs/comm/action/card.php | 4 ++-- htdocs/core/lib/functions.lib.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2c008202348..590d1bafe17 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1865,7 +1865,7 @@ if ($id > 0) { // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; } // Status @@ -1997,7 +1997,7 @@ if ($id > 0) { print ''; // Reminders - if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { + if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { $filteruserid = $user->id; if ($user->rights->agenda->allactions->read) { $filteruserid = 0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a4bbf9f6f3..b45f6f895b3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3828,6 +3828,10 @@ function isValidPhone($phone) */ function dol_strlen($string, $stringencoding = 'UTF-8') { + if (is_null($string)) { + return 0; + } + if (function_exists('mb_strlen')) { return mb_strlen($string, $stringencoding); } else { From 00e7623bb4b6791fcd917a8364a92c23ae3013e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 23:15:06 +0200 Subject: [PATCH 0869/1289] Fix warnings --- htdocs/core/lib/functions.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b45f6f895b3..1b421224761 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7099,6 +7099,10 @@ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false) */ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UTF-8', $removelasteolbr = 1) { + if (is_null($stringtoencode)) { + return ''; + } + $newstring = $stringtoencode; if (dol_textishtml($stringtoencode)) { // Check if text is already HTML or not $newstring = preg_replace('//i', '
', $newstring); // Replace "
" by "
". It's same and avoid pb with FPDF. @@ -7293,6 +7297,10 @@ function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8') */ function dol_textishtml($msg, $option = 0) { + if (is_null($msg)) { + return false; + } + if ($option == 1) { if (preg_match('/ Date: Mon, 10 Oct 2022 23:18:13 +0200 Subject: [PATCH 0870/1289] Warning --- htdocs/core/class/html.formmargin.class.php | 6 +++--- htdocs/public/opensurvey/studs.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 38ec91ff143..61737ab00f3 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -108,7 +108,7 @@ class FormMargin // calcul des marges if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise - if ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '1') { // remise globale considérée comme produit + if (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '1') { // remise globale considérée comme produit $marginInfos['pa_products'] += $pa; $marginInfos['pv_products'] += $pv; $marginInfos['pa_total'] += $pa; @@ -120,7 +120,7 @@ class FormMargin //} //else $marginInfos['margin_on_products'] += $pv - $pa; - } elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '2') { // remise globale considérée comme service + } elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '2') { // remise globale considérée comme service $marginInfos['pa_services'] += $pa; $marginInfos['pv_services'] += $pv; $marginInfos['pa_total'] += $pa; @@ -130,7 +130,7 @@ class FormMargin // $marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa); //else $marginInfos['margin_on_services'] += $pv - $pa; - } elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '3') { // remise globale prise en compte uniqt sur total + } elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '3') { // remise globale prise en compte uniqt sur total $marginInfos['pa_total'] += $pa; $marginInfos['pv_total'] += $pv; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index bd49b6afbe4..f11f8aea918 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -116,9 +116,9 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo if (GETPOST('nom', 'alphanohtml')) { $nouveauchoix = ''; for ($i = 0; $i < $nbcolonnes; $i++) { - if (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '1') { + if (GETPOSTISSET("choix".$i) && GETPOST("choix".$i) == '1') { $nouveauchoix .= "1"; - } elseif (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '2') { + } elseif (GETPOSTISSET("choix".$i) && GETPOST("choix".$i) == '2') { $nouveauchoix .= "2"; } else { $nouveauchoix .= "0"; From 1f051493e1595260c38d2653dd6fd42beb3506a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Oct 2022 23:49:41 +0200 Subject: [PATCH 0871/1289] Clean code: Replace join on category for filter on categ with EXISTS --- htdocs/product/list.php | 35 +++++++++---------- htdocs/societe/list.php | 76 +++++++++++++++++++++++++++-------------- 2 files changed, 67 insertions(+), 44 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3561388709d..6121004fd37 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -439,9 +439,6 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; } -if (!empty($searchCategoryProductList) || !empty($catid)) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang if (getDolGlobalInt('MAIN_MULTILANGS')) { @@ -506,30 +503,32 @@ if ($catid > 0) { if ($catid == -2) { $sql .= " AND cp.fk_categorie IS NULL"; } -$searchCategoryProductSqlList = array(); -if ($searchCategoryProductOperator == 1) { + +// Search for tag/category ($searchCategoryProductList is an array of ID) +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $searchCategoryProductSqlList[] = "cp.fk_categorie = ".$db->escape($searchCategoryProduct); + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); } } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } -} else { - foreach ($searchCategoryProductList as $searchCategoryProduct) { - if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; - } elseif (intval($searchCategoryProduct) > 0) { - $searchCategoryProductSqlList[] = "p.rowid IN (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product WHERE fk_categorie = ".((int) $searchCategoryProduct).")"; + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } - } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } } + if ($fourn_id > 0) { $sql .= " AND pfp.fk_soc = ".((int) $fourn_id); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index fbdaff3041a..92db68c7744 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -478,13 +478,6 @@ $sql .= " region.code_region as region_code, region.nom as region_name"; if ($search_sale && $search_sale != '-1') { $sql .= ", sc.fk_soc, sc.fk_user"; } -// We'll need these fields in order to filter by categ -if ($search_categ_cus && $search_categ_cus != -1) { - $sql .= ", cc.fk_categorie, cc.fk_soc"; -} -if ($search_categ_sup && $search_categ_sup != -1) { - $sql .= ", cs.fk_categorie, cs.fk_soc"; -} // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -505,13 +498,6 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_ty $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_effectif)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region.code_region = state.fk_region)"; -// We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ_cus) && $search_categ_cus != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_sup) && $search_categ_sup != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale == -2) { @@ -540,26 +526,64 @@ if ($search_sale == -2) { } elseif ($search_sale > 0) { $sql .= " AND sc.fk_user = ".((int) $search_sale); } -if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); +$searchCategoryCustomerList = array($search_categ_cus); +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } } -if ($search_categ_sup > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_sup); +$searchCategorySupplierList = array($search_categ_sup); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } -if ($search_categ_cus == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; -} -if ($search_categ_sup == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} - if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } if (strlen($search_cti)) { $sql .= natural_search('s.phone', $search_cti); } - if ($search_id > 0) { $sql .= natural_search("s.rowid", $search_id, 1); } From 5dc48c829484fdd06ca09e6d896688fcf877d1be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 00:01:31 +0200 Subject: [PATCH 0872/1289] NEW Replace join on category (for filter on categ) with EXISTS/NOT --- htdocs/contact/list.php | 99 +++++++++++++++++++++++++++++++---------- htdocs/societe/list.php | 4 +- 2 files changed, 77 insertions(+), 26 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 572bf85da3f..8f4c59bb2f8 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -399,15 +399,6 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_stcommcontact as st ON st.id = p.fk_stcommcontact"; -if (!empty($search_categ) && $search_categ != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cc ON p.rowid = cc.fk_socpeople"; // We need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ -} if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } @@ -437,23 +428,83 @@ if ($search_priv != '0' && $search_priv != '1') { } } -if ($search_categ > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ); +$searchCategoryContactList = $search_categ ? array($search_categ) : array(); +$searchCategoryContactOperator = 0; +// Search for tag/category ($searchCategoryContactList is an array of ID) +if (!empty($searchCategoryContactList)) { + $searchCategoryContactSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryContactList as $searchCategoryContact) { + if (intval($searchCategoryContact) == -2) { + $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople)"; + } elseif (intval($searchCategoryContact) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } + } + if ($listofcategoryid) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryContactOperator == 1) { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryContactSqlList).")"; + } + } else { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryContactSqlList).")"; + } + } } -if ($search_categ == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; +$searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array(); +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } } -if ($search_categ_thirdparty > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_thirdparty); -} -if ($search_categ_thirdparty == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} -if ($search_categ_supplier > 0) { - $sql .= " AND cs2.fk_categorie = ".((int) $search_categ_supplier); -} -if ($search_categ_supplier == -2) { - $sql .= " AND cs2.fk_categorie IS NULL"; +$searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array(); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } if ($sall) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 92db68c7744..f32317163ad 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -526,7 +526,7 @@ if ($search_sale == -2) { } elseif ($search_sale > 0) { $sql .= " AND sc.fk_user = ".((int) $search_sale); } -$searchCategoryCustomerList = array($search_categ_cus); +$searchCategoryCustomerList = $search_categ_cus ? array($search_categ_cus) : array();; $searchCategoryCustomerOperator = 0; // Search for tag/category ($searchCategoryCustomerList is an array of ID) if (!empty($searchCategoryCustomerList)) { @@ -552,7 +552,7 @@ if (!empty($searchCategoryCustomerList)) { } } } -$searchCategorySupplierList = array($search_categ_sup); +$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array(); $searchCategorySupplierOperator = 0; // Search for tag/category ($searchCategorySupplierList is an array of ID) if (!empty($searchCategorySupplierList)) { From 584d8b53f698394c903907ababecc80c79756ecb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 00:22:11 +0200 Subject: [PATCH 0873/1289] FIX filter in member list --- htdocs/adherents/list.php | 103 ++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 4c80627d70e..74373d95eda 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -142,31 +142,31 @@ if ($db->type == 'pgsql') { unset($fieldstosearchall['d.rowid']); } $arrayfields = array( - 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), - 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'd.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), - 'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1), - 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), - 'd.morphy'=>array('label'=>$langs->trans("MemberNature"), 'checked'=>1), - 't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1), - 'd.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1), - 'd.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0), - 'd.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), - 'd.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), - 'd.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>0), - 'd.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0), - 'd.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>0), - 'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - /*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0), - 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/ - 'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500), - 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'd.birth'=>array('label'=>$langs->trans("Birthday"), 'checked'=>0, 'position'=>500), - 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'd.ref'=>array('label'=>"Ref", 'checked'=>1), + 'd.civility'=>array('label'=>"Civility", 'checked'=>0), + 'd.lastname'=>array('label'=>"Lastname", 'checked'=>1), + 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), + 'd.gender'=>array('label'=>"Gender", 'checked'=>0), + 'd.company'=>array('label'=>"Company", 'checked'=>1), + 'd.login'=>array('label'=>"Login", 'checked'=>1), + 'd.morphy'=>array('label'=>"MemberNature", 'checked'=>1), + 't.libelle'=>array('label'=>"Type", 'checked'=>1), + 'd.email'=>array('label'=>"Email", 'checked'=>1), + 'd.address'=>array('label'=>"Address", 'checked'=>0), + 'd.zip'=>array('label'=>"Zip", 'checked'=>0), + 'd.town'=>array('label'=>"Town", 'checked'=>0), + 'd.phone'=>array('label'=>"Phone", 'checked'=>0), + 'd.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), + 'd.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>0), + 'state.nom'=>array('label'=>"State", 'checked'=>0), + 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), + /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), + 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ + 'd.datefin'=>array('label'=>"EndSubscription", 'checked'=>1, 'position'=>500), + 'd.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), + 'd.birth'=>array('label'=>"Birthday", 'checked'=>0, 'position'=>500), + 'd.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'd.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), ); // Extra fields @@ -350,27 +350,43 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; } -if ((!empty($search_categ) && ($search_categ > 0 || $search_categ == -2)) || !empty($catid)) { - // We need this table joined to the select in order to filter by categ - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)"; $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid"; -if ($catid > 0) { - $sql .= " AND cm.fk_categorie = ".((int) $catid); + +if ($catid && empty($search_categ)) { + $search_categ = $catid; } -if ($catid == -2) { - $sql .= " AND cm.fk_categorie IS NULL"; -} -if ($search_categ > 0) { - $sql .= " AND cm.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cm.fk_categorie IS NULL"; + +$searchCategoryContactList = $search_categ ? array($search_categ) : array(); +$searchCategoryContactOperator = 0; +// Search for tag/category ($searchCategoryContactList is an array of ID) +if (!empty($searchCategoryContactList)) { + $searchCategoryContactSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryContactList as $searchCategoryContact) { + if (intval($searchCategoryContact) == -2) { + $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member)"; + } elseif (intval($searchCategoryContact) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } + } + if ($listofcategoryid) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryContactOperator == 1) { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryContactSqlList).")"; + } + } else { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryContactSqlList).")"; + } + } } + $sql .= " AND d.entity IN (".getEntity('adherent').")"; if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); @@ -391,7 +407,7 @@ if ($search_status != '') { // Peut valoir un nombre ou liste de nombre separes par virgules $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; } -if ($search_morphy != '') { +if ($search_morphy != '' && $search_morphy != '-1') { $sql .= natural_search("d.morphy", $search_morphy); } if ($search_ref) { @@ -670,7 +686,7 @@ $moreforfilter = ''; if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1); + $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= '
'; } $parameters = array(); @@ -741,10 +757,11 @@ if (!empty($arrayfields['d.login']['checked'])) { print ''; print ''; } +// Nature if (!empty($arrayfields['d.morphy']['checked'])) { - print ''; + print ''; $arraymorphy = array('mor'=>$langs->trans("Moral"), 'phy'=>$langs->trans("Physical")); - print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1); + print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); print ''; } if (!empty($arrayfields['t.libelle']['checked'])) { From 92d0dff65da2a8bd0df293e0d9cf301c5a75a0a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 02:26:12 +0200 Subject: [PATCH 0874/1289] Clean code --- htdocs/categories/class/categorie.class.php | 2 + htdocs/compta/bank/list.php | 41 +++++++++++++------- htdocs/product/list.php | 16 +++----- htdocs/product/stock/list.php | 35 +++++++++++++---- htdocs/projet/list.php | 37 +++++++++++++----- htdocs/user/list.php | 43 ++++++++++++++------- 6 files changed, 117 insertions(+), 57 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index acdf2e71a32..d9a7eb4b1c7 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1981,6 +1981,7 @@ class Categorie extends CommonObject * @param string $type The category type (e.g Categorie::TYPE_WAREHOUSE) * @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid") * @return string A additional SQL JOIN query + * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN. @TODO Replace with getWhereQuery($type, $searchCategoryList) */ public static function getFilterJoinQuery($type, $rowIdName) { @@ -1998,6 +1999,7 @@ class Categorie extends CommonObject * @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid") * @param Array $searchList A list with the selected categories * @return string A additional SQL SELECT query + * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN */ public static function getFilterSelectQuery($type, $rowIdName, $searchList) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 5f223450ab7..bccad47e2d8 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -59,9 +59,7 @@ $search_number = GETPOST('search_number', 'alpha'); $search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened' $optioncss = GETPOST('optioncss', 'alpha'); -if (isModEnabled('categorie')) { - $search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); -} +$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); $socid = 0; // Security check @@ -162,6 +160,7 @@ if (empty($reshook)) { $search_label = ''; $search_number = ''; $search_status = ''; + $search_category_list = array(); } // Mass actions @@ -197,11 +196,6 @@ $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)"; } - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_ACCOUNT, "b.rowid"); -} - $sql .= " WHERE b.entity IN (".getEntity('bank_account').")"; if ($search_status == 'opened') { $sql .= " AND clos = 0"; @@ -209,11 +203,6 @@ if ($search_status == 'opened') { if ($search_status == 'closed') { $sql .= " AND clos = 1"; } - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_ACCOUNT, "b.rowid", $search_category_list); -} - if ($search_ref != '') { $sql .= natural_search('b.ref', $search_ref); } @@ -223,6 +212,32 @@ if ($search_label != '') { if ($search_number != '') { $sql .= natural_search('b.number', $search_number); } +// Search for tag/category ($searchCategoryBankList is an array of ID) +$searchCategoryBankList = $search_category_list; +$searchCategoryBankOperator = 0; +if (!empty($searchCategoryBankList)) { + $searchCategoryBankSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryBankList as $searchCategoryBank) { + if (intval($searchCategoryBank) == -2) { + $searchCategoryBankSqlList[] = "NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account)"; + } elseif (intval($searchCategoryBank) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank); + } + } + if ($listofcategoryid) { + $searchCategoryBankSqlList[] = " EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryBankOperator == 1) { + if (!empty($searchCategoryBankSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryBankSqlList).")"; + } + } else { + if (!empty($searchCategoryBankSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryBankSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6121004fd37..26f6a3a410c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -77,12 +77,15 @@ if (GETPOSTISSET('formfilteraction')) { $searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT; } $searchCategoryProductList = GETPOST('search_category_product_list', 'array'); +$catid = GETPOST('catid', 'int'); +if (!empty($catid) && empty($searchCategoryProductList)) { + $searchCategoryProductList = array($catid); +} $search_tosell = GETPOST("search_tosell", 'int'); $search_tobuy = GETPOST("search_tobuy", 'int'); $search_country = GETPOST("search_country", 'int'); $search_state = GETPOST("state_id", 'int'); $fourn_id = GETPOST("fourn_id", 'int'); -$catid = GETPOST('catid', 'int'); $search_tobatch = GETPOST("search_tobatch", 'int'); $search_accountancy_code_sell = GETPOST("search_accountancy_code_sell", 'alpha'); $search_accountancy_code_sell_intra = GETPOST("search_accountancy_code_sell_intra", 'alpha'); @@ -296,6 +299,7 @@ if ($search_type == '0') { $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); } + /* * Actions */ @@ -452,7 +456,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units cu ON cu.rowid = p.fk_unit"; } - $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); @@ -497,13 +500,6 @@ if ($search_vatrate) { if (dol_strlen($canvas) > 0) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } -if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $catid); -} -if ($catid == -2) { - $sql .= " AND cp.fk_categorie IS NULL"; -} - // Search for tag/category ($searchCategoryProductList is an array of ID) if (!empty($searchCategoryProductList)) { $searchCategoryProductSqlList = array(); @@ -528,7 +524,6 @@ if (!empty($searchCategoryProductList)) { } } } - if ($fourn_id > 0) { $sql .= " AND pfp.fk_soc = ".((int) $fourn_id); } @@ -692,7 +687,6 @@ if ($resql) { if ($fourn_id > 0) { $param .= "&fourn_id=".urlencode($fourn_id); } - //if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); if ($show_childproducts) { $param .= ($show_childproducts ? "&search_show_childproducts=".urlencode($show_childproducts) : ""); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 496a2720e97..af2bb49b05e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -227,9 +227,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_WAREHOUSE, "t.rowid"); -} if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } @@ -240,12 +237,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk if ($separatedPMP) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as pa ON pa.fk_product = p.rowid AND pa.fk_product = ps.fk_product AND pa.entity = ". (int) $conf->entity; } - $sql .= " WHERE t.entity IN (".getEntity('stock').")"; - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_WAREHOUSE, "t.rowid", $search_category_list); -} foreach ($search as $key => $val) { $class_key = $key; if ($class_key == 'status') { @@ -268,6 +260,33 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// Search for tag/category ($searchCategoryWarehouseList is an array of ID) +$searchCategoryWarehouseList = $search_category_list; +$searchCategoryWarehouseOperator = 0; +if (!empty($searchCategoryWarehouseList)) { + $searchCategoryWarehouseSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryWarehouseList as $searchCategoryWarehouse) { + if (intval($searchCategoryWarehouse) == -2) { + $searchCategoryWarehouseSqlList[] = "NOT EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse)"; + } elseif (intval($searchCategoryWarehouse) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryWarehouse); + } + } + if ($listofcategoryid) { + $searchCategoryWarehouseSqlList[] = " EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryWarehouseOperator == 1) { + if (!empty($searchCategoryWarehouseSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryWarehouseSqlList).")"; + } + } else { + if (!empty($searchCategoryWarehouseSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryWarehouseSqlList).")"; + } + } +} + // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 29078c054a5..9ca5fc63c76 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -143,15 +143,12 @@ $search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); $search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); $search_date_end_endday = GETPOST('search_date_end_endday', 'int'); $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver - +$search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); if ($search_status == '') { $search_status = -1; // -1 or 1 } -if (isModEnabled('categorie')) { - $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); -} // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Project($db); @@ -424,9 +421,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); -} if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } @@ -447,9 +441,6 @@ if ($search_project_contact > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp_contact"; } $sql .= " WHERE p.entity IN (".getEntity('project').')'; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_array); -} if (empty($user->rights->projet->all->lire)) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users } @@ -569,6 +560,32 @@ if ($search_price_booth != '') { if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } +// Search for tag/category ($searchCategoryProjectList is an array of ID) +$searchCategoryProjectList = $search_category_array; +$searchCategoryProjectOperator = 0; +if (!empty($searchCategoryProjectList)) { + $searchCategoryProjectSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProjectList as $searchCategoryProject) { + if (intval($searchCategoryProject) == -2) { + $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; + } elseif (intval($searchCategoryProject) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } + } + if ($listofcategoryid) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProjectOperator == 1) { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProjectSqlList).")"; + } + } else { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProjectSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/user/list.php b/htdocs/user/list.php index dfc8fdb3568..72b00c75577 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -163,9 +163,11 @@ $search_statut = GETPOST('search_statut', 'intcomma'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_supervisor = GETPOST('search_supervisor', 'intcomma'); -$optioncss = GETPOST('optioncss', 'alpha'); $search_categ = GETPOST("search_categ", 'int'); $catid = GETPOST('catid', 'int'); +if (!empty($catid) && empty($search_categ)) { + $search_categ = $catid; +} // Default search if ($search_statut == '') { @@ -368,9 +370,6 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; -if (!empty($search_categ) || !empty($catid)) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_user as cu ON u.rowid = cu.fk_user"; // We'll need this table joined to the select in order to filter by categ -} // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -428,17 +427,31 @@ if ($search_statut != '' && $search_statut >= 0) { if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } -if ($catid > 0) { - $sql .= " AND cu.fk_categorie = ".((int) $catid); -} -if ($catid == -2) { - $sql .= " AND cu.fk_categorie IS NULL"; -} -if ($search_categ > 0) { - $sql .= " AND cu.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cu.fk_categorie IS NULL"; + +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = array($search_categ); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } } if ($search_warehouse > 0) { $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); From f516a4b0528b6b82c24423106b79d08881ee52a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 03:01:09 +0200 Subject: [PATCH 0875/1289] FIX filter on categories --- htdocs/compta/facture/list.php | 78 +- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 5 +- htdocs/fourn/facture/list.php | 2166 +++++++++-------- .../knowledgerecord_list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/projet/tasks/list.php | 49 +- 9 files changed, 1196 insertions(+), 1112 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 02517537bdf..3db63c119bf 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -73,15 +73,15 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicelist'; if ($contextpage == 'poslist') { - $_GET['optioncss'] = 'print'; + $optioncss = 'print'; } $lineid = GETPOST('lineid', 'int'); $userid = GETPOST('userid', 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); $search_type = GETPOST('search_type', 'int'); @@ -137,10 +137,10 @@ $search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); $search_categ_cus = GETPOST("search_categ_cus", 'int'); +$search_product_category = GETPOST('search_product_category', 'int'); $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); -$optioncss = GETPOST('optioncss', 'alpha'); $option = GETPOST('search_option'); if ($option == 'late') { @@ -581,9 +581,6 @@ if (!$sall) { $sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed'; } */ -if ($search_categ_cus && $search_categ_cus != -1) { - $sql .= ", cc.fk_categorie, cc.fk_soc"; -} // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -598,10 +595,6 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus) && $search_categ_cus != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} - $sql .= ', '.MAIN_DB_PREFIX.'facture as f'; if ($sortfield == "f.datef") { $sql .= $db->hintindex('idx_facture_datef'); @@ -619,10 +612,6 @@ if (!$sall) { if ($sall || $search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} - if (!empty($search_fac_rec_source_title)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_rec as facrec ON f.fk_fac_rec_source=facrec.rowid'; } @@ -646,9 +635,6 @@ $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -746,12 +732,6 @@ if ($search_multicurrency_montant_ttc != '') { if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } -if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); -} -if ($search_categ_cus == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; -} if ($search_status != '-1' && $search_status != '') { if (is_numeric($search_status) && $search_status >= 0) { if ($search_status == '0') { @@ -813,6 +793,58 @@ if ($search_user > 0) { if (!empty($search_fac_rec_source_title)) { $sql .= natural_search('facrec.titre', $search_fac_rec_source_title); } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = $search_product_category ? array($search_product_category) : array(); +$searchCategoryProductOperator = 0; +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} +$searchCategoryCustomerList = $search_categ_cus ? array($search_categ_cus) : array();; +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 29db15e0a0b..4c3282317bd 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -1096,7 +1096,7 @@ class Translate if ($obj) { // If a translation exists, we use it lese we use the default label $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true); + $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true); $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label']; } $i++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1b421224761..334418833b4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -967,7 +967,10 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options break; case 'custom': if (empty($filter)) { - return 'BadFourthParameterForGETPOST'; + return 'BadParameterForGETPOST - Param 3 of sanitizeVal()'; + } + if (empty($options)) { + return 'BadParameterForGETPOST - Param 4 of sanitizeVal()'; } $out = filter_var($out, $filter, $options); break; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 6e006704a83..10df6a29137 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -72,7 +72,6 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search $search_label = GETPOST("search_label", "alpha"); $search_amount_no_tax = GETPOST("search_amount_no_tax", "alpha"); $search_amount_all_tax = GETPOST("search_amount_all_tax", "alpha"); -$search_product_category = GETPOST('search_product_category', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refsupplier = GETPOST('search_refsupplier', 'alpha'); $search_type = GETPOST('search_type', 'int'); @@ -116,10 +115,10 @@ $search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int'); $search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); -$toselect = GETPOST('toselect', 'array'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_categ_sup = trim(GETPOST("search_categ_sup", 'int')); +$search_product_category = GETPOST('search_product_category', 'int'); $option = GETPOST('search_option'); if ($option == 'late') { @@ -162,9 +161,9 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $fieldstosearchall = array( 'f.ref'=>'Ref', 'f.ref_supplier'=>'RefSupplier', - 'pd.description'=>'Description', - 's.nom'=>"ThirdParty", 'f.note_public'=>'NotePublic', + 's.nom'=>"ThirdParty", + 'pd.description'=>'Description', ); if (empty($user->socid)) { $fieldstosearchall["f.note_private"] = "NotePrivate"; @@ -296,10 +295,10 @@ if (empty($reshook)) { $search_datelimit_end = ''; $toselect = array(); $search_array_options = array(); + $search_categ_sup = 0; $filter = ''; $option = ''; $socid = ""; - $search_categ_sup = 0; } // Mass actions @@ -421,9 +420,6 @@ $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; $sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; -if ($search_categ_sup && $search_categ_sup != '-1') { - $sql .= ", cs.fk_categorie, cs.fk_soc"; -} // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. if (!$search_all) { @@ -443,10 +439,6 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_sup) && $search_categ_supplier != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; -} - $sql .= ', '.MAIN_DB_PREFIX.'facture_fourn as f'; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (f.rowid = ef.fk_object)"; @@ -457,9 +449,6 @@ if (!$search_all) { if ($search_all || $search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; // We'll need this table joined to the select in order to filter by sale @@ -479,9 +468,6 @@ $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -598,11 +584,57 @@ if ($option == 'late') { if ($search_label) { $sql .= natural_search('f.libelle', $search_label); } -if ($search_categ_sup > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_sup); +$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array(); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } -if ($search_categ_sup == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = $search_product_category ? array($search_product_category) : array(); +$searchCategorySupplierOperator = 0; +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } } if ($search_status != '' && $search_status >= 0) { $sql .= " AND f.fk_statut = ".((int) $search_status); @@ -640,9 +672,6 @@ if (!$search_all) { $sql .= ' country.code,'; $sql .= " p.rowid, p.ref, p.title,"; $sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender"; - if ($search_categ_sup && $search_categ_sup != '-1') { - $sql .= ", cs.fk_categorie, cs.fk_soc"; - } if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { //prevent error with sql_mode=only_full_group_by @@ -678,1105 +707,1116 @@ $sql .= $db->plimit($limit + 1, $offset); //print $sql; $resql = $db->query($sql); -if ($resql) { - $num = $db->num_rows($resql); +if (!$resql) { + dol_print_error($db); +} - $arrayofselected = is_array($toselect) ? $toselect : array(); +$num = $db->num_rows($resql); - if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->facid; +$arrayofselected = is_array($toselect) ? $toselect : array(); - header("Location: ".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$id); - exit; - } +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { + $obj = $db->fetch_object($resql); + $id = $obj->facid; - llxHeader('', $langs->trans("SuppliersInvoices"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); + header("Location: ".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$id); + exit; +} - if ($socid) { - $soc = new Societe($db); - $soc->fetch($socid); - if (empty($search_company)) { - $search_company = $soc->name; - $search_company_alias = $soc->name_alias; - } - } +llxHeader('', $langs->trans("SuppliersInvoices"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); - $param = '&socid='.$socid; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); - } - if ($search_all) { - $param .= '&search_all='.urlencode($search_all); - } - if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); - } - if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); - } - if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); - } - if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); - } - if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); - } - if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); - } - if ($search_datelimit_startday) { - $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); - } - if ($search_datelimit_startmonth) { - $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); - } - if ($search_datelimit_startyear) { - $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); - } - if ($search_datelimit_endday) { - $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); - } - if ($search_datelimit_endmonth) { - $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); - } - if ($search_datelimit_endyear) { - $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); - } - if ($search_ref) { - $param .= '&search_ref='.urlencode($search_ref); - } - if ($search_refsupplier) { - $param .= '&search_refsupplier='.urlencode($search_refsupplier); - } - if ($search_type != '') { - $param .= '&search_type='.urlencode($search_type); - } - if ($search_label) { - $param .= '&search_label='.urlencode($search_label); - } - if ($search_company) { - $param .= '&search_company='.urlencode($search_company); - } - if ($search_company_alias) { - $param .= '&search_company_alias='.urlencode($search_company_alias); - } - if ($search_login) { - $param .= '&search_login='.urlencode($search_login); - } - if ($search_montant_ht != '') { - $param .= '&search_montant_ht='.urlencode($search_montant_ht); - } - if ($search_montant_vat != '') { - $param .= '&search_montant_vat='.urlencode($search_montant_vat); - } - if ($search_montant_localtax1 != '') { - $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1); - } - if ($search_montant_localtax2 != '') { - $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2); - } - if ($search_montant_ttc != '') { - $param .= '&search_montant_ttc='.urlencode($search_montant_ttc); - } - if ($search_multicurrency_code != '') { - $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code); - } - if ($search_multicurrency_tx != '') { - $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx); - } - if ($search_multicurrency_montant_ht != '') { - $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht); - } - if ($search_multicurrency_montant_vat != '') { - $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat); - } - if ($search_multicurrency_montant_ttc != '') { - $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc); - } - if ($search_amount_no_tax) { - $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); - } - if ($search_amount_all_tax) { - $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); - } - if ($search_status >= 0) { - $param .= "&search_status=".urlencode($search_status); - } - if ($show_files) { - $param .= '&show_files='.urlencode($show_files); - } - if ($option) { - $param .= "&search_option=".urlencode($option); - } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); - } - if ($search_categ_sup > 0) { - $param .= '&search_categ_sup='.urlencode($search_categ_sup); - } - if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); +if ($socid) { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) { + $search_company = $soc->name; + $search_company_alias = $soc->name_alias; } +} - // Add $param from extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - // Add $param from hooks - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook - $param .= $hookmanager->resPrint; +$param = '&socid='.$socid; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +if ($search_all) { + $param .= '&search_all='.urlencode($search_all); +} +if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); +} +if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); +} +if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); +} +if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); +} +if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); +} +if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); +} +if ($search_datelimit_startday) { + $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); +} +if ($search_datelimit_startmonth) { + $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); +} +if ($search_datelimit_startyear) { + $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); +} +if ($search_datelimit_endday) { + $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); +} +if ($search_datelimit_endmonth) { + $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); +} +if ($search_datelimit_endyear) { + $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); +} +if ($search_ref) { + $param .= '&search_ref='.urlencode($search_ref); +} +if ($search_refsupplier) { + $param .= '&search_refsupplier='.urlencode($search_refsupplier); +} +if ($search_type != '') { + $param .= '&search_type='.urlencode($search_type); +} +if ($search_label) { + $param .= '&search_label='.urlencode($search_label); +} +if ($search_company) { + $param .= '&search_company='.urlencode($search_company); +} +if ($search_company_alias) { + $param .= '&search_company_alias='.urlencode($search_company_alias); +} +if ($search_login) { + $param .= '&search_login='.urlencode($search_login); +} +if ($search_montant_ht != '') { + $param .= '&search_montant_ht='.urlencode($search_montant_ht); +} +if ($search_montant_vat != '') { + $param .= '&search_montant_vat='.urlencode($search_montant_vat); +} +if ($search_montant_localtax1 != '') { + $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1); +} +if ($search_montant_localtax2 != '') { + $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2); +} +if ($search_montant_ttc != '') { + $param .= '&search_montant_ttc='.urlencode($search_montant_ttc); +} +if ($search_multicurrency_code != '') { + $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code); +} +if ($search_multicurrency_tx != '') { + $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx); +} +if ($search_multicurrency_montant_ht != '') { + $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht); +} +if ($search_multicurrency_montant_vat != '') { + $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat); +} +if ($search_multicurrency_montant_ttc != '') { + $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc); +} +if ($search_amount_no_tax) { + $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); +} +if ($search_amount_all_tax) { + $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); +} +if ($search_status >= 0) { + $param .= "&search_status=".urlencode($search_status); +} +if ($show_files) { + $param .= '&show_files='.urlencode($show_files); +} +if ($option) { + $param .= "&search_option=".urlencode($option); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +if ($search_categ_sup > 0) { + $param .= '&search_categ_sup='.urlencode($search_categ_sup); +} +if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { + $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); +} - // List of mass actions available - $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), - ); +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; - if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) { - $langs->load('withdrawals'); - $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); - } - if ($user->rights->fournisseur->facture->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); - } - if (in_array($massaction, array('presend', 'predelete'))) { - $arrayofmassactions = array(); - } - $massactionbutton = $form->selectMassAction('', $arrayofmassactions); +// List of mass actions available +$arrayofmassactions = array( + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); - $url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.urlencode($socid); - } - $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); +if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) { + $langs->load('withdrawals'); + $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); +} +if ($user->rights->fournisseur->facture->supprimer) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); - $i = 0; - print '
'."\n"; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +$url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; +if (!empty($socid)) { + $url .= '&socid='.urlencode($socid); +} +$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); - print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_invoice', 0, $newcardbutton, '', $limit, 0, 0, 1); +$i = 0; +print ''."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; - $topicmail = "SendBillRef"; - $modelmail = "invoice_supplier_send"; - $objecttmp = new FactureFournisseur($db); - $trackid = 'sinv'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; +print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_invoice', 0, $newcardbutton, '', $limit, 0, 0, 1); - if ($search_all) { - foreach ($fieldstosearchall as $key => $val) { - $fieldstosearchall[$key] = $langs->trans($val); - } - print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; - } +$topicmail = "SendBillRef"; +$modelmail = "invoice_supplier_send"; +$objecttmp = new FactureFournisseur($db); +$trackid = 'sinv'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - // If the user can view prospects other than his' - $moreforfilter = ''; - if ($user->rights->user->user->lire) { - $langs->load("commercial"); - $moreforfilter .= '
'; - $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200'); - $moreforfilter .= '
'; - } - // If the user can view prospects other than his' - if ($user->rights->user->user->lire) { - $moreforfilter .= '
'; - $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); - $moreforfilter .= '
'; - } - // If the user can view prospects other than his' - if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { - include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
'; - $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); - $moreforfilter .= '
'; +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); } + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; +} - if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
'; - $tmptitle = $langs->trans('SuppliersCategoriesShort'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $tmptitle); - $moreforfilter .= '
'; - } - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $moreforfilter .= $hookmanager->resPrint; - } else { - $moreforfilter = $hookmanager->resPrint; - } +// If the user can view prospects other than his' +$moreforfilter = ''; +if ($user->rights->user->user->lire) { + $langs->load("commercial"); + $moreforfilter .= '
'; + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200'); + $moreforfilter .= '
'; +} +// If the user can view prospects other than his' +if ($user->rights->user->user->lire) { + $moreforfilter .= '
'; + $tmptitle = $langs->trans('LinkedToSpecificUsers'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); + $moreforfilter .= '
'; +} +// If the user can view prospects other than his' +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter .= '
'; + $tmptitle = $langs->trans('IncludingProductWithTag'); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); + $moreforfilter .= '
'; +} - if ($moreforfilter) { - print '
'; - print $moreforfilter; - print '
'; - } +if (isModEnabled('categorie')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter .= '
'; + $tmptitle = $langs->trans('SuppliersCategoriesShort'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $tmptitle); + $moreforfilter .= '
'; +} +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} - $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) { - $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); - } +if ($moreforfilter) { + print '
'; + print $moreforfilter; + print '
'; +} - print '
'; - print ''."\n"; +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +if ($massactionbutton) { + $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); +} - // Line for filters - print ''; - // Ref - if (!empty($arrayfields['f.ref']['checked'])) { - print ''; - } - // Ref supplier - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; - } - // Type - if (!empty($arrayfields['f.type']['checked'])) { - print ''; - } - // Label - if (!empty($arrayfields['f.label']['checked'])) { - print ''; - } - // Date invoice - if (!empty($arrayfields['f.datef']['checked'])) { - print ''; - } - // Date due - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - } - // Project - if (!empty($arrayfields['p.ref']['checked'])) { - print ''; - } - // Thirpdarty - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - } - // Alias - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - } - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print ''; - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - } - // Company type - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - } - // Condition of payment - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - } - // Payment mode - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.total_ht']['checked'])) { - // Amount without tax - print ''; - } - if (!empty($arrayfields['f.total_vat']['checked'])) { - // Amount vat - print ''; - } - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - // Amount tax 1 - print ''; - } - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - // Amount tax 2 - print ''; - } - if (!empty($arrayfields['f.total_ttc']['checked'])) { - // Amount inc tac - print ''; - } - if (!empty($arrayfields['u.login']['checked'])) { - // Author - print ''; - } - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''; - } - if (!empty($arrayfields['rtp']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - // Currency - print ''; - } - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - // Currency rate - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''; - } - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; +print '
'; +print '
'; - print ''; - print ''; - print ''; - print ''; - $listtype = array( - FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), - ); - /* - if (!empty($conf->global->INVOICE_USE_SITUATION)) - { - $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); - } - */ - //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. - print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); - print ''; - print ''; - print ''; - print '
'; - print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); - print '
'; - print '
'; - print '
'; - /* - print $langs->trans('From').' '; - print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); - print '
'; - print '
'; - print $langs->trans('to').' ';*/ - print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); - print '
'.$langs->trans("Alert"); - print '
'; - print '
0 ? " disabled" : "").'>'; - print ''; - print ''; - print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); - print ''; - print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); - print ''; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 20, 1, 'maxwidth100', 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'."\n"; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['f.datec']['checked'])) { - print ''; - } - // Date modification - if (!empty($arrayfields['f.tms']['checked'])) { - print ''; - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print ''; - } - // Action column - print ''; +// Ref +if (!empty($arrayfields['f.ref']['checked'])) { + print ''; +} +// Ref supplier +if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print ''; +} +// Type +if (!empty($arrayfields['f.type']['checked'])) { + print ''; +} +// Label +if (!empty($arrayfields['f.label']['checked'])) { + print ''; +} +// Date invoice +if (!empty($arrayfields['f.datef']['checked'])) { + print ''; +} +// Date due +if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print ''; +} +// Project +if (!empty($arrayfields['p.ref']['checked'])) { + print ''; +} +// Thirpdarty +if (!empty($arrayfields['s.nom']['checked'])) { + print ''; +} +// Alias +if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; +} +// Town +if (!empty($arrayfields['s.town']['checked'])) { + print ''; +} +// Zip +if (!empty($arrayfields['s.zip']['checked'])) { + print ''; +} +// State +if (!empty($arrayfields['state.nom']['checked'])) { + print ''; +} +// Country +if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; +} +// Company type +if (!empty($arrayfields['typent.code']['checked'])) { + print ''; +} +// Condition of payment +if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print ''; +} +// Payment mode +if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.total_ht']['checked'])) { + // Amount without tax + print ''; +} +if (!empty($arrayfields['f.total_vat']['checked'])) { + // Amount vat + print ''; +} +if (!empty($arrayfields['f.total_localtax1']['checked'])) { + // Amount tax 1 + print ''; +} +if (!empty($arrayfields['f.total_localtax2']['checked'])) { + // Amount tax 2 + print ''; +} +if (!empty($arrayfields['f.total_ttc']['checked'])) { + // Amount inc tac + print ''; +} +if (!empty($arrayfields['u.login']['checked'])) { + // Author + print ''; +} +if (!empty($arrayfields['dynamount_payed']['checked'])) { + print ''; +} +if (!empty($arrayfields['rtp']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + // Currency + print ''; +} +if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + // Currency rate + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print ''; +} +if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print ''; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - print "\n"; +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Date creation +if (!empty($arrayfields['f.datec']['checked'])) { + print ''; +} +// Date modification +if (!empty($arrayfields['f.tms']['checked'])) { + print ''; +} +// Status +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print ''; +} +// Action column +print ''; - print ''; - if (!empty($arrayfields['f.ref']['checked'])) { - print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref,f.rowid', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.type']['checked'])) { - print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.label']['checked'])) { - print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.datef']['checked'])) { - print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['p.ref']['checked'])) { - print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.nom']['checked'])) { - print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.name_alias']['checked'])) { - print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.town']['checked'])) { - print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.zip']['checked'])) { - print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['state.nom']['checked'])) { - print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['state.name_alias']['checked'])) { - print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['country.code_iso']['checked'])) { - print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['typent.code']['checked'])) { - print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder); - } - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder); - } - if (!empty($arrayfields['f.total_ht']['checked'])) { - print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_vat']['checked'])) { - print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['u.login']['checked'])) { - print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); - } - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['rtp']['checked'])) { - print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (!empty($arrayfields['f.datec']['checked'])) { - print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - } - if (!empty($arrayfields['f.tms']['checked'])) { - print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - } - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right '); - } - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); - print "\n"; +print "\n"; - $facturestatic = new FactureFournisseur($db); - $supplierstatic = new Fournisseur($db); - $projectstatic = new Project($db); - $userstatic = new User($db); +print ''; +if (!empty($arrayfields['f.ref']['checked'])) { + print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref,f.rowid', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.type']['checked'])) { + print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.label']['checked'])) { + print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.datef']['checked'])) { + print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['p.ref']['checked'])) { + print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.nom']['checked'])) { + print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.town']['checked'])) { + print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.zip']['checked'])) { + print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['state.nom']['checked'])) { + print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['state.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['country.code_iso']['checked'])) { + print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['typent.code']['checked'])) { + print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['f.total_ht']['checked'])) { + print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_vat']['checked'])) { + print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_localtax1']['checked'])) { + print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_localtax2']['checked'])) { + print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['u.login']['checked'])) { + print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); +} +if (!empty($arrayfields['dynamount_payed']['checked'])) { + print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['rtp']['checked'])) { + print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (!empty($arrayfields['f.datec']['checked'])) { + print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.tms']['checked'])) { + print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right '); +} +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +print "\n"; - if ($num > 0) { - $i = 0; - $totalarray = array(); - $totalarray['nbfield']=0; - $totalarray['val'] = array(); - $totalarray['val']['f.total_ht']=0; - $totalarray['val']['f.total_vat']=0; - $totalarray['val']['f.total_localtax1']=0; - $totalarray['val']['f.total_localtax1']=0; - $totalarray['val']['f.total_ttc']=0; +$facturestatic = new FactureFournisseur($db); +$supplierstatic = new Fournisseur($db); +$projectstatic = new Project($db); +$userstatic = new User($db); - while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); +if ($num > 0) { + $i = 0; + $totalarray = array(); + $totalarray['nbfield']=0; + $totalarray['val'] = array(); + $totalarray['val']['f.total_ht']=0; + $totalarray['val']['f.total_vat']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_ttc']=0; - $datelimit = $db->jdate($obj->datelimite); - $facturestatic->id = $obj->facid; - $facturestatic->ref = $obj->ref; - $facturestatic->type = $obj->type; - $facturestatic->ref_supplier = $obj->ref_supplier; - $facturestatic->date_echeance = $db->jdate($obj->datelimite); - $facturestatic->statut = $obj->fk_statut; - $facturestatic->note_public = $obj->note_public; - $facturestatic->note_private = $obj->note_private; - $facturestatic->multicurrency_code = $obj->multicurrency_code; - $facturestatic->multicurrency_tx = $obj->multicurrency_tx; - $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht; - $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat; - $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); - $thirdparty->id = $obj->socid; - $thirdparty->name = $obj->name; - $thirdparty->name_alias = $obj->alias; - $thirdparty->client = $obj->client; - $thirdparty->fournisseur = $obj->fournisseur; - $thirdparty->code_client = $obj->code_client; - $thirdparty->code_compta_client = $obj->code_compta_client; - $thirdparty->code_fournisseur = $obj->code_fournisseur; - $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur; - $thirdparty->email = $obj->email; - $thirdparty->country_code = $obj->country_code; + $datelimit = $db->jdate($obj->datelimite); + $facturestatic->id = $obj->facid; + $facturestatic->ref = $obj->ref; + $facturestatic->type = $obj->type; + $facturestatic->ref_supplier = $obj->ref_supplier; + $facturestatic->date_echeance = $db->jdate($obj->datelimite); + $facturestatic->statut = $obj->fk_statut; + $facturestatic->note_public = $obj->note_public; + $facturestatic->note_private = $obj->note_private; + $facturestatic->multicurrency_code = $obj->multicurrency_code; + $facturestatic->multicurrency_tx = $obj->multicurrency_tx; + $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht; + $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat; + $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc; - $paiement = $facturestatic->getSommePaiement(); - $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); - $totaldeposits = $facturestatic->getSumDepositsUsed(); - $totalpay = $paiement + $totalcreditnotes + $totaldeposits; - $remaintopay = $obj->total_ttc - $totalpay; - $multicurrency_paiement = $facturestatic->getSommePaiement(1); - $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1); - $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1); - $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits; - $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay); + $thirdparty->id = $obj->socid; + $thirdparty->name = $obj->name; + $thirdparty->name_alias = $obj->alias; + $thirdparty->client = $obj->client; + $thirdparty->fournisseur = $obj->fournisseur; + $thirdparty->code_client = $obj->code_client; + $thirdparty->code_compta_client = $obj->code_compta_client; + $thirdparty->code_fournisseur = $obj->code_fournisseur; + $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur; + $thirdparty->email = $obj->email; + $thirdparty->country_code = $obj->country_code; - $facturestatic->alreadypaid = ($paiement ? $paiement : 0); - $facturestatic->paye = $obj->paye; - $facturestatic->statut = $obj->fk_statut; - $facturestatic->type = $obj->type; + $paiement = $facturestatic->getSommePaiement(); + $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); + $totaldeposits = $facturestatic->getSumDepositsUsed(); + $totalpay = $paiement + $totalcreditnotes + $totaldeposits; + $remaintopay = $obj->total_ttc - $totalpay; + $multicurrency_paiement = $facturestatic->getSommePaiement(1); + $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1); + $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits; + $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay); + + $facturestatic->alreadypaid = ($paiement ? $paiement : 0); + $facturestatic->paye = $obj->paye; + $facturestatic->statut = $obj->fk_statut; + $facturestatic->type = $obj->type; - //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice - if ($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) { - if ($facturestatic->isCreditNoteUsed()) { - $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed(); - } + //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice + if ($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) { + if ($facturestatic->isCreditNoteUsed()) { + $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed(); } + } - print ''; - if (!empty($arrayfields['f.ref']['checked'])) { - print ''; + if (!empty($arrayfields['f.ref']['checked'])) { + print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } + print "\n"; + if (!$i) { + $totalarray['nbfield']++; } + } - // Supplier ref - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Supplier ref + if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Type - if (!empty($arrayfields['f.type']['checked'])) { - print '"; - if (!$i) { - $totalarray['nbfield']++; - } + // Type + if (!empty($arrayfields['f.type']['checked'])) { + print '"; + if (!$i) { + $totalarray['nbfield']++; } + } - // Label - if (!empty($arrayfields['f.label']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Label + if (!empty($arrayfields['f.label']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Date - if (!empty($arrayfields['f.datef']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Date + if (!empty($arrayfields['f.datef']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Date limit - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Project - if (!empty($arrayfields['p.ref']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Third party - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Alias - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Type ent - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Payment condition - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Payment mode - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Amount HT - if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; - } - $totalarray['val']['f.total_ht'] += $obj->total_ht; - } - // Amount VAT - if (!empty($arrayfields['f.total_vat']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat'; - } - $totalarray['val']['f.total_vat'] += $obj->total_vat; - } - // Amount LocalTax1 - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1'; - } - $totalarray['val']['f.total_localtax1'] += $obj->total_localtax1; - } - // Amount LocalTax2 - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2'; - } - $totalarray['val']['f.total_localtax2'] += $obj->total_localtax2; - } - // Amount TTC - if (!empty($arrayfields['f.total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc'; - } - $totalarray['val']['f.total_ttc'] += $obj->total_ttc; - } - - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; - $userstatic->lastname = $obj->lastname; - $userstatic->firstname = $obj->firstname; - $userstatic->email = $obj->user_email; - $userstatic->statut = $obj->user_statut; - $userstatic->entity = $obj->entity; - $userstatic->photo = $obj->photo; - $userstatic->office_phone = $obj->office_phone; - $userstatic->office_fax = $obj->office_fax; - $userstatic->user_mobile = $obj->user_mobile; - $userstatic->job = $obj->job; - $userstatic->gender = $obj->gender; - - // Author - if (!empty($arrayfields['u.login']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; - } - $totalarray['val']['totalam'] += $totalpay; - } - - if (!empty($arrayfields['rtp']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'rtp'; - } - $totalarray['val']['rtp'] += $remaintopay; - } - - // Currency - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Currency rate - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount HT - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount VAT - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount TTC - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Pending amount - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; // TODO Use a denormalized field - 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); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Date creation - if (!empty($arrayfields['f.datec']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['f.tms']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print '"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Action column - print ''; if (!$i) { $totalarray['nbfield']++; } - - print "\n"; - - $i++; } - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // Project + if (!empty($arrayfields['p.ref']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Third party + if (!empty($arrayfields['s.nom']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Town + if (!empty($arrayfields['s.town']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Zip + if (!empty($arrayfields['s.zip']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // State + if (!empty($arrayfields['state.nom']['checked'])) { + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Country + if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Type ent + if (!empty($arrayfields['typent.code']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Payment condition + if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Payment mode + if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Amount HT + if (!empty($arrayfields['f.total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; + } + $totalarray['val']['f.total_ht'] += $obj->total_ht; + } + // Amount VAT + if (!empty($arrayfields['f.total_vat']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat'; + } + $totalarray['val']['f.total_vat'] += $obj->total_vat; + } + // Amount LocalTax1 + if (!empty($arrayfields['f.total_localtax1']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1'; + } + $totalarray['val']['f.total_localtax1'] += $obj->total_localtax1; + } + // Amount LocalTax2 + if (!empty($arrayfields['f.total_localtax2']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2'; + } + $totalarray['val']['f.total_localtax2'] += $obj->total_localtax2; + } + // Amount TTC + if (!empty($arrayfields['f.total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc'; + } + $totalarray['val']['f.total_ttc'] += $obj->total_ttc; + } + + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + + // Author + if (!empty($arrayfields['u.login']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['dynamount_payed']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; + } + $totalarray['val']['totalam'] += $totalpay; + } + + if (!empty($arrayfields['rtp']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'rtp'; + } + $totalarray['val']['rtp'] += $remaintopay; + } + + // Currency + if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Currency rate + if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount HT + if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount VAT + if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount TTC + if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Pending amount + if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print ''; // TODO Use a denormalized field + 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); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Date creation + if (!empty($arrayfields['f.datec']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date modification + if (!empty($arrayfields['f.tms']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Status + if (!empty($arrayfields['f.fk_statut']['checked'])) { + print '"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print "\n"; + + $i++; } - $db->free($resql); - - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print "
'; - print ''; - print ''; - $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); - print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1); - print ''; - $searchpicto = $form->showFilterButtons(); - print $searchpicto; +// Line for filters +print '
'; + print ''; print ''; + print ''; + print ''; + $listtype = array( + FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + ); + /* + if (!empty($conf->global->INVOICE_USE_SITUATION)) + { + $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); + } + */ + //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. + print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); + print ''; + print ''; + print ''; + print '
'; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; + print '
'; + print '
'; + /* + print $langs->trans('From').' '; + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); + print '
'; + print '
'; + print $langs->trans('to').' ';*/ + print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); + print '
'.$langs->trans("Alert"); + print '
'; + print '
0 ? " disabled" : "").'>'; + print ''; + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); + print ''; + print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); + print ''; + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 20, 1, 'maxwidth100', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print ''; + print ''; + $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1); + print ''; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
'; + print '
'; - print ''; - // Picto + Ref - print '
'; - print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); + print ''; + // Picto + Ref + print '
'; + print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); - $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); - $subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); - print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir); - print '
'; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); + $subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); + print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir); + print '
'; - print "
'; - print $obj->ref_supplier; - print ''; + print $obj->ref_supplier; + print ''; - print $facturestatic->getLibType(); - print "'; + print $facturestatic->getLibType(); + print "'; - print $obj->label; - print ''; + print $obj->label; + print ''; - print dol_print_date($db->jdate($obj->datef), 'day'); - print ''; + print dol_print_date($db->jdate($obj->datef), 'day'); + print ''.dol_print_date($datelimit, 'day'); - if ($facturestatic->hasDelay()) { - print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); - } - print ''; - if ($obj->project_id > 0) { - $projectstatic->id = $obj->project_id; - $projectstatic->ref = $obj->project_ref; - $projectstatic->title = $obj->project_label; - print $projectstatic->getNomUrl(1); - } - print ''; - print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); - print ''; - print $thirdparty->name_alias; - print ''; - print $obj->town; - print ''; - print dol_escape_htmltag($obj->zip); - print '".$obj->state_name."'; - $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; - print ''; - if (empty($typenArray)) { - $typenArray = $formcompany->typent_array(1); - } - print $typenArray[$obj->typent_code]; - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); - print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'; - if ($userstatic->id) { - print $userstatic->getLoginUrl(-1); - } else { - print ' '; - } - print "'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''.(!empty($remaintopay) ?price($remaintopay, 0, $langs) : ' ').''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); - print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; - print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type); - 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->facid, $arrayofselected)) { - $selected = 1; - } - print ''; + // Date limit + if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print ''.dol_print_date($datelimit, 'day'); + if ($facturestatic->hasDelay()) { + print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); } print '
'; + if ($obj->project_id > 0) { + $projectstatic->id = $obj->project_id; + $projectstatic->ref = $obj->project_ref; + $projectstatic->title = $obj->project_label; + print $projectstatic->getNomUrl(1); + } + print ''; + print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + print $thirdparty->name_alias; + print ''; + print $obj->town; + print ''; + print dol_escape_htmltag($obj->zip); + print '".$obj->state_name."'; + $tmparray = getCountry($obj->fk_pays, 'all'); + print $tmparray['label']; + print ''; + if (empty($typenArray)) { + $typenArray = $formcompany->typent_array(1); + } + print $typenArray[$obj->typent_code]; + print ''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'; + if ($userstatic->id) { + print $userstatic->getLoginUrl(-1); + } else { + print ' '; + } + print "'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''.(!empty($remaintopay) ?price($remaintopay, 0, $langs) : ' ').''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); + print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; + print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type); + 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->facid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
\n"; - print '
'; - - print "
\n"; - - $hidegeneratedfilelistifempty = 1; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { - $hidegeneratedfilelistifempty = 0; - } - - // Show list of available documents - $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource .= str_replace('&', '&', $param); - - $filedir = $diroutputmassaction; - $genallowed = $user->rights->facture->lire; - $delallowed = $user->rights->facture->creer; - $title = ''; - - print $formfile->showdocuments('massfilesarea_supplier_invoice', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} else { - dol_print_error($db); + // Show total line + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; +} + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print "\n"; +print ''; + +print "\n"; + +$hidegeneratedfilelistifempty = 1; +if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; +} + +// Show list of available documents +$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; +$urlsource .= str_replace('&', '&', $param); + +$filedir = $diroutputmassaction; +$genallowed = $user->rights->facture->lire; +$delallowed = $user->rights->facture->creer; +$title = ''; + +print $formfile->showdocuments('massfilesarea_supplier_invoice', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + // End of page llxFooter(); $db->close(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index d9fc25fa1fe..217c7c71468 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -472,7 +472,7 @@ $moreforfilter.= '';*/ // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie') && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 1); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index b2eb15563ed..49b50a037e9 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -682,7 +682,7 @@ print ''."\n"; $needToFetchEachLine = 0; if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) { + if ($val && preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object } } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 793fedd3a2d..d9ed8a37c5e 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -270,6 +270,7 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// Search for tag/category $searchCategoryProductSqlList = array(); if ($searchCategoryProductOperator == 1) { $existsCategoryProductList = array(); @@ -314,7 +315,6 @@ if ($searchCategoryProductOperator == 1) { $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } } -//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index d2f3e2358d9..a2bcceab0e5 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -375,7 +375,7 @@ if ($result || !($id > 0)) { $morefilters = ' AND d.fk_product IN ('.$db->sanitize((is_array($listofprodids) && count($listofprodids)) ? join(',', $listofprodids) : '0').')'; } if ($search_categ == -2) { - $morefilters = ' AND d.fk_product NOT IN (SELECT cp.fk_product from '.MAIN_DB_PREFIX.'categorie_product as cp)'; + $morefilters = ' AND NOT EXISTS (SELECT cp.fk_product FROM '.MAIN_DB_PREFIX.'categorie_product as cp WHERE d.fk_product = cp.fk_product)'; } if ($key == 'propal') { diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 2c84872bb38..1f0130bd7b4 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -46,7 +46,7 @@ $mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_categ = GETPOST("search_categ", 'alpha'); +$search_categ = GETPOST("search_categ", 'int'); $search_projectstatus = GETPOST('search_projectstatus'); if (!isset($search_projectstatus) || $search_projectstatus === '') { @@ -332,13 +332,9 @@ $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,"; $sql .= " s.nom as name, s.name_alias as alias, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; -$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, "; +$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut,"; $sql .= " t.description, t.fk_task_parent"; $sql .= " ,t.budget_amount"; -// We'll need these fields in order to filter by categ -if ($search_categ > 0) { - $sql .= ", cs.fk_categorie, cs.fk_project"; -} // Add sum fields if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " , SUM(tt.task_duration * ".$db->ifsql("invoice_id IS NULL", "1", "0").") as tobill, SUM(tt.task_duration * ".$db->ifsql("invoice_id IS NULL", "0", "1").") as billed"; @@ -355,10 +351,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; -// We'll need this table joined to the select in order to filter by categ -if ($search_categ > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ -} $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid"; @@ -384,12 +376,6 @@ if (is_object($projectstatic) && $projectstatic->id > 0) { if ($socid) { $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } -if ($search_categ > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} if ($search_project_ref) { $sql .= natural_search('p.ref', $search_project_ref); } @@ -448,6 +434,32 @@ if ($search_project_user > 0) { if ($search_task_user > 0) { $sql .= " AND ect.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listoftaskcontacttype))).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".((int) $search_task_user); } +// Search for tag/category ($searchCategoryProjectList is an array of ID) +$searchCategoryProjectList = array($search_categ); +$searchCategoryProjectOperator = 0; +if (!empty($searchCategoryProjectList)) { + $searchCategoryProjectSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProjectList as $searchCategoryProject) { + if (intval($searchCategoryProject) == -2) { + $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; + } elseif (intval($searchCategoryProject) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } + } + if ($listofcategoryid) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProjectOperator == 1) { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProjectSqlList).")"; + } + } else { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProjectSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -459,9 +471,6 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed $sql .= " s.nom, s.rowid,"; $sql .= " t.datec, t.dateo, t.datee, t.tms,"; $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut"; - if ($search_categ) { - $sql .= ", cs.fk_categorie, cs.fk_project"; - } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -675,7 +684,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 0, $tmptitle, 'maxwidth300'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300'); $moreforfilter .= '
'; } From fca08dbf2342e15d36399ff0430c2acd885e6de2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 11 Oct 2022 08:00:25 +0200 Subject: [PATCH 0876/1289] FIX missing quote --- htdocs/contrat/class/contrat.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 5a882a4e68e..f8ffa809a86 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1703,8 +1703,8 @@ class Contrat extends CommonObject $total_localtax1 = $tabprice[9]; $total_localtax2 = $tabprice[10]; - $localtax1_type = $localtaxes_type[0]; - $localtax2_type = $localtaxes_type[2]; + $localtax1_type = (empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]); + $localtax2_type = (empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]); // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) @@ -1737,8 +1737,8 @@ class Contrat extends CommonObject $sql .= ",tva_tx = ".((float) price2num($tvatx)); $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx)); $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx)); - $sql .= ",localtax1_type='".$this->db->escape($localtax1_type); - $sql .= ",localtax2_type='".$this->db->escape($localtax2_type); + $sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'"; + $sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'"; $sql .= ", total_ht = ".((float) price2num($total_ht)); $sql .= ", total_tva = ".((float) price2num($total_tva)); $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1)); From ba94bc146f19e2019d33fcb2c91e580bffb552c8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 11 Oct 2022 10:00:23 +0200 Subject: [PATCH 0877/1289] FIX: supplier price update: missing error reporting --- htdocs/fourn/class/fournisseur.product.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index ea5dc639a5e..ca557e027dc 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -419,7 +419,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } @@ -506,6 +510,7 @@ class ProductFournisseur extends Product if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); } else { + $this->error = $this->db->lasterror(); $error++; } @@ -518,7 +523,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } From c5c0628ee86e12f8a7371c33720bf2c698c8c7a2 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 11 Oct 2022 10:05:56 +0200 Subject: [PATCH 0878/1289] add short cicility --- htdocs/langs/en_US/dict.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index 0524cf1ca18..9eaeb52f8f2 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -250,7 +250,9 @@ CountryMF=Saint Martin ##### Civilities ##### CivilityMME=Mrs. +CivilityMMEShort=CivilityMMEShort CivilityMR=Mr. +CivilityMRShort=CivilityMRShort CivilityMLE=Ms. CivilityMTRE=Master CivilityDR=Doctor From 5528dc3843b2ccc4ef71ab4c76175fe7dfe3a2b5 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 11 Oct 2022 10:26:03 +0200 Subject: [PATCH 0879/1289] FIX closed warehouse for shipping --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2e2dbc97946..29ad812f6e6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2334,7 +2334,7 @@ if ($resql) { // Get local and virtual stock and store it into cache if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) { - $generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock() + $generic_product->load_stock('nobatch,warehouseopen'); // ->load_virtual_stock() is already included into load_stock() $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel; $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; } else { From b61bee1f8dcabda3d68d53131d43c1263b28f73f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 11:45:01 +0200 Subject: [PATCH 0880/1289] Fix setup of status --- htdocs/langs/en_US/website.lang | 2 +- htdocs/website/index.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 8644becdd8c..874cdc76f28 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -140,7 +140,7 @@ PagesRegenerated=%s page(s)/container(s) regenerated RegenerateWebsiteContent=Regenerate web site cache files AllowedInFrames=Allowed in Frames DefineListOfAltLanguagesInWebsiteProperties=Define list of all available languages into web site properties. -GenerateSitemaps=Generate website sitemap file +GenerateSitemaps=Generate website sitemap.xml file ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... ConfirmSitemapsCreation=Confirm sitemap generation SitemapGenerated=Sitemap file %s generated diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 55c2b8f31a8..6d07e9f5c5f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2775,7 +2775,7 @@ if (!GETPOST('hide_websitemenu')) { // Toolbar for websites // - print ''; + print ''; if ($action != 'file_manager') { print '
'; print $langs->trans("Website").': '; @@ -3012,7 +3012,7 @@ if (!GETPOST('hide_websitemenu')) { if ($websitekey && $websitekey != '-1' && (!in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesiteconfirm'))) && (!in_array($mode, array('replacesite'))) && !$file_manager) { print '
'; // Close current websitebar to open a new one - print ''; + print ''; print '
'; print '
'; @@ -3052,19 +3052,18 @@ if (!GETPOST('hide_websitemenu')) { print $out; - if (!empty($conf->use_javascript_ajax)) { print ''; //print '
'; if ($object->status == $object::STATUS_DRAFT) { // website is off, we do not allow to change status of page $text_off = 'SetWebsiteOnlineBefore'; - if ($objectpage->status == $objectpage::STATUS_DRAFT) { + if ($websitepage->status == $websitepage::STATUS_DRAFT) { // page is off print ''.img_picto($langs->trans($text_off), 'switch_off').''; } else { print ''.img_picto($langs->trans($text_off), 'switch_on').''; } } else { - print ajax_object_onoff($objectpage, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsitepage'); + print ajax_object_onoff($websitepage, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle'.(empty($websitepage->id) ? ' opacitymedium disabled' : ''), 'statuswebsitepage'); } //print '
'; print '
'; From bfd33c91572e76c538ec51e6e465d93a46bdb913 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 13:45:29 +0200 Subject: [PATCH 0881/1289] Fix migration when table llx_asset is missing --- README.md | 2 +- .../install/mysql/migration/15.0.0-16.0.0.sql | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c476f14a8cc..826955aef92 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) -- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). +- Check that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 6d9aebf934f..795726bd89c 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -365,7 +365,52 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom -- Set default ticket type to OTHER if no default exists UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1); + -- Assets - New module + +CREATE TABLE llx_asset( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) NOT NULL, + entity integer DEFAULT 1 NOT NULL, + label varchar(255), + + fk_asset_model integer, + + reversal_amount_ht double(24,8), + acquisition_value_ht double(24,8) DEFAULT NULL, + recovered_vat double(24,8), + + reversal_date date, + + date_acquisition date NOT NULL, + date_start date NOT NULL, + + qty real DEFAULT 1 NOT NULL, + + acquisition_type smallint DEFAULT 0 NOT NULL, + asset_type smallint DEFAULT 0 NOT NULL, + + not_depreciated integer DEFAULT 0, + + disposal_date date, + disposal_amount_ht double(24,8), + fk_disposal_type integer, + disposal_depreciated integer DEFAULT 0, + disposal_subject_to_vat integer DEFAULT 0, + + note_public text, + note_private text, + + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer NOT NULL +) ENGINE=innodb; + ALTER TABLE llx_asset DROP FOREIGN KEY fk_asset_asset_type; ALTER TABLE llx_asset DROP INDEX idx_asset_fk_asset_type; From b34824c2d5d76e0532668d19a83462c464b613df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 13:52:20 +0200 Subject: [PATCH 0882/1289] Doc --- README-FR.md | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README-FR.md b/README-FR.md index a67bf204076..74be3f1754c 100644 --- a/README-FR.md +++ b/README-FR.md @@ -56,6 +56,10 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: +- Faites une sauvegarde de votre instance [voir ce tutorial](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) + +- Vérifiez que la nouvelle version est compatible avec la version PHP de votre serveur [voir PHP support](https://wiki.dolibarr.org/index.php/Releases). + - Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers fournis dans ce nouveau package. diff --git a/README.md b/README.md index c476f14a8cc..826955aef92 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) -- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). +- Check that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). From 66c6d1927b872b4fef50d2e336194bb8d69bc198 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 16:46:08 +0200 Subject: [PATCH 0883/1289] Fix duplicate invoice created --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 714320fbf1c..d5e44f4afed 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4220,7 +4220,7 @@ abstract class CommonObject $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct - if ($nb_rows_affected >= 0) { + if ($nb_rows_affected > 0) { if (empty($trigkey)) { // Try to guess trigkey (for backward compatibility, now we should have trigkey defined into the call of setStatus) if ($this->element == 'supplier_proposal' && $status == 2) { From 7ebda11ad05f76735288c4c7ce353738b77a2571 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 Oct 2022 22:08:26 +0200 Subject: [PATCH 0884/1289] Fix search in TakePOS --- htdocs/langs/en_US/errors.lang | 1 + htdocs/takepos/admin/terminal.php | 2 +- htdocs/takepos/index.php | 17 +++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 8c5e7562b8b..afcbe76e828 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -14,6 +14,7 @@ ErrorLoginAlreadyExists=Login %s already exists. ErrorGroupAlreadyExists=Group %s already exists. ErrorEmailAlreadyExists=Email %s already exists. ErrorRecordNotFound=Record not found. +ErrorRecordNotFoundShort=Not found ErrorFailToCopyFile=Failed to copy file '%s' into '%s'. ErrorFailToCopyDir=Failed to copy directory '%s' into '%s'. ErrorFailToRenameFile=Failed to rename file '%s' into '%s'. diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 4645f5d9cf2..b2d2b87ced0 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -363,7 +363,7 @@ $htmltext .= ''; print '
'; print load_fiche_titre($langs->trans('FreeLegalTextOnInvoices'), '', ''); -print '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index b567ff5fee9..2dda7872743 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -585,7 +585,9 @@ function New() { * return {void} */ function Search2(keyCodeForEnter, moreorless) { - console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter); + var eventKeyCode = window.event.keyCode; + + console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode); var search_term = $('#search').val(); var search_start = 0; @@ -608,20 +610,19 @@ function Search2(keyCodeForEnter, moreorless) { } var search = false; - var eventKeyCode = window.event.keyCode; - if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) { + if (keyCodeForEnter != '' || eventKeyCode == keyCodeForEnter) { search = true; } if (search === true) { - - // temporization time to give time to type + // if a timer has been already started (search2_timer is a global js variable), we cancel it now + // we click onto another key, we will restart another timer just after if (search2_timer) { clearTimeout(search2_timer); } + // temporization time to give time to type search2_timer = setTimeout(function(){ - pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; @@ -693,8 +694,8 @@ function Search2(keyCodeForEnter, moreorless) { if (data.length == 0) { $('#search').val('load('errors'); - echo dol_escape_js($langs->trans("ErrorRecordNotFound")); - ?>'); + echo dol_escape_js($langs->transnoentitiesnoconv("ErrorRecordNotFoundShort")); + ?> ('+search_term+')'); $('#search').select(); } else ClearSearch(); From 77898ab4566b56bf473fed5e32350220ce8bdf2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 11:52:33 +0200 Subject: [PATCH 0885/1289] Fix f... option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS (do not use this!) --- htdocs/accountancy/admin/index.php | 3 +++ htdocs/accountancy/journal/purchasesjournal.php | 4 ++-- htdocs/accountancy/supplier/list.php | 2 +- htdocs/compta/journal/purchasesjournal.php | 4 ++-- htdocs/core/class/commoninvoice.class.php | 6 +++--- htdocs/core/class/discount.class.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index af569e08ae3..c32148b81fc 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -265,6 +265,9 @@ if (!$user->admin) { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { print '
' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + print '
' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; + } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
'; } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index f2d7721ca90..c175889357c 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -133,7 +133,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND fd.fk_code_ventilation > 0"; $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; @@ -754,7 +754,7 @@ if (empty($action) || $action == 'view') { $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index d14beb84cc2..4593541e87a 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -342,7 +342,7 @@ if (strlen(trim($search_country))) { if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); } -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index ea320007f4d..8646fccc359 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -94,7 +94,7 @@ $periodlink = ''; $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescPurchasesJournal").'
'; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); @@ -118,7 +118,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; $sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn"; $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql .= " WHERE f.fk_statut > 0 AND f.entity IN (".getEntity('invoice').")"; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index bed28c63035..72c8a3c2b9c 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -169,7 +169,7 @@ abstract class CommonInvoice extends CommonObject /** * Return amount (with tax) of all deposits invoices used by invoice. * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended), - * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). + * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). * * @param int $multicurrency Return multicurrency_amount instead of amount * @return float <0 and set ->error if KO, Sum of deposits amount otherwise @@ -177,7 +177,7 @@ abstract class CommonInvoice extends CommonObject public function getSumDepositsUsed($multicurrency = 0) { /*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { - // FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. + // FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. return 0.0; }*/ @@ -373,7 +373,7 @@ abstract class CommonInvoice extends CommonObject $sql = "SELECT rc.amount_ttc as amount, rc.multicurrency_amount_ttc as multicurrency_amount, rc.datec as date, f.ref as ref, rc.description as type"; $sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.((int) $this->id); - $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is set) + $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is set) } if ($sql) { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index dff1383a629..052d5ae7e1c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -559,7 +559,7 @@ class DiscountAbsolute /** * Return amount (with tax) of all deposits invoices used by invoice as a payment. - * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS or FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). * * @param CommonInvoice $invoice Object invoice (customer of supplier) * @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dffde749fbe..107cf07c23d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5701,7 +5701,7 @@ class Form print ''; print '
'; if (!empty($discount_type)) { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!$filter || $filter == "fk_invoice_supplier_source IS NULL") { $translationKey = 'HasAbsoluteDiscountFromSupplier'; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 449ef19176a..3b0f4fdb6e5 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2097,7 +2097,7 @@ if ($action == 'create') { print '
'; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a1fa9a0c0e6..c0ff43083eb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2628,7 +2628,7 @@ if ($action == 'create') { } $resteapayeraffiche = $resteapayer; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 09f12d70e4a..399d1271037 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1600,7 +1600,7 @@ if ($action == 'create') { print '
'.$langs->trans("Parameters").''.$langs->trans('Value').'
'; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { From 020d3dcbe5acc5ce2473c6f9a4d738109c4bbb70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 12:14:04 +0200 Subject: [PATCH 0886/1289] Fix f... option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS (do not use this!) --- htdocs/accountancy/journal/variousjournal.php | 3 + .../facture/class/facturestats.class.php | 17 ++- htdocs/compta/facture/prelevement.php | 4 +- htdocs/compta/localtax/quadri_detail.php | 3 + htdocs/compta/resultat/clientfourn.php | 7 +- htdocs/compta/resultat/index.php | 7 +- htdocs/compta/resultat/result.php | 5 +- htdocs/compta/stats/byratecountry.php | 9 +- htdocs/compta/stats/cabyprodserv.php | 1 - htdocs/compta/tva/clients.php | 3 + htdocs/compta/tva/index.php | 3 + htdocs/compta/tva/quadri_detail.php | 3 + htdocs/core/lib/tax.lib.php | 112 ++++++++++++++---- 13 files changed, 138 insertions(+), 39 deletions(-) diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 32a4adb3569..099ceb1542c 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -201,6 +201,9 @@ if ($object->nature == 2 || $object->nature == 3) { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } } $listofchoices = array('notyet' => $langs->trans("NotYetInGeneralLedger"), 'already' => $langs->trans("AlreadyInGeneralLedger")); diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 522fe9aa2e2..55ae05ff0a5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -97,10 +97,19 @@ class FactureStats extends Stats if ($this->userid > 0) { $this->where .= ' AND f.fk_user_author = '.((int) $this->userid); } - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $this->where .= " AND f.type IN (0,1,2,5)"; - } else { - $this->where .= " AND f.type IN (0,1,2,3,5)"; + if ($mode == 'customer') { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } + } + if ($mode == 'supplier') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } } if ($typentid) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 5a10c2055c0..45844ce0c54 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -253,7 +253,7 @@ if ($object->id > 0) { $resteapayeraffiche = $resteapayer; if ($type == 'bank-transfer') { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -266,7 +266,7 @@ if ($object->id > 0) { $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); } else { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 969376209eb..0f283a6d849 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -193,6 +193,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
'.$lan if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
'.$langs->trans("DepositsAreNotIncluded"); } +if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.='
'.$langs->trans("SupplierDepositsAreNotIncluded"); +} */ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= $langs->trans("ThisIsAnEstimatedValue"); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index e0b2f2823a6..f4babff9572 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -188,6 +188,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -636,7 +639,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -1340,7 +1343,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 9272cb3838a..9a25e516657 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -164,6 +164,9 @@ if ($modecompta == 'CREANCES-DETTES') { } else { $description .= "
".$langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -329,7 +332,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -437,7 +440,7 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index c4c42a130ad..540009ebd95 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -204,6 +204,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -230,8 +233,6 @@ if ($modecompta == "CREANCES-DETTES") { $exportlink = ''; $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; - //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); - //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 86a547204f7..eaec1761117 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -224,7 +224,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } - +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} // Customers invoices $elementcust = $langs->trans("CustomersInvoices"); $productcust = $langs->trans("ProductOrService"); @@ -255,6 +257,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -405,7 +410,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql2 .= " WHERE ff.datef >= '".$db->idate($date_start)."'"; $sql2 .= " AND ff.datef <= '".$db->idate($date_end)."'"; $sql .= " AND ff.fk_statut in (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (0,1,2,5)"; } else { $sql .= " AND ff.type IN (0,1,2,3,5)"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 152c6ac0442..b8f6327ccd5 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -246,7 +246,6 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } - $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices"); diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index f7b860cd792..a4e6e74cce7 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -153,6 +153,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 16b24361160..f0efe305d8c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -211,6 +211,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 15c45d6055b..dc7e868d52c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -163,6 +163,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index a0602dfd74e..29ced3591a1 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -174,10 +174,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -222,10 +230,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -359,10 +375,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -407,10 +431,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -730,10 +762,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -776,10 +816,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -915,10 +963,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -961,10 +1017,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; From 9d0453028dc7ab541f095ba098159cf7003e32a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 12:39:45 +0200 Subject: [PATCH 0887/1289] Fix remove trans --- htdocs/admin/security_other.php | 2 +- htdocs/langs/en_US/admin.lang | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index bec69a7a6e4..d4c5a3e034a 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -193,7 +193,7 @@ print '
'; print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 502953f0140..3a1056e1be7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2311,7 +2311,6 @@ MAIN_MAIL_SMTPS_AUTH_TYPE=Authentification method UsePassword=Use a password UseOauth=Use a OAUTH token Images=Images -Posts=Posts MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with an IP Address CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: From 3a1b4bf9d2a64390eeac26fc74a906cd580e7840 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 13:24:34 +0200 Subject: [PATCH 0888/1289] Better translation for english countries for journals. --- htdocs/install/mysql/data/llx_accounting_abc.sql | 8 ++++---- htdocs/langs/en_US/accountancy.lang | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 8874fad0784..661e786ca06 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -48,11 +48,11 @@ INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('VT', 'ACCOUNTING_SELL_JOURNAL', 2, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AC', 'ACCOUNTING_PURCHASE_JOURNAL', 3, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'FinanceJournal', 4, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'ACCOUNTING_BANK_JOURNAL', 4, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('ER', 'ACCOUNTING_EXPENSEREPORT_JOURNAL', 5, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('OD', 'ACCOUNTING_MISCELLANEOUS_JOURNAL', 1, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AN', 'ACCOUNTING_HAS_NEW_JOURNAL', 9, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('ER', 'ExpenseReportsJournal', 5, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'InventoryJournal', 8, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AN', 'ACCOUNTING_HAS_NEW_JOURNAL', 9, 0, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'ACCOUNTING_INVENTORY_JOURNAL', 8, 0, 1); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index bb4451de682..40482298e63 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -165,12 +165,14 @@ ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow ACCOUNTING_DATE_START_BINDING=Define a date to start binding & transfer in accountancy. Below this date, the transactions will not be transferred to accounting. ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, what is the period selected by default -ACCOUNTING_SELL_JOURNAL=Sell journal -ACCOUNTING_PURCHASE_JOURNAL=Purchase journal -ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal +ACCOUNTING_SELL_JOURNAL=Sales journal (sales and returns) +ACCOUNTING_PURCHASE_JOURNAL=Purchase journal (purchase and returns) +ACCOUNTING_BANK_JOURNAL=Cash journal (receipts and disbursements) ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal -ACCOUNTING_SOCIAL_JOURNAL=Social journal +ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal +ACCOUNTING_INVENTORY_JOURNAL=Inventory journal +ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit) ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) @@ -463,6 +465,5 @@ FECFormatMulticurrencyCode=Multicurrency code (Idevise) DateExport=Date export WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manually in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate. ExpenseReportJournal=Expense Report Journal -InventoryJournal=Inventory Journal NAccounts=%s accounts From 5d782308d59ad688eeb14d640e8e9d48f49f940c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 13:30:52 +0200 Subject: [PATCH 0889/1289] Space missing --- htdocs/install/mysql/data/llx_accounting_account_fr.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index d49e509a5be..4520969f82b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -136,7 +136,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__, 93,'PCG99-ABREGE','INCOME', '75', '1407', 'Autres produits de gestion courante', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94,'PCG99-ABREGE','INCOME', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95,'PCG99-ABREGE','INCOME', '754', '93', 'Ristournes perçues des coopératives', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96,'PCG99-ABREGE','INCOME', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96,'PCG99-ABREGE','INCOME', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97,'PCG99-ABREGE','INCOME', '76', '1407', 'Produits financiers', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98,'PCG99-ABREGE','INCOME', '77', '1407', 'Produits exceptionnels', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99,'PCG99-ABREGE','INCOME', '781', '1407', 'Reprises sur amortissements et provisions', 1); From f0cee03b0f888d5703586d3b6f82a5ae3a64f58e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 13:40:08 +0200 Subject: [PATCH 0890/1289] Standardize chart of account file --- .../mysql/data/llx_accounting_account_gb.sql | 368 +++++++++--------- 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_gb.sql b/htdocs/install/mysql/data/llx_accounting_account_gb.sql index 35c245efa95..fc2acf12395 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_gb.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_gb.sql @@ -26,10 +26,10 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71501, 'ENG-BASE', 'CAPIT', '1', '0', 'Equity, provisions for liabilities and charges and liabilities at more than one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71502, 'ENG-BASE', 'IMMO', '2', '0', 'Administration fees.Fixed assets and receivables over one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71503, 'ENG-BASE', 'STOCK', '3', '0', 'Stock and orders running', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71504, 'ENG-BASE', 'TIERS', '4', '0', 'Amounts receivable and payable within one year', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71504, 'ENG-BASE', 'THIRDPARTY', '4', '0', 'Amounts receivable and payable within one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71505, 'ENG-BASE', 'FINAN', '5', '0', 'Placing of cash and cash equivalents', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71506, 'ENG-BASE', 'CHARGE','6', '0', 'Charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71507, 'ENG-BASE', 'PROD', '7', '0', 'Products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71506, 'ENG-BASE', 'EXPENSE','6', '0', 'Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71507, 'ENG-BASE', 'INCOME', '7', '0', 'Products', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70103, 'ENG-BASE', 'CAPIT', '10', '71501', 'Capital and reserves', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70104, 'ENG-BASE', 'CAPIT', '101', '70103', 'Capital', 1); @@ -158,70 +158,70 @@ 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__, 70227, 'ENG-BASE', 'STOCK', '394', '70223', 'Provisions for depreciation of work in process', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70228, 'ENG-BASE', 'STOCK', '395', '70223', 'Provisions for depreciation of inventories of products', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70229, 'ENG-BASE', 'STOCK', '397', '70223', 'Provisions for depreciation of inventories of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70230, 'ENG-BASE', 'TIERS', '40', '71504', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70231, 'ENG-BASE', 'TIERS', '400', '70230', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70232, 'ENG-BASE', 'TIERS', '401', '70230', 'Suppliers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70233, 'ENG-BASE', 'TIERS', '403', '70230', 'Suppliers - Payables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70234, 'ENG-BASE', 'TIERS', '404', '70230', 'Suppliers of fixed assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70235, 'ENG-BASE', 'TIERS', '405', '70230', 'Capital Suppliers - Payables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70236, 'ENG-BASE', 'TIERS', '408', '70230', 'Supplier invoices not yet received', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70237, 'ENG-BASE', 'TIERS', '409', '70230', 'Debtors suppliers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70238, 'ENG-BASE', 'TIERS', '41', '71504', 'Accounts receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70239, 'ENG-BASE', 'TIERS', '410', '70238', 'Customers and Related Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70240, 'ENG-BASE', 'TIERS', '411', '70238', 'Customers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70241, 'ENG-BASE', 'TIERS', '413', '70238', 'Accounts Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70242, 'ENG-BASE', 'TIERS', '416', '70238', 'Doubtful or contentious customers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70243, 'ENG-BASE', 'TIERS', '418', '70238', 'Customers - Products not yet billed', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70244, 'ENG-BASE', 'TIERS', '419', '70238', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70245, 'ENG-BASE', 'TIERS', '42', '71504', 'Personnel and related accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70246, 'ENG-BASE', 'TIERS', '421', '70245', 'Staff - Remuneration due', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70247, 'ENG-BASE', 'TIERS', '422', '70245', 'Works councils, establishment, ...', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70248, 'ENG-BASE', 'TIERS', '424', '70245', 'Employee participation in results', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70249, 'ENG-BASE', 'TIERS', '425', '70245', 'Staff - Advances and Advances', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70250, 'ENG-BASE', 'TIERS', '426', '70245', 'Staff - Deposits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70251, 'ENG-BASE', 'TIERS', '427', '70245', 'Staff - Oppositions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70252, 'ENG-BASE', 'TIERS', '428', '70245', 'Personnel - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70253, 'ENG-BASE', 'TIERS', '43', '71504', 'Social security and other social organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70254, 'ENG-BASE', 'TIERS', '431', '70253', 'Social Security', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70255, 'ENG-BASE', 'TIERS', '437', '70253', 'Other social organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70256, 'ENG-BASE', 'TIERS', '438', '70253', 'Social organizations - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70257, 'ENG-BASE', 'TIERS', '44', '71504', 'State and other public authorities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70258, 'ENG-BASE', 'TIERS', '441', '70257', 'Status - Grants Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70259, 'ENG-BASE', 'TIERS', '442', '70257', 'Statement - Taxes and taxes recoverable on third parties', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70260, 'ENG-BASE', 'TIERS', '443', '70257', 'Special operations with the State, public authorities, international organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70261, 'ENG-BASE', 'TIERS', '444', '70257', 'State - Income taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70262, 'ENG-BASE', 'TIERS', '445', '70257', 'State - Taxes on turnover', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70263, 'ENG-BASE', 'TIERS', '446', '70257', 'Bonded Bonds', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70264, 'ENG-BASE', 'TIERS', '447', '70257', 'Other taxes, duties and similar payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70265, 'ENG-BASE', 'TIERS', '448', '70257', 'Statement of Accounts Payable and Accrued Income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70266, 'ENG-BASE', 'TIERS', '449', '70257', 'Emission quotas to be returned to the State', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70267, 'ENG-BASE', 'TIERS', '45', '71504', 'Group and Associates', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70268, 'ENG-BASE', 'TIERS', '451', '70267', 'Group', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70269, 'ENG-BASE', 'TIERS', '455', '70267', 'Associates - Current Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70270, 'ENG-BASE', 'TIERS', '456', '70267', 'Associates - Capital transactions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70271, 'ENG-BASE', 'TIERS', '457', '70267', 'Associates - Dividends payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70272, 'ENG-BASE', 'TIERS', '458', '70267', 'Associates- Joint and EIG Operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70273, 'ENG-BASE', 'TIERS', '46', '71504', 'Miscellaneous receivables and creditors', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70274, 'ENG-BASE', 'TIERS', '462', '70273', 'Receivables on disposals of fixed assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70275, 'ENG-BASE', 'TIERS', '464', '70273', 'Debts on acquisitions of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70276, 'ENG-BASE', 'TIERS', '465', '70273', 'Receivables on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70277, 'ENG-BASE', 'TIERS', '467', '70273', 'Other accounts receivable or payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70278, 'ENG-BASE', 'TIERS', '468', '70273', 'Miscellaneous - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70279, 'ENG-BASE', 'TIERS', '47', '71504', 'Transition or suspense accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70280, 'ENG-BASE', 'TIERS', '471', '70279', 'Waiting Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70281, 'ENG-BASE', 'TIERS', '476', '70279', 'Conversion Difference - Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70282, 'ENG-BASE', 'TIERS', '477', '70279', 'Translation differences - Liabilities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70283, 'ENG-BASE', 'TIERS', '478', '70279', 'Other transitional accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70284, 'ENG-BASE', 'TIERS', '48', '71504', 'regularisation account', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70285, 'ENG-BASE', 'TIERS', '481', '70284', 'Expenses to be spread over several financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70286, 'ENG-BASE', 'TIERS', '486', '70284', 'Prepaid expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70287, 'ENG-BASE', 'TIERS', '487', '70284', 'Deferred income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70288, 'ENG-BASE', 'TIERS', '488', '70284', 'Accounts for the periodic distribution of expenses and revenues', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70289, 'ENG-BASE', 'TIERS', '489', '70284', 'Emission allowances allocated by the State', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70290, 'ENG-BASE', 'TIERS', '49', '71504', 'Provisions for depreciation of third party accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70291, 'ENG-BASE', 'TIERS', '491', '70290', 'Provisions for depreciation of customer accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70292, 'ENG-BASE', 'TIERS', '495', '70290', 'Provisions for impairment of group and associate accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70293, 'ENG-BASE', 'TIERS', '496', '70290', 'Provisions for depreciation of accounts receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70230, 'ENG-BASE', 'THIRDPARTY', '40', '71504', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70231, 'ENG-BASE', 'THIRDPARTY', '400', '70230', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70232, 'ENG-BASE', 'THIRDPARTY', '401', '70230', 'Suppliers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70233, 'ENG-BASE', 'THIRDPARTY', '403', '70230', 'Suppliers - Payables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70234, 'ENG-BASE', 'THIRDPARTY', '404', '70230', 'Suppliers of fixed assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70235, 'ENG-BASE', 'THIRDPARTY', '405', '70230', 'Capital Suppliers - Payables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70236, 'ENG-BASE', 'THIRDPARTY', '408', '70230', 'Supplier invoices not yet received', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70237, 'ENG-BASE', 'THIRDPARTY', '409', '70230', 'Debtors suppliers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70238, 'ENG-BASE', 'THIRDPARTY', '41', '71504', 'Accounts receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70239, 'ENG-BASE', 'THIRDPARTY', '410', '70238', 'Customers and Related Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70240, 'ENG-BASE', 'THIRDPARTY', '411', '70238', 'Customers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70241, 'ENG-BASE', 'THIRDPARTY', '413', '70238', 'Accounts Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70242, 'ENG-BASE', 'THIRDPARTY', '416', '70238', 'Doubtful or contentious customers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70243, 'ENG-BASE', 'THIRDPARTY', '418', '70238', 'Customers - Products not yet billed', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70244, 'ENG-BASE', 'THIRDPARTY', '419', '70238', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70245, 'ENG-BASE', 'THIRDPARTY', '42', '71504', 'Personnel and related accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70246, 'ENG-BASE', 'THIRDPARTY', '421', '70245', 'Staff - Remuneration due', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70247, 'ENG-BASE', 'THIRDPARTY', '422', '70245', 'Works councils, establishment, ...', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70248, 'ENG-BASE', 'THIRDPARTY', '424', '70245', 'Employee participation in results', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70249, 'ENG-BASE', 'THIRDPARTY', '425', '70245', 'Staff - Advances and Advances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70250, 'ENG-BASE', 'THIRDPARTY', '426', '70245', 'Staff - Deposits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70251, 'ENG-BASE', 'THIRDPARTY', '427', '70245', 'Staff - Oppositions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70252, 'ENG-BASE', 'THIRDPARTY', '428', '70245', 'Personnel - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70253, 'ENG-BASE', 'THIRDPARTY', '43', '71504', 'Social security and other social organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70254, 'ENG-BASE', 'THIRDPARTY', '431', '70253', 'Social Security', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70255, 'ENG-BASE', 'THIRDPARTY', '437', '70253', 'Other social organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70256, 'ENG-BASE', 'THIRDPARTY', '438', '70253', 'Social organizations - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70257, 'ENG-BASE', 'THIRDPARTY', '44', '71504', 'State and other public authorities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70258, 'ENG-BASE', 'THIRDPARTY', '441', '70257', 'Status - Grants Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70259, 'ENG-BASE', 'THIRDPARTY', '442', '70257', 'Statement - Taxes and taxes recoverable on third parties', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70260, 'ENG-BASE', 'THIRDPARTY', '443', '70257', 'Special operations with the State, public authorities, international organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70261, 'ENG-BASE', 'THIRDPARTY', '444', '70257', 'State - Income taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70262, 'ENG-BASE', 'THIRDPARTY', '445', '70257', 'State - Taxes on turnover', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70263, 'ENG-BASE', 'THIRDPARTY', '446', '70257', 'Bonded Bonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70264, 'ENG-BASE', 'THIRDPARTY', '447', '70257', 'Other taxes, duties and similar payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70265, 'ENG-BASE', 'THIRDPARTY', '448', '70257', 'Statement of Accounts Payable and Accrued Income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70266, 'ENG-BASE', 'THIRDPARTY', '449', '70257', 'Emission quotas to be returned to the State', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70267, 'ENG-BASE', 'THIRDPARTY', '45', '71504', 'Group and Associates', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70268, 'ENG-BASE', 'THIRDPARTY', '451', '70267', 'Group', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70269, 'ENG-BASE', 'THIRDPARTY', '455', '70267', 'Associates - Current Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70270, 'ENG-BASE', 'THIRDPARTY', '456', '70267', 'Associates - Capital transactions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70271, 'ENG-BASE', 'THIRDPARTY', '457', '70267', 'Associates - Dividends payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70272, 'ENG-BASE', 'THIRDPARTY', '458', '70267', 'Associates- Joint and EIG Operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70273, 'ENG-BASE', 'THIRDPARTY', '46', '71504', 'Miscellaneous receivables and creditors', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70274, 'ENG-BASE', 'THIRDPARTY', '462', '70273', 'Receivables on disposals of fixed assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70275, 'ENG-BASE', 'THIRDPARTY', '464', '70273', 'Debts on acquisitions of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70276, 'ENG-BASE', 'THIRDPARTY', '465', '70273', 'Receivables on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70277, 'ENG-BASE', 'THIRDPARTY', '467', '70273', 'Other accounts receivable or payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70278, 'ENG-BASE', 'THIRDPARTY', '468', '70273', 'Miscellaneous - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70279, 'ENG-BASE', 'THIRDPARTY', '47', '71504', 'Transition or suspense accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70280, 'ENG-BASE', 'THIRDPARTY', '471', '70279', 'Waiting Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70281, 'ENG-BASE', 'THIRDPARTY', '476', '70279', 'Conversion Difference - Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70282, 'ENG-BASE', 'THIRDPARTY', '477', '70279', 'Translation differences - Liabilities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70283, 'ENG-BASE', 'THIRDPARTY', '478', '70279', 'Other transitional accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70284, 'ENG-BASE', 'THIRDPARTY', '48', '71504', 'regularisation account', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70285, 'ENG-BASE', 'THIRDPARTY', '481', '70284', 'Expenses to be spread over several financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70286, 'ENG-BASE', 'THIRDPARTY', '486', '70284', 'Prepaid expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70287, 'ENG-BASE', 'THIRDPARTY', '487', '70284', 'Deferred income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70288, 'ENG-BASE', 'THIRDPARTY', '488', '70284', 'Accounts for the periodic distribution of expenses and revenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70289, 'ENG-BASE', 'THIRDPARTY', '489', '70284', 'Emission allowances allocated by the State', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70290, 'ENG-BASE', 'THIRDPARTY', '49', '71504', 'Provisions for depreciation of third party accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70291, 'ENG-BASE', 'THIRDPARTY', '491', '70290', 'Provisions for depreciation of customer accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70292, 'ENG-BASE', 'THIRDPARTY', '495', '70290', 'Provisions for impairment of group and associate accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70293, 'ENG-BASE', 'THIRDPARTY', '496', '70290', 'Provisions for depreciation of accounts receivable', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70294, 'ENG-BASE', 'FINAN', '50', '71505', 'Marketable securities', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70295, 'ENG-BASE', 'FINAN', '501', '70294', 'Shares in related companies', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70296, 'ENG-BASE', 'FINAN', '502', '70294', 'Treasury shares', 1); @@ -250,120 +250,120 @@ 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__, 70319, 'ENG-BASE', 'FINAN', '58', '71505', 'Internal transfers', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70320, 'ENG-BASE', 'FINAN', '59', '71505', 'Provisions for impairment of financial accounts', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70321, 'ENG-BASE', 'FINAN', '590', '70320', 'Provisions for depreciation of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70322, 'ENG-BASE', 'CHARGE', '60', '71506', 'Shopping', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70323, 'ENG-BASE', 'CHARGE', '601', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70324, 'ENG-BASE', 'CHARGE', '602', '70322', 'Stored Procurement - Other Supplies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70325, 'ENG-BASE', 'CHARGE', '603', '70322', 'Inventory Changes (Supplies and Commodities)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70326, 'ENG-BASE', 'CHARGE', '604', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70327, 'ENG-BASE', 'CHARGE', '605', '70322', 'Purchase of equipment, works and equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70328, 'ENG-BASE', 'CHARGE', '606', '70322', 'Non-stock purchases of materials and supplies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70329, 'ENG-BASE', 'CHARGE', '607', '70322', 'Purchases of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70330, 'ENG-BASE', 'CHARGE', '608', '70322', 'Reserved account, where applicable, to the recapitulation of incidental expenses included in purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70331, 'ENG-BASE', 'CHARGE', '609', '70322', 'Discounts, rebates and rebates obtained on purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70332, 'ENG-BASE', 'CHARGE', '61', '71506', 'Outside services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70333, 'ENG-BASE', 'CHARGE', '611', '70332', 'General subcontracting', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70334, 'ENG-BASE', 'CHARGE', '612', '70332', 'Lease payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70335, 'ENG-BASE', 'CHARGE', '613', '70332', 'Rentals', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70336, 'ENG-BASE', 'CHARGE', '614', '70332', 'Rental and condominium expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70337, 'ENG-BASE', 'CHARGE', '615', '70332', 'Maintenance and repairs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70338, 'ENG-BASE', 'CHARGE', '616', '70332', 'Insurance premiums', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70339, 'ENG-BASE', 'CHARGE', '617', '70332', 'Studies and research', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70340, 'ENG-BASE', 'CHARGE', '618', '70332', 'Various', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70341, 'ENG-BASE', 'CHARGE', '619', '70332', 'Discounts, rebates and rebates obtained on external services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70342, 'ENG-BASE', 'CHARGE', '62', '71506', 'Other services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70343, 'ENG-BASE', 'CHARGE', '621', '70342', 'Staff outside the company', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70344, 'ENG-BASE', 'CHARGE', '622', '70342', 'Remuneration of intermediaries and fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70345, 'ENG-BASE', 'CHARGE', '623', '70342', 'Advertising, publications, public relations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70346, 'ENG-BASE', 'CHARGE', '624', '70342', 'Transport of goods and public transport of personnel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70347, 'ENG-BASE', 'CHARGE', '625', '70342', 'Travel, missions and receptions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70348, 'ENG-BASE', 'CHARGE', '626', '70342', 'Postal and telecommunications costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70349, 'ENG-BASE', 'CHARGE', '627', '70342', 'Banking and related services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70350, 'ENG-BASE', 'CHARGE', '628', '70342', 'Various', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70351, 'ENG-BASE', 'CHARGE', '629', '70342', 'Discounts, rebates and rebates obtained on other external services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70352, 'ENG-BASE', 'CHARGE', '63', '71506', 'Taxes other and payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70353, 'ENG-BASE', 'CHARGE', '631', '70352', 'Taxes and similar payments on remuneration (tax administrations)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70354, 'ENG-BASE', 'CHARGE', '633', '70352', 'Taxes and similar payments on remuneration (other bodies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70355, 'ENG-BASE', 'CHARGE', '635', '70352', 'Other taxes, duties and similar payments (tax administrations)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70356, 'ENG-BASE', 'CHARGE', '637', '70352', 'Other taxes, duties and similar payments (other bodies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70357, 'ENG-BASE', 'CHARGE', '64', '71506', 'Staff costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70358, 'ENG-BASE', 'CHARGE', '641', '70357', 'Remuneration of staff', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70359, 'ENG-BASE', 'CHARGE', '644', '70357', 'Remuneration of the operator''s work', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70360, 'ENG-BASE', 'CHARGE', '645', '70357', 'Social Security and Welfare Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70361, 'ENG-BASE', 'CHARGE', '646', '70357', 'Personal social contributions of the operator', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70362, 'ENG-BASE', 'CHARGE', '647', '70357', 'Other payroll taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70363, 'ENG-BASE', 'CHARGE', '648', '70357', 'Other staff costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70364, 'ENG-BASE', 'CHARGE', '65', '71506', 'Other current operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70365, 'ENG-BASE', 'CHARGE', '651', '70364', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70366, 'ENG-BASE', 'CHARGE', '653', '70364', 'Attendance fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70367, 'ENG-BASE', 'CHARGE', '654', '70364', 'Loss on bad debts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70368, 'ENG-BASE', 'CHARGE', '655', '70364', 'Share of profit or loss on transactions made jointly', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70369, 'ENG-BASE', 'CHARGE', '658', '70364', 'Miscellaneous operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70370, 'ENG-BASE', 'CHARGE', '66', '71506', 'Financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70371, 'ENG-BASE', 'CHARGE', '661', '70370', 'Interest charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70372, 'ENG-BASE', 'CHARGE', '664', '70370', 'Loss on receivables related to investments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70373, 'ENG-BASE', 'CHARGE', '665', '70370', 'Discounts granted', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70374, 'ENG-BASE', 'CHARGE', '666', '70370', 'Exchange losses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70375, 'ENG-BASE', 'CHARGE', '667', '70370', 'Net expense on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70376, 'ENG-BASE', 'CHARGE', '668', '70370', 'Other financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70377, 'ENG-BASE', 'CHARGE', '67', '71506', 'Extraordinary charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70378, 'ENG-BASE', 'CHARGE', '671', '70377', 'Exceptional charges on management operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70379, 'ENG-BASE', 'CHARGE', '672', '70377', 'Account available to entities to record, in the course of the financial year, expenses over previous financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70380, 'ENG-BASE', 'CHARGE', '675', '70377', 'Book value of assets sold', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70381, 'ENG-BASE', 'CHARGE', '678', '70377', 'Other extraordinary expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70382, 'ENG-BASE', 'CHARGE', '68', '71506', 'Depreciation, amortization and provisions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70383, 'ENG-BASE', 'CHARGE', '681', '70382', 'Depreciation, amortization and provisions - Operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70384, 'ENG-BASE', 'CHARGE', '686', '70382', 'Depreciation, amortization and provisions - Financial expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70385, 'ENG-BASE', 'CHARGE', '687', '70382', 'Depreciation, amortization and provisions - Extraordinary expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70386, 'ENG-BASE', 'CHARGE', '69', '71506', 'Employee participation - income tax and assimilated', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70387, 'ENG-BASE', 'CHARGE', '691', '70386', 'Employee participation in results', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70388, 'ENG-BASE', 'CHARGE', '695', '70386', 'Income taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70389, 'ENG-BASE', 'CHARGE', '696', '70386', 'Corporate income tax related to distributions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70390, 'ENG-BASE', 'CHARGE', '697', '70386', 'Annual corporation tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70391, 'ENG-BASE', 'CHARGE', '698', '70386', 'Tax integration', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70392, 'ENG-BASE', 'CHARGE', '699', '70386', 'Products - Reports back deficits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70393, 'ENG-BASE', 'PROD', '70', '71507', 'Sales of manufactured goods, services, goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70394, 'ENG-BASE', 'PROD', '701', '70393', 'Sales of finished products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70395, 'ENG-BASE', 'PROD', '702', '70393', 'Sales of intermediate products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70396, 'ENG-BASE', 'PROD', '703', '70393', 'Sales of residual products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70397, 'ENG-BASE', 'PROD', '704', '70393', 'Works', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70398, 'ENG-BASE', 'PROD', '705', '70393', 'Studies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70399, 'ENG-BASE', 'PROD', '706', '70393', 'Services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70400, 'ENG-BASE', 'PROD', '707', '70393', 'Sale of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70401, 'ENG-BASE', 'PROD', '708', '70393', 'Income from ancillary activities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70402, 'ENG-BASE', 'PROD', '709', '70393', 'Discounts, rebates and rebates granted by the company', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70403, 'ENG-BASE', 'PROD', '71', '71507', 'Stored production (or destocking)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70404, 'ENG-BASE', 'PROD', '713', '70403', 'Change in stocks (in-process production, products)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70405, 'ENG-BASE', 'PROD', '72', '71507', 'Immobilised production', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70406, 'ENG-BASE', 'PROD', '721', '70405', 'Intangible assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70407, 'ENG-BASE', 'PROD', '722', '70405', 'Property, plant and equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70408, 'ENG-BASE', 'PROD', '74', '71507', 'Operating grants', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70409, 'ENG-BASE', 'PROD', '75', '71507', 'Other management products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70410, 'ENG-BASE', 'PROD', '751', '70409', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70411, 'ENG-BASE', 'PROD', '752', '70409', 'Income from buildings not used for professional purposes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70412, 'ENG-BASE', 'PROD', '753', '70409', 'Directors'' fees and remuneration of directors, managers, ...', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70413, 'ENG-BASE', 'PROD', '754', '70409', 'Perceived refunds of cooperatives (from surplus)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70414, 'ENG-BASE', 'PROD', '755', '70409', 'Share of profits on transactions made jointly', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70415, 'ENG-BASE', 'PROD', '758', '70409', 'Miscellaneous current management products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70416, 'ENG-BASE', 'PROD', '76', '71507', 'Financial products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70417, 'ENG-BASE', 'PROD', '761', '70416', 'Income from participations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70418, 'ENG-BASE', 'PROD', '762', '70416', 'Income from other financial assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70419, 'ENG-BASE', 'PROD', '763', '70416', 'Revenue from other receivables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70420, 'ENG-BASE', 'PROD', '764', '70416', 'Income from marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70421, 'ENG-BASE', 'PROD', '765', '70416', 'Discounts obtained', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70422, 'ENG-BASE', 'PROD', '766', '70416', 'Exchange gains', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70423, 'ENG-BASE', 'PROD', '767', '70416', 'Net proceeds on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70424, 'ENG-BASE', 'PROD', '768', '70416', 'Other financial income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70425, 'ENG-BASE', 'PROD', '77', '71507', 'Exceptional products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70426, 'ENG-BASE', 'PROD', '771', '70425', 'Extraordinary income from management operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70427, 'ENG-BASE', 'PROD', '772', '70425', 'Account available to entities to record, during the financial year, the revenues over previous financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70428, 'ENG-BASE', 'PROD', '775', '70425', 'Proceeds from disposals of assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70429, 'ENG-BASE', 'PROD', '777', '70425', 'Share of investment grants transferred to profit or loss for the year', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70430, 'ENG-BASE', 'PROD', '778', '70425', 'Other extraordinary income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70431, 'ENG-BASE', 'PROD', '78', '71507', 'Reversals of depreciation and provisions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70432, 'ENG-BASE', 'PROD', '781', '70431', 'Reversals of depreciation and provisions (to be included in revenue)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70433, 'ENG-BASE', 'PROD', '786', '70431', 'Reversals of provisions for risks (to be recorded in financial income)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70434, 'ENG-BASE', 'PROD', '787', '70431', 'Reversals of provisions (to be recorded in exceptional income)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70435, 'ENG-BASE', 'PROD', '79', '71507', 'Transfers of charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70436, 'ENG-BASE', 'PROD', '791', '70435', 'Transfers of operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70437, 'ENG-BASE', 'PROD', '796', '70435', 'Transfers of financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70438, 'ENG-BASE', 'PROD', '797', '70435', 'Transfers of Exceptional Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70322, 'ENG-BASE', 'EXPENSE', '60', '71506', 'Shopping', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70323, 'ENG-BASE', 'EXPENSE', '601', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70324, 'ENG-BASE', 'EXPENSE', '602', '70322', 'Stored Procurement - Other Supplies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70325, 'ENG-BASE', 'EXPENSE', '603', '70322', 'Inventory Changes (Supplies and Commodities)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70326, 'ENG-BASE', 'EXPENSE', '604', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70327, 'ENG-BASE', 'EXPENSE', '605', '70322', 'Purchase of equipment, works and equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70328, 'ENG-BASE', 'EXPENSE', '606', '70322', 'Non-stock purchases of materials and supplies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70329, 'ENG-BASE', 'EXPENSE', '607', '70322', 'Purchases of goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70330, 'ENG-BASE', 'EXPENSE', '608', '70322', 'Reserved account, where applicable, to the recapitulation of incidental expenses included in purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70331, 'ENG-BASE', 'EXPENSE', '609', '70322', 'Discounts, rebates and rebates obtained on purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70332, 'ENG-BASE', 'EXPENSE', '61', '71506', 'Outside services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70333, 'ENG-BASE', 'EXPENSE', '611', '70332', 'General subcontracting', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70334, 'ENG-BASE', 'EXPENSE', '612', '70332', 'Lease payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70335, 'ENG-BASE', 'EXPENSE', '613', '70332', 'Rentals', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70336, 'ENG-BASE', 'EXPENSE', '614', '70332', 'Rental and condominium expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70337, 'ENG-BASE', 'EXPENSE', '615', '70332', 'Maintenance and repairs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70338, 'ENG-BASE', 'EXPENSE', '616', '70332', 'Insurance premiums', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70339, 'ENG-BASE', 'EXPENSE', '617', '70332', 'Studies and research', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70340, 'ENG-BASE', 'EXPENSE', '618', '70332', 'Various', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70341, 'ENG-BASE', 'EXPENSE', '619', '70332', 'Discounts, rebates and rebates obtained on external services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70342, 'ENG-BASE', 'EXPENSE', '62', '71506', 'Other services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70343, 'ENG-BASE', 'EXPENSE', '621', '70342', 'Staff outside the company', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70344, 'ENG-BASE', 'EXPENSE', '622', '70342', 'Remuneration of intermediaries and fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70345, 'ENG-BASE', 'EXPENSE', '623', '70342', 'Advertising, publications, public relations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70346, 'ENG-BASE', 'EXPENSE', '624', '70342', 'Transport of goods and public transport of personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70347, 'ENG-BASE', 'EXPENSE', '625', '70342', 'Travel, missions and receptions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70348, 'ENG-BASE', 'EXPENSE', '626', '70342', 'Postal and telecommunications costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70349, 'ENG-BASE', 'EXPENSE', '627', '70342', 'Banking and related services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70350, 'ENG-BASE', 'EXPENSE', '628', '70342', 'Various', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70351, 'ENG-BASE', 'EXPENSE', '629', '70342', 'Discounts, rebates and rebates obtained on other external services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70352, 'ENG-BASE', 'EXPENSE', '63', '71506', 'Taxes other and payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70353, 'ENG-BASE', 'EXPENSE', '631', '70352', 'Taxes and similar payments on remuneration (tax administrations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70354, 'ENG-BASE', 'EXPENSE', '633', '70352', 'Taxes and similar payments on remuneration (other bodies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70355, 'ENG-BASE', 'EXPENSE', '635', '70352', 'Other taxes, duties and similar payments (tax administrations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70356, 'ENG-BASE', 'EXPENSE', '637', '70352', 'Other taxes, duties and similar payments (other bodies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70357, 'ENG-BASE', 'EXPENSE', '64', '71506', 'Staff costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70358, 'ENG-BASE', 'EXPENSE', '641', '70357', 'Remuneration of staff', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70359, 'ENG-BASE', 'EXPENSE', '644', '70357', 'Remuneration of the operator''s work', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70360, 'ENG-BASE', 'EXPENSE', '645', '70357', 'Social Security and Welfare Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70361, 'ENG-BASE', 'EXPENSE', '646', '70357', 'Personal social contributions of the operator', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70362, 'ENG-BASE', 'EXPENSE', '647', '70357', 'Other payroll taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70363, 'ENG-BASE', 'EXPENSE', '648', '70357', 'Other staff costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70364, 'ENG-BASE', 'EXPENSE', '65', '71506', 'Other current operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70365, 'ENG-BASE', 'EXPENSE', '651', '70364', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70366, 'ENG-BASE', 'EXPENSE', '653', '70364', 'Attendance fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70367, 'ENG-BASE', 'EXPENSE', '654', '70364', 'Loss on bad debts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70368, 'ENG-BASE', 'EXPENSE', '655', '70364', 'Share of profit or loss on transactions made jointly', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70369, 'ENG-BASE', 'EXPENSE', '658', '70364', 'Miscellaneous operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70370, 'ENG-BASE', 'EXPENSE', '66', '71506', 'Financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70371, 'ENG-BASE', 'EXPENSE', '661', '70370', 'Interest charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70372, 'ENG-BASE', 'EXPENSE', '664', '70370', 'Loss on receivables related to investments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70373, 'ENG-BASE', 'EXPENSE', '665', '70370', 'Discounts granted', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70374, 'ENG-BASE', 'EXPENSE', '666', '70370', 'Exchange losses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70375, 'ENG-BASE', 'EXPENSE', '667', '70370', 'Net expense on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70376, 'ENG-BASE', 'EXPENSE', '668', '70370', 'Other financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70377, 'ENG-BASE', 'EXPENSE', '67', '71506', 'Extraordinary charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70378, 'ENG-BASE', 'EXPENSE', '671', '70377', 'Exceptional charges on management operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70379, 'ENG-BASE', 'EXPENSE', '672', '70377', 'Account available to entities to record, in the course of the financial year, expenses over previous financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70380, 'ENG-BASE', 'EXPENSE', '675', '70377', 'Book value of assets sold', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70381, 'ENG-BASE', 'EXPENSE', '678', '70377', 'Other extraordinary expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70382, 'ENG-BASE', 'EXPENSE', '68', '71506', 'Depreciation, amortization and provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70383, 'ENG-BASE', 'EXPENSE', '681', '70382', 'Depreciation, amortization and provisions - Operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70384, 'ENG-BASE', 'EXPENSE', '686', '70382', 'Depreciation, amortization and provisions - Financial expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70385, 'ENG-BASE', 'EXPENSE', '687', '70382', 'Depreciation, amortization and provisions - Extraordinary expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70386, 'ENG-BASE', 'EXPENSE', '69', '71506', 'Employee participation - income tax and assimilated', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70387, 'ENG-BASE', 'EXPENSE', '691', '70386', 'Employee participation in results', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70388, 'ENG-BASE', 'EXPENSE', '695', '70386', 'Income taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70389, 'ENG-BASE', 'EXPENSE', '696', '70386', 'Corporate income tax related to distributions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70390, 'ENG-BASE', 'EXPENSE', '697', '70386', 'Annual corporation tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70391, 'ENG-BASE', 'EXPENSE', '698', '70386', 'Tax integration', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70392, 'ENG-BASE', 'EXPENSE', '699', '70386', 'Products - Reports back deficits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70393, 'ENG-BASE', 'INCOME', '70', '71507', 'Sales of manufactured goods, services, goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70394, 'ENG-BASE', 'INCOME', '701', '70393', 'Sales of finished products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70395, 'ENG-BASE', 'INCOME', '702', '70393', 'Sales of intermediate products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70396, 'ENG-BASE', 'INCOME', '703', '70393', 'Sales of residual products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70397, 'ENG-BASE', 'INCOME', '704', '70393', 'Works', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70398, 'ENG-BASE', 'INCOME', '705', '70393', 'Studies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70399, 'ENG-BASE', 'INCOME', '706', '70393', 'Services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70400, 'ENG-BASE', 'INCOME', '707', '70393', 'Sale of goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70401, 'ENG-BASE', 'INCOME', '708', '70393', 'Income from ancillary activities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70402, 'ENG-BASE', 'INCOME', '709', '70393', 'Discounts, rebates and rebates granted by the company', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70403, 'ENG-BASE', 'INCOME', '71', '71507', 'Stored production (or destocking)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70404, 'ENG-BASE', 'INCOME', '713', '70403', 'Change in stocks (in-process production, products)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70405, 'ENG-BASE', 'INCOME', '72', '71507', 'Immobilised production', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70406, 'ENG-BASE', 'INCOME', '721', '70405', 'Intangible assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70407, 'ENG-BASE', 'INCOME', '722', '70405', 'Property, plant and equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70408, 'ENG-BASE', 'INCOME', '74', '71507', 'Operating grants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70409, 'ENG-BASE', 'INCOME', '75', '71507', 'Other management products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70410, 'ENG-BASE', 'INCOME', '751', '70409', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70411, 'ENG-BASE', 'INCOME', '752', '70409', 'Income from buildings not used for professional purposes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70412, 'ENG-BASE', 'INCOME', '753', '70409', 'Directors'' fees and remuneration of directors, managers, ...', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70413, 'ENG-BASE', 'INCOME', '754', '70409', 'Perceived refunds of cooperatives (from surplus)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70414, 'ENG-BASE', 'INCOME', '755', '70409', 'Share of profits on transactions made jointly', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70415, 'ENG-BASE', 'INCOME', '758', '70409', 'Miscellaneous current management products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70416, 'ENG-BASE', 'INCOME', '76', '71507', 'Financial products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70417, 'ENG-BASE', 'INCOME', '761', '70416', 'Income from participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70418, 'ENG-BASE', 'INCOME', '762', '70416', 'Income from other financial assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70419, 'ENG-BASE', 'INCOME', '763', '70416', 'Revenue from other receivables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70420, 'ENG-BASE', 'INCOME', '764', '70416', 'Income from marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70421, 'ENG-BASE', 'INCOME', '765', '70416', 'Discounts obtained', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70422, 'ENG-BASE', 'INCOME', '766', '70416', 'Exchange gains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70423, 'ENG-BASE', 'INCOME', '767', '70416', 'Net proceeds on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70424, 'ENG-BASE', 'INCOME', '768', '70416', 'Other financial income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70425, 'ENG-BASE', 'INCOME', '77', '71507', 'Exceptional products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70426, 'ENG-BASE', 'INCOME', '771', '70425', 'Extraordinary income from management operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70427, 'ENG-BASE', 'INCOME', '772', '70425', 'Account available to entities to record, during the financial year, the revenues over previous financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70428, 'ENG-BASE', 'INCOME', '775', '70425', 'Proceeds from disposals of assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70429, 'ENG-BASE', 'INCOME', '777', '70425', 'Share of investment grants transferred to profit or loss for the year', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70430, 'ENG-BASE', 'INCOME', '778', '70425', 'Other extraordinary income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70431, 'ENG-BASE', 'INCOME', '78', '71507', 'Reversals of depreciation and provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70432, 'ENG-BASE', 'INCOME', '781', '70431', 'Reversals of depreciation and provisions (to be included in revenue)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70433, 'ENG-BASE', 'INCOME', '786', '70431', 'Reversals of provisions for risks (to be recorded in financial income)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70434, 'ENG-BASE', 'INCOME', '787', '70431', 'Reversals of provisions (to be recorded in exceptional income)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70435, 'ENG-BASE', 'INCOME', '79', '71507', 'Transfers of charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70436, 'ENG-BASE', 'INCOME', '791', '70435', 'Transfers of operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70437, 'ENG-BASE', 'INCOME', '796', '70435', 'Transfers of financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70438, 'ENG-BASE', 'INCOME', '797', '70435', 'Transfers of Exceptional Charges', 1); From 4cf294f14a3d961a0ac303c57ea13f94abf26510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 Oct 2022 13:42:47 +0200 Subject: [PATCH 0891/1289] typo --- htdocs/core/modules/modFacture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 9eac5d7b5e7..2cc4b1f7429 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -239,7 +239,7 @@ class modFacture extends DolibarrModules 'f.ref' => 'InvoiceRef*', 'f.ref_ext' => 'ExternalRef', 'f.ref_int' => 'ExternalRef', - 'f.ref_client' => 'CutomerRef', + 'f.ref_client' => 'CustomerRef', 'f.type' => 'Type*', 'f.fk_soc' => 'Customer*', 'f.datec' => 'InvoiceDateCreation', From 541b4e0b64cbb0ecdf95bc1dc66089a0bb5ab788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 Oct 2022 13:49:04 +0200 Subject: [PATCH 0892/1289] Update modFacture.class.php --- htdocs/core/modules/modFacture.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 2cc4b1f7429..23b9ea85639 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -352,7 +353,7 @@ class modFacture extends DolibarrModules ) ); - //Import Supplier Invoice Lines + // Import Invoice Lines $r++; $this->import_code[$r] = $this->rights_class.'_'.$r; $this->import_label[$r] = "InvoiceLine"; // Translation key From 62c3d3b2f010c85b44f88ab0aed6e64cea1801e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 14:06:30 +0200 Subject: [PATCH 0893/1289] MODULEBUILDER_SPECIFIC_EDITOR_NAME/URL is now a stable option --- htdocs/modulebuilder/admin/setup.php | 26 ++++++++++--------- htdocs/modulebuilder/index.php | 39 ++++++++++++++++------------ 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 50c86e38cc0..4c7e597e889 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -132,21 +132,23 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } } print ''; +} - print ''; - print ''; - print ''; - print ''; +print ''; +print ''; +print ''; +print ''; - print ''; - print ''; - print ''; - print ''; +print ''; +print ''; +print ''; +print ''; +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''; print ''; print ''; From 9fa00c1771e2a3ef8b0996622cea4431d98b7fc0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 15:29:30 +0200 Subject: [PATCH 0894/1289] Fix trans in comments --- .../iso-normes/accountancy/accountancy_rules.txt | 8 ++++++++ htdocs/comm/index.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/class/commande.class.php | 4 ++-- htdocs/commande/index.php | 2 +- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/modules/asset/mod_asset_standard.php | 2 +- htdocs/core/modules/bom/mod_bom_standard.php | 2 +- htdocs/core/modules/commande/mod_commande_marbre.php | 4 ++-- htdocs/core/modules/commande/mod_commande_saphir.php | 4 ++-- htdocs/core/modules/hrm/mod_evaluation_standard.php | 2 +- htdocs/core/modules/modApi.class.php | 2 +- htdocs/core/modules/modAsset.class.php | 2 +- htdocs/core/modules/modBom.class.php | 2 +- htdocs/core/modules/modCommande.class.php | 3 +-- htdocs/core/modules/modDataPolicy.class.php | 2 +- htdocs/core/modules/modDav.class.php | 2 +- htdocs/core/modules/modEmailCollector.class.php | 2 +- htdocs/core/modules/modEventOrganization.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modKnowledgeManagement.class.php | 2 +- htdocs/core/modules/modMrp.class.php | 2 +- htdocs/core/modules/modMultiCurrency.class.php | 2 +- htdocs/core/modules/modPartnership.class.php | 2 +- htdocs/core/modules/modRecruitment.class.php | 2 +- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modStockTransfer.class.php | 2 +- htdocs/core/modules/modTakePos.class.php | 2 +- htdocs/core/modules/modWebhook.class.php | 2 +- htdocs/core/modules/modWorkstation.class.php | 2 +- htdocs/core/modules/modZapier.class.php | 2 +- htdocs/core/modules/propale/mod_propale_marbre.php | 2 +- .../modules/stocktransfer/mod_stocktransfer_standard.php | 2 +- .../supplier_proposal/mod_supplier_proposal_marbre.php | 2 +- .../core/modules/workstation/mod_workstation_standard.php | 2 +- .../interface_95_modZapier_ZapierTriggers.class.php | 2 +- htdocs/emailcollector/class/emailcollector.class.php | 8 ++++---- htdocs/fourn/class/fournisseur.commande.class.php | 8 ++++---- htdocs/fourn/commande/list.php | 2 +- htdocs/index.php | 2 +- .../knowledgemanagement/mod_knowledgerecord_standard.php | 2 +- .../template/core/modules/modMyModule.class.php | 2 +- .../core/modules/mymodule/mod_myobject_advanced.php | 2 +- .../core/modules/mymodule/mod_myobject_standard.php | 2 +- .../interface_99_modMyModule_MyModuleTriggers.class.php | 2 +- .../core/modules/partnership/mod_partnership_advanced.php | 2 +- .../core/modules/partnership/mod_partnership_standard.php | 2 +- htdocs/product/stock/product.php | 4 ++-- htdocs/projet/graph_opportunities.inc.php | 2 +- htdocs/public/payment/newpayment.php | 2 +- .../recruitment/mod_recruitmentcandidature_advanced.php | 2 +- .../recruitment/mod_recruitmentcandidature_standard.php | 2 +- .../recruitment/mod_recruitmentjobposition_advanced.php | 2 +- .../recruitment/mod_recruitmentjobposition_standard.php | 2 +- htdocs/supplier_proposal/index.php | 2 +- 57 files changed, 77 insertions(+), 70 deletions(-) diff --git a/dev/resources/iso-normes/accountancy/accountancy_rules.txt b/dev/resources/iso-normes/accountancy/accountancy_rules.txt index a265bcf4f54..918d0f01d3c 100644 --- a/dev/resources/iso-normes/accountancy/accountancy_rules.txt +++ b/dev/resources/iso-normes/accountancy/accountancy_rules.txt @@ -12,3 +12,11 @@ Le client règle rapidement et on lui accorde un escompte de 3% (120 € * 3% = 411xxx 3,60 € TTC Et ça marche à l’inverse avec un fournisseur sauf que l’on est en 775000 au lieu de 665000 pour escompte obtenus. + + + + +Un compte comptable de Tiers vente = Acount Receivable +Un compte comptable de Tiers achat = Acount Payable + + \ No newline at end of file diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 27f9b91a9d7..15f94043b1c 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -321,7 +321,7 @@ if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) /* - * Draft customer orders + * Draft sales orders */ if (isModEnabled('commande') && $user->rights->commande->lire) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2afc01914e0..7b447aaf941 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -32,7 +32,7 @@ /** * \file htdocs/commande/card.php * \ingroup commande - * \brief Page to show customer order + * \brief Page to show sales order */ // Load Dolibarr environment diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index aa7a7f11a55..11761333794 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3395,7 +3395,7 @@ class Commande extends CommonOrder } /** - * Delete the customer order + * Delete the sales order * * @param User $user User object * @param int $notrigger 1=Does not execute triggers, 0= execute triggers @@ -4062,7 +4062,7 @@ class Commande extends CommonOrder } /** - * Is the customer order delayed? + * Is the sales order delayed? * * @return bool true if late, false if not */ diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 9ee103911f7..9b653b90e65 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -22,7 +22,7 @@ /** * \file htdocs/commande/index.php * \ingroup commande - * \brief Home page of customer order module + * \brief Home page of sales order module */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 334418833b4..5a67d5b120e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9133,10 +9133,10 @@ function getLanguageCodeFromCountryCode($countrycode) * @param string $type Value for object where objectvalue can be * 'thirdparty' to add a tab in third party view * 'intervention' to add a tab in intervention view - * 'supplier_order' to add a tab in supplier order view - * 'supplier_invoice' to add a tab in supplier invoice view - * 'invoice' to add a tab in customer invoice view - * 'order' to add a tab in customer order view + * 'supplier_order' to add a tab in purchase order view + * 'supplier_invoice' to add a tab in purchase invoice view + * 'invoice' to add a tab in sales invoice view + * 'order' to add a tab in sales order view * 'contract' to add a tabl in contract view * 'product' to add a tab in product view * 'propal' to add a tab in propal view diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 5c77f8ab821..a106bf62369 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -189,7 +189,7 @@ function order_admin_prepare_head() /** - * Return a HTML table that contains a pie chart of customer orders + * Return a HTML table that contains a pie chart of sales orders * * @param int $socid (Optional) Show only results from the customer with this id * @return string A HTML table that contains a pie chart of customer invoices diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a9f82e3776d..a1bccc1dd28 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -448,7 +448,7 @@ function show_stats_for_company($product, $socid) print ''; print ''; } - // Customer orders + // Sales orders if (isModEnabled('commande') && $user->rights->commande->lire) { $nblines++; $ret = $product->load_stats_commande($socid); diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php index af28c0f9c5b..2e3ee3938e1 100644 --- a/htdocs/core/modules/asset/mod_asset_standard.php +++ b/htdocs/core/modules/asset/mod_asset_standard.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/asset/modules_asset.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Asset */ class mod_asset_standard extends ModeleNumRefAsset { diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index f5a9fb75976..db2d0f2ed7f 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -25,7 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/bom/modules_bom.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for BOM */ class mod_bom_standard extends ModeleNumRefboms { diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 8c9ef0385eb..71a41d0b3c4 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -20,12 +20,12 @@ /** * \file htdocs/core/modules/commande/mod_commande_marbre.php * \ingroup commande - * \brief File of class to manage customer order numbering rules Marbre + * \brief File of class to manage Sales Order numbering rules Marbre */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; /** - * Class to manage customer order numbering rules Marbre + * Class to manage Sales Order numbering rules Marbre */ class mod_commande_marbre extends ModeleNumRefCommandes { diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index ad2b109f2d1..07dcfdced9e 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -23,14 +23,14 @@ /** * \file htdocs/core/modules/commande/mod_commande_saphir.php * \ingroup commande - * \brief Fichier contenant la classe du modele de numerotation de reference de commande Saphir + * \brief File of class to manage Sales Order numbering rules Saphir */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; /** - * Class to manage customer order numbering rules Saphir + * Class to manage Sales Order numbering rules Saphir */ class mod_commande_saphir extends ModeleNumRefCommandes { diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index 4c5bb083870..b6b517b8fb9 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -26,7 +26,7 @@ dol_include_once('/core/modules/hrm/modules_evaluation.php'); /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for HR evaluation */ class mod_evaluation_standard extends ModeleNumRefEvaluation { diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 48420a264d3..5eaae25a67c 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -107,7 +107,7 @@ class modApi extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index fbe6134c797..a0fb405887e 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -137,7 +137,7 @@ class modAsset extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index d39affa4d78..6f2cc7ac4b2 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -156,7 +156,7 @@ class modBom extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 6a88c14271b..f0486b5cb58 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -34,11 +34,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** - * Class to describe module customer orders + * Class to describe module Sales Orders */ class modCommande extends DolibarrModules { - /** * Constructor. Define names, constants, directories, boxes, permissions * diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 2768e7d1d7a..93f3e6f4024 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -162,7 +162,7 @@ class modDataPolicy extends DolibarrModules { // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index aeea231fd1e..356f043cea0 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -131,7 +131,7 @@ class modDav extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 03c668910ce..514fe1be667 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -131,7 +131,7 @@ class modEmailCollector extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 6708eb4192a..f600ef633aa 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -169,7 +169,7 @@ class modEventOrganization extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 0da5663d452..09ff03cae9b 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -141,7 +141,7 @@ class modHRM extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 634f36406a2..b331c56a917 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -184,7 +184,7 @@ class modKnowledgeManagement extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index f93ce224662..fb836c8393b 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -168,7 +168,7 @@ class modMrp extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 54297d5e77c..f08c9a4b021 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -113,7 +113,7 @@ class modMultiCurrency extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index ccd67542830..8e8421540c7 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -199,7 +199,7 @@ class modPartnership extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index f1fe6f2072c..8b2db1a115a 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -177,7 +177,7 @@ class modRecruitment extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index ab73c8828b4..59dc7878161 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -120,7 +120,7 @@ class modResource extends DolibarrModules // 'order_supplier' to add a tab in supplier order view // 'invoice_supplier' to add a tab in supplier invoice view // 'invoice' to add a tab in customer invoice view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'product' to add a tab in product view // 'stock' to add a tab in stock view // 'propal' to add a tab in propal view diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index a90b28be5aa..c834900c2cf 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -166,7 +166,7 @@ class modStockTransfer extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 8096629c9a4..b06bf0fe8b0 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -142,7 +142,7 @@ class modTakePos extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index b1aaea23929..225f09659c2 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -183,7 +183,7 @@ class modWebhook extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 51094439df0..a8be0f23226 100644 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -166,7 +166,7 @@ class modWorkstation extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index 6d05aa7b283..b14419e0982 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -172,7 +172,7 @@ class modZapier extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 28d66dfc40a..54dd0096b2e 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; /** - * Class to manage customer order numbering rules Marbre + * Class to manage business proposition rules Marbre */ class mod_propale_marbre extends ModeleNumRefPropales { diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php index 6a6c7c556e6..fc647d3135c 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktrans /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Stock */ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer { diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 2e618b3ece3..cb4f76fa727 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier /** - * Class to manage customer order numbering rules Marbre + * Class to manage the Marbre numbering rule for Request for quotation */ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal { diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php index 7bef21a8599..758783316e4 100644 --- a/htdocs/core/modules/workstation/mod_workstation_standard.php +++ b/htdocs/core/modules/workstation/mod_workstation_standard.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Workstation */ class mod_workstation_standard extends ModeleNumRefWorkstation { diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index ccd7a607d3a..7c16599f039 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -203,7 +203,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers // case 'MYECMDIR_CREATE': // case 'MYECMDIR_MODIFY': - // Customer orders + // Sales orders case 'ORDER_CREATE': $resql = $this->db->query($sql); while ($resql && $obj = $this->db->fetch_array($resql)) { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f5da262e0c1..8d72666ad53 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -28,12 +28,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal -require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order +require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Sale Order require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Purchase Order +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting @@ -1766,7 +1766,7 @@ class EmailCollector extends CommonObject if ($reg[1] == 'pro') { // Customer Proposal $objectemail = new Propal($this->db); } - if ($reg[1] == 'ord') { // Customer Order + if ($reg[1] == 'ord') { // Sale Order $objectemail = new Commande($this->db); } if ($reg[1] == 'shi') { // Shipment diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 770276e96b8..9e59dbceda6 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1832,7 +1832,7 @@ class CommandeFournisseur extends CommonOrder // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. $result = $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', (isset($this->fk_soc) ? $this->fk_soc : $this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc - // If supplier order created from customer order, we take best supplier price + // If supplier order created from sales order, we take best supplier price // If $pu (defined previously from pu_ht or pu_ttc) is not defined at all, we also take the best supplier price if ($result > 0 && ($origin == 'commande' || $pu === '')) { $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice @@ -2608,11 +2608,11 @@ class CommandeFournisseur extends CommonOrder } /** - * Update a supplier order from a customer order + * Update a supplier order from a sales order * * @param User $user User that create - * @param int $idc Id of supplier order to update - * @param int $comclientid Id of customer order to use as template + * @param int $idc Id of purchase order to update + * @param int $comclientid Id of sale order to use as template * @return int <0 if KO, >0 if OK */ public function updateFromCommandeClient($user, $idc, $comclientid) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 82e36af6943..208a184bca2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -527,7 +527,7 @@ if (empty($reshook)) { } } - $cmd->classifyBilled($user); // TODO Move this in workflow like done for customer orders + $cmd->classifyBilled($user); // TODO Move this in workflow like done for sales orders if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) { $TFactThird[$cmd->socid] = $objecttmp; diff --git a/htdocs/index.php b/htdocs/index.php index f9ca18f530a..c8c1a234f02 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -194,7 +194,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed"); } - // Number of customer orders a deal + // Number of sales orders a deal if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index ba5a3c3b391..1e5f69aaa93 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -26,7 +26,7 @@ dol_include_once('/knowledgemanagement/core/modules/knowledgemanagement/modules_ /** - * Class to manage customer order numbering rules standard + * Class to manage the knowledgerecord numbering rules standard */ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord { diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 212f02aa4b3..99cd900b512 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -188,7 +188,7 @@ class modMyModule extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sale order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 61186a3b4f3..cce647de224 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for MyObject */ class mod_myobject_advanced extends ModeleNumRefMyObject { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index 75068cf8d57..f21ffe880d0 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -26,7 +26,7 @@ dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for MyObject */ class mod_myobject_standard extends ModeleNumRefMyObject { diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index 2c76818ab84..8f7764ad100 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -155,7 +155,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'MYECMDIR_MODIFY': //case 'MYECMDIR_DELETE': - // Customer orders + // Sales orders //case 'ORDER_CREATE': //case 'ORDER_MODIFY': //case 'ORDER_VALIDATE': diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index d717bdc49bf..676de032659 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/partnership/core/modules/partnership/modules_partnership.php' /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Partnership */ class mod_partnership_advanced extends ModeleNumRefPartnership { diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php index d5a2bb326b2..5de4b07f215 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php @@ -26,7 +26,7 @@ dol_include_once('/partnership/core/modules/partnership/modules_partnership.php' /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Partnership */ class mod_partnership_standard extends ModeleNumRefPartnership { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c7503bb957f..faaf7e346fa 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -761,7 +761,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
'; - // Number of customer orders running + // Number of sales orders running if (isModEnabled('commande')) { if ($found) { $helpondiff .= '
'; @@ -776,7 +776,7 @@ if ($id > 0 || $ref) { $helpondiff .= ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; } - // Number of product from customer order already sent (partial shipping) + // Number of product from sales order already sent (partial shipping) if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index ae0542d8b4b..8c6fc512509 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -43,7 +43,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $valsnb = array(); $valsamount = array(); $dataseries = array(); - // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for sale orders), 3=Closed (Sent/Received, billed or not) while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d3b08e9672b..2e830a8241b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1005,7 +1005,7 @@ if (!$source) { } -// Payment on customer order +// Payment on sales order if ($source == 'order') { $found = true; $langs->load("orders"); diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index 8772e97bf77..9635eba3e58 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentcandi /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Job application */ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandidature { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php index ce96d1cd67b..4221915eb29 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php @@ -26,7 +26,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentcandi /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Job application */ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandidature { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index c280153f9c8..4f781a18214 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobpo /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Job position */ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosition { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php index b2b413ee508..260ee510c5b 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php @@ -26,7 +26,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobpo /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Job positions */ class mod_recruitmentjobposition_standard extends ModeleNumRefRecruitmentJobPosition { diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index a77c4eac47d..40cca19a8b1 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -90,7 +90,7 @@ if ($resql) { $dataseries = array(); $colorseries = array(); $vals = array(); - // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for sales orders), 3=Closed (Sent/Received, billed or not) while ($i < $num) { $row = $db->fetch_row($resql); if ($row) { From d3797c48a8d4be1ab8a22e84f4cd9043ce368411 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 16:17:25 +0200 Subject: [PATCH 0895/1289] Fix warnings --- htdocs/core/boxes/modules_boxes.php | 4 +- htdocs/modulebuilder/index.php | 170 ++++++++++++++-------------- 2 files changed, 88 insertions(+), 86 deletions(-) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 769f74da1a1..f87ea993acd 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -354,7 +354,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $out .= "\n".$textnoformat."\n"; } - $out .= "\n"; + $out .= "boximg\n"; } $out .= "\n"; @@ -495,7 +495,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box } // We set info of modules - $widget[$j]['picto'] = $objMod->picto ? img_object('', $objMod->picto) : img_object('', 'generic'); + $widget[$j]['picto'] = (empty($objMod->picto) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto)); $widget[$j]['file'] = $files[$key]; $widget[$j]['fullpath'] = $fullpath[$key]; $widget[$j]['relpath'] = $relpath[$key]; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2f002bef290..2af45204da6 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1771,7 +1771,7 @@ if ($dirins && $action == 'generatepackage') { $arrayversion = explode('.', $moduleobj->version, 3); if (count($arrayversion)) { - $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip'; + $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).(empty($arrayversion[2]) ? '' : '.'.$arrayversion[2]).'.zip'; $dirofmodule = dol_buildpath($modulelowercase, 0).'/bin'; $outputfilezip = $dirofmodule.'/'.$FILENAMEZIP; @@ -2342,15 +2342,15 @@ if ($module == 'initmodule') { print '
'; print ''; print ''; print '
'.$langs->trans("MaxNumberOfPostOnPublicPagesByIP").''; print ''; -print ' '.strtolower($langs->trans("Posts")); +print ''; print '
'.$langs->trans("UseSpecificEditorName").''; - print ''; - print '
'.$langs->trans("UseSpecificEditorName").''; +print ''; +print '
'.$langs->trans("UseSpecificEditorURL").''; - print ''; - print '
'.$langs->trans("UseSpecificEditorURL").''; +print ''; +print '
'.$langs->trans("UseSpecificFamily").''; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1c30d709576..2f002bef290 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2161,25 +2161,30 @@ if ($module == 'initmodule') { print '
'; print ''.$langs->trans("Version").''; print '
'; - print ''; + print ''; print '
'; print '
'; print ''.$langs->trans("Family").''; print '
'; print ''; print ajax_combobox("family"); print '
'; @@ -2187,20 +2192,20 @@ if ($module == 'initmodule') { print '
'; print ''.$langs->trans("Picto").''; print '
'; - print ''; + print ''; print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.
Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]'); print '
'; print '
'; print ''.$langs->trans("EditorName").''; print '
'; - print '
'; + print '
'; print '
'; print '
'; print ''.$langs->trans("EditorUrl").''; print '
'; - print '
'; + print '
'; print '
'; print '
'; @@ -2416,7 +2421,7 @@ if ($module == 'initmodule') { print $langs->trans("EditorUrl"); print '
'; if (!empty($moduleobj->editor_url)) { - print ''.$moduleobj->editor_url.' '.img_picto('', 'globe').''; + print ''.$moduleobj->editor_url.' '.img_picto('', 'globe').''; } print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -2532,8 +2532,8 @@ if ($module == 'initmodule') { $pathtofile = 'langs/'.$langfile['relativename']; } print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } print ''; @@ -2815,12 +2815,12 @@ if ($module == 'initmodule') { print '
'; // Main DAO class file print ' '.$langs->trans("ClassFile").' : '.(dol_is_file($realpathtoclass) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).(dol_is_file($realpathtoclass) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; // Image if (dol_is_file($realpathtopicto)) { print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; - //print ' '.img_picto($langs->trans("Edit"), 'edit').''; + //print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } elseif (!empty($tmpobject)) { print ' '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth"'); @@ -2831,9 +2831,9 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("ApiClassFile").' : '.(dol_is_file($realpathtoapi) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'').''; if (dol_is_file($realpathtoapi)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; if (empty($conf->global->$const_name)) { // If module is not activated print ''.$langs->trans("GoToApiExplorer").''; @@ -2841,107 +2841,107 @@ if ($module == 'initmodule') { print ''.$langs->trans("GoToApiExplorer").''; } } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } // PHPUnit print '
'; print ' '.$langs->trans("TestClassFile").' : '.(dol_is_file($realpathtophpunit) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'').''; if (dol_is_file($realpathtophpunit)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; print '
'; print ' '.$langs->trans("PageForLib").' : '.(dol_is_file($realpathtolib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolib).(dol_is_file($realpathtolib) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print ' '.$langs->trans("PageForObjLib").' : '.(dol_is_file($realpathtoobjlib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).(dol_is_file($realpathtoobjlib) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; print ' '.$langs->trans("SqlFile").' : '.(dol_is_file($realpathtosql) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).(dol_is_file($realpathtosql) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '   '.$langs->trans("DropTableIfEmpty").''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '   '.$langs->trans("DropTableIfEmpty").''; //print '   '.$langs->trans("RunSql").''; print '
'; print ' '.$langs->trans("SqlFileKey").' : '.(dol_is_file($realpathtosqlkey) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlkey).(dol_is_file($realpathtosqlkey) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; //print '   '.$langs->trans("RunSql").''; print '
'; print ' '.$langs->trans("SqlFileExtraFields").' : '.(dol_is_file($realpathtosqlextra) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextra).(dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey) ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; - print ''.$langs->trans("DropTableIfEmpty").''; + print ''.$langs->trans("DropTableIfEmpty").''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } //print '   '.$langs->trans("RunSql").''; print '
'; print ' '.$langs->trans("SqlFileKeyExtraFields").' : '.(dol_is_file($realpathtosqlextrakey) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextrakey).(dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey) ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; print '
'; print '
'; print ' '.$langs->trans("PageForList").' : '.(dol_is_file($realpathtolist) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolist).(dol_is_file($realpathtolist) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print ' '.$langs->trans("PageForCreateEditView").' : '.(dol_is_file($realpathtocard) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocard).(dol_is_file($realpathtocard) ? '' : '').'?action=create'; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; // Page contact print ' '.$langs->trans("PageForContactTab").' : '.(dol_is_file($realpathtocontact) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocontact).(dol_is_file($realpathtocontact) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtocontact)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; // Page document print ' '.$langs->trans("PageForDocumentTab").' : '.(dol_is_file($realpathtodocument) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtodocument).(dol_is_file($realpathtodocument) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtodocument)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; // Page notes print ' '.$langs->trans("PageForNoteTab").' : '.(dol_is_file($realpathtonote) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtonote).(dol_is_file($realpathtonote) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtonote)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; // Page agenda print ' '.$langs->trans("PageForAgendaTab").' : '.(dol_is_file($realpathtoagenda) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoagenda).(dol_is_file($realpathtoagenda) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtoagenda)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
'; print '
'; @@ -3253,7 +3253,7 @@ if ($module == 'initmodule') { $format = 'markdown'; } print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } } else { @@ -3346,7 +3346,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; if (is_array($dicts) && !empty($dicts)) { print ' '.$langs->trans("LanguageFile").' : '; @@ -3370,18 +3370,20 @@ if ($module == 'initmodule') { //$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); $firstdicname = ''; - foreach ($dicts['tabname'] as $key => $dic) { - $dicname = $dic; - $diclabel = $dicts['tablib'][$key]; + if (!empty($dicts['tabname'])) { + foreach ($dicts['tabname'] as $key => $dic) { + $dicname = $dic; + $diclabel = $dicts['tablib'][$key]; - if (empty($firstdicname)) { - $firstdicname = $dicname; + if (empty($firstdicname)) { + $firstdicname = $dicname; + } + + $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; + $head3[$h][1] = $diclabel; + $head3[$h][2] = $dicname; + $h++; } - - $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; - $head3[$h][1] = $diclabel; - $head3[$h][2] = $dicname; - $h++; } if ($h > 1) { @@ -3571,7 +3573,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -3721,7 +3723,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -3812,7 +3814,7 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ''; @@ -3821,11 +3823,11 @@ if ($module == 'initmodule') { if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').' '; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -3872,7 +3874,7 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; if (!empty($triggers)) { @@ -3881,15 +3883,15 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ''; print ' '.$langs->trans("TriggersFile"); print ' : '.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; print ''; } @@ -3934,11 +3936,11 @@ if ($module == 'initmodule') { print ' '.$langs->trans("CSSFile").' : '; if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print ''; } else { @@ -3980,11 +3982,11 @@ if ($module == 'initmodule') { print ' '.$langs->trans("JSFile").' : '; if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print ''; } else { @@ -4029,13 +4031,13 @@ if ($module == 'initmodule') { $pathtofile = $widget['relpath']; print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ' '.$langs->trans("WidgetFile").' : '.$langs->trans("NoWidget").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -4077,7 +4079,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } else { $fullpathoffile = dol_buildpath($file, 0); @@ -4148,13 +4150,13 @@ if ($module == 'initmodule') { $pathtofile = $clifile['relpath']; print ' '.$langs->trans("CLIFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ' '.$langs->trans("CLIFile").' : '.$langs->trans("FileNotYetGenerated"); ''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -4195,7 +4197,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; @@ -4324,14 +4326,14 @@ if ($module == 'initmodule') { } print ''; print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ''; print ' '.$langs->trans("SpecificationFile").' : '.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -4386,7 +4388,7 @@ if ($module == 'initmodule') { print ''; print '
'; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '

'; @@ -4401,7 +4403,7 @@ if ($module == 'initmodule') { print ''; print '
'; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '
'; @@ -4456,7 +4458,7 @@ if ($module == 'initmodule') { $arrayversion = explode('.', $moduleobj->version, 3); if (count($arrayversion)) { - $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? ".".$arrayversion[2] : '').".zip"; + $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).(empty($arrayversion[2]) ? '' : ".".$arrayversion[2]).".zip"; $outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; } @@ -4469,7 +4471,7 @@ if ($module == 'initmodule') { $relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP; print ''.$outputfilezip.''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print ''; @@ -4500,7 +4502,7 @@ if ($module == 'initmodule') { print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; From 6d326e965b3346c08eacef2351a661b09ec27e8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 16:32:01 +0200 Subject: [PATCH 0896/1289] Fix td balance --- htdocs/admin/oauth.php | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 014d3844368..6bf59508d11 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -282,10 +282,9 @@ if (count($listinsetup) > 0) { } print ''; + // Delete print ''; - $label = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array); - print ''; print img_picto('', 'delete'); print ''; @@ -300,41 +299,53 @@ if (count($listinsetup) > 0) { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''; - print ''; + print ''; + print ''; + print ''; if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { print ''; print ''.$langs->trans("URLOfServiceForAuthorization").''; print ''; - print ''; + print ''; + print ''; + print ''; } } else { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''.$langs->trans("FeatureNotYetSupported").''; - print ''; + print ''; + print ''; + print ''; } // Api Id print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; // Api Secret print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; - // TODO Move this into token generation + // TODO Move this into token generation ? if ($supported) { if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { print ''; print ''.$langs->trans("Scopes").''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; } else { $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes'])); $currentscopes = explode(',', getDolGlobalString($key[4])); @@ -354,13 +365,17 @@ if (count($listinsetup) > 0) { print ''; print ''; } - print ''; + print ''; + print ''; + print ''; } } else { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''.$langs->trans("FeatureNotYetSupported").''; - print ''; + print ''; + print ''; + print ''; } print ''."\n"; From 9ce11683de5963b54b71a13d881cc389d35cbbfb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 16:38:10 +0200 Subject: [PATCH 0897/1289] Transifex sync --- htdocs/langs/ar_IQ/projects.lang | 2 - htdocs/langs/de_AT/admin.lang | 2 - htdocs/langs/de_CH/accountancy.lang | 2 - htdocs/langs/de_CH/admin.lang | 2 - htdocs/langs/de_CH/commercial.lang | 3 - htdocs/langs/el_CY/members.lang | 3 - htdocs/langs/el_CY/projects.lang | 2 - htdocs/langs/en_AE/members.lang | 3 - htdocs/langs/en_AE/projects.lang | 2 - htdocs/langs/en_AU/members.lang | 3 - htdocs/langs/en_AU/projects.lang | 2 - htdocs/langs/en_CA/members.lang | 3 - htdocs/langs/en_CA/projects.lang | 2 - htdocs/langs/en_GB/accountancy.lang | 1 - htdocs/langs/en_GB/admin.lang | 1 - htdocs/langs/en_GB/members.lang | 3 - htdocs/langs/en_GB/projects.lang | 2 - htdocs/langs/en_GB/trips.lang | 10 +-- htdocs/langs/en_IN/members.lang | 3 - htdocs/langs/en_SG/members.lang | 3 - htdocs/langs/en_SG/projects.lang | 2 - htdocs/langs/en_ZA/members.lang | 3 - htdocs/langs/en_ZA/projects.lang | 2 - htdocs/langs/es_AR/admin.lang | 1 - htdocs/langs/es_AR/commercial.lang | 1 - htdocs/langs/es_AR/mailmanspip.lang | 1 - htdocs/langs/es_BO/members.lang | 3 - htdocs/langs/es_BO/projects.lang | 2 - htdocs/langs/es_CL/accountancy.lang | 1 - htdocs/langs/es_CL/admin.lang | 2 - htdocs/langs/es_CL/commercial.lang | 2 - htdocs/langs/es_CL/errors.lang | 1 - htdocs/langs/es_CL/mailmanspip.lang | 1 - htdocs/langs/es_CL/members.lang | 2 - htdocs/langs/es_CL/projects.lang | 1 - htdocs/langs/es_CL/ticket.lang | 2 - htdocs/langs/es_CO/accountancy.lang | 3 - htdocs/langs/es_CO/admin.lang | 1 - htdocs/langs/es_CO/commercial.lang | 3 - htdocs/langs/es_CO/errors.lang | 1 - htdocs/langs/es_CO/mailmanspip.lang | 1 - htdocs/langs/es_CO/projects.lang | 1 - htdocs/langs/es_CO/ticket.lang | 2 - htdocs/langs/es_DO/members.lang | 3 - htdocs/langs/es_DO/projects.lang | 2 - htdocs/langs/es_EC/accountancy.lang | 1 - htdocs/langs/es_EC/admin.lang | 2 - htdocs/langs/es_EC/commercial.lang | 2 - htdocs/langs/es_EC/errors.lang | 1 - htdocs/langs/es_EC/mailmanspip.lang | 1 - htdocs/langs/es_EC/projects.lang | 1 - htdocs/langs/es_EC/ticket.lang | 3 - htdocs/langs/es_GT/members.lang | 3 - htdocs/langs/es_GT/projects.lang | 2 - htdocs/langs/es_HN/members.lang | 3 - htdocs/langs/es_HN/projects.lang | 2 - htdocs/langs/es_MX/accountancy.lang | 1 - htdocs/langs/es_MX/admin.lang | 1 - htdocs/langs/es_PA/members.lang | 3 - htdocs/langs/es_PA/projects.lang | 2 - htdocs/langs/es_PE/members.lang | 3 - htdocs/langs/es_PY/members.lang | 3 - htdocs/langs/es_PY/projects.lang | 2 - htdocs/langs/es_US/members.lang | 3 - htdocs/langs/es_US/projects.lang | 2 - htdocs/langs/es_UY/members.lang | 3 - htdocs/langs/es_UY/projects.lang | 2 - htdocs/langs/es_VE/admin.lang | 1 - htdocs/langs/es_VE/projects.lang | 2 - htdocs/langs/fr_CA/admin.lang | 1 - htdocs/langs/fr_CA/commercial.lang | 2 - htdocs/langs/fr_CA/errors.lang | 1 - htdocs/langs/fr_FR/accountancy.lang | 14 ++-- htdocs/langs/fr_FR/admin.lang | 66 +++++++++++------- htdocs/langs/fr_FR/agenda.lang | 3 +- htdocs/langs/fr_FR/banks.lang | 2 +- htdocs/langs/fr_FR/bookmarks.lang | 1 + htdocs/langs/fr_FR/boxes.lang | 1 + htdocs/langs/fr_FR/cashdesk.lang | 14 ++-- htdocs/langs/fr_FR/categories.lang | 2 + htdocs/langs/fr_FR/commercial.lang | 6 +- htdocs/langs/fr_FR/companies.lang | 10 +-- htdocs/langs/fr_FR/contracts.lang | 5 +- htdocs/langs/fr_FR/cron.lang | 8 +++ htdocs/langs/fr_FR/datapolicy.lang | 92 ++++++++++++++++++++++++++ htdocs/langs/fr_FR/errors.lang | 13 +++- htdocs/langs/fr_FR/exports.lang | 6 +- htdocs/langs/fr_FR/holiday.lang | 22 +++++- htdocs/langs/fr_FR/install.lang | 4 +- htdocs/langs/fr_FR/interventions.lang | 1 + htdocs/langs/fr_FR/languages.lang | 1 + htdocs/langs/fr_FR/mailmanspip.lang | 2 +- htdocs/langs/fr_FR/mails.lang | 4 +- htdocs/langs/fr_FR/main.lang | 10 ++- htdocs/langs/fr_FR/members.lang | 19 +++--- htdocs/langs/fr_FR/modulebuilder.lang | 22 +++--- htdocs/langs/fr_FR/mrp.lang | 13 ++-- htdocs/langs/fr_FR/oauth.lang | 8 ++- htdocs/langs/fr_FR/other.lang | 10 ++- htdocs/langs/fr_FR/partnership.lang | 19 +++--- htdocs/langs/fr_FR/paypal.lang | 1 + htdocs/langs/fr_FR/productbatch.lang | 7 +- htdocs/langs/fr_FR/products.lang | 6 +- htdocs/langs/fr_FR/projects.lang | 5 +- htdocs/langs/fr_FR/propal.lang | 2 +- htdocs/langs/fr_FR/receiptprinter.lang | 6 +- htdocs/langs/fr_FR/receptions.lang | 1 - htdocs/langs/fr_FR/recruitment.lang | 7 +- htdocs/langs/fr_FR/stocks.lang | 3 +- htdocs/langs/fr_FR/suppliers.lang | 1 + htdocs/langs/fr_FR/ticket.lang | 21 +++--- htdocs/langs/fr_FR/users.lang | 1 - htdocs/langs/fr_FR/website.lang | 10 ++- htdocs/langs/fr_FR/withdrawals.lang | 14 ++-- htdocs/langs/it_CH/accountancy.lang | 3 - htdocs/langs/nl_BE/admin.lang | 1 - htdocs/langs/nl_BE/commercial.lang | 3 - htdocs/langs/nl_BE/ticket.lang | 1 - htdocs/langs/pt_AO/projects.lang | 2 - htdocs/langs/pt_BR/admin.lang | 3 - htdocs/langs/pt_BR/commercial.lang | 2 - htdocs/langs/pt_BR/errors.lang | 1 - htdocs/langs/pt_BR/mailmanspip.lang | 1 - htdocs/langs/pt_BR/ticket.lang | 2 - htdocs/langs/pt_BR/website.lang | 1 - htdocs/langs/pt_MZ/accountancy.lang | 2 - htdocs/langs/pt_MZ/admin.lang | 3 - htdocs/langs/pt_MZ/commercial.lang | 2 - htdocs/langs/pt_MZ/errors.lang | 1 - htdocs/langs/pt_MZ/mailmanspip.lang | 1 - htdocs/langs/pt_MZ/projects.lang | 1 - htdocs/langs/pt_MZ/website.lang | 1 - 132 files changed, 340 insertions(+), 305 deletions(-) delete mode 100644 htdocs/langs/ar_IQ/projects.lang delete mode 100644 htdocs/langs/el_CY/members.lang delete mode 100644 htdocs/langs/el_CY/projects.lang delete mode 100644 htdocs/langs/en_AE/members.lang delete mode 100644 htdocs/langs/en_AE/projects.lang delete mode 100644 htdocs/langs/en_AU/members.lang delete mode 100644 htdocs/langs/en_AU/projects.lang delete mode 100644 htdocs/langs/en_CA/members.lang delete mode 100644 htdocs/langs/en_CA/projects.lang delete mode 100644 htdocs/langs/en_GB/members.lang delete mode 100644 htdocs/langs/en_GB/projects.lang delete mode 100644 htdocs/langs/en_IN/members.lang delete mode 100644 htdocs/langs/en_SG/members.lang delete mode 100644 htdocs/langs/en_SG/projects.lang delete mode 100644 htdocs/langs/en_ZA/members.lang delete mode 100644 htdocs/langs/en_ZA/projects.lang delete mode 100644 htdocs/langs/es_BO/members.lang delete mode 100644 htdocs/langs/es_BO/projects.lang delete mode 100644 htdocs/langs/es_DO/members.lang delete mode 100644 htdocs/langs/es_DO/projects.lang delete mode 100644 htdocs/langs/es_GT/members.lang delete mode 100644 htdocs/langs/es_GT/projects.lang delete mode 100644 htdocs/langs/es_HN/members.lang delete mode 100644 htdocs/langs/es_HN/projects.lang delete mode 100644 htdocs/langs/es_PA/members.lang delete mode 100644 htdocs/langs/es_PA/projects.lang delete mode 100644 htdocs/langs/es_PE/members.lang delete mode 100644 htdocs/langs/es_PY/members.lang delete mode 100644 htdocs/langs/es_PY/projects.lang delete mode 100644 htdocs/langs/es_US/members.lang delete mode 100644 htdocs/langs/es_US/projects.lang delete mode 100644 htdocs/langs/es_UY/members.lang delete mode 100644 htdocs/langs/es_UY/projects.lang delete mode 100644 htdocs/langs/es_VE/projects.lang create mode 100644 htdocs/langs/fr_FR/datapolicy.lang delete mode 100644 htdocs/langs/it_CH/accountancy.lang delete mode 100644 htdocs/langs/pt_AO/projects.lang diff --git a/htdocs/langs/ar_IQ/projects.lang b/htdocs/langs/ar_IQ/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/ar_IQ/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 54771c2245a..eb37ef1ee98 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -21,8 +21,6 @@ SessionSaveHandler=Sessionmanager YourSession=Ihre Anmeldung Sessions=Benutzeranmeldungen DolibarrSetup=Dolibarr installieren oder aktualisieren -InternalUser=interner Nutzer -ExternalUser=externer Nutzer InternalUsers=interne Nutzer ExternalUsers=externe Nutzer UploadNewTemplate=Neue Vorlage(n) hochladen diff --git a/htdocs/langs/de_CH/accountancy.lang b/htdocs/langs/de_CH/accountancy.lang index 6a826327010..a65ad255398 100644 --- a/htdocs/langs/de_CH/accountancy.lang +++ b/htdocs/langs/de_CH/accountancy.lang @@ -39,7 +39,6 @@ CountriesNotInEEC=Nicht EWR - Staaten CountriesInEECExceptMe=Länder im EWR ausser %s CountriesExceptMe=Alle Staaten, ausser %s AccountantFiles=Geschäftsvorgänge exportieren -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). ExportAccountingSourceDocHelp2=Die Journale exportierst du im Menu %s - %s. VueByAccountAccounting=Anzeigen nach Buchhaltungskonto VueBySubAccountAccounting=Anzeigen nach Nebenbuchkonto @@ -232,7 +231,6 @@ AccountingAccountForSalesTaxAreDefinedInto=Obacht: Das Buchhaltungskonto für d NumberOfAccountancyEntries=Anzahl Einträge NumberOfAccountancyMovements=Anzahl Bewegungen ACCOUNTING_DISABLE_BINDING_ON_SALES=Bindung & Übertragung in der Verkaufsbuchhaltung deaktivieren (Kundenrechnungen werden in der Buchhaltung nicht berücksichtigt) -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ConfirmExportFile=Bestätigen der Generierung der Buchhaltungsexportdatei ? ExportDraftJournal=Exportiere Entwurfsjournal Modelcsv=Exportformat diff --git a/htdocs/langs/de_CH/admin.lang b/htdocs/langs/de_CH/admin.lang index 3529a5b6b40..b8e31734903 100644 --- a/htdocs/langs/de_CH/admin.lang +++ b/htdocs/langs/de_CH/admin.lang @@ -256,7 +256,6 @@ SetAsDefault=Als Standard definieren InstalledInto=Installiert im Verzeichnis %s BarcodeInitForThirdparties=Barcode Init. für alle Partner BarcodeInitForProductsOrServices=Alle Strichcodes für Produkte oder Services initialisieren oder zurücksetzen -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Alle aktuellen Barcode-Werte löschen ConfirmEraseAllCurrentBarCode=Wirklich alle aktuellen Barcode-Werte löschen? AllBarcodeReset=Alle Barcode-Werte wurden entfernt @@ -396,7 +395,6 @@ Permission215=Lieferanten einrichten Permission255=Andere Passwörter ändern Permission272=Rechnungen anzeigen Permission273=Ausgabe Rechnungen -Permission300=Barcodes auslesen Permission301=Barcodes erzeugen und ändern. Permission331=Lesezeichen einsehen Permission430=PHP Debug Bar verwenden diff --git a/htdocs/langs/de_CH/commercial.lang b/htdocs/langs/de_CH/commercial.lang index edf30db19b1..a3ab0012f82 100644 --- a/htdocs/langs/de_CH/commercial.lang +++ b/htdocs/langs/de_CH/commercial.lang @@ -35,8 +35,5 @@ Stats=Verkaufsstatistik StatusProsp=Interessenten Status NoLimit=Kein Limit ToOfferALinkForOnlineSignature=Link zur Digitalen Unterschrift -WelcomeOnOnlineSignaturePage=Willkommen auf der Seite zum Offerten von %s zu aktzeptieren. -ThisScreenAllowsYouToSignDocFrom=Hier kannst du die Offerte akzeptieren, unterzeichen oder zurückweisen. -ThisIsInformationOnDocumentToSign=Hier die Informationen zum Dokument, das zu akzeptieren oder zurückzuweisen ist. SignatureProposalRef=Unterschrift zur Offerte %s FeatureOnlineSignDisabled=Hoppla, online unterschreiben ist entweder deaktiviert - oder die Offerte wurde erstellt, bevor online unterschreiben aktiviert worden war. diff --git a/htdocs/langs/el_CY/members.lang b/htdocs/langs/el_CY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/el_CY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/el_CY/projects.lang b/htdocs/langs/el_CY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/el_CY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_AE/members.lang b/htdocs/langs/en_AE/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_AE/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_AE/projects.lang b/htdocs/langs/en_AE/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_AE/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_AU/members.lang b/htdocs/langs/en_AU/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_AU/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_AU/projects.lang b/htdocs/langs/en_AU/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_AU/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_CA/members.lang b/htdocs/langs/en_CA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_CA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_CA/projects.lang b/htdocs/langs/en_CA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_CA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_GB/accountancy.lang b/htdocs/langs/en_GB/accountancy.lang index 0afbc72c036..8ed034a497b 100644 --- a/htdocs/langs/en_GB/accountancy.lang +++ b/htdocs/langs/en_GB/accountancy.lang @@ -50,7 +50,6 @@ ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin sorting the page "Links to do" by th ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin sorting the page "Links done" by the most recent elements ACCOUNTING_LENGTH_GACCOUNT=Length of the General Ledger accounts (If you set value to 6 here, the account '706' will appear as '706000' on screen) ACCOUNTING_SELL_JOURNAL=Sales journal -ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal ACCOUNTING_ACCOUNT_SUSPENSE=Suspense account DONATION_ACCOUNTINGACCOUNT=Finance account to register donations ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Default sales account (used if not defined in the product sheet) diff --git a/htdocs/langs/en_GB/admin.lang b/htdocs/langs/en_GB/admin.lang index 40504938dbe..f61f52381f7 100644 --- a/htdocs/langs/en_GB/admin.lang +++ b/htdocs/langs/en_GB/admin.lang @@ -39,7 +39,6 @@ UMaskExplanation=This parameter allows you to define permissions set by default ListOfDirectories=List of OpenDocument template directories ListOfDirectoriesForModelGenODT=List of directories containing template files in OpenDocument format.

Put here full path of directories.
Add a carriage return between each directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt or .ods. FollowingSubstitutionKeysCanBeUsed=
To learn how to create your .odt document templates, before storing them in those directories, read wiki documentation: -InitEmptyBarCode=Init value for the %s empty barcodes Module50200Name=PayPal DictionaryAccountancyJournal=Finance journals CompanyZip=Postcode diff --git a/htdocs/langs/en_GB/members.lang b/htdocs/langs/en_GB/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_GB/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_GB/projects.lang b/htdocs/langs/en_GB/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_GB/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_GB/trips.lang b/htdocs/langs/en_GB/trips.lang index 31e58b7f935..b9af13b26fa 100644 --- a/htdocs/langs/en_GB/trips.lang +++ b/htdocs/langs/en_GB/trips.lang @@ -1,8 +1,8 @@ # Dolibarr language file - Source file is en_US - trips -TripsAndExpensesStatistics=Expense report statistics -FeesKilometersOrAmout=Amount or Miles -TripNDF=Information expense report -TF_METRO=Tube -ErrorDoubleDeclaration=You have submitted another expense report in a similar date range. BrouillonnerTrip=Move expense report status back to "Draft" ConfirmBrouillonnerTrip=Are you sure you want to move this expense report status back to "Draft"? +ErrorDoubleDeclaration=You have submitted another expense report in a similar date range. +FeesKilometersOrAmout=Amount or Miles +TripNDF=Information expense report +TripsAndExpensesStatistics=Expense report statistics +TF_METRO=Tube diff --git a/htdocs/langs/en_IN/members.lang b/htdocs/langs/en_IN/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_IN/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_SG/members.lang b/htdocs/langs/en_SG/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_SG/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_SG/projects.lang b/htdocs/langs/en_SG/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_SG/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_ZA/members.lang b/htdocs/langs/en_ZA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_ZA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_ZA/projects.lang b/htdocs/langs/en_ZA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_ZA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_AR/admin.lang b/htdocs/langs/es_AR/admin.lang index 76c93629d16..beedcee5010 100644 --- a/htdocs/langs/es_AR/admin.lang +++ b/htdocs/langs/es_AR/admin.lang @@ -252,7 +252,6 @@ UpdateServerOffline=Actualizar servidor fuera de línea WithCounter=Administrar un contador AddCRIfTooLong=No hay ajuste de texto automático. El texto que es demasiado largo no será mostrado en el documento. Por favor agregar saltos de línea en el área de texto si es necesario. String=Cuerda -InitEmptyBarCode=Init value for the %s empty barcodes Module30Name=Facturas Module40Desc=Gestión de proveedores y compras (órdenes de compra y facturas de proveedores) Module52Name=Inventarios(Stocks) diff --git a/htdocs/langs/es_AR/commercial.lang b/htdocs/langs/es_AR/commercial.lang index d85913580a1..b8b70ff7a01 100644 --- a/htdocs/langs/es_AR/commercial.lang +++ b/htdocs/langs/es_AR/commercial.lang @@ -60,6 +60,5 @@ Stats=Estadísticas de ventas StatusProsp=Estado del cliente potencial DraftPropals=Presupuestos en borrador ToOfferALinkForOnlineSignature=Vínculo para firma digital -ThisScreenAllowsYouToSignDocFrom=Esta pantalla te permitirá aceptar, firmar o rechazar un presupuesto SignatureProposalRef=Firma del presupuesto %s FeatureOnlineSignDisabled=La funcionalidad para la firma digital está deshabilitada o el documento fue generado antes de habilitar la función diff --git a/htdocs/langs/es_AR/mailmanspip.lang b/htdocs/langs/es_AR/mailmanspip.lang index 700cfd3bb70..840c7e7dd58 100644 --- a/htdocs/langs/es_AR/mailmanspip.lang +++ b/htdocs/langs/es_AR/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=La prueba de suscripción se ha ejecutado correctamente MailmanDeletionSuccess=La prueba de desuscripción se ha ejecutado correctamente SynchroMailManEnabled=Será realizada una actualización en la lista de envío de correos SynchroSpipEnabled=Será realizada una actualización en el módulo SPIP -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Envío de Correos DescADHERENT_MAILMAN_URL=URL para suscripciones a la lista de envío de correos DescADHERENT_MAILMAN_UNSUB_URL=URL para desuscripciones a la lista de envío de correos DescADHERENT_MAILMAN_LISTS=Lista(s) para inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_BO/members.lang b/htdocs/langs/es_BO/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_BO/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_BO/projects.lang b/htdocs/langs/es_BO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_BO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_CL/accountancy.lang b/htdocs/langs/es_CL/accountancy.lang index 2bff8d60933..9a12ca9824b 100644 --- a/htdocs/langs/es_CL/accountancy.lang +++ b/htdocs/langs/es_CL/accountancy.lang @@ -217,4 +217,3 @@ ToBind=Líneas para enlazar UseMenuToSetBindindManualy=Líneas aún no enlazadas, use el menú %s para hacer el enlace manualmente WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario del informe de gastos -InventoryJournal=Revista de inventario diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang index aa792dc23db..7e7c5a27736 100644 --- a/htdocs/langs/es_CL/admin.lang +++ b/htdocs/langs/es_CL/admin.lang @@ -340,7 +340,6 @@ DefaultLink=Enlace predeterminado ValueOverwrittenByUserSetup=Advertencia, este valor puede ser sobrescrito por la configuración específica del usuario (cada usuario puede establecer su propia URL de clicktodial) BarcodeInitForProductsOrServices=Inicialización o reinicio masivo del código de barras para productos o servicios CurrentlyNWithoutBarCode=Actualmente, tiene %s registros en %s %s sin código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores actuales del código de barras ConfirmEraseAllCurrentBarCode=¿Seguro que quieres borrar todos los valores actuales del código de barras? AllBarcodeReset=Todos los valores del código de barras han sido eliminados @@ -574,7 +573,6 @@ Permission281=Leer contactos Permission291=Tarifas de lectura Permission292=Establecer permisos sobre las tarifas Permission293=Modificar las tarifas del cliente. -Permission300=Leer codigos de barras Permission301=Crear / modificar códigos de barras Permission311=Leer Servicios Permission312=Asignar servicio / suscripción al contrato diff --git a/htdocs/langs/es_CL/commercial.lang b/htdocs/langs/es_CL/commercial.lang index 33c14696715..2308c317fae 100644 --- a/htdocs/langs/es_CL/commercial.lang +++ b/htdocs/langs/es_CL/commercial.lang @@ -57,6 +57,4 @@ ActionAC_AUTO=Eventos insertados automáticamente Stats=Estadísticas de ventas StatusProsp=Estado de la perspectiva DraftPropals=Cotizaciones borrador -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, un presupuesto/propuesta comercial SignatureProposalRef=Firma de cotización / propuesta comercial %s diff --git a/htdocs/langs/es_CL/errors.lang b/htdocs/langs/es_CL/errors.lang index 8c45fd1469b..93bfc615ce6 100644 --- a/htdocs/langs/es_CL/errors.lang +++ b/htdocs/langs/es_CL/errors.lang @@ -69,7 +69,6 @@ ErrorFieldValueNotIn=El campo %s : ' %s ' no es un valor e ErrorFieldRefNotIn=Campo %s : ' %s ' no es una referencia %s existente ErrorsOnXLines=Se encontraron errores %s ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=Los caracteres especiales no están permitidos para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine la referencia de registro o renombrada para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas diff --git a/htdocs/langs/es_CL/mailmanspip.lang b/htdocs/langs/es_CL/mailmanspip.lang index 34a39aa742a..fdbf3c00d12 100644 --- a/htdocs/langs/es_CL/mailmanspip.lang +++ b/htdocs/langs/es_CL/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó con éxito MailmanDeletionSuccess=La prueba de cancelación se ejecutó con éxito SynchroMailManEnabled=Se realizará una actualización de Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Mailman DescADHERENT_MAILMAN_URL=URL para las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para la cancelación de suscripciones de Mailman DescADHERENT_MAILMAN_LISTS=Lista (s) para la inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_CL/members.lang b/htdocs/langs/es_CL/members.lang index a226d236563..d8ea715ef45 100644 --- a/htdocs/langs/es_CL/members.lang +++ b/htdocs/langs/es_CL/members.lang @@ -53,7 +53,6 @@ YourMembershipWasValidated=Su membresía fue validada YourMembershipWasCanceled=Su membresía fue cancelada CardContent=Contenido de su tarjeta de miembro ThisIsContentOfYourMembershipRequestWasReceived=Queremos informarle que se recibió su solicitud de membresía.

-ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

ThisIsContentOfSubscriptionReminderEmail=Queremos informarle que su suscripción está a punto de caducar o ya ha caducado (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). Esperamos que lo renueven.

ThisIsContentOfYourCard=Este es un resumen de la información que tenemos sobre usted. Por favor, póngase en contacto con nosotros si algo es incorrecto.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Asunto de la notificación por correo electrónico recibida en caso de autoinscripción de un invitado @@ -85,7 +84,6 @@ MenuMembersStats=Estadística NewMemberbyWeb=Nuevo miembro agregado. Esperando aprobacion NewMemberForm=Nueva forma de miembro TurnoverOrBudget=Volumen de ventas (empresa) o Cotización (asociación o colectivo) -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type MEMBER_NEWFORM_PAYONLINE=Salte en la página integrada de pago en línea MembersStatisticsByProperties=Estadísticas de miembros por naturaleza NoEmailSentToMember=No se envió ningún correo electrónico al miembro diff --git a/htdocs/langs/es_CL/projects.lang b/htdocs/langs/es_CL/projects.lang index aaae5a794c4..7afb36f5a70 100644 --- a/htdocs/langs/es_CL/projects.lang +++ b/htdocs/langs/es_CL/projects.lang @@ -156,6 +156,5 @@ ModuleSalaryToDefineHourlyRateMustBeEnabled=El módulo 'Salarios' debe e NewTaskRefSuggested=Referencia de tarea ya utilizada, se requiere una nueva referencia de tarea TimeSpentForIntervention=Tiempo dedicado TimeSpentForInvoice=Tiempo dedicado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado desde el tiempo invertido en el proyecto UsageBillTimeShort=Uso: Bill time diff --git a/htdocs/langs/es_CL/ticket.lang b/htdocs/langs/es_CL/ticket.lang index c1f9984feda..5a4f2f39b72 100644 --- a/htdocs/langs/es_CL/ticket.lang +++ b/htdocs/langs/es_CL/ticket.lang @@ -73,8 +73,6 @@ TicketDurationAutoInfos=Duración calculada automáticamente a partir de interve SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. Sin enviar correo electrónico TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta TicketMessageHelp=Solo este texto se guardará en la lista de mensajes en la tarjeta de Tickets. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Ticket de contactos diff --git a/htdocs/langs/es_CO/accountancy.lang b/htdocs/langs/es_CO/accountancy.lang index 8e9afa1c3f8..43dd8df9360 100644 --- a/htdocs/langs/es_CO/accountancy.lang +++ b/htdocs/langs/es_CO/accountancy.lang @@ -33,7 +33,6 @@ GroupIsEmptyCheckSetup=El grupo está vacío, verifique la configuración del gr DetailByAccount=Mostrar detalle por cuenta AccountWithNonZeroValues=Cuentas con valores distintos de cero. CountriesInEECExceptMe=Países en EEC excepto %s -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). MainAccountForCustomersNotDefined=Cuenta contable principal para clientes no definidos en la configuración. MainAccountForSuppliersNotDefined=Cuenta de contabilidad principal para proveedores no definidos en la configuración. MainAccountForUsersNotDefined=Cuenta de contabilidad principal para usuarios no definidos en la configuración. @@ -215,7 +214,6 @@ AccountingAccountForSalesTaxAreDefinedInto=Nota: la cuenta contable del impuesto NumberOfAccountancyMovements=Numero de movimientos ACCOUNTING_DISABLE_BINDING_ON_SALES=Deshabilitar la vinculación y la transferencia en la contabilidad de las ventas (las facturas de los clientes no se tendrán en cuenta en la contabilidad) ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Deshabilite la vinculación y transferencia en contabilidad en compras (las facturas de proveedores no se tendrán en cuenta en la contabilidad) -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ExportDraftJournal=Exportar borrador de revista Selectmodelcsv=Selecciona un modelo de exportación. Modelcsv_CEGID=Exportación para CEGID Expert Comptabilité @@ -277,4 +275,3 @@ FECFormatCredit=Crédito (crédito) DateExport=Exportación de fecha WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario de informe de gastos -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_CO/admin.lang b/htdocs/langs/es_CO/admin.lang index d6fec62304b..af4d57d1984 100644 --- a/htdocs/langs/es_CO/admin.lang +++ b/htdocs/langs/es_CO/admin.lang @@ -362,7 +362,6 @@ ValueOverwrittenByUserSetup=Advertencia, este valor puede ser sobrescrito por la BarcodeInitForThirdparties=init para código de barras masivo para terceros BarcodeInitForProductsOrServices=Código de barras masivo de inicio o reinicio para productos o servicios. CurrentlyNWithoutBarCode=Actualmente, tienes el registro %s en %s %s sin un código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores de código de barras actuales ConfirmEraseAllCurrentBarCode=¿Está seguro de que desea borrar todos los valores de código de barras actuales? AllBarcodeReset=Todos los valores de código de barras han sido eliminados diff --git a/htdocs/langs/es_CO/commercial.lang b/htdocs/langs/es_CO/commercial.lang index 4ecf1bf3338..a682aab5fd4 100644 --- a/htdocs/langs/es_CO/commercial.lang +++ b/htdocs/langs/es_CO/commercial.lang @@ -53,8 +53,5 @@ Stats=Estadísticas de ventas StatusProsp=Estado cliente potencial DraftPropals=Borrador de propuestas comerciales ToOfferALinkForOnlineSignature=Enlace para firma en línea -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una cotización / propuesta comercial -ThisIsInformationOnDocumentToSign=Esta es información en el documento para aceptar o rechazar SignatureProposalRef=Firma de cotización / propuesta comercial %s FeatureOnlineSignDisabled=Característica para la firma en línea deshabilitada o documento generado antes de que se habilitara la característica diff --git a/htdocs/langs/es_CO/errors.lang b/htdocs/langs/es_CO/errors.lang index 2e958b678d9..23b931b6d88 100644 --- a/htdocs/langs/es_CO/errors.lang +++ b/htdocs/langs/es_CO/errors.lang @@ -73,7 +73,6 @@ ErrorWrongValueForField=El campo %s: '%s' no coincide con la regla ErrorFieldValueNotIn=El campo %s : ' %s ' no es un valor que se encuentra en el campo %s de %s ErrorFieldRefNotIn=El campo%s: '%s' no es una referia existente %s ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=No se permiten caracteres especiales para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine el registro o la referencia renombrada para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas. diff --git a/htdocs/langs/es_CO/mailmanspip.lang b/htdocs/langs/es_CO/mailmanspip.lang index 98090117641..eaf04c1a531 100644 --- a/htdocs/langs/es_CO/mailmanspip.lang +++ b/htdocs/langs/es_CO/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó con éxito MailmanDeletionSuccess=La prueba de cancelación de suscripción se ejecutó con éxito SynchroMailManEnabled=Se realizará una actualización de Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Mailman DescADHERENT_MAILMAN_URL=URL de las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para darse de baja de Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para la inscripción automática de nuevos miembros (separados por coma) diff --git a/htdocs/langs/es_CO/projects.lang b/htdocs/langs/es_CO/projects.lang index d7d0f29d616..2535094af83 100644 --- a/htdocs/langs/es_CO/projects.lang +++ b/htdocs/langs/es_CO/projects.lang @@ -186,7 +186,6 @@ NewTaskRefSuggested=La referencia de tarea ya se usó, se requiere una nueva ref TimeSpentInvoiced=Tiempo invertido facturado TimeSpentForIntervention=Tiempo usado TimeSpentForInvoice=Tiempo usado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado a partir del tiempo dedicado al proyecto InterventionGeneratedFromTimeSpent=La intervención %s se ha generado a partir del tiempo dedicado al proyecto ProjectBillTimeDescription=Verifique si ingresa la hoja de tiempo en las tareas del proyecto Y planea generar factura(s) a partir de la hoja de tiempo para facturar al cliente del proyecto (no verifique si planea crear una factura que no se base en las hojas de tiempo ingresadas). Nota: Para generar factura, vaya a la pestaña 'Tiempo invertido' del proyecto y seleccione las líneas para incluir. diff --git a/htdocs/langs/es_CO/ticket.lang b/htdocs/langs/es_CO/ticket.lang index 02301c15de2..3f6313f135e 100644 --- a/htdocs/langs/es_CO/ticket.lang +++ b/htdocs/langs/es_CO/ticket.lang @@ -93,8 +93,6 @@ SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. No enviar correo electrónico TicketGoIntoContactTab=Vaya a la pestaña "Contactos" para seleccionarlos. TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta TicketMessageHelp=Solo este texto se guardará en la lista de mensajes de la tarjeta del ticket. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Ticket de contactos diff --git a/htdocs/langs/es_DO/members.lang b/htdocs/langs/es_DO/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_DO/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_DO/projects.lang b/htdocs/langs/es_DO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_DO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_EC/accountancy.lang b/htdocs/langs/es_EC/accountancy.lang index 56a5c3e928d..b24e09e5bb2 100644 --- a/htdocs/langs/es_EC/accountancy.lang +++ b/htdocs/langs/es_EC/accountancy.lang @@ -229,4 +229,3 @@ ToBind=Líneas para atar UseMenuToSetBindindManualy=Líneas aún no enlazadas, use el menú %s para hacer el enlace manualmente. WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario del informe de gastos -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_EC/admin.lang b/htdocs/langs/es_EC/admin.lang index 96820c4587e..6286debaffd 100644 --- a/htdocs/langs/es_EC/admin.lang +++ b/htdocs/langs/es_EC/admin.lang @@ -335,7 +335,6 @@ ValueOverwrittenByUserSetup=Advertencia: este valor puede ser sobrescrito por la BarcodeInitForThirdparties=Inicio masivo de código de barras para terceros. BarcodeInitForProductsOrServices=Inicio de código de barras masivo o restablecimiento de productos o servicios CurrentlyNWithoutBarCode=Actualmente, tiene %s registrado en %s %s sin código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores de códigos de barras actuales ConfirmEraseAllCurrentBarCode=¿Está seguro de que desea borrar todos los valores de códigos de barras actuales? AllBarcodeReset=Todos los valores de código de barras se han eliminado @@ -586,7 +585,6 @@ Permission282=Crear / modificar contactos Permission291=Leer tarifas Permission292=Establecer permisos en las tarifas Permission293=Modificar las tarifas del cliente. -Permission300=Leer codigos de barras Permission301=Crear / modificar códigos de barras Permission311=Leer servicios Permission312=Asignar servicio / suscripción al contrato. diff --git a/htdocs/langs/es_EC/commercial.lang b/htdocs/langs/es_EC/commercial.lang index 85789b47b39..ee890081cfd 100644 --- a/htdocs/langs/es_EC/commercial.lang +++ b/htdocs/langs/es_EC/commercial.lang @@ -60,6 +60,4 @@ ActionAC_OTH_AUTOShort=Automático Stats=Estadísticas de ventas StatusProsp=Estado del prospecto DraftPropals=Proyecto de propuestas comerciales -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una propuesta de cotización/comercial SignatureProposalRef=Firma de cotización/propuesta comercial %s. diff --git a/htdocs/langs/es_EC/errors.lang b/htdocs/langs/es_EC/errors.lang index 87dd8507320..ae701afac8d 100644 --- a/htdocs/langs/es_EC/errors.lang +++ b/htdocs/langs/es_EC/errors.lang @@ -64,7 +64,6 @@ ErrorWrongValueForField=El campo %s: '%s' no coincide con la expre ErrorFieldValueNotIn=El campo %s: '%s' no es un valor que se encuentra en el campo %s de %s ErrorFieldRefNotIn=Campo %s: '%s' no es una %s referencia existente ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=No se permiten caracteres especiales para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine la referencia de registro o renombrado para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas diff --git a/htdocs/langs/es_EC/mailmanspip.lang b/htdocs/langs/es_EC/mailmanspip.lang index 6b8fb02ecff..dc6431a176e 100644 --- a/htdocs/langs/es_EC/mailmanspip.lang +++ b/htdocs/langs/es_EC/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó correctamente MailmanDeletionSuccess=La prueba de cancelación de la suscripción se ejecutó correctamente SynchroMailManEnabled=Se realizará una actualización Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña del administrador de Mailman DescADHERENT_MAILMAN_URL=URL para las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para cancelación de suscripciones de Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para la inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_EC/projects.lang b/htdocs/langs/es_EC/projects.lang index 7ac28478c77..c87a5444272 100644 --- a/htdocs/langs/es_EC/projects.lang +++ b/htdocs/langs/es_EC/projects.lang @@ -165,7 +165,6 @@ NewTaskRefSuggested=Referencia de tarea ya utilizada, se requiere una nueva refe TimeSpentInvoiced=Tiempo gastado facturado TimeSpentForIntervention=Tiempo usado TimeSpentForInvoice=Tiempo usado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado a partir del tiempo dedicado al proyecto ProjectBillTimeDescription=Verifique si ingresa la hoja de tiempo en las tareas del proyecto Y planea generar factura(s) de la hoja de tiempo para facturar al cliente del proyecto (no verifique si planea crear una factura que no se base en las hojas de tiempo ingresadas). Nota: Para generar la factura, vaya a la pestaña 'Tiempo empleado' del proyecto y seleccione las líneas para incluir. UsageBillTimeShort=Uso: Tiempo a facturar diff --git a/htdocs/langs/es_EC/ticket.lang b/htdocs/langs/es_EC/ticket.lang index 657aba67728..29b388752e1 100644 --- a/htdocs/langs/es_EC/ticket.lang +++ b/htdocs/langs/es_EC/ticket.lang @@ -65,9 +65,6 @@ TicketDurationAutoInfos=Duración calculada automáticamente a partir de interve SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. No se envio el correo electrónico TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta -TicketMessageMailSignatureHelpAdmin=Este texto se inserta después del mensaje de respuesta. TicketMessageHelp=Solo este texto se guardará en la lista de mensajes en la tarjeta de tickets. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Boleto de contactos diff --git a/htdocs/langs/es_GT/members.lang b/htdocs/langs/es_GT/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_GT/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_GT/projects.lang b/htdocs/langs/es_GT/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_GT/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_HN/members.lang b/htdocs/langs/es_HN/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_HN/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_HN/projects.lang b/htdocs/langs/es_HN/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_HN/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_MX/accountancy.lang b/htdocs/langs/es_MX/accountancy.lang index 1ae2423f16f..ef79a5fabff 100644 --- a/htdocs/langs/es_MX/accountancy.lang +++ b/htdocs/langs/es_MX/accountancy.lang @@ -125,4 +125,3 @@ ExportDraftJournal=Exportar borrador de diario SomeMandatoryStepsOfSetupWereNotDone=Algunos pasos obligatorios de la instalación no se realizaron, favor de completar ExportNotSupported=El formato de exportación configurado no se admite en esta página NoJournalDefined=Ningún diario definido -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_MX/admin.lang b/htdocs/langs/es_MX/admin.lang index 8c57272b7ea..4097de49b9f 100644 --- a/htdocs/langs/es_MX/admin.lang +++ b/htdocs/langs/es_MX/admin.lang @@ -238,7 +238,6 @@ ExtrafieldSelectList =Seleccionar de la tabla ComputedFormula=Campo calculado Computedpersistent=Almacenar campo calculado SetAsDefault=Establecer como predeterminado -InitEmptyBarCode=Init value for the %s empty barcodes ClickToShowDescription=Haga clic para mostrar la descripción DependsOn=Este módulo necesita los módulo(s) WarningSettingSortOrder=Advertencia, establecer un orden predeterminado puede resultar en un error técnico al pasar a la página de lista si "campo" es un campo desconocido. Si experimenta un error de este tipo, vuelva a esta página para eliminar el orden predeterminado y restaurar el comportamiento predeterminado. diff --git a/htdocs/langs/es_PA/members.lang b/htdocs/langs/es_PA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PA/projects.lang b/htdocs/langs/es_PA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_PA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_PE/members.lang b/htdocs/langs/es_PE/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PE/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PY/members.lang b/htdocs/langs/es_PY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PY/projects.lang b/htdocs/langs/es_PY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_PY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_US/members.lang b/htdocs/langs/es_US/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_US/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_US/projects.lang b/htdocs/langs/es_US/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_US/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_UY/members.lang b/htdocs/langs/es_UY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_UY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

-CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_UY/projects.lang b/htdocs/langs/es_UY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_UY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_VE/admin.lang b/htdocs/langs/es_VE/admin.lang index 33ac1c8513d..5ac3d8e921b 100644 --- a/htdocs/langs/es_VE/admin.lang +++ b/htdocs/langs/es_VE/admin.lang @@ -5,7 +5,6 @@ ConfirmPurgeSessions=¿De verdad quieres purgar todas las sesiones? Esto descone SetupArea=Parametrizaje NotConfigured=Módulo / Aplicación no configurada GenericMaskCodes3=Cualquier otro carácter en la máscara se quedará sin cambios.
No se permiten espacios
-InitEmptyBarCode=Init value for the %s empty barcodes Module1780Desc=Crear etiquetas/Categoría (Productos, clientes, proveedores, contactos y miembros) Permission254=Modificar la contraseña de otros usuarios Permission255=Eliminar o desactivar otros usuarios diff --git a/htdocs/langs/es_VE/projects.lang b/htdocs/langs/es_VE/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_VE/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index a04f84af674..d9c277fcdf6 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -72,7 +72,6 @@ ExtrafieldCheckBoxFromList=Les cases à cocher du tableau ExtrafieldLink=Lier à un objet LibraryToBuildPDF=Bibliothèque utilisée pour la génération de PDF CurrentlyNWithoutBarCode=Actuellement, vous avez %s enregistrements sur %s %s sans code à barres défini. -InitEmptyBarCode=Init value for the %s empty barcodes ConfirmEraseAllCurrentBarCode=Êtes-vous sûr de vouloir effacer toutes les valeurs actuelles du code-barres? EnableFileCache=Activer le cache de fichiers DisplayCompanyManagers=Afficher les noms des gestionnaires diff --git a/htdocs/langs/fr_CA/commercial.lang b/htdocs/langs/fr_CA/commercial.lang index fe52f49e25d..0f68fbd09db 100644 --- a/htdocs/langs/fr_CA/commercial.lang +++ b/htdocs/langs/fr_CA/commercial.lang @@ -9,5 +9,3 @@ SaleRepresentativesOfThirdParty=Représentants commerciaux de tiers LastDoneTasks=Dernières %s actions complétées LastActionsToDo=Le plus ancien %s actions non complétées ActionAC_OTH_AUTO=Événements insérés automatiquement -ThisScreenAllowsYouToSignDocFrom=Cet écran vous permet d'accepter et signer ou de refuser le devis ou la proposition commerciale -ThisIsInformationOnDocumentToSign=Ceci est une information sur le document à accepter ou à refuser diff --git a/htdocs/langs/fr_CA/errors.lang b/htdocs/langs/fr_CA/errors.lang index 86d639a66e5..2560a86fb1b 100644 --- a/htdocs/langs/fr_CA/errors.lang +++ b/htdocs/langs/fr_CA/errors.lang @@ -51,7 +51,6 @@ ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire % ErrorModuleRequireJavascript=Javascript ne doit pas être désactivé pour que cette fonction fonctionne. Pour activer / désactiver Javascript, accédez au menu Accueil-> Configuration-> Affichage. ErrorPasswordsMustMatch=Les deux mots de passe dactylographiés doivent correspondre les uns aux autres ErrorFileIsInfectedWithAVirus=Le programme antivirus n'a pas pu valider le fichier (le fichier peut être infecté par un virus) -ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas autorisés pour le champ "%s" ErrorNumRefModel=Une référence existe dans la base de données (%s) et n'est pas compatible avec cette règle de numérotation. Supprimez l'enregistrement ou la renommée référence pour activer ce module. ErrorBadMaskBadRazMonth=Erreur, mauvaise valeur de réinitialisation ErrorCounterMustHaveMoreThan3Digits=Le compteur doit avoir plus de 3 chiffres diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 83d10982ca2..53edef4c0a1 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -59,6 +59,7 @@ MainAccountForSuppliersNotDefined=Compte comptable général pour les fournisseu MainAccountForUsersNotDefined=Compte comptable général pour les utilisateurs non défini dans la configuration MainAccountForVatPaymentNotDefined=Compte comptable général pour les paiements de TVA non défini dans la configuration MainAccountForSubscriptionPaymentNotDefined=Le compte comptable général des paiements de cotisations n'est pas défini dans la configuration +UserAccountNotDefined=Compte comptable pour l'utilisateur non défini dans la configuration AccountancyArea=Espace comptabilité AccountancyAreaDescIntro=L'utilisation du module de comptabilité se fait en plusieurs étapes: @@ -185,7 +186,7 @@ ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Compte comptable pour enregistrer les ad ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT=Compte comptable par défaut pour les acomptes clients UseAuxiliaryAccountOnCustomerDeposit=Enregistrer le compte client comme compte individuel dans le grand livre auxiliaire pour les lignes d'acompte (si désactivé, le compte individuel pour les lignes d'acompte restera vide) ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT=Compte comptable par défaut pour enregistrer l'acompte fournisseur -UseAuxiliaryAccountOnSupplierDeposit=Store supplier account as individual account in subsidiary ledger for lines of down payments (if disabled, individual account for down payment lines will remain empty) +UseAuxiliaryAccountOnSupplierDeposit=Stocker le compte fournisseur comme compte individuel dans le grand livre auxiliaire pour les lignes d'acomptes (si désactivé, le compte individuel pour les lignes d'acompte restera vide) ACCOUNTING_PRODUCT_BUY_ACCOUNT=Compte comptable par défaut pour les produits achetés (utilisé si non défini dans la fiche produit) ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT=Compte comptable par défaut pour les produits achetés dans la CEE (utilisé si non défini dans la fiche produit) @@ -286,7 +287,7 @@ DescClosure=Consultez ici le nombre de mouvements par mois non encore validés & OverviewOfMovementsNotValidated=Aperçu des mouvements non validés et verrouillés AllMovementsWereRecordedAsValidated=Tous les mouvements ont été enregistrés comme validés et ont été verrouillés NotAllMovementsCouldBeRecordedAsValidated=Certains mouvements n'ont pas pu être enregistrés comme validés et n'ont pas été verrouillés -ValidateMovements=Valider et verrouiller l'enregistrement... +ValidateMovements=Valider et verrouiller les mouvements... DescValidateMovements=Toute modification ou suppression d'écriture, de lettrage et de suppression sera interdite. Toutes les entrées pour un exercice doivent être validées, sinon la fermeture ne sera pas possible ValidateHistory=Lier automatiquement @@ -401,7 +402,11 @@ Calculated=Calculé Formula=Formule ## Reconcile +LetteringAuto=Rapprocher automatiquement +LetteringManual=Rapprocher manuel Unlettering=Annuler le rapprochement +UnletteringAuto=Annuler le rapprochement automatique +UnletteringManual=Annuler rapprochement manuel AccountancyNoLetteringModified=Pas de rapprochement modifié AccountancyOneLetteringModifiedSuccessfully=Un rapprochement modifié avec succès AccountancyLetteringModifiedSuccessfully=%s rapprochements modifiés avec succès @@ -410,8 +415,9 @@ AccountancyOneUnletteringModifiedSuccessfully=Une annulation de rapprochement mo AccountancyUnletteringModifiedSuccessfully=%s annulations de rapprochement modifiées avec succès ## Confirm box -ConfirmMassUnlettering=Confirmation d'annulation de rapprochement en masse -ConfirmMassUnletteringQuestion=Êtes-vous sûr de vouloir annuler le rapprochement de(s) %s enregistrement(s) sélectionné(s) ? +ConfirmMassUnletteringAuto=Confirmation d'annulation de rapprochement automatique +ConfirmMassUnletteringManual=Confirmation de dé-rapprochement manuel +ConfirmMassUnletteringQuestion=Voulez-vous vraiment annuler le rapprochement des %s enregistrements sélectionnés ? ConfirmMassDeleteBookkeepingWriting=Confirmation de suppression en masse ConfirmMassDeleteBookkeepingWritingQuestion=Cela supprimera la transaction de la comptabilité (toutes les lignes liées à la même transaction seront supprimées). Êtes-vous sûr de vouloir supprimer le(s) %s enregistrement(s) sélectionné(s) ? diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 313e151a044..3f45fc1643d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -51,8 +51,6 @@ ClientSortingCharset=Jeu de caractère de tri du client WarningModuleNotActive=Le module %s doit être activé pour utiliser cette fonction. WarningOnlyPermissionOfActivatedModules=Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer d'autres modules sur la page Accueil->Configuration->Modules. DolibarrSetup=Installation ou mise à jour de Dolibarr -InternalUser=Utilisateur interne -ExternalUser=Utilisateur externe InternalUsers=Utilisateurs internes ExternalUsers=Utilisateurs externes UserInterface=Interface utilisateur @@ -190,7 +188,7 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Commande pour désactiver les clés étrangères à l'importation CommandsToDisableForeignKeysForImportWarning=Requis si vous voulez être en mesure de restaurer votre « dump » SQL plus tard ExportCompatibility=Compatibilité du fichier d'exportation généré -ExportUseMySQLQuickParameter=Utiliser le paramètre --quick +ExportUseMySQLQuickParameter=Utiliser le paramètre --quick ExportUseMySQLQuickParameterHelp=Le paramètre '--quick' aide à réduire la consommation de RAM pour les longues listes MySqlExportParameters=Paramètres de l'exportation MySQL PostgreSqlExportParameters= Paramètres de l'exportation PostgreSQL @@ -285,7 +283,7 @@ ContentForLines=Contenu à afficher pour chaque produit ou service (à partir de NoticePeriod=Délai de prévenance NewByMonth=Mois suivant Emails=Emails -EMailsSetup=Configuration Emails +EMailsSetup=Configuration des mails EMailsDesc=Cette page permet de définir les paramètres et options d'envoi des e-mails. EmailSenderProfiles=Expéditeur des e-mails EMailsSenderProfileDesc=Vous pouvez garder cette section vide. Si vous entrez des emails ici, ils seront ajoutés à la liste des expéditeurs possibles dans la liste déroulante lorsque vous écrivez un nouvel email. @@ -338,7 +336,7 @@ MenuHandlers=Gestionnaires de menu MenuAdmin=Édition menu DoNotUseInProduction=Ne pas utiliser en production ThisIsProcessToFollow=Procédure de mise à jour: -ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative +ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative StepNb=Étape %s FindPackageFromWebSite=Rechercher le paquet qui répond à votre besoin (par exemple sur le site web %s). DownloadPackageFromWebSite=Télécharger le package (par exemple depuis le site web officiel %s) @@ -439,8 +437,10 @@ Unique=Unique Boolean=Boolean (case à cocher unique) ExtrafieldPhone = Téléphone ExtrafieldPrice = Prix +ExtrafieldPriceWithCurrency=Prix avec devise ExtrafieldMail = Email ExtrafieldUrl = Url +ExtrafieldIP = IP ExtrafieldSelect = Liste de sélection ExtrafieldSelectList = Liste issue d'une table ExtrafieldSeparator=Séparateur (il ne s'agit pas d'un champ de saisie) @@ -501,7 +501,7 @@ WarningPHPMail=AVERTISSEMENT: la configuration pour envoyer des e-mails à parti WarningPHPMailA= - L'utilisation des serveurs de prestataires de messagerie augmente le niveau confiance des e-mails, cela augmente donc les chances de délivrabilité en n'étant pas considéré comme spam. WarningPHPMailB=- Certains fournisseurs de services de messagerie (comme Yahoo) ne vous permettent pas d'envoyer un e-mail à partir d'un autre serveur que leur propre serveur. Votre configuration actuelle utilise le serveur de l'application pour envoyer des e-mails et non le serveur de votre fournisseur de messagerie, donc certains destinataires (ceux compatibles avec le protocole DMARC restrictif), demanderont à votre fournisseur de messagerie si ils peuvent accepter votre message et ce fournisseur de messagerie (comme Yahoo) peut répondre «non» parce que le serveur d'envoi n'est pas le leur, aussi une partie de vos e-mails envoyés peuvent ne pas être acceptés pour la livraison (faites également attention au quota d'envoi de votre fournisseur de messagerie). WarningPHPMailC=- Utiliser le serveur SMTP de votre propre fournisseur de services de messagerie pour envoyer des e-mails est également intéressant afin que tous les e-mails envoyés depuis l'application soient également enregistrés dans votre répertoire "Envoyés" de votre boîte aux lettres. -WarningPHPMailD=Aussi, il est recommandé de changer le mode d'envoi des e-mails à la valeur "SMTP". Si vous souhaitez vraiment conserver la méthode "PHP" par défaut pour envoyer des e-mails, ignorez simplement cet avertissement ou supprimez-le en définissant la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP sur 1 dans Accueil - Configuration - Autre. +WarningPHPMailD=Aussi, il est recommandé de changer le mode d'envoi des e-mails à la valeur "SMTP". Si vous souhaitez vraiment conserver la méthode "PHP" par défaut pour envoyer des e-mails, ignorez simplement cet avertissement ou supprimez-le en définissant la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP sur 1 dans Accueil - Configuration - Divers. WarningPHPMail2=Si votre fournisseur de messagerie SMTP a besoin de restreindre le client de messagerie à certaines adresses IP (très rare), voici l'adresse IP du mail user agent (MUA) de votre application CRM ERP : %s . WarningPHPMailSPF=Si le nom de domaine de votre adresse e-mail d'expéditeur est protégé par un enregistrement SPF (demandez à votre fournisseur de nom de domaine), vous devez inclure les adresses IP suivantes dans l'enregistrement SPF du DNS de votre domaine: %s. ActualMailSPFRecordFound=Enregistrement SPF réel trouvé (pour l'e-mail %s) : %s @@ -842,9 +842,9 @@ Permission286=Exporter les contacts Permission291=Consulter les tarifs Permission292=Définir les permissions sur les tarifs Permission293=Modifier les tarifs clients -Permission300=Consulter les codes-barres -Permission301=Créer/modifier les codes-barres -Permission302=Supprimer les codes-barres +Permission301=Générer le PDF du code barre +Permission304=Créer/modifier les codes-barres +Permission305=Supprimer les codes-barres Permission311=Consulter les services Permission312=Affecter le service/abonnement au contrat Permission331=Lire les marque-pages @@ -1081,9 +1081,9 @@ DictionaryAssetDisposalType=Type de cession d'actifs TypeOfUnit=Type d'unité SetupSaved=Configuration sauvegardée SetupNotSaved=Configuration non enregistrée -OAuthServiceConfirmDeleteTitle=Suprresion d'entrée OAuth -OAuthServiceConfirmDeleteMessage=Êtes vous sur de vouloir supprimer cette entrée OAuth? Tous les jetons existants associés seront supprimés. -ErrorInEntryDeletion=Erreur dans la suppression +OAuthServiceConfirmDeleteTitle=Supprimer l'entrée OAuth +OAuthServiceConfirmDeleteMessage=Voulez-vous vraiment supprimer cette entrée OAuth ? Tous les jetons existants pour celui-ci seront également supprimés. +ErrorInEntryDeletion=Erreur lors de la suppression de l'entrée EntryDeleted=Entrée supprimée BackToModuleList=Retour liste des modules BackToDictionaryList=Retour liste des dictionnaires @@ -1242,7 +1242,7 @@ BrowserName=Nom du navigateur BrowserOS=OS du navigateur ListOfSecurityEvents=Liste des événements de sécurité Dolibarr SecurityEventsPurged=Evenement de sécurité purgés -TrackableSecurityEvents=Trackable security events +TrackableSecurityEvents=événement de sécurité traçable LogEventDesc=Vous pouvez activer ici l'historique des événements d'audit de sécurité. Cet historique est consultable par les administrateurs dans le menu %s - %s. Attention, cette fonctionnalité peut générer un gros volume de données. AreaForAdminOnly=Les paramètres d'installation ne peuvent être remplis que par les utilisateurs administrateurs uniquement. SystemInfoDesc=Les informations systèmes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement. @@ -1385,7 +1385,7 @@ NumberingModules=Modèles de numérotation DocumentModules=Modèles de documents ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorythme interne de Dolibarr :%s caractères contenant chiffres et minuscules -PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. +PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. PasswordGenerationPerso=Renvoie un mot de passe en fonction d'une configuration personnalisée. SetupPerso=Selon votre configuration PasswordPatternDesc=Description du masque du mot de passe @@ -1463,7 +1463,7 @@ OrdersNumberingModules=Modèles de numérotation des commandes OrdersModelModule=Modèles de document des commandes FreeLegalTextOnOrders=Mention complémentaire sur les commandes WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) -ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. +ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. BANK_ASK_PAYMENT_BANK_DURING_ORDER=Demander le compte bancaire cible durant la commande ##### Interventions ##### InterventionsSetup=Configuration du module Interventions @@ -1618,7 +1618,7 @@ LDAPFieldUserid=Id utilisateur LDAPFieldUseridExample=Exemple: uidnumber LDAPFieldHomedirectory=Répertoire racine LDAPFieldHomedirectoryExample=Exemple: homedirectory -LDAPFieldHomedirectoryprefix=Répertoire racine +LDAPFieldHomedirectoryprefix=Préfixe du répertoire racine LDAPSetupNotComplete=Configuration LDAP incomplète (à compléter sur les autres onglets) LDAPNoUserOrPasswordProvidedAccessIsReadOnly=Administrateur ou mot de passe non renseigné. Les accès LDAP seront donc anonymes et en lecture seule. LDAPDescContact=Cette page permet de définir le nom des attributs de l'arbre LDAP pour chaque information des contacts Dolibarr. @@ -1653,7 +1653,7 @@ TestNotPossibleWithCurrentBrowsers=Une détection automatique n'est pas possible DefaultValuesDesc=Vous pouvez définir/forcer ici la valeur par défaut que vous voulez obtenir lorsque vous créez un nouvel enregistrement, et/ou les filtres par défaut ou ordre de tri des listes. DefaultCreateForm=Valeurs par défaut (sur les formulaires de création) DefaultSearchFilters=Filtres de recherche par défaut -DefaultSortOrder=Ordre de tri par défaut +DefaultSortOrder=Ordre de tri par défaut DefaultFocus=Champs par défaut ayant le focus DefaultMandatory=Champs de formulaire obligatoires ##### Products ##### @@ -1770,7 +1770,7 @@ DetailMenuHandler=Nom du gestionnaire menu dans lequel faire apparaitre le nouve DetailMenuModule=Nom du module si l'entrée menu est issue d'un module DetailType=Type de menu (top ou left) DetailTitre=Libellé du menu ou code libellé à traduire -DetailUrl=URL vers laquelle le menu pointe (Lien URL absolu ou lien externe avec http://) +DetailUrl=URL où le menu vous envoie (lien URL relatif ou lien externe avec https://) DetailEnabled=Condition d'affichage ou non DetailRight=Condition d'affichage plein ou grisé DetailLangs=Fichier .lang pour la traduction du code libellé @@ -1872,7 +1872,7 @@ ChequeReceiptsNumberingModule=Module de numérotation des bordereaux de remises MultiCompanySetup=Configuration du module Multi-société ##### Suppliers ##### SuppliersSetup=Configuration du module Fournisseurs -SuppliersCommandModel=Modèle de commande fournisseur complet +SuppliersCommandModel=Modèle de commande fournisseur complet SuppliersCommandModelMuscadet=Modèle de commande fournisseur complet (ancienne implémentation du modèle Cornas) SuppliersInvoiceModel=Modèle de facture fournisseur complet SuppliersInvoiceNumberingModel=Modèles de numérotation des factures fournisseur @@ -1907,7 +1907,7 @@ NbMajMin=Nombre minimal de caractères majuscules NbNumMin=Nombre minimal de caractères numériques NbSpeMin=Nombre minimal de caractères spéciaux NbIteConsecutive=Nombre maximal de répétition des mêmes caractères -NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique +NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique SalariesSetup=Configuration du module salaires SortOrder=Ordre de tri Format=Format @@ -1928,7 +1928,7 @@ GoOntoContactCardToAddMore=Rendez-vous sur l'onglet "Notifications" d'un tiers p Threshold=Seuil BackupDumpWizard=Assistant pour créer le fichier dump de la base de données BackupZipWizard=Assistant pour générer l'archive du répertoire documents -SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : +SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : SomethingMakeInstallFromWebNotPossible2=Pour cette raison, le processus de mise à jour décrit ici est une processus manuel que seul un utilisateur ayant des droits privilégiés peut réaliser. InstallModuleFromWebHasBeenDisabledByFile=L'installation de module externe depuis l'application a été désactivé par l'administrator. Vous devez lui demander de supprimer le fichier %s pour permettre cette fonctionnalité. ConfFileMustContainCustom=Installer ou créer un module externe à partir de l'application nécessite de sauvegarder les fichiers du module dans le répertoire %s. Pour que ce répertoire soit reconnu par Dolibarr, vous devez paramétrer le fichier de configuration conf/conf.php en ajoutant les 2 lignes suivantes :
$dolibarr_main_url_root_alt='/custom'
$dolibarr_main_document_root_alt='%s/custom'; @@ -2078,12 +2078,13 @@ loginPassword=Mot de passe oauthToken=Jeton Oauth2 accessType=Type d'accès oauthService=Service Oauth -TokenMustHaveBeenCreated=Module OAuth2 must be enabled and an oauth2 token must have been created with the correct permissions (for example scope "gmail_full" with OAuth for Gmail). +TokenMustHaveBeenCreated=Le module OAuth2 doit être activé et un token oauth2 doit avoir été créé avec les bonnes permissions (par exemple scope "gmail_full" avec OAuth pour Gmail). MailboxSourceDirectory=Répertoire source de la boîte aux lettres MailboxTargetDirectory=Répertoire cible de la boîte aux lettres EmailcollectorOperations=Opérations à effectuer par le collecteur EmailcollectorOperationsDesc=Les opérations sont exécutées de haut en bas MaxEmailCollectPerCollect=Nombre maximum d'emails collectés par collecte +TestCollectNow=Tester la collecte CollectNow=Collecter maintenant ConfirmCloneEmailCollector=Voulez-vous vraiment cloner le collecteur d'e-mails %s ? DateLastCollectResult=Date de la dernière tentative de collecte @@ -2107,7 +2108,7 @@ NoNewEmailToProcess=Aucun nouvel email (correspondants aux filtres) à traiter NothingProcessed=Aucune action faite XEmailsDoneYActionsDone=%s e-mails pré-qualifiés, %s e-mails traités avec succès (pour %s enregistrement/actions effectuées) RecordEvent=Enregistrer un événement dans l'agenda (avec le type Email envoyé ou reçu) -CreateLeadAndThirdParty=Créer un prospect (et un tiers si nécessaire) +CreateLeadAndThirdParty=Créer une opportunité (et un tiers si nécessaire) CreateTicketAndThirdParty=Créer un ticket (lié à un tiers si le tiers a été chargé par une opération précédente ou a été deviné à partir d'un tracker en en-tête d'email, sans tiers sinon) CodeLastResult=Dernier code de retour NbOfEmailsInInbox=Nombre de courriels dans le répertoire source @@ -2228,7 +2229,7 @@ NoExternalModuleWithUpdate=Aucune mise à jour trouvée pour les modules externe SwaggerDescriptionFile=Fichier de description de l’API Swagger (à utiliser avec redoc par exemple) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=Vous avez activé l'API WS qui est dépréciée. Vous devriez utiliser l'API REST à la place. RandomlySelectedIfSeveral=Sélectionnée au hasard si plusieurs images sont disponibles -SalesRepresentativeInfo=For Proposals, Orders, Invoices. +SalesRepresentativeInfo=Pour Propositions, Commandes, Factures DatabasePasswordObfuscated=Le mot de passe de la base de données est masqué dans le fichier de configuration DatabasePasswordNotObfuscated=Le mot de passe de la base de données n'est PAS masqué dans le fichier de configuration APIsAreNotEnabled=Les modules API ne sont pas activés @@ -2310,4 +2311,21 @@ MAIN_MAIL_SMTPS_AUTH_TYPE=Méthode d'authentification UsePassword=Utiliser mot de passe UseOauth=Utiliser un token OAUTH Images=Images +Posts=publications MaxNumberOfImagesInGetPost=Nombre maximum d'images autorisées dans un champ HTML soumis dans un formulaire +MaxNumberOfPostOnPublicPagesByIP=Nombre maximum de publications sur des pages publiques avec une adresse IP +CIDLookupURL=Le module apporte une URL qui peut être utilisée par un outil externe pour obtenir le nom d'un tiers ou d'un contact à partir de son numéro de téléphone. L'URL à utiliser est : +ScriptIsEmpty=Le script est manquant +ShowHideTheNRequests=Afficher/Cacher les %s requête(s) SQL. +DefinedAPathForAntivirusCommandIntoSetup=Définir un chemin pour un programme antivirus dans %s +TriggerCodes=Événements déclenchables +TriggerCodeInfo=Saisissez ici le(s) code(s) déclencheur(s) qui doivent générer la publication d'une requête web (seules les URL externes sont autorisées). Vous pouvez entrer plusieurs codes déclencheurs séparés par une virgule. +EditableWhenDraftOnly=Si décochée, la valeur ne peut être modifiée que lorsque l'objet a un état de brouillon +CssOnEdit=CSS sur les pages d'édition +CssOnView=CSS sur les pages de visualisation +CssOnList=CSS sur les pages de liste +HelpCssOnEditDesc=Le CSS utilisé lors de la modification du champ.
Exemple : "minwidth100 maxwidth500 widthcentpercentminusx" +HelpCssOnViewDesc=Le CSS utilisé lors de l'affichage du champ. +HelpCssOnListDesc=Le CSS utilisé lorsque le champ est à l'intérieur du tableau d'une liste.
Exemple : "tdoverflowmax200" +RECEPTION_PDF_HIDE_ORDERED=Masquer la quantité commandée sur les documents générés pour les réceptions +MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Afficher le prix sur les documents générés pour les réceptions diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 1ac6cb60597..62dbae7233e 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -87,6 +87,7 @@ SupplierInvoiceSentByEMail=Facture fournisseur %s envoyée par email ShippingSentByEMail=Bon d'expédition %s envoyé par email ShippingValidated= Expédition %s validée InterventionSentByEMail=Intervention %s envoyé par email +ProjectSentByEMail=Projet %s envoyé par email ProposalDeleted=Proposition commerciale supprimée OrderDeleted=Commande supprimée InvoiceDeleted=Facture supprimée @@ -99,7 +100,7 @@ PRODUCT_MODIFYInDolibarr=Produit %s modifié PRODUCT_DELETEInDolibarr=Produit%ssupprimé HOLIDAY_CREATEInDolibarr=Demande de congé %s créée HOLIDAY_MODIFYInDolibarr=Demande de congé %s modifiée -HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée +HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée HOLIDAY_VALIDATEInDolibarr=Demande de congé %s validée HOLIDAY_DELETEInDolibarr=Demande de congé %s supprimée EXPENSE_REPORT_CREATEInDolibarr=Note de frais %s créée diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index af88349f585..35de9806932 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -185,4 +185,4 @@ AlreadyOneBankAccount=un compte bancaire est déjà défini SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=Virement SEPA : 'Type de paiement' au niveau 'Virement' SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=A la génération d'un fichier SEPA XML pour les virements, la section "PaymentTypeInformation" peut maintenant être placée dans la section "CreditTransferTransactionInformation" (à la place de la section "Payment").\nNous recommandons fortement de ne pas cocher cette case pour conserver "PaymentTypeInformation" dans "Payment level" car toutes les banques ne l'accepterons pas obligatoirement au niveau de "CreditTransferTransactionInformation". Contactez votre banque avant de modifier ce paramètre. ToCreateRelatedRecordIntoBank=Pour créer un enregistrement bancaire associé manquant -BanklineExtraFields=Bank Line Extrafields +BanklineExtraFields=Extrait de la ligne bancaire diff --git a/htdocs/langs/fr_FR/bookmarks.lang b/htdocs/langs/fr_FR/bookmarks.lang index b449ca7110a..355b1b351e4 100644 --- a/htdocs/langs/fr_FR/bookmarks.lang +++ b/htdocs/langs/fr_FR/bookmarks.lang @@ -20,3 +20,4 @@ ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choisir si le raccourci doit ouv BookmarksManagement=Gestion des marque-pages BookmarksMenuShortCut=Ctrl + Maj + m NoBookmarks=Aucun marque page enregistré +NoBookmarkFound=Pas de marque-page trouvé. diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index 75c6ccb9ed9..4cb9011885d 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -46,6 +46,7 @@ BoxMyLastBookmarks=Mes %s derniers marque-pages BoxOldestExpiredServices=Plus anciens services expirés BoxLastExpiredServices=Les %s plus anciens contrats avec services actifs expirés BoxTitleLastActionsToDo=Les %s derniers événements à réaliser +BoxTitleOldestActionsToDo=Les %s plus anciens événement non terminés BoxTitleLastContracts=Les %s derniers contrats modifiés BoxTitleLastModifiedDonations=Les %s derniers dons modifiés BoxTitleLastModifiedExpenses=Les %s dernières notes de frais modifiées diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 244718df17d..049ee169cef 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -136,10 +136,12 @@ PrintWithoutDetails=Générer sans les détails YearNotDefined=L'année n'est pas définie TakeposBarcodeRuleToInsertProduct=Règle de lecture du code barre des produits TakeposBarcodeRuleToInsertProductDesc=Règle pour extraire la référence produit + une quantité d'un code barre scanné.
Si vide (valeur par défaut), l'application utilisera le code-barres complet scanné pour trouver le produit.

Si elle est définie, la syntaxe doit être:
ref: NB + Qu: NB + QD: NB + autres: NB
où NB est le nombre de caractères à utiliser pour extraire les données du code à barres scannés avec:
  • ref : référence produit
  • qu : quantité de jeu lors de l'insertion article (unités)
  • qd: quantité de jeu lors de l'insertion article (décimaux)
  • autre : autres caractères
-HideCategories=Masquer les catégories -HideStockOnLine=Masquer le stock en ligne -ShowOnlyProductInStock=Affficher les produits en stock -ShowCategoryDescription=Afficher la description des catégories -ShowProductReference=Afficher la référence des produits -UsePriceHT= Utiliser le prix HT et non en TTC AlreadyPrinted=Déjà imprimé +HideCategories=Cacher catégories +HideStockOnLine=Cacher les stocks sur les lignes +ShowOnlyProductInStock=Afficher les produits en stock +ShowCategoryDescription=Afficher la description de la catégorie +ShowProductReference=Afficher la référence des produits +UsePriceHT=Utiliser le prix HT et non le prix TTC +TerminalName=Terminal %s +TerminalNameDesc=Nom du terminal diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 5f478aabc7f..641cf97bacf 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -42,6 +42,7 @@ MemberHasNoCategory=Ce membre n'appartient à aucun(e) tag/catégorie ContactHasNoCategory=Ce contact n'appartient à aucun(e) tag/catégorie ProjectHasNoCategory=Ce projet n'est classé dans aucune catégorie ClassifyInCategory=Ajouter tag/catégorie +RemoveCategory=Supprimer la catégorie NotCategorized=Sans tag/catégorie CategoryExistsAtSameLevel=Ce tag existe déjà avec cette référence ContentsVisibleByAllShort=Contenu visible par tous @@ -67,6 +68,7 @@ StockCategoriesShort=Tags/catégories d’entrepôt ThisCategoryHasNoItems=Cette catégorie ne contient aucun élément. CategId=ID du(de la) tag/catégorie ParentCategory=Catégorie parente +ParentCategoryID=ID de la balise/catégorie parent ParentCategoryLabel=Libellé du tag/catégorie parent CatSupList=Liste des tags/catégories des fournisseurs CatCusList=Liste des tags/catégories des clients/prospects diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 84bb1364386..924059a1262 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -75,11 +75,11 @@ DraftPropals=Propositions brouillons NoLimit=Pas de limite ToOfferALinkForOnlineSignature=Lien pour signature en ligne WelcomeOnOnlineSignaturePageProposal=Bienvenue sur la page pour accepter les propositions commerciales de %s -WelcomeOnOnlineSignaturePageContract=Bienvenue sur la page de signature en ligne de contrats au format PDF de %s +WelcomeOnOnlineSignaturePageContract=Bienvenue sur la page de signature du contrat PDF %s ThisScreenAllowsYouToSignDocFromProposal=Cet écran vous permet d'accepter et signer en ligne, ou de refuser, le devis ou la proposition commerciale -ThisScreenAllowsYouToSignDocFromContract=Cet écran vous permet de signer en ligne des contrats au format PDF. +ThisScreenAllowsYouToSignDocFromContract=Cet écran vous permet de signer en ligne un contrat au format PDF. ThisIsInformationOnDocumentToSignProposal=Voici les informations sur le document à accepter ou refuser -ThisIsInformationOnDocumentToSignContract=Voici les informations sur le contrat a signer +ThisIsInformationOnDocumentToSignContract=Voici les informations sur le contrat à signer SignatureProposalRef=Signature du devis ou proposition commerciale %s SignatureContractRef=Signature du contrat %s FeatureOnlineSignDisabled=Fonctionnalité pour la signature en ligne désactivée ou document généré avant l'activation de la fonctionnalité diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index e875ef168fd..f66d2005c73 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -313,11 +313,11 @@ CustomerAbsoluteDiscountShort=Remise fixe CompanyHasRelativeDiscount=Ce client a une remise par défaut de %s%% CompanyHasNoRelativeDiscount=Ce client n'a pas de remise relative par défaut HasRelativeDiscountFromSupplier=Vous avez une réduction par défaut de %s%% chez ce fournisseur -HasNoRelativeDiscountFromSupplier=Vous n'avez pas de remise relative par défaut chez ce fournisseur +HasNoRelativeDiscountFromSupplier=Aucune remise relative par défaut de ce fournisseur CompanyHasAbsoluteDiscount=Ce client dispose de crédits disponibles (avoirs ou acomptes) pour un montant de %s %s CompanyHasDownPaymentOrCommercialDiscount=Ce client a une réduction disponible (commercial, acompte) pour %s%s CompanyHasCreditNote=Ce client a %s %s d'avoirs disponibles -HasNoAbsoluteDiscountFromSupplier=Vous n'avez aucun crédit de réduction disponible auprès de ce fournisseur +HasNoAbsoluteDiscountFromSupplier=Aucun rabais/crédit disponible auprès de ce fournisseur HasAbsoluteDiscountFromSupplier=Vous avez des crédits disponibles (avoirs ou acomptes) pour %s %s chez ce fournisseur HasDownPaymentOrCommercialDiscountFromSupplier=Vous avez des crédits disponibles (bon de réductions, acomptes) pour %s %s chez ce fournisseur HasCreditNoteFromSupplier=Vous avez des avoirs pour %s %s chez ce fournisseur @@ -444,7 +444,7 @@ AddAddress=Créer adresse SupplierCategory=Catégorie du fournisseur JuridicalStatus200=Indépendant DeleteFile=Suppression d'un fichier -ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier %s? +ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier %s ? AllocateCommercial=Affecter un commercial Organization=Organisme FiscalYearInformation=Exercice fiscal @@ -467,7 +467,7 @@ UniqueThirdParties=Nombre total des tiers InActivity=Ouvert ActivityCeased=Clos ThirdPartyIsClosed=Le tiers est clôturé -ProductsIntoElements=Liste des produits/services jusqu'à %s +ProductsIntoElements=Liste des produits/services présents dans %s CurrentOutstandingBill=Montant encours OutstandingBill=Montant encours autorisé OutstandingBillReached=Montant encours autorisé dépassé @@ -498,3 +498,5 @@ RestOfEurope=Reste de l'Union Européenne (UE) OutOfEurope=Hors Union Européenne (UE) CurrentOutstandingBillLate=Montant impayé arrivé à échéance BecarefullChangeThirdpartyBeforeAddProductToInvoice=Attention : selon votre configuration des prix des produits/services, vous devriez changer le tiers avant d'ajouter le produit +EmailAlreadyExistsPleaseRewriteYourCompanyName=l'e-mail existe déjà, veuillez réécrire le nom de votre entreprise +TwoRecordsOfCompanyName=plusieurs fiches existent pour cette entreprise merci de nous contacter pour compléter votre demande de partenariat" diff --git a/htdocs/langs/fr_FR/contracts.lang b/htdocs/langs/fr_FR/contracts.lang index bb7bf18da67..3c3d5620d1a 100644 --- a/htdocs/langs/fr_FR/contracts.lang +++ b/htdocs/langs/fr_FR/contracts.lang @@ -20,6 +20,7 @@ ContractsSubscriptions=Contrats/Abonnements ContractsAndLine=Contrats et lignes de contrats Contract=Contrat ContractLine=Ligne de contrat +ContractLines=Lignes du contrat Closing=Fermé NoContracts=Pas de contrats MenuServices=Services @@ -79,7 +80,7 @@ ConfirmDeleteContractLine=Êtes-vous sûr de vouloir supprimer cette ligne de co MoveToAnotherContract=Déplacer le service vers un autre contrat de ce tiers. ConfirmMoveToAnotherContract=J'ai choisi le contrat cible et confirme le déplacement du service dans ce contrat. ConfirmMoveToAnotherContractQuestion=Choisissez vers quel autre contrat (du même tiers), vous voulez déplacer ce service ? -PaymentRenewContractId=Renouvellement service (numéro %s) +PaymentRenewContractId=Renouveler le contrat %s (service %s) ExpiredSince=Expiré le NoExpiredServices=Pas de services actifs expirés ListOfServicesToExpireWithDuration=Liste des services actifs expirant dans %s jours @@ -104,3 +105,5 @@ AllowOnlineSign=Autoriser la signature en ligne AllowExternalDownload=Autoriser le téléchargement externe ShowClosedServices=Afficher les services fermés HideClosedServices=Masquer les services fermés +UserStartingService=Utilisateur démarrant le service +UserClosingService=Utilisateur stoppant le service diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 64bf5493285..e851fd5a13a 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -82,10 +82,18 @@ UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nombre de fichiers de sauvegarde à garder +MakeSendLocalDatabaseDumpShort=Envoyer la sauvegarde de la base de données locale +MakeSendLocalDatabaseDump=Envoyez la sauvegarde de la base de données locale par e-mail. Les paramètres sont : to, from, subject, message, filename (nom du fichier envoyé), filter ('sql' pour la sauvegarde de la base de données uniquement) +CleanUnfinishedCronjobShort=Nettoyer la tâche planifiée inachevée +CleanUnfinishedCronjob=Nettoyer la tâche planifiée bloquée dans le traitement lorsque le processus n'est plus en cours d'exécution WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés. DATAPOLICYJob=Nettoyeur de données et anonymiseur JobXMustBeEnabled=La tâche planifiée %s doit être activée +EmailIfError=E-mail d'avertissement en cas d'erreur +ErrorInBatch=Erreur lors de l'exécution du travail %s + # Cron Boxes LastExecutedScheduledJob=Dernier travail planifié exécuté NextScheduledJobExecute=Prochaine travail planifié à exécuter NumberScheduledJobError=Nombre de travaux planifiées en erreur +NumberScheduledJobNeverFinished=Nombre de tâches planifiées jamais terminées diff --git a/htdocs/langs/fr_FR/datapolicy.lang b/htdocs/langs/fr_FR/datapolicy.lang new file mode 100644 index 00000000000..16ed7ca5933 --- /dev/null +++ b/htdocs/langs/fr_FR/datapolicy.lang @@ -0,0 +1,92 @@ +# Copyright (C) 2018 Nicolas ZABOURI +# +# 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 . + +# Module label 'ModuledatapolicyName' +Module4100Name = Politique de confidentialité des données +# Module description 'ModuledatapolicyDesc' +Module4100Desc = Module de gestion de la confidentialité des données (conformité avec le RGPD) + +# +# Administration page +# +datapolicySetup = Configuration de la politique de confidentialité des données du module +Deletion = Suppression de données +datapolicySetupPage = En fonction des législations de vos pays (Exemple Article 5 du RGPD), les données personnelles doivent être conservées pendant une durée n'excédant pas celle nécessaire aux finalités pour lesquelles elles ont été collectées, sauf à des fins d'archivage.
La suppression se fera automatiquement après une certaine durée sans événement (la durée que vous aurez indiquée ci-dessous). +NB_MONTHS = %s mois +ONE_YEAR = 1 an +NB_YEARS = %s ans +DATAPOLICY_TIERS_CLIENT = Client +DATAPOLICY_TIERS_PROSPECT = Prospect +DATAPOLICY_TIERS_PROSPECT_CLIENT = Prospect/Client +DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Ni prospect/Ni client +DATAPOLICY_TIERS_FOURNISSEUR = Fournisseur +DATAPOLICY_CONTACT_CLIENT = Client +DATAPOLICY_CONTACT_PROSPECT = Prospect +DATAPOLICY_CONTACT_PROSPECT_CLIENT = Prospect/Client +DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Ni prospect/Ni client +DATAPOLICY_CONTACT_FOURNISSEUR = Fournisseur +DATAPOLICY_ADHERENT = Adhérent +DATAPOLICY_Tooltip_SETUP = Type de contact - Indiquez vos choix pour chaque type. +DATAPOLICYMail = Configuration des e-mails +DATAPOLICYSUBJECTMAIL = Objet du courriel +DATAPOLICYCONTENTMAIL = Contenu de l'e-mail +DATAPOLICYSUBSITUTION = Vous pouvez utiliser les variables suivantes dans votre email (LINKACCEPT permet de créer un lien enregistrant l'accord de la personne, LINKREFUSED permet d'enregistrer le refus de la personne) : +DATAPOLICYACCEPT = Message après accord +DATAPOLICYREFUSE = Message après désaccord +SendAgreementText = Vous pouvez envoyer un e-mail RGPD à tous vos contacts concernés (qui n'ont pas encore reçu d'e-mail et pour lesquels vous n'avez rien enregistré concernant leur accord RGPD). Pour ce faire, utilisez le bouton suivant. +SendAgreement = Envoyer des emails +AllAgreementSend = Tous les e-mails ont été envoyés +TXTLINKDATAPOLICYACCEPT = Texte pour le lien "accord" +TXTLINKDATAPOLICYREFUSE = Texte pour le lien "désaccord" + + +# +# Extrafields +# +DATAPOLICY_BLOCKCHECKBOX = RGPD : Traitement des données personnelles +DATAPOLICY_consentement = Consentement obtenu pour le traitement des données personnelles +DATAPOLICY_opposition_traitement = S'oppose au traitement de ses données personnelles +DATAPOLICY_opposition_prospection = S'oppose au traitement de ses données personnelles à des fins de prospection + +# +# Popup +# +DATAPOLICY_POPUP_ANONYME_TITLE = Anonymiser un tiers +DATAPOLICY_POPUP_ANONYME_TEXTE = Vous ne pouvez pas supprimer ce contact de Dolibarr car il y a des éléments liés. Conformément au RGPD, vous rendrez toutes ces données anonymes pour respecter vos obligations. Voulez-vous continuer ? + +# +# Button for portability +# +DATAPOLICY_PORTABILITE = Portabilité RGPD +DATAPOLICY_PORTABILITE_TITLE = Exportation de données personnelles +DATAPOLICY_PORTABILITE_CONFIRMATION = Vous souhaitez exporter les données personnelles de ce contact. Êtes-vous sûr ? + +# +# Notes added during an anonymization +# +ANONYMISER_AT = Anonymisé le %s + +# V2 +DATAPOLICYReturn = Validation RGPD +DATAPOLICY_date = Date d'accord/désaccord RGPD +DATAPOLICY_send = Date d'envoi de l'e-mail d'accord +DATAPOLICYReturn = Validation RGPD +DATAPOLICY_SEND = Envoyer un e-mail RGPD +MailSent = L'email a été envoyé + +# ERROR +ErrorSubjectIsRequired = Erreur : L'objet de l'email est obligatoire. Indiquez-le dans la configuration du module +=Suite à un problème technique, nous n'avons pas pu enregistrer votre choix. Nous nous en excusons. Contactez-nous pour nous faire part de votre choix. +NUMBER_MONTH_BEFORE_DELETION = Nombre de mois avant la suppression diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f043c5b5afc..d407d7c91b8 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -48,6 +48,7 @@ ErrorBadImageFormat=Cet image est dans un format non pris en charge (Votre PHP n ErrorBadDateFormat=La valeur '%s' a un format de date non reconnu ErrorWrongDate=La date est incorrecte ErrorFailedToWriteInDir=Impossible d'écrire dans le répertoire %s +ErrorFailedToBuildArchive=Échec de la création du fichier d'archive %s ErrorFoundBadEmailInFile=Syntaxe d'email incorrecte trouvée pour %s lignes dans le fichier (exemple ligne %s avec email=%s) ErrorUserCannotBeDelete=L'utilisateur ne peut pas être supprimé. Peut-être est-il associé à des éléments de Dolibarr. ErrorFieldsRequired=Des champs obligatoire n'ont pas été remplis. @@ -76,7 +77,7 @@ ErrorNoValueForCheckBoxType=Les valeurs de la liste de case à cochées doivent ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas avoir plus d'une virgule: %s mais il en faut au moins une: clé, valeur ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. -ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ %s ne doit contenir ni caractères spéciaux ni majuscules et ne peut contenir que des chiffres. +ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ %s ne doit pas contenir de caractères spéciaux, ni de majuscules, et doit commencer par un caractère alphabétique (a-z) ErrorFieldMustHaveXChar=Le champ %s doit comporter au moins %s caractères. ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export. @@ -97,7 +98,6 @@ ErrorFieldValueNotIn=Champ %s: '%s' n'est pas une valeur disponibl ErrorFieldRefNotIn=Champ %s: '%s' n'est pas une référence existante comme %s ErrorsOnXLines=Erreurs sur %s enregistrement(s) source ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) ! -ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admis pour le champ "%s" ErrorNumRefModel=Une référence existe en base (%s) et est incompatible avec cette numérotation. Supprimez la ligne ou renommez la référence pour activer ce module. ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur ErrorOrdersNotCreatedQtyTooLow=Certaines commandes n'ont pas été créées en raison de quantités trop faibles @@ -291,6 +291,13 @@ ErrorAjaxRequestFailed=Demande échouée ErrorThirpdartyOrMemberidIsMandatory=Définir un tiers ou un adhérent dans le partenariat est obligatoire ErrorFailedToWriteInTempDirectory=Impossible d'écrire dans le répertoire temporaire ErrorQuantityIsLimitedTo=La quantité est limitée à %s +ErrorFailedToLoadThirdParty=Impossible de trouver/charger un tiers à partir de id=%s, email=%s, name=%s +ErrorThisPaymentModeIsNotSepa=Ce mode de paiement n'est pas un compte bancaire +ErrorStripeCustomerNotFoundCreateFirst=Le client Stripe n'est pas défini pour ce tiers (ou défini sur une valeur supprimée du côté Stripe). Créez (ou rattachez) d'abord. +ErrorCharPlusNotSupportedByImapForSearch=La recherche IMAP n'est pas en mesure de rechercher dans l'expéditeur ou le destinataire une chaîne contenant le caractère + +ErrorTableNotFound=Table %s introuvable +ErrorValueForTooLow=La valeur pour %s est trop faible +ErrorValueCantBeNull=La valeur pour %s ne peut pas être nulle # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. @@ -326,6 +333,8 @@ WarningAvailableOnlyForHTTPSServers=Disponible uniquement si une connexion sécu WarningModuleXDisabledSoYouMayMissEventHere=Le module %s n’a pas été activé. Par conséquent, il se peut que vous manquiez beaucoup d’événements ici. WarningPaypalPaymentNotCompatibleWithStrict=La valeur 'Strict' fait que les fonctionnalités de paiement en ligne ne fonctionnent pas correctement. Utilisez plutôt 'Lax'. WarningThemeForcedTo=Attention, le choix du thème a été forcé à %s par la constante cachée MAIN_FORCETHEME +WarningPagesWillBeDeleted=Attention, cela supprimera également toutes les pages/conteneurs existants du site. Vous devriez exporter votre site Web avant, afin d'avoir une sauvegarde pour le réimporter plus tard. +WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal=La validation automatique est désactivée lorsque l'option de diminution du stock est définie sur "Validation de la facture". # Validate RequireValidValue = Valeur non valide diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index 665173fd58e..260bcebda1d 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -95,8 +95,8 @@ NbOfLinesOK=Nombre de lignes sans erreur ni avertissement : %s. NbOfLinesImported=Nombre de lignes importées avec succès : %s. DataComeFromNoWhere=La valeur à insérer n'est issue d'aucun champ du fichier source. DataComeFromFileFieldNb=La valeur à insérer provient de la colonne %s dans le fichier source. -DataComeFromIdFoundFromRef=La valeur provenant du fichier source sera utilisée pour trouver l'identifiant de l'objet parent à utiliser (donc l'objet %s qui a la référence du fichier source doit exister dans la base de données). -DataComeFromIdFoundFromCodeId=Le valeur du code provenant du fichier source sera utilisé pour trouver l'id de l'objet parent à utiliser (donc le code du fichier source doit exister dans le dictionnaire %s ). Notez que si vous connaissez l'identifiant, vous pouvez également l'utiliser dans le fichier source à la place du code. L'importation devrait fonctionner dans les deux cas. +DataComeFromIdFoundFromRef=La valeur qui vient du fichier source sera utilisée pour trouver l'id de l'objet parent à utiliser (donc l'objet %s qui a la réf. du fichier source doit exister dans la base de données). +DataComeFromIdFoundFromCodeId=La valeur du code provenant du fichier source sera utilisée pour trouver l'identifiant de l'objet parent à utiliser (donc le code du fichier source doit exister dans le dictionnaire %s). Notez que si vous connaissez l'identifiant, vous pouvez également l'utiliser dans le fichier source à la place du code. L'importation devrait fonctionner dans les deux cas. DataIsInsertedInto=La donnée issue du fichier source sera insérée dans le champ suivant: DataIDSourceIsInsertedInto=L'identifiant de l'objet père, retrouvé à partir de la donnée dans le fichier source, sera inséré dans le champ suivant : DataCodeIDSourceIsInsertedInto=L'identifiant de la ligne père, retrouvé à partir du code, sera inséré dans le champ suivant : @@ -134,7 +134,9 @@ FormatControlRule=Règle de contrôle de format ## imports updates KeysToUseForUpdates=Clé à utiliser pour mettre à jour les données NbInsert=Nombre de lignes insérées: %s +NbInsertSim=Nombre de lignes qui seront insérées : %s NbUpdate=Nombre de lignes mises à jour: %s +NbUpdateSim=Nombre de lignes qui seront mises à jour : %s MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s StocksWithBatch=Stocks et entrepôts des produits avec numéro de lot/série WarningFirstImportedLine=La ou les premières lignes ne seront pas importées avec la sélection actuelle diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 22720779eaf..27439f66c27 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -1,10 +1,11 @@ # Dolibarr language file - Source file is en_US - holiday HRM=GRH -Holidays=Congés -Holiday=Congé +Holidays=Feuilles +Holiday=Demande de congés CPTitreMenu=Demande de congés MenuReportMonth=État mensuel MenuAddCP=Créer demande de congés +MenuCollectiveAddCP=Nouvelle demande de congé collectif NotActiveModCP=Vous devez activer le module Congés pour afficher cette page. AddCP=Créer une demande de congés DateDebCP=Date Début @@ -57,6 +58,7 @@ ConfirmDeleteCP=Confirmer la suppression de cette demande de congés ? ErrorCantDeleteCP=Erreur, vous n'avez pas le droit de supprimer cette demande de congés. CantCreateCP=Erreur, vous n'avez pas le droit de créer une demande de congés. InvalidValidatorCP=Vous devez choisir un approbateur pour votre demande de congés. +InvalidValidator=L'utilisateur choisi n'est pas un approbateur. NoDateDebut=Vous devez choisir une date de début. NoDateFin=Vous devez choisir une date de fin. ErrorDureeCP=Votre demande de congés payés ne contient aucun jour ouvré. @@ -80,6 +82,8 @@ MotifCP=Motif UserCP=Utilisateur ErrorAddEventToUserCP=Une erreur est survenue durant l'ajout du congé exceptionnel. AddEventToUserOkCP=L'ajout du congé exceptionnel à bien été effectué. +ErrorFieldRequiredUserOrGroup=Le champ "groupe" ou le champ "utilisateur" doivent être remplis +fusionGroupsUsers=Le champ "groupes" et le champ "utilisateur" seront fusionnés MenuLogCP=Voir historique modif. LogCP=Historique des mises à jour de jours de congés disponibles ActionByCP=Réalisée par @@ -87,6 +91,13 @@ UserUpdateCP=Mis à jour pour PrevSoldeCP=Précédent Solde NewSoldeCP=Nouveau Solde alreadyCPexist=Une demande de congés a déjà été faite sur cette période. +UseralreadyCPexist=Une demande de congé a déjà été faite pour cette période pour %s. +groups=Groupes +users=Utilisateurs +AutoSendMail=Envoi automatique d'email +NewHolidayForGroup=Nouvelle demande de congé collectif +SendRequestCollectiveCP=Envoyer la demande de congé collectif +AutoValidationOnCreate=Validation automatique FirstDayOfHoliday=Premier jour de congés LastDayOfHoliday=Dernier jour de congés BoxTitleLastLeaveRequests=Les %s dernières demandes de congés modifiées @@ -138,3 +149,10 @@ XIsAUsualNonWorkingDay=%s est généralement un jour NON ouvrable BlockHolidayIfNegative=Bloqué lorsque le solde est négatif LeaveRequestCreationBlockedBecauseBalanceIsNegative=La création de cette demande de congé est bloquée car votre solde est négatif ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=La demande de congé %s doit être brouillon, annulée ou refusée pour être supprimée +IncreaseHolidays=Augmenter le nombre de jours de vacances +HolidayRecordsIncreased= %s registres de vacances augmentés +HolidayRecordIncreased=Registre de vacances augmenté +ConfirmMassIncreaseHoliday=Augmentation en masse des vacances +NumberDayAddMass=Nombre de jours à ajouter à la sélection +ConfirmMassIncreaseHolidayQuestion=Êtes-vous sûr de vouloir augmenter les vacances du ou des enregistrement(s) sélectionnés %s ? +HolidayQtyNotModified=Le solde des jours restants pour %s n'a pas été modifié diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index 5e520547352..0888db3aca6 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -28,6 +28,7 @@ ErrorPHPVersionTooLow=Version PHP trop ancienne. La version %s ou supérieure es ErrorPHPVersionTooHigh=Version PHP trop élevée. La version %s ou inférieure est requise. ErrorConnectedButDatabaseNotFound=Connexion au serveur réussie mais base '%s' introuvable. ErrorDatabaseAlreadyExists=La base de données '%s' existe déjà. +ErrorNoMigrationFilesFoundForParameters=Aucun fichier de migration trouvé pour les versions sélectionnées IfDatabaseNotExistsGoBackAndUncheckCreate=Si la base n'existe pas, revenez en arrière et cochez l'option "Créer la base de données". IfDatabaseExistsGoBackAndCheckCreate=Si la base existe déjà, revenez en arrière et désactiver l'option "Créer la base de données". WarningBrowserTooOld=Version du navigateur trop ancienne. Nous vous recommandons de mettre à jour vers une version récente de Firefox, Chrome ou Opera. @@ -50,7 +51,6 @@ DatabaseName=Nom de la base de données DatabasePrefix=Préfixe des tables DatabasePrefixDescription=Préfixe de table de base de données. Si vide, la valeur par défaut est llx_. AdminLogin=Identifiant du propriétaire de la base de données Dolibarr. -PasswordAgain=Vérification du mot de passe AdminPassword=Mot de passe du propriétaire de la base de données Dolibarr. CreateDatabase=Créer la base de données CreateUser=Créer le propriétaire ou lui affecter les droits à la base @@ -212,3 +212,5 @@ ClickHereToGoToApp=Cliquez ici pour aller sur votre application ClickOnLinkOrRemoveManualy=Si une mise à niveau est en cours, veuillez patienter. Si non, cliquez sur le lien suivant. Si vous atteignez toujours cette page, vous devez supprimer manuellement le fichier install.lock dans le répertoire documents Loaded=Chargé FunctionTest=Fonction test +NodoUpgradeAfterDB=Aucune action demandée par les modules externes après la mise à jour de la base de données +NodoUpgradeAfterFiles=Aucune action demandée par les modules externes après la mise à jour des fichiers ou des répertoires diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index 50e6ff1d9d1..c09f8431498 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -68,3 +68,4 @@ ConfirmReopenIntervention=Êtes-vous sur de vouloir ré-ouvrir l'intervention %s, i ErrorUserPermissionAllowsToLinksToItselfOnly=Pour des raisons de sécurité, il faut posséder les droits de modification de tous les utilisateurs pour pouvoir lier un adhérent à un utilisateur autre que vous même. SetLinkToUser=Lier à un utilisateur Dolibarr SetLinkToThirdParty=Lier à un tiers Dolibarr +MemberCountersArePublic=Les compteurs de membres valides sont publics MembersCards=Génération de cartes pour les membres MembersList=Liste des adhérents MembersListToValid=Liste des adhérents brouillons (à valider) @@ -72,6 +73,12 @@ MemberTypeCanNotBeDeleted=Ce type d'adhérent ne peut pas être supprimé NewSubscription=Nouvelle cotisation NewSubscriptionDesc=Ce formulaire permet de vous inscrire comme nouvel adhérent de l'association. Pour un renouvellement (si vous êtes déjà adhérent), contactez plutôt l'association par email %s. Subscription=Adhésion / cotisation +AnyAmountWithAdvisedAmount=Tout montant avec une quantité recommandée de %s%s +AnyAmountWithoutAdvisedAmount=Tout montant +CanEditAmountShort=Tout montant +CanEditAmountShortForValues=recommandé, tout montant +MembershipDuration=Durée +GetMembershipButtonLabel=Obtenir l'adhésion Subscriptions=Adhésions / cotisations SubscriptionLate=En retard SubscriptionNotReceived=Cotisation non reçue @@ -136,7 +143,7 @@ CardContent=Contenu de votre fiche adhérent # Text of email templates ThisIsContentOfYourMembershipRequestWasReceived=Nous vous informons que votre demande d'adhésion a bien été reçue.

ThisIsContentOfYourMembershipWasValidated=Nous vous informons que votre adhésion a été validé avec les informations suivantes:

-ThisIsContentOfYourSubscriptionWasRecorded=Nous vous informons que votre nouvelle cotisation a été enregistrée.

+ThisIsContentOfYourSubscriptionWasRecorded=Nous voulons vous informer que votre nouvelle cotisation a été enregistrée. Veuillez trouver votre facture ci-jointe.

ThisIsContentOfSubscriptionReminderEmail=Nous voulons vous informer que votre adhésion est sur le point d'expirer ou a déjà expiré (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). Nous espérons que vous pourrez la renouveler, votre soutien nous est précieux.

ThisIsContentOfYourCard=Ceci est un rappel des informations que nous avons vous concernant. N'hésitez pas à nous contacter en cas d'erreur.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Sujet de l'email reçu en cas d'auto-inscription d'un invité @@ -199,14 +206,8 @@ NbOfSubscriptions=Nombre de cotisations AmountOfSubscriptions=Montant des cotisations TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité) DefaultAmount=Montant par défaut de la cotisation -CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation quel que soit le type d'adhésion -AmountIsLowerToMinimumNotice=sur un dû total de %s -AnyAmountWithAdvisedAmount=Montant libre avec un montant recommandé de %s %s -AnyAmountWithoutAdvisedAmount=Montant libre -CanEditAmountShortForValues=conseillé, montant libre -MembershipDuration=Durée -GetMembershipButtonLabel=Adhérer -CanEditAmountShort=Montant libre +CanEditAmount=Le visiteur peut choisir/modifier le montant de sa contribution quel que soit le type d'adhérent +AmountIsLowerToMinimumNotice=Le montant est inférieur au montant minimum de %s MEMBER_NEWFORM_PAYONLINE=Rediriger sur la page intégrée de paiement en ligne ByProperties=Par nature MembersStatisticsByProperties=Statistiques des adhérents par nature diff --git a/htdocs/langs/fr_FR/modulebuilder.lang b/htdocs/langs/fr_FR/modulebuilder.lang index d29c9f2164b..2bd50f4225b 100644 --- a/htdocs/langs/fr_FR/modulebuilder.lang +++ b/htdocs/langs/fr_FR/modulebuilder.lang @@ -1,7 +1,8 @@ # Dolibarr language file - Source file is en_US - loan +IdModule= ID module ModuleBuilderDesc=Cet outil ne doit être utilisé que par des utilisateurs ou des développeurs expérimentés. Il fournit des utilitaires pour construire ou éditer votre propre module. La documentation pour le développement manuel alternatif est ici . EnterNameOfModuleDesc=Entrez le nom du module/application à créer sans espaces. Utilisez des majuscules pour séparer les mots (Par exemple: MyModule, EcommerceForShop, SyncWithMySystem...) -EnterNameOfObjectDesc=Entrez le nom de l'objet à créer sans espaces. Utilisez des majuscules pour séparer les mots (par exemple: MyObject, Student, Teacher...). Le fichier de classe CRUD, mais aussi le fichier d'API, les pages pour lister/ajouter/modifier/supprimer l'objet et les fichiers SQL seront générés. +EnterNameOfObjectDesc=Renseignez le nom de l'objet à créer, sans utiliser d'espace. Utilisez des majuscules pour séparer les termes (par exemple : MyObject, Student, Teacher...). Le fichier de classe CRUD, les pages pour lister/ajouter/modifier/supprimer l'objet et les fichiers SQL seront générés. EnterNameOfDictionaryDesc=Entrez le nom du dictionnaire à créer sans espaces. Utilisez des majuscules pour séparer les mots (Par exemple : MyDico...). Le fichier de classe, mais aussi le fichier SQL seront générés. ModuleBuilderDesc2=Chemin ou les modules sont générés/modifiés (premier répertoire pour les modules externes défini dans %s):%s ModuleBuilderDesc3=Modules générés/éditables trouvés : %s @@ -9,6 +10,7 @@ ModuleBuilderDesc4=Un module est détecté comme 'modifiable' quand le fichier < NewModule=Nouveau module NewObjectInModulebuilder=Nouvel objet NewDictionary=Nouveau dictionnaire +ModuleName=Nom du module ModuleKey=Clé du module ObjectKey=Clé de l'objet DicKey=Clé du dictionnaire @@ -48,6 +50,7 @@ PathToModulePackage=Chemin du zip du package du module/application PathToModuleDocumentation=Chemin d'accès au fichier de documentation du module (%s) SpaceOrSpecialCharAreNotAllowed=Les espaces et les caractères spéciaux ne sont pas autorisés. FileNotYetGenerated=Fichier non encore généré +GenerateCode=Générer le code RegenerateClassAndSql=Forcer la mise à jour des fichiers .class et .sql RegenerateMissingFiles=Générer les fichiers manquant SpecificationFile=Fichier de documentation @@ -86,10 +89,10 @@ ListOfMenusEntries=Liste des entrées du menu ListOfDictionariesEntries=Liste des entrées de dictionnaires ListOfPermissionsDefined=Liste des permissions SeeExamples=Voir des exemples ici -EnabledDesc=Condition pour que ce champ soit actif (Exemples: 1 ou $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Le champ est-il visible ? (Exemples: 0 = Jamais visible, 1 = Visible sur les listes et formulaires de création/mise à jour/visualisation, 2 = Visible uniquement sur la liste, 3 = Visible uniquement sur le formulaire de création/mise à jour/affichage (pas les listes), 4=Visible sur les listes et formulaire de mise à jour et affichage uniquement (pas en création), 5=Visible sur les listes et formulaire en lecture (pas en création ni modification).

Utiliser une valeur négative signifie que le champ n'est pas affiché par défaut sur la liste mais peut être sélectionné pour l'affichage).

Il peut s'agir d'une expression, par exemple :
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) -DisplayOnPdfDesc=Afficher ce champ sur les documents PDF compatibles, vous pouvez gérer la position avec le champ "Position.
Actuellement, les modèles compatibles PDF connus sont : eratostene (commande), espadon (expédition), sponge (factures), cyan (devis/propositions commerciales), cornas (commande fournisseur)

Pour le document :
0 = non affiché
1 = affiché
2 = affiché uniquement si non vide

Pour les lignes de document :
0 = non affiché
1 = affiché dans une colonne
3 = affiché dans la colonne description après la description
4 = affiché dans la colonne description après la description uniquement si non vide -DisplayOnPdf=Afficher sur PDF +EnabledDesc=Condition pour que ce champs soit actif.

Exemples:
1
isModEnabled('MAIN_MODULE_MYMODULE')
getDolGlobalString('MYMODULE_OPTION')==2 +VisibleDesc=Le champ est-il visible ? (Exemples: 0=Jamais visible, 1=Visible sur les listes et formulaires de création/mise à jour/visualisation, 2=Visible uniquement sur les listes, 3=Visible uniquement sur le formulaire de création/mise à jour/affichage (pas les listes), 4=Visible sur les listes et formulaire de mise à jour et affichage uniquement (pas en création), 5=Visible sur les listes et formulaire en lecture (pas en création ni modification).

Utiliser une valeur négative signifie que le champ n'est pas affiché par défaut sur la liste mais peut être sélectionné pour l'affichage).

Il peut s'agir d'une expression, par exemple :
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
$user->hasRight('holiday', 'define_holiday')?1:5 +DisplayOnPdfDesc=Affichez ce champ sur les documents PDF compatibles, vous pouvez gérer la position avec le champ "Position".
Pour le document :
0 = non affiché
1 = affiché
2 = affiché uniquement si non vide

Pour les lignes de document :
0 = non affiché
1 = affiché dans une colonne
3 = affiché dans la colonne description après la description
4 = affiché dans la colonne description après la description uniquement si non vide +DisplayOnPdf=Sur les PDF IsAMeasureDesc=Peut-on cumuler la valeur du champ pour obtenir un total dans les listes ? (Exemples: 1 ou 0) SearchAllDesc=Le champ doit-il être utilisé pour effectuer une recherche à partir de l'outil de recherche rapide ? (Exemples: 1 ou 0) SpecDefDesc=Entrez ici toute la documentation que vous souhaitez joindre au module et qui n'a pas encore été définis dans d'autres onglets. Vous pouvez utiliser .md ou, mieux, la syntaxe enrichie .asciidoc. @@ -105,7 +108,7 @@ TriggerDefDesc=Définissez dans le fichier trigger le code que vous souhaitez ex SeeIDsInUse=Voir les IDs utilisés dans votre installation SeeReservedIDsRangeHere=Voir la plage des ID réservés ToolkitForDevelopers=Boîte à outils pour développeurs Dolibarr -TryToUseTheModuleBuilder=Si vous connaissez SQL et PHP, vous pouvez utiliser l'assistant de création de module natif.
Activez le module %s et utilisez l'assistant en cliquant sur la . dans le menu en haut à droite.
Avertissement: Il s'agit d'une fonctionnalité avancée pour les développeurs. Ne pas expérimenter sur votre site de production! +TryToUseTheModuleBuilder=Si vous connaissez SQL et PHP, vous pouvez utiliser l'assistant de création de module natif.
Activez le module %s et utilisez l'assistant en cliquant sur la dans le menu en haut à droite.
Avertissement: Il s'agit d'une fonctionnalité avancée pour les développeurs. Ne pas expérimenter sur votre site de production! SeeTopRightMenu=Voir à droite de votre barre de menu principal AddLanguageFile=Ajouter le fichier de langue YouCanUseTranslationKey=Vous pouvez utiliser ici une clé qui est la clé de traduction trouvée dans le fichier de langue (voir l'onglet "Langues") @@ -132,9 +135,9 @@ UseSpecificAuthor = Utiliser un auteur spécifique UseSpecificVersion = Utiliser une version initiale spécifique IncludeRefGeneration=La référence de l'objet doit être générée automatiquement par des règles de numérotation personnalisées IncludeRefGenerationHelp=Cochez cette case si vous souhaitez inclure du code pour gérer automatiquement la génération de la référence à l'aide de règles de numérotation personnalisées -IncludeDocGeneration=Je souhaite générer des documents à partir de modèles pour l'objet +IncludeDocGeneration=Je souhaite la fonctionnalité pour générer des documents (PDF, ODT) à partir de modèles pour cet objet IncludeDocGenerationHelp=Si vous cochez cette case, du code sera généré pour ajouter une section "Générer un document" sur la fiche de l'objet. -ShowOnCombobox=Afficher la valeur dans la liste déroulante +ShowOnCombobox=Afficher la valeur dans les listes déroulantes KeyForTooltip=Clé pour l'info-bulle CSSClass=CSS pour le formulaire d'édition / création CSSViewClass=CSS pour le formulaire de lecture @@ -154,3 +157,6 @@ ListOfTabsEntries=Liste des entrées d'onglet TabsDefDesc=Définissez ici les onglets proposés par votre module TabsDefDescTooltip=Les onglets fournis par votre module/application sont définis dans le tableau $this->tabs dans le fichier descripteur de module. Vous pouvez modifier manuellement ce fichier ou utiliser l'éditeur intégré. BadValueForType=Mauvaise valeur pour le type %s +DefinePropertiesFromExistingTable=Définir des propriétés à partir d'une table existante +DefinePropertiesFromExistingTableDesc=Si une table dans la base de données (pour l'objet à créer) existe déjà, vous pouvez l'utiliser pour définir les propriétés de l'objet. +DefinePropertiesFromExistingTableDesc2=Laisser vide si la table n'existe pas encore. Le générateur de code utilisera différents types de champs pour créer un exemple de table que vous pourrez modifier ultérieurement. diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index b9730cdb7f8..3cab2476a09 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,9 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) -BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travail est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" -BOMProductsList=Liste des composants -BOMServicesList=Liste des services +BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travail est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x poste de travail ahr", sinon "quantité (convertie en heures) x prix de revient de la prestation" GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. ErrorAVirtualProductCantBeUsedIntoABomOrMo=Un kit ne peut pas être utilisé dans une Nomenclature ou un Ordre de fabrication. Workstation=Poste de travail @@ -94,7 +92,6 @@ WorkstationSetup = Configuration du module Poste de travail WorkstationSetupPage = Configuration du module Poste de travail WorkstationList=Liste des postes de travail WorkstationCreate=Ajouter un nouveau poste de travail -DefaultWorkstation=Poste de travail par défaut ConfirmEnableWorkstation=Voulez-vous vraiment activer le poste de travail %s? EnableAWorkstation=Activer le module Poste de travail ConfirmDisableWorkstation=Voulez-vous vraiment désactiver la station de travail %s? @@ -113,7 +110,7 @@ THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article BOM=Nomenclature CollapseBOMHelp=Vous pouvez définir l'affichage par défaut des détails de la nomenclature dans la configuration du module BOM MOAndLines=Ordres de fabrication et lignes -MoChildGenerate=Generate Child Mo -ParentMo=MO Parent -MOChild=MO Child -BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arborescence qui mène à la nomenclature %s +MoChildGenerate=Générer OF enfant +ParentMo=OF parent +MOChild=OF Enfant +BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arbre menant à la nomenclature %s diff --git a/htdocs/langs/fr_FR/oauth.lang b/htdocs/langs/fr_FR/oauth.lang index 95cb2958bcb..e884f616f39 100644 --- a/htdocs/langs/fr_FR/oauth.lang +++ b/htdocs/langs/fr_FR/oauth.lang @@ -9,8 +9,9 @@ HasAccessToken=Un jeton a été généré et sauvegardé dans la base de donnée NewTokenStored=Jeton reçu et sauvegardé ToCheckDeleteTokenOnProvider=Cliquer ici pour vérifier/effacer les autorisations sauvées par le fournisseur OAuth %s TokenDeleted=Jeton effacé +GetAccess=Cliquez ici pour obtenir un token RequestAccess=Cliquez ici pour demander/renouveler l'accès et recevoir un nouveau jeton -DeleteAccess=Cliquez ici pour effacer le jeton +DeleteAccess=Cliquez ici pour supprimer le jeton UseTheFollowingUrlAsRedirectURI=Utilisez l'URL suivante comme URI de redirection quand vous créez des identifiants d'accès chez votre fournisseur OAuth : ListOfSupportedOauthProviders=Ajoutez vos fournisseurs de jetons OAuth2. Ensuite, rendez-vous sur la page d'administration de votre fournisseur OAuth pour créer/obtenir un identifiant et un secret OAuth et enregistrez-les ici. Une fois cela fait, basculez sur l'autre onglet pour générer votre jeton. OAuthSetupForLogin=Page pour gérer (générer/supprimer) les jetons OAuth @@ -34,5 +35,6 @@ OAUTH_ID=ID OAuth OAUTH_SECRET=Code secret OAuth OAuthProviderAdded=Fournisseur OAuth ajouté AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=Une entrée OAuth pour ce fournisseur et ce libellé existe déjà -ScopeUndefined=Permissions (Scopes) non définies (voir onglet précédent) -Scopes=Portées \ No newline at end of file +URLOfServiceForAuthorization=URL fournie par le service OAuth pour l'authentification +Scopes=Permissions ("Scopes" OAuth) +ScopeUndefined=Permissions (Cibles) non définies (voir onglet précédent) diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 7617085348e..6c714be2c4d 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -311,10 +311,10 @@ ExternalSiteURL=URL du site externe du contenu iFrame HTML ExternalSiteModuleNotComplete=La configuration du module "Site externe" est incomplète. ExampleMyMenuEntry=Mon entrée de menu -# FTP +# ftp FTPClientSetup=Connexion client FTP/FTPS NewFTPClient=Nouvelle connexion FTP/FTPS -FTPArea=Zone des connexions FTP/FTPS +FTPArea=Zone FTP/SFTP FTPAreaDesc=Vue d'un serveur FTP/FTPS SetupOfFTPClientModuleNotComplete=La configuration du client FTP/FTPS semble incomplète FTPFeatureNotSupportedByYourPHP=Votre version de PHP ne supporte pas les fonctions FTP/FTPS @@ -325,3 +325,9 @@ FTPFailedToRemoveDir=Échec suppression répertoire %s (Vérifiez les per FTPPassiveMode=Mode passif ChooseAFTPEntryIntoMenu=Sélection d'un site FTP/FTPS depuis le menu FailedToGetFile=Echec à la récupération du fichier %s +ErrorFTPNodisconnect=Erreur de déconnexion du serveur FTP/SFTP +FileWasUpload=Le fichier %s a été téléchargé +FTPFailedToUploadFile=Impossible de télécharger le fichier %s. +AddFolder=Créer un dossier +FileWasCreateFolder=Le dossier %s a été créé +FTPFailedToCreateFolder=Échec de la création du dossier %s. diff --git a/htdocs/langs/fr_FR/partnership.lang b/htdocs/langs/fr_FR/partnership.lang index 845bf4ff36c..41849e2812e 100644 --- a/htdocs/langs/fr_FR/partnership.lang +++ b/htdocs/langs/fr_FR/partnership.lang @@ -28,6 +28,7 @@ PartnershipCheckBacklink=Partenariat : Vérifiez le backlink référent # Menu # NewPartnership=Nouveau partenariat +NewPartnershipbyWeb= Votre partenariat a été ajouté avec succès. ListOfPartnerships=Listes des partenariats # @@ -42,6 +43,7 @@ PARTNERSHIP_BACKLINKS_TO_CHECK=Liens de retour à vérifier PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb de jours avant l'annulation de l'état d'un partenariat lorsque la cotisation a expiré ReferingWebsiteCheck=Vérification du site référent ReferingWebsiteCheckDesc=Vous pouvez activer une fonctionnalité pour vérifier que vos partenaires ont ajouté un rétrolien vers les domaines de votre site Web sur leur propre site Web. +PublicFormRegistrationPartnerDesc=Dolibarr peut vous fournir une URL/un site Web public pour permettre aux visiteurs externes de demander à faire partie du programme de partenariat. # # Object @@ -59,6 +61,12 @@ BacklinkNotFoundOnPartnerWebsite=Lien de retour non trouvé sur le site web part ConfirmClosePartnershipAsk=Êtes-vous sûr de vouloir annuler ce partenariat ? PartnershipType=Type de partenariat PartnershipRefApproved=Partenariat %s approuvé +KeywordToCheckInWebsite=Si vous souhaitez vérifier qu'un mot-clé donné est présent dans le site de chaque partenaire, définissez ce mot-clé ici +PartnershipDraft=Brouillon +PartnershipAccepted=Accepté +PartnershipRefused=Refusé +PartnershipCanceled=Annulé +PartnershipManagedFor=Les partenaires sont # # Template Mail @@ -82,11 +90,6 @@ CountLastUrlCheckError=Nombre d'erreurs lors de la dernière vérification d'URL LastCheckBacklink=Date de la dernière vérification d'URL ReasonDeclineOrCancel=Raison du refus -# -# Status -# -PartnershipDraft=Brouillon -PartnershipAccepted=Accepté -PartnershipRefused=Refusé -PartnershipCanceled=Annulé -PartnershipManagedFor=Les partenaires sont +NewPartnershipRequest=Nouvelle demande de partenariat +NewPartnershipRequestDesc=Ce formulaire vous permet de demander à faire partie de l'un de nos programmes de partenariat. Si vous avez besoin d'aide pour remplir ce formulaire, veuillez contacter par email %s . + diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang index 0fdb3e38d20..be600a2671b 100644 --- a/htdocs/langs/fr_FR/paypal.lang +++ b/htdocs/langs/fr_FR/paypal.lang @@ -34,3 +34,4 @@ ARollbackWasPerformedOnPostActions=Une annulation a été effectuée sur toutes ValidationOfPaymentFailed=La validation du paiement a échoué CardOwner=Titulaire de la carte PayPalBalance=Crédit Paypal +OnlineSubscriptionPaymentLine=Cotisation en ligne enregistrée sur %s
Payé via %s
Adresse IP d'origine : %s
ID de transaction : %s diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 68b5e928084..8493e419384 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -1,8 +1,8 @@ # ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=Utiliser les numéros de lots/série -ProductStatusOnBatch=Oui (Lot/Série requis) +ProductStatusOnBatch=Oui (lot/série requis) ProductStatusOnSerial=Oui (numéro de série unique requis) -ProductStatusNotOnBatch=Non (Lot/Série non utilisé) +ProductStatusNotOnBatch=Non (lot/série non utilisé) ProductStatusOnBatchShort=Lot ProductStatusOnSerialShort=Numéro Série ProductStatusNotOnBatchShort=Non @@ -17,6 +17,7 @@ printBatch=Lot/Série: %s printEatby=DMD/DLUO: %s printSellby=DLC: %s printQty=Qté: %d +printPlannedWarehouse=Entrepôt : %s AddDispatchBatchLine=Ajouter une ligne pour la répartition par durée de conservation WhenProductBatchModuleOnOptionAreForced=Quand le module Lot/Série est activé, le mode de décrémentation automatique des stocks est forcé sur 'Décrémenter les stocks réel sur validation d'expédition' et le mode d'incrémentation automatique de stocks est forcé sur 'Incrémenter les stocks réels sur ventilation manuels dans les entrepôts' et ne peut pas être édité. Les autres options peuvent être définies comme vous le voulez. ProductDoesNotUseBatchSerial=Ce produit n'utilise pas les numéros de lot/série @@ -43,4 +44,4 @@ HideLots=Masquer les lots OutOfOrder=Hors d'usage InWorkingOrder=En état de marche ToReplace=Remplacer -CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre. +CantMoveNonExistantSerial=Erreur : un numéro de série sur lequel vous avez demandé un mouvement n'existe plus. Peut-être avez-vous utilisé plusieurs fois le même numéro de série depuis le même entrepôt sur la même expédition, ou peut-être était-il utilisé sur une autre expédition. Supprimez cette expédition et préparez-en une autre. diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 3e7eece5d0e..9061f0498fc 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -140,7 +140,7 @@ PriceQtyMin=Prix quantité min. PriceQtyMinCurrency=Prix (devise) pour cette quantité. WithoutDiscount=Sans remise VATRateForSupplierProduct=Taux TVA (pour ce produit/fournisseur) -DiscountQtyMin=Remise par défaut quantité min. +DiscountQtyMin=Remise pour cette qté. NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit NoSupplierPriceDefinedForThisProduct=Aucun prix/qté fournisseur défini pour ce produit PredefinedItem=Article prédéfini @@ -345,7 +345,7 @@ PossibleValues=Valeurs possibles GoOnMenuToCreateVairants=Allez sur le menu %s - %s pour ajouter les attributs de variantes (comme les couleurs, tailles, ...) UseProductFournDesc=Ajouter une fonctionnalité pour définir la description produit définie par les vendeurs (pour chaque référence vendeur) en plus de la description pour les clients ProductSupplierDescription=Description du fournisseur du produit -UseProductSupplierPackaging=Utiliser le conditionnement/emballage sur les prix fournisseur (recalculer les quantités en fonction de l'emballage défini sur le prix fournisseur lors de l'ajout / mise à jour de la ligne dans les documents fournisseurs) +UseProductSupplierPackaging=Utiliser l'emballage pour les prix arrondis aux multiples pour les prix d'achat (recalculer les quantités en fonction des multiples définis sur les prix d'achat lors de l'ajout/de la mise à jour d'une ligne dans les documents d'un fournisseur) PackagingForThisProduct=Conditionnement PackagingForThisProductDesc=Vous achèterez automatiquement un multiple de cette quantité. QtyRecalculatedWithPackaging=La quantité de la ligne a été recalculée en fonction de l'emballage du fournisseur @@ -417,7 +417,6 @@ ErrorsProductsMerge=Erreur lors de la fusion des produits SwitchOnSaleStatus=Basculer le statut En vente SwitchOnPurchaseStatus=Basculer le statut En achat StockMouvementExtraFields= Champs supplémentaires (mouvement de stock) -OrProductsWithCategories=Ou produits avec tags/categories InventoryExtraFields= Attributs supplémentaires (inventaire) ScanOrTypeOrCopyPasteYourBarCodes=Scannez ou tapez ou copiez/collez vos codes-barres PuttingPricesUpToDate=Mise à jour des prix avec les prix connus actuels @@ -428,3 +427,4 @@ RealValuation=Valorisation réelle ConfirmEditExtrafield = Sélectionnez l'extrafield que vous souhaitez modifier ConfirmEditExtrafieldQuestion = Voulez-vous vraiment modifier cet extrafield ? ModifyValueExtrafields = Modifier la valeur d'un extrafield +OrProductsWithCategories=Ou des produits avec des tags/catégories diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index af97ce451bb..90fe82c2ffb 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -167,7 +167,7 @@ OpportunityAmount=Montant opportunité OpportunityAmountShort=Montant opportunité OpportunityWeightedAmount=Montant pondéré des opportunités OpportunityWeightedAmountShort=Montant pondéré opp. -OpportunityAmountAverageShort=montant moyen des opportunités +OpportunityAmountAverageShort=Montant moyen des opportunités OpportunityAmountWeigthedShort=Montant pondéré des opportunités WonLostExcluded=hors opportunités remportées/perdues ##### Types de contacts ##### @@ -259,7 +259,7 @@ TimeSpentInvoiced=Temps passé facturé TimeSpentForIntervention=Temps consommé TimeSpentForInvoice=Temps consommés OneLinePerUser=Une ligne par utilisateur -ServiceToUseOnLines=Service à utiliser sur les lignes +ServiceToUseOnLines=Service à utiliser sur les lignes par défaut InvoiceGeneratedFromTimeSpent=La facture %s a été générée à partir du temps passé sur le projet InterventionGeneratedFromTimeSpent=L'intervention %s a été générée à partir du temps consacré au projet ProjectBillTimeDescription=Cochez si vous saisissez du temps sur les tâches du projet ET prévoyez de générer des factures à partir des temps pour facturer le client du projet (ne cochez pas si vous comptez créer une facture qui n'est pas basée sur la saisie des temps). Note: Pour générer une facture, aller sur l'onglet 'Temps consommé' du project et sélectionnez les lignes à inclure. @@ -294,3 +294,4 @@ EnablePublicLeadForm=Activer le formulaire public de contact NewLeadbyWeb=Votre message ou votre demande a été enregistré. Nous vous répondrons ou vous contacterons bientôt. NewLeadForm=Nouveau formulaire de contact LeadFromPublicForm=Lead en ligne à partir d'un formulaire public +ExportAccountingReportButtonLabel=Obtenir un rapport diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index 4c44d0691c3..93bfd82a24e 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -47,7 +47,7 @@ SendPropalByMail=Envoyer proposition commerciale par email DatePropal=Date de proposition DateEndPropal=Date de fin de validité ValidityDuration=Durée de validité -SetAcceptedRefused=Accepter/Refuser +SetAcceptedRefused=Accepter/Refuser ErrorPropalNotFound=Propale %s inexistante AddToDraftProposals=Ajouter à proposition brouillon NoDraftProposals=Pas de propositions brouillons diff --git a/htdocs/langs/fr_FR/receiptprinter.lang b/htdocs/langs/fr_FR/receiptprinter.lang index 6c313e08dd8..6964eb61308 100644 --- a/htdocs/langs/fr_FR/receiptprinter.lang +++ b/htdocs/langs/fr_FR/receiptprinter.lang @@ -7,7 +7,7 @@ TestSentToPrinter=Test envoyé à l'imprimante %s ReceiptPrinter=Imprimantes Tickets ReceiptPrinterDesc=Réglage des imprimantes de tickets ReceiptPrinterTemplateDesc=Réglage des modèles -ReceiptPrinterTypeDesc=Description des types d'imprimantes de tickets +ReceiptPrinterTypeDesc=Exemple de valeurs possibles pour le champ "Paramètres" selon le type de driver ReceiptPrinterProfileDesc=Description des imprimantes de tickets ListPrinters=Liste des imprimantes SetupReceiptTemplate=Réglage des modèles @@ -54,7 +54,9 @@ DOL_DOUBLE_WIDTH=Double la taille en largeur DOL_DEFAULT_HEIGHT_WIDTH=Hauteur et largeur par défaut  DOL_UNDERLINE=Activer le souligné DOL_UNDERLINE_DISABLED=Désactiver le souligné -DOL_BEEP=Bruit de fond +DOL_BEEP=Notification sonore +DOL_BEEP_ALTERNATIVE=Bip sonore (mode alternatif) +DOL_PRINT_CURR_DATE=Imprimer la date/l'heure actuelle DOL_PRINT_TEXT=Imprimer le texte DateInvoiceWithTime=Date et heure de facturation YearInvoice=Année de facturation diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 30ac8e985bc..5411fc7142f 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -48,7 +48,6 @@ ReceptionsNumberingModules=Module de numérotation pour les réceptions ReceptionsReceiptModel=Modèles de document pour les réceptions NoMorePredefinedProductToDispatch=Plus de produits prédéfinis à expédier ReceptionExist=Une réception existe -ByingPrice=Prix d'achat ReceptionBackToDraftInDolibarr=Réception %s retourné en brouillon ReceptionClassifyClosedInDolibarr=Reception %s classée Fermée ReceptionUnClassifyCloseddInDolibarr=Réception %s ré-ouverte diff --git a/htdocs/langs/fr_FR/recruitment.lang b/htdocs/langs/fr_FR/recruitment.lang index f2d8df78aa3..1525b06d5b3 100644 --- a/htdocs/langs/fr_FR/recruitment.lang +++ b/htdocs/langs/fr_FR/recruitment.lang @@ -57,8 +57,9 @@ EmailRecruiter=Email recruteur ToUseAGenericEmail=Pour utiliser un e-mail générique. S'il n'est pas défini, l'email du responsable du recrutement sera utilisé NewCandidature=Nouvelle candidature ListOfCandidatures=Liste des candidatures -RequestedRemuneration=Rémunération demandée -ProposedRemuneration=Rémunération proposée +Remuneration=Salaire +RequestedRemuneration=Salaire demandé +ProposedRemuneration=Salaire proposé ContractProposed=Contrat proposé ContractSigned=Contrat signé ContractRefused=Contrat refusé @@ -74,3 +75,5 @@ JobClosedTextCanceled=Le poste n'est plus ouvert. ExtrafieldsJobPosition=Attributs complémentaires (postes) ExtrafieldsApplication=Attributs complémentaires (candidature) MakeOffer=Faire un offre +WeAreRecruiting=Nous recrutons. Voici une liste de postes à pourvoir... +NoPositionOpen=Aucun poste ouvert pour le moment diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 2b3559787d3..a0d91884279 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -24,6 +24,7 @@ StockAtDateInFuture=Date dans le futur StocksByLotSerial=Stocks par lot/série LotSerial=Lots/séries LotSerialList=Liste des numéros de lots/séries +SubjectToLotSerialOnly=Produits soumis au lot/série uniquement Movements=Mouvements ErrorWarehouseRefRequired=Le nom de référence de l'entrepôt est obligatoire ListOfWarehouses=Liste des entrepôts @@ -234,7 +235,7 @@ StockIncrease=Augmentation du stock StockDecrease=Diminution du stock InventoryForASpecificWarehouse=Inventaire pour un entrepôt spécifique InventoryForASpecificProduct=Inventaire pour un produit spécifique -StockIsRequiredToChooseWhichLotToUse=Un stock existant est requis pour pouvoir choisir un lot +StockIsRequiredToChooseWhichLotToUse=Un stock existant est nécessaire pour pouvoir choisir le lot à utiliser ForceTo=Forcer à AlwaysShowFullArbo=Afficher l'arborescence complète de l'entrepôt sur la popup du lien entrepôt (Avertissement: cela peut réduire considérablement les performances) StockAtDatePastDesc=Vous pouvez voir ici le stock (stock réel) à une date donnée dans le passé diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 0998191b0a2..f73df3434c9 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -4,6 +4,7 @@ SuppliersInvoice=Facture fournisseur SupplierInvoices=Factures fournisseur ShowSupplierInvoice=Montrer la facture fournisseur NewSupplier=Nouveau fournisseur +NewSupplierInvoice = Nouvelle facture du vendeur History=Historique ListOfSuppliers=Liste des fournisseurs ShowSupplier=Afficher fournisseur diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 3f5be72e1d9..be78d74f2a8 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -149,6 +149,8 @@ TicketsAutoNotifyCloseHelp=Lors de la clôture d'un ticket, il vous sera propos TicketWrongContact=Le contact fourni ne fait pas partie des contacts actuels du ticket. E-mail non envoyé. TicketChooseProductCategory=Catégorie de produit pour les tickets TicketChooseProductCategoryHelp=Sélectionnez la catégorie de produit du support de ticket. Celui-ci sera utilisé pour lier automatiquement un contrat à un ticket. +TicketUseCaptchaCode=Utiliser le code graphique (CAPTCHA) lors de la création d'un ticket +TicketUseCaptchaCodeHelp=Ajoute la vérification CAPTCHA lors de la création d'un nouveau ticket. # # Index & list page @@ -204,8 +206,8 @@ TicketSeverity=Sévérité ShowTicket=Voir le ticket RelatedTickets=Tickets liés TicketAddIntervention=Créer intervention -CloseTicket=Fermer|Résoudre ticket -AbandonTicket=Abandonner le ticket +CloseTicket=Fermer|Résoudre +AbandonTicket=Abandonner CloseATicket=Fermer|Résoudre un ticket ConfirmCloseAticket=Confirmer la fermeture du ticket ConfirmAbandonTicket=Confirmez-vous la fermeture du ticket au statut 'Abandonné' @@ -219,18 +221,17 @@ SendMessageByEmail=Envoyer ce message par email TicketNewMessage=Nouveau message ErrorMailRecipientIsEmptyForSendTicketMessage=Le destinataire est vide. Aucun e-mail envoyé TicketGoIntoContactTab=Rendez-vous dans le tableau "Contacts" pour les sélectionner -TicketMessageMailIntro=Introduction +TicketMessageMailIntro=Entête de message TicketMessageMailIntroHelp=Ce texte est ajouté seulement au début de l'email et ne sera pas sauvegardé. -TicketMessageMailIntroLabelAdmin=Texte d'introduction à toutes les réponses aux tickets TicketMessageMailIntroText=Bonjour,
Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici le message :
TicketMessageMailIntroHelpAdmin=Ce texte sera inséré avant la réponse lors d'une réponse à un ticket depuis Dolibarr -TicketMessageMailSignature=Signature -TicketMessageMailSignatureHelp=Ce texte est ajouté seulement à la fin de l'email et ne sera pas sauvegardé. -TicketMessageMailSignatureText=Message envoyé par %s via Dolibarr -TicketMessageMailSignatureLabelAdmin=Signature de l'email de réponse -TicketMessageMailSignatureHelpAdmin=Ce texte sera inséré après le message de réponse. +TicketMessageMailFooter=Pied de page des messages +TicketMessageMailFooterHelp=Ce texte est ajouté uniquement à la fin du message envoyé par e-mail et ne sera pas enregistré. +TicketMessageMailFooterText=Message envoyé par %s via Dolibarr +TicketMessageMailFooterHelpAdmin=Ce texte sera inséré après le message de réponse. TicketMessageHelp=Seul ce texte sera sauvegardé dans la liste des messages sur la fiche ticket. TicketMessageSubstitutionReplacedByGenericValues=Les variables de substitution sont remplacées par des valeurs génériques. +ForEmailMessageWillBeCompletedWith=Pour les e-mails envoyés à des utilisateurs externes, le message sera complété par TimeElapsedSince=Temps écoulé depuis TicketTimeToRead=Temps écoulé avant la lecture TicketTimeElapsedBeforeSince=Temps écoulé avant / depuis @@ -296,7 +297,7 @@ TicketNewEmailBodyInfosTrackUrlCustomer=Vous pouvez voir la progression du ticke TicketCloseEmailBodyInfosTrackUrlCustomer=Vous pouvez consulter l'historique de ce ticket en cliquant sur le lien suivant TicketEmailPleaseDoNotReplyToThisEmail=Merci de ne pas répondre directement à ce courriel ! Utilisez le lien pour répondre via l'interface. TicketPublicInfoCreateTicket=Ce formulaire vous permet d'enregistrer un ticket dans notre système de gestion. -TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire avec précision le problème. Fournissez le plus d'informations possibles pour nous permettre d'identifier correctement votre demande. +TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire précisément votre question. Fournissez le plus d'informations possible pour nous permettre d'identifier correctement votre demande. TicketPublicMsgViewLogIn=Merci d'entrer le code de suivi du ticket TicketTrackId=ID de suivi publique OneOfTicketTrackId=Un de vos ID de suivi diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang index 5888332a820..4840c05740a 100644 --- a/htdocs/langs/fr_FR/users.lang +++ b/htdocs/langs/fr_FR/users.lang @@ -68,7 +68,6 @@ CreateDolibarrLogin=Créer un compte utilisateur CreateDolibarrThirdParty=Créer un tiers LoginAccountDisableInDolibarr=Le compte est désactivé sur Dolibarr. UsePersonalValue=Utiliser valeur personnalisée -InternalUser=Utilisateur interne ExportDataset_user_1=Utilisateurs et attributs DomainUser=Utilisateur du domaine %s Reactivate=Réactiver diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 53e07d0dd2e..c46c3b33e37 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -1,5 +1,6 @@ # Dolibarr language file - Source file is en_US - website Shortname=Code +WebsiteName=Nom du site web WebsiteSetupDesc=Créez ici les sites Web que vous souhaitez utiliser. Ensuite, allez dans le menu Sites Web pour les éditer. DeleteWebsite=Effacer site web ConfirmDeleteWebsite=Êtes-vous sûr de vouloir supprimer ce site web. Toutes les pages et le contenu seront également supprimés. Les fichiers téléversés (comme ceux dans le répertoire medias, dans le module GED, ...) seront conservés. @@ -15,9 +16,9 @@ WEBSITE_HTML_HEADER=Ajout en bas de l'en-tête HTML (commun à toutes les pages) WEBSITE_ROBOT=Fichier robot (robots.txt) WEBSITE_HTACCESS=Fichier .htaccess du site web WEBSITE_MANIFEST_JSON=Fichier manifest.json de site Web -WEBSITE_README=Fichier README.md WEBSITE_KEYWORDSDesc=Utiliser une virgule pour séparer les valeurs -EnterHereLicenseInformation=Entrez ici les métadonnées ou les informations de licence pour créer un fichier README.md. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package. +EnterHereReadmeInformation=Entrez ici une description du site Web. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package de modèles. +EnterHereLicenseInformation=Entrez ici la LICENCE du code du site Web. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package de modèles. HtmlHeaderPage=En-tête HTML (spécifique pour la page uniquement) PageNameAliasHelp=Nom ou alias de la page.
Cet alias est également utilisé pour forger une URL SEO lorsque le site Web est exécuté à partir d'un hôte virtuel d'un serveur Web (comme Apache, Nginx, ...). Utilisez le bouton "%s" pour modifier cet alias. EditTheWebSiteForACommonHeader=Remarque: Si vous souhaitez définir un en-tête personnalisé pour toutes les pages, modifiez l'en-tête au niveau du site plutôt qu'au niveau page/container. @@ -42,6 +43,8 @@ ViewPageInNewTab=Pré-visualiser la page dans un nouvel onglet SetAsHomePage=Définir comme page d'accueil RealURL=URL réelle ViewWebsiteInProduction=Pré-visualiser le site web en utilisant l'URL de la page d'accueil +Virtualhost=Hôte virtuel ou nom de domaine +VirtualhostDesc=Le nom de l'hôte virtuel ou du domaine (par exemple : www.mywebsite.com, mybigcompany.net, ...) SetHereVirtualHost= Utilisation avec Apache/NGinx/...
Créez sur votre serveur Web (Apache, Nginx, ...) un hôte virtuel dédié avec PHP activé et un répertoire racine sur
%s ExampleToUseInApacheVirtualHostConfig=Exemple à utiliser dans la configuration de l'hôte virtuel Apache: YouCanAlsoTestWithPHPS= Utilisation avec un serveur PHP incorporé
Sous environnement de développement, vous pouvez préférer tester le site avec le serveur Web PHP intégré (PHP 5.5 requis) en exécutant
php -S 0.0.0.0:8080 -t %s @@ -145,3 +148,6 @@ ImportFavicon=Favicon ErrorFaviconType=Le Favicon doit être en png ErrorFaviconSize=Le Favicon doit être de taille 16x16, 32x32 ou 64x64 FaviconTooltip=Téléverser une image qui doit être au format png (16x16, 32x32 ou 64x64) +NextContainer=Page/conteneur suivant(e) +PreviousContainer=Page/conteneur précédent(e) +WebsiteMustBeDisabled=Le site Web doit avoir le statut "désactivé" diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index f91ffbd55f3..8b6e6aa317e 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -42,6 +42,7 @@ CreditTransferStatistics=Statistiques sur les virements Rejects=Rejets LastWithdrawalReceipt=Les %s derniers bons de prélèvements MakeWithdrawRequest=Faire une demande de prélèvement +MakeWithdrawRequestStripe=Faire une demande de paiement par prélèvement automatique via Stripe MakeBankTransferOrder=Faire une demande de virement WithdrawRequestsDone=%s demandes de prélèvements enregistrées BankTransferRequestsDone=%s demandes de prélèvements enregistrées @@ -100,8 +101,11 @@ CreditDate=Crédité le WithdrawalFileNotCapable=Impossible de générer le fichier de reçu des prélèvement pour votre pays %s (Votre pays n'est pas supporté) ShowWithdraw=Afficher ordre de prélèvement IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins une demande de prélèvement non traité, elle ne sera pas classée payée afin de permettre le prélèvement d'abord. -DoStandingOrdersBeforePayments=Cet onglet vous permet de demander un prélèvement. Une fois la demande faite, allez dans le menu Banque->Paiement par prélèvement pour générer l'ordre de prélèvement. Lorsque l'ordre de paiement est clos, le paiement sur les factures seront automatiquement enregistrés, et les factures fermées si le reste à payer est nul. -DoCreditTransferBeforePayments=Cet onglet vous permet de demander un ordre de virement. Une fois fait, allez dans le menu Banque ->Paiements par virement pour gérer l'ordre de virement. Lorsque le virement est clôturé, le paiement des factures fournisseurs sera automatiquement enregistré et les factures clôturées si le solde à payer est nul. +DoStandingOrdersBeforePayments=Cet onglet vous permet de demander un ordre de prélèvement automatique. Une fois cela fait, vous pouvez vous rendre dans le menu "Banque->Paiement par prélèvement" pour générer et gérer un fichier d'ordre de prélèvement. +DoStandingOrdersBeforePayments2=Vous pouvez également envoyer une demande directement à un processeur de paiement SEPA comme Stripe, ... +DoStandingOrdersBeforePayments3=Lors de la clôture d'un ordre de prélèvement, le règlement des factures sera automatiquement enregistré, et les factures clôturées si le reste à payer est nul. +DoCreditTransferBeforePayments=Cet onglet vous permet de demander un ordre de virement. Une fois cela fait, allez dans le menu "Banque->Paiement par virement" pour générer et gérer un fichier d'ordre de virement. +DoCreditTransferBeforePayments3=A la clôture de l'ordre de virement, le règlement des factures sera automatiquement enregistré, et les factures clôturées si le reste à payer est nul. WithdrawalFile=Fichier de prélèvement CreditTransferFile=Fichier de virement SetToStatusSent=Mettre au statut "Fichier envoyé" @@ -118,7 +122,7 @@ WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement SepaMandate=Mandat prélèvement SEPA SepaMandateShort=Mandat SEPA PleaseReturnMandate=Merci de retourner ce formulaire mandat par email à %s ou par courrier à -SEPALegalText=En signant ce formulaire de mandat, vous autorisez (A) %s à envoyer des instructions à votre banque pour débiter votre compte et (B) votre banque à débiter votre compte conformément aux instructions de %s. Dans le cadre de vos droits, vous avez droit à un remboursement de votre banque selon les termes et conditions de votre accord avec votre banque. Vos droits concernant le mandat ci-dessus sont expliqués dans une déclaration que vous pouvez obtenir auprès de votre banque. +SEPALegalText=En signant ce formulaire de mandat, vous autorisez (A) %s et son prestataire de services de paiement à envoyer des instructions à votre banque pour débiter votre compte et (B) votre banque à débiter votre compte conformément aux instructions de %s. Dans le cadre de vos droits, vous avez droit à un remboursement de votre banque selon les termes et conditions de votre accord avec votre banque. Vos droits concernant le mandat ci-dessus sont expliqués dans une déclaration que vous pouvez obtenir auprès de votre banque. CreditorIdentifier=Identifiant créditeur CreditorName=Nom du créditeur SEPAFillForm=(B) Remplir tous les champs marqués * @@ -137,7 +141,7 @@ SEPAFRST=SEPA FRST ExecutionDate=Date d'éxecution CreateForSepa=Créer fichier de prélèvement automatique ICS=Identifiant du créancier - ICS -IDS=Debitor Identifier +IDS=Identifiant débiteur END_TO_END=Balise XML SEPA "EndToEndId" - Identifiant unique attribué par transaction USTRD=Balise XML SEPA "Non structurée" ADDDAYS=Ajouter des jours à la date d'exécution @@ -156,4 +160,4 @@ ErrorICSmissing=ICS manquant pour le compte bancaire %s TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Le montant total de l'ordre de prélèvement diffère de la somme des lignes WarningSomeDirectDebitOrdersAlreadyExists=Attention : Il y a déjà des ordres de prélèvement automatique en attente (%s) demandés pour un montant de %s WarningSomeCreditTransferAlreadyExists=Attention : Il y a déjà des virements en attente (%s) demandés pour un montant de %s -UsedFor=Used for %s +UsedFor=Utilisé pour %s diff --git a/htdocs/langs/it_CH/accountancy.lang b/htdocs/langs/it_CH/accountancy.lang deleted file mode 100644 index 44c4229cd8b..00000000000 --- a/htdocs/langs/it_CH/accountancy.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - accountancy -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index 29adcec7d4d..96a2c46c4ed 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -192,7 +192,6 @@ LibraryToBuildPDF=Bibliotheek om PDF bestanden te genereren. RefreshPhoneLink=Herladen link SetAsDefault=Instellen als standaard BarcodeInitForProductsOrServices=Mass barcode init of reset voor producten of diensten -InitEmptyBarCode=Init value for the %s empty barcodes NoDetails=Geen aanvullende details in voettekst DisplayCompanyInfo=Bedrijfsadres weergeven DisplayCompanyManagers=Namen van beheerders weergeven diff --git a/htdocs/langs/nl_BE/commercial.lang b/htdocs/langs/nl_BE/commercial.lang index d949aad6bac..fae3f5e6ae7 100644 --- a/htdocs/langs/nl_BE/commercial.lang +++ b/htdocs/langs/nl_BE/commercial.lang @@ -11,8 +11,5 @@ ActionAC_COM=Verzend verkooporder per mail ActionAC_SUP_ORD=Verzend bestelling per mail ActionAC_SUP_INV=Stuur leveranciersfactuur per mail ToOfferALinkForOnlineSignature=Link voor online handtekening -WelcomeOnOnlineSignaturePage=Welkom op deze pagina om commerciële voorstellen van %s te accepteren -ThisScreenAllowsYouToSignDocFrom=Met dit scherm kunt u een offerte / commercieel voorstel accepteren en ondertekenen of weigeren -ThisIsInformationOnDocumentToSign=In dit document is informatie om te accepteren of te weigeren SignatureProposalRef=Handtekening van offerte / commercieel voorstel %s FeatureOnlineSignDisabled=Functie voor online ondertekenen uitgeschakeld of het document is gegenereerd voordat de functie was ingeschakeld diff --git a/htdocs/langs/nl_BE/ticket.lang b/htdocs/langs/nl_BE/ticket.lang index 37e0550685c..30a0241a7d4 100644 --- a/htdocs/langs/nl_BE/ticket.lang +++ b/htdocs/langs/nl_BE/ticket.lang @@ -67,7 +67,6 @@ SendMessageByEmail=Stuur bericht per e-mail ErrorMailRecipientIsEmptyForSendTicketMessage=Ontvanger is leeg. Geen e-mail verzonden TicketMessageMailIntro=Inleiding TicketMessageMailIntroHelp=Deze tekst wordt alleen aan het begin van de e-mail toegevoegd en wordt niet opgeslagen. -TicketMessageMailSignatureLabelAdmin=Handtekening van reactie-e-mail TicketMessageHelp=Alleen deze tekst wordt opgeslagen in de berichtenlijst van het ticket. TicketMessageSubstitutionReplacedByGenericValues=Vervangingenvariabelen worden vervangen door generieke waarden. TimeElapsedSince=tijd verstreken sinds diff --git a/htdocs/langs/pt_AO/projects.lang b/htdocs/langs/pt_AO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/pt_AO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index d2ab3e033a9..80684c463d4 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -47,8 +47,6 @@ ClientSortingCharset=Conferência de Clientes WarningModuleNotActive=Módulo %s deve ser Ativado! WarningOnlyPermissionOfActivatedModules=Somente as permissões relacionadas com os módulos ativados que aparecem aqui. DolibarrSetup=Instalação/Atualização do Dolibarr -InternalUser=Usuário Interno -ExternalUser=Usuário Externo InternalUsers=Usuários Internos ExternalUsers=Usuários Externos UploadNewTemplate=Carregar novo(s) tema(s) @@ -652,7 +650,6 @@ Permission283=Deletar Contatos Permission286=Exportar Contatos Permission291=Ler Tarifas Permission292=Definir Permissões das Tarifas -Permission300=Ler códigos de barras Permission301=Criar/modificar códigos de barras Permission311=Ler Serviços Permission312=Atribuir Serviço no Contrato diff --git a/htdocs/langs/pt_BR/commercial.lang b/htdocs/langs/pt_BR/commercial.lang index a70dde7954c..d7296bed8f8 100644 --- a/htdocs/langs/pt_BR/commercial.lang +++ b/htdocs/langs/pt_BR/commercial.lang @@ -54,7 +54,5 @@ Stats=Estatísticas de vendas StatusProsp=Status de prospecto de cliente DraftPropals=Minutas de orçamentos ToOfferALinkForOnlineSignature=Link para assinatura on-line -WelcomeOnOnlineSignaturePage=Bem-vindo à página para aceitar propostas comerciais de %s -ThisScreenAllowsYouToSignDocFrom=Esta tela permite que você aceite e assine ou recuse um orçamento / proposta comercial SignatureProposalRef=Assinatura da cotação / proposta comercial %s FeatureOnlineSignDisabled=Recurso para assinatura online desabilitado ou documento gerado antes que o recurso fosse ativado diff --git a/htdocs/langs/pt_BR/errors.lang b/htdocs/langs/pt_BR/errors.lang index 03f3d75a362..517027dde8c 100644 --- a/htdocs/langs/pt_BR/errors.lang +++ b/htdocs/langs/pt_BR/errors.lang @@ -64,7 +64,6 @@ ErrorFieldValueNotIn=Campo %s : '%s' não é um valor encontrado n ErrorFieldRefNotIn=Campo %s : '%s' não é uma referência existente %s ErrorsOnXLines=%s erros encontrados ErrorFileIsInfectedWithAVirus=O antivírus não foi capaz de atestar o arquivo (o arquivo pode estar infectado por um vírus) -ErrorSpecialCharNotAllowedForField=O campo "%s" não aceita caracteres especiais ErrorNumRefModel=Uma referência existe no banco de dados (% s) e não é compatível com esta regra de numeração. Remover registro ou referência renomeado para ativar este módulo. ErrorQtyTooLowForThisSupplier=Quantidade muito baixa para este fornecedor ou nenhum preço definido neste produto para este fornecedor ErrorOrdersNotCreatedQtyTooLow=Algumas encomendas não foram criadas por causa de quantidades muito baixas diff --git a/htdocs/langs/pt_BR/mailmanspip.lang b/htdocs/langs/pt_BR/mailmanspip.lang index bbea232c4ef..9e0a707c3eb 100644 --- a/htdocs/langs/pt_BR/mailmanspip.lang +++ b/htdocs/langs/pt_BR/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=O teste da assinatura foi realizado com sucesso MailmanDeletionSuccess=O teste de cancelamento da assinatura foi realizado com sucesso SynchroMailManEnabled=O Mailman sera atualizado SynchroSpipEnabled=O SPIP sera atualizado -DescADHERENT_MAILMAN_ADMINPW=Senha do administrador Mailman DescADHERENT_MAILMAN_URL=URL para inscriçoes Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para desenscriçoes Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para inscriçao automatica de novos membros (separado por virgula) diff --git a/htdocs/langs/pt_BR/ticket.lang b/htdocs/langs/pt_BR/ticket.lang index 2a751f5516a..df070b1eced 100644 --- a/htdocs/langs/pt_BR/ticket.lang +++ b/htdocs/langs/pt_BR/ticket.lang @@ -97,8 +97,6 @@ TicketUpdated=Bilhete atualizado SendMessageByEmail=Enviar mensagem por e-mail ErrorMailRecipientIsEmptyForSendTicketMessage=O destinatário está vazio. Nenhum e-mail enviado TicketMessageMailIntroHelp=Este texto é adicionado apenas no início do e-mail e não será salvo. -TicketMessageMailSignatureHelp=Este texto é adicionado somente no final do e-mail e não será salvo. -TicketMessageMailSignatureLabelAdmin=Assinatura do e-mail de resposta TicketTimeElapsedBeforeSince=Tempo decorrido antes / desde TicketContacts=Bilhete de contatos TicketDocumentsLinked=Documentos vinculados ao ticket diff --git a/htdocs/langs/pt_BR/website.lang b/htdocs/langs/pt_BR/website.lang index a5781ea5a75..e2afc369eb2 100644 --- a/htdocs/langs/pt_BR/website.lang +++ b/htdocs/langs/pt_BR/website.lang @@ -9,7 +9,6 @@ WEBSITE_CSS_URL=URL do arquivo CSS externo. WEBSITE_HTML_HEADER=Adição na parte inferior do cabeçalho HTML (comum a todas as páginas) WEBSITE_ROBOT=Arquivo robô (robots.txt) WEBSITE_MANIFEST_JSON=Arquivo manifest.json do site -WEBSITE_README=Arquivo README.md EnterHereLicenseInformation=Digite aqui metadados ou informações de licença para arquivar num arquivo README.md. Se você distribuir seu site como modelo, o arquivo será incluído no pacote tentado. HtmlHeaderPage=Cabeçalho HTML (específico apenas para esta página) PageNameAliasHelp=Nome ou alias da página.
Esse alias também é usado para forjar uma URL de SEO quando o site é executado a partir de um host virtual de um servidor da Web (como Apacke, Nginx, ...). Use o botão %s para editar este alias. diff --git a/htdocs/langs/pt_MZ/accountancy.lang b/htdocs/langs/pt_MZ/accountancy.lang index 90584e4bd28..b99e895d7c0 100644 --- a/htdocs/langs/pt_MZ/accountancy.lang +++ b/htdocs/langs/pt_MZ/accountancy.lang @@ -27,7 +27,6 @@ ConfirmDeleteCptCategory=Tem certeza de que deseja remover essa conta contábil JournalizationInLedgerStatus=Situação do registro do diário GroupIsEmptyCheckSetup=O grupo está vazio, verifique a configuração do grupo de contabilidade personalizado AccountantFiles=Exportar documentos de origem -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). VueByAccountAccounting=Ver por conta contábil MainAccountForCustomersNotDefined=Conta contábil principal para clientes não definidos na configuração MainAccountForUsersNotDefined=Conta contábil principal para usuários não definidos na configuração @@ -185,7 +184,6 @@ AccountingJournalType9=Novo ErrorAccountingJournalIsAlreadyUse=Esta Livro de Registro já está sendo usado NumberOfAccountancyEntries=Número de entradas NumberOfAccountancyMovements=Número de movimentos -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ExportDraftJournal=Livro de Registro de rascunho de exportação Selectmodelcsv=Escolha um modelo de exportação Modelcsv_CEGID=Exportar para CEGID Expert Comptable diff --git a/htdocs/langs/pt_MZ/admin.lang b/htdocs/langs/pt_MZ/admin.lang index e805a0c6120..f499ad97ebf 100644 --- a/htdocs/langs/pt_MZ/admin.lang +++ b/htdocs/langs/pt_MZ/admin.lang @@ -47,8 +47,6 @@ ClientSortingCharset=Conferência de Clientes WarningModuleNotActive=Módulo %s deve ser Ativado! WarningOnlyPermissionOfActivatedModules=Somente as permissões relacionadas com os módulos ativados que aparecem aqui. DolibarrSetup=Instalação/Atualização do Dolibarr -InternalUser=Usuário Interno -ExternalUser=Usuário Externo InternalUsers=Usuários Internos ExternalUsers=Usuários Externos SetupArea=Conf. @@ -647,7 +645,6 @@ Permission283=Deletar Contatos Permission286=Exportar Contatos Permission291=Ler Tarifas Permission292=Definir Permissões das Tarifas -Permission300=Ler códigos de barras Permission301=Criar/modificar códigos de barras Permission311=Ler Serviços Permission312=Atribuir Serviço no Contrato diff --git a/htdocs/langs/pt_MZ/commercial.lang b/htdocs/langs/pt_MZ/commercial.lang index 493791da89d..4e15f6d6895 100644 --- a/htdocs/langs/pt_MZ/commercial.lang +++ b/htdocs/langs/pt_MZ/commercial.lang @@ -56,7 +56,5 @@ Stats=Estatísticas de vendas StatusProsp=Status de prospecto de cliente DraftPropals=Minutas de orçamentos ToOfferALinkForOnlineSignature=Link para assinatura on-line -WelcomeOnOnlineSignaturePage=Bem-vindo à página para aceitar propostas comerciais de %s -ThisScreenAllowsYouToSignDocFrom=Esta tela permite que você aceite e assine ou recuse um orçamento / proposta comercial SignatureProposalRef=Assinatura da cotação / proposta comercial %s FeatureOnlineSignDisabled=Recurso para assinatura online desabilitado ou documento gerado antes que o recurso fosse ativado diff --git a/htdocs/langs/pt_MZ/errors.lang b/htdocs/langs/pt_MZ/errors.lang index 03f3d75a362..517027dde8c 100644 --- a/htdocs/langs/pt_MZ/errors.lang +++ b/htdocs/langs/pt_MZ/errors.lang @@ -64,7 +64,6 @@ ErrorFieldValueNotIn=Campo %s : '%s' não é um valor encontrado n ErrorFieldRefNotIn=Campo %s : '%s' não é uma referência existente %s ErrorsOnXLines=%s erros encontrados ErrorFileIsInfectedWithAVirus=O antivírus não foi capaz de atestar o arquivo (o arquivo pode estar infectado por um vírus) -ErrorSpecialCharNotAllowedForField=O campo "%s" não aceita caracteres especiais ErrorNumRefModel=Uma referência existe no banco de dados (% s) e não é compatível com esta regra de numeração. Remover registro ou referência renomeado para ativar este módulo. ErrorQtyTooLowForThisSupplier=Quantidade muito baixa para este fornecedor ou nenhum preço definido neste produto para este fornecedor ErrorOrdersNotCreatedQtyTooLow=Algumas encomendas não foram criadas por causa de quantidades muito baixas diff --git a/htdocs/langs/pt_MZ/mailmanspip.lang b/htdocs/langs/pt_MZ/mailmanspip.lang index bbea232c4ef..9e0a707c3eb 100644 --- a/htdocs/langs/pt_MZ/mailmanspip.lang +++ b/htdocs/langs/pt_MZ/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=O teste da assinatura foi realizado com sucesso MailmanDeletionSuccess=O teste de cancelamento da assinatura foi realizado com sucesso SynchroMailManEnabled=O Mailman sera atualizado SynchroSpipEnabled=O SPIP sera atualizado -DescADHERENT_MAILMAN_ADMINPW=Senha do administrador Mailman DescADHERENT_MAILMAN_URL=URL para inscriçoes Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para desenscriçoes Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para inscriçao automatica de novos membros (separado por virgula) diff --git a/htdocs/langs/pt_MZ/projects.lang b/htdocs/langs/pt_MZ/projects.lang index 8d0c1cedae8..065ddf804d6 100644 --- a/htdocs/langs/pt_MZ/projects.lang +++ b/htdocs/langs/pt_MZ/projects.lang @@ -6,6 +6,5 @@ LinkToElementShort=Link para ProjectReferers=Itens correlatos OppStatusPROPO=Proposta OppStatusPENDING=Pedente -ServiceToUseOnLines=Service to use on lines by default NewInter=Nova Intervenção StartDateCannotBeAfterEndDate=A data final não pode ser anterior a data de início diff --git a/htdocs/langs/pt_MZ/website.lang b/htdocs/langs/pt_MZ/website.lang index a5781ea5a75..e2afc369eb2 100644 --- a/htdocs/langs/pt_MZ/website.lang +++ b/htdocs/langs/pt_MZ/website.lang @@ -9,7 +9,6 @@ WEBSITE_CSS_URL=URL do arquivo CSS externo. WEBSITE_HTML_HEADER=Adição na parte inferior do cabeçalho HTML (comum a todas as páginas) WEBSITE_ROBOT=Arquivo robô (robots.txt) WEBSITE_MANIFEST_JSON=Arquivo manifest.json do site -WEBSITE_README=Arquivo README.md EnterHereLicenseInformation=Digite aqui metadados ou informações de licença para arquivar num arquivo README.md. Se você distribuir seu site como modelo, o arquivo será incluído no pacote tentado. HtmlHeaderPage=Cabeçalho HTML (específico apenas para esta página) PageNameAliasHelp=Nome ou alias da página.
Esse alias também é usado para forjar uma URL de SEO quando o site é executado a partir de um host virtual de um servidor da Web (como Apacke, Nginx, ...). Use o botão %s para editar este alias. From 168ea58a077163e2df1c9abb1f550b11287f8d81 Mon Sep 17 00:00:00 2001 From: Faustin Date: Wed, 12 Oct 2022 18:59:05 +0200 Subject: [PATCH 0898/1289] NEW #22546 : can now set user supervisors using mass action in htdocs/user --- htdocs/core/actions_massactions.inc.php | 39 +++++++++++++++++++++++++ htdocs/core/tpl/massactions_pre.tpl.php | 18 ++++++++++++ htdocs/langs/en_US/main.lang | 4 +++ htdocs/langs/fr_FR/main.lang | 4 +++ htdocs/user/list.php | 5 +++- 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9a2eda2df8e..49cc6fa873c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1240,6 +1240,45 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } } +if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) { + $db->begin(); + $supervisortoset=GETPOST('supervisortoset'); + if (!empty($supervisortoset)) { + foreach ($toselect as $toselectid) { + $result = $object->fetch($toselectid); + //var_dump($contcats);exit; + if ($result > 0) { + $object->fk_user = $supervisortoset; + $res = $object->update($user); + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } + } + } else { + setEventMessage('UserNotFound', 'errors'); + $error++; + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } else { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } + $db->commit(); + $toselect=array(); + } else { + $db->rollback(); + } +} + if (!$error && ($massaction == 'enable' || ($action == 'enable' && $confirm == 'yes')) && $permissiontoadd) { $db->begin(); diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 8a8222101ee..f09d7defeb1 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -78,6 +78,24 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } } +if ($massaction == 'presetsupervisor') { + $formquestion = array(); + + $valuefield = '
'; + $valuefield .= img_picto('', 'user').' '; + $valuefield .= $form->select_dolusers('', 'supervisortoset', 1, $arrayofselected, 0, '', 0, $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); + $valuefield .= '
'; + + $formquestion[] = array( + 'type' => 'other', + 'name' => 'supervisortoset', + 'label' => $langs->trans("Supervisor"), + 'value' => $valuefield + ); + + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1); +} + if ($massaction == 'presend') { $langs->load("mails"); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 2b021f406f3..325e27b6606 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1146,10 +1146,14 @@ UpdateForAllLines=Update for all lines OnHold=On hold Civility=Civility AffectTag=Affect Tag +SetSupervisor=Set Supervisor CreateExternalUser=Create external user ConfirmAffectTag=Bulk Tag Affect +ConfirmSetSupervisor=Bulk Supervisor Set ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? +ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)? CategTypeNotFound=No tag type found for type of records +SupervisorNotFound=Supervisor not found CopiedToClipboard=Copied to clipboard InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. ConfirmCancel=Are you sure you want to cancel diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 3770780df7e..1406a0ddbaa 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -1146,10 +1146,14 @@ UpdateForAllLines=Mise à jour de toutes les lignes OnHold=En attente Civility=Civilité AffectTag=Affecter un tag/catégorie +SetSupervisor=Choisir un superviseur CreateExternalUser=Créer utilisateur externe ConfirmAffectTag=Affecter les tags en masse +ConfirmSetSupervisor=Choisir un superviseur en masse ConfirmAffectTagQuestion=Êtes-vous sur de vouloir affecter ces catégories aux %s lignes sélectionnées ? +ConfirmSetSupervisorQuestion=Êtes-vous sur de vouloir affecter ce superviseur aux %s lignes sélectionnées ? CategTypeNotFound=Aucun type de tag trouvé pour ce type d'enregistrements +SupervisorNotFound=Supervisuer non trouvé CopiedToClipboard=Copié dans le presse-papier InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération. ConfirmCancel=Êtes-vous sûr de vouloir annuler diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 72b00c75577..05d2f88c035 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -604,9 +604,12 @@ if ($permissiontoadd) { if (isModEnabled('category') && $permissiontoadd) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } +if ($permissiontoadd) { + $arrayofmassactions['presetsupervisor'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("SetSupervisor"); +} //if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'presetsupervisor'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From f718de344b730e5d0d98be2f5b815f3716d1a2df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 19:40:21 +0200 Subject: [PATCH 0899/1289] Fix typo --- htdocs/core/class/html.form.class.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_card.php | 2 +- htdocs/langs/en_US/modulebuilder.lang | 10 +++++++--- htdocs/modulebuilder/index.php | 13 ++++++++----- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e1859d61653..6ae2e0d1a29 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -673,7 +673,7 @@ class Form if ($direction < 0) { $s .= '<'.$tag.$paramfortooltipimg; if ($tag == 'td') { - $s .= ' class=valigntop" width="14"'; + $s .= ' class="valigntop" width="14"'; } $s .= '>'.$textfordialog.$img.''; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 18f36c192c2..ce3fceeff1c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -118,7 +118,7 @@ if (empty($reshook)) { $triggermodname = 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_MODIFY'; // Name of trigger action code to execute when we modify record - // Upadate / add for lang + // Update / add for lang if (($action == 'update' || $action == 'add') && !empty($permissiontoadd)) { $object->lang = (GETPOSTISSET('langkm') ? GETPOST('langkm', 'aZ09') : $object->lang); } diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 0e11bef2bf1..13bcfdd76de 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -56,6 +56,8 @@ RegenerateMissingFiles=Generate missing files SpecificationFile=File of documentation LanguageFile=File for language ObjectProperties=Object Properties +Property=Propery +PropertyDesc=A property is an attribute that characterizes an object. This attribute has a code, a label and a type with several options. ConfirmDeleteProperty=Are you sure you want to delete the property %s? This will change code in PHP class but also remove column from table definition of object. NotNull=Not NULL NotNullDesc=1=Set database to NOT NULL, 0=Allow null values, -1=Allow null values by forcing value to NULL if empty ('' or 0) @@ -90,7 +92,8 @@ ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active.

Examples:
1
isModEnabled('MAIN_MODULE_MYMODULE')
getDolGlobalString('MYMODULE_OPTION')==2 -VisibleDesc=Is the field visible ? (Examples: 0=Never 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 end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
$user->hasRight('holiday', 'define_holiday')?1:5 +VisibleDesc=Is the field visible ? (Examples: 0=Never 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 end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing). +ItCanBeAnExpression=It can be an expression. Example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
$user->hasRight('holiday', 'define_holiday')?1:5 DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty DisplayOnPdf=On PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) @@ -144,13 +147,14 @@ CSSViewClass=CSS for read form CSSListClass=CSS for list NotEditable=Not editable ForeignKey=Foreign key -TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
'1' means we add a + button after the combo to create the record
'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' +TypeOfFieldsHelp=Example:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
'1' means we add a + button after the combo to create the record
'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' +TypeOfFieldsHelpIntro=This is the type of the field/attribute. AsciiToHtmlConverter=Ascii to HTML converter AsciiToPdfConverter=Ascii to PDF converter TableNotEmptyDropCanceled=Table not empty. Drop has been canceled. ModuleBuilderNotAllowed=The module builder is available but not allowed to your user. ImportExportProfiles=Import and export profiles -ValidateModBuilderDesc=Set this to 1 if you want to have the method $this->validateField() of object being called to validate the content of the field during insert or upadate. Set 0 if there is no validation required. +ValidateModBuilderDesc=Set this to 1 if you want to have the method $this->validateField() of object being called to validate the content of the field during insert or update. Set 0 if there is no validation required. WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated LinkToParentMenu=Parent menu (fk_xxxxmenu) ListOfTabsEntries=List of tab entries diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2af45204da6..a3d3e9d38fd 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2974,21 +2974,24 @@ if ($module == 'initmodule') { print '
'; print ''; print ''; - print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; From 95b69eaefbea97b0d7f1e7bd5296a7eaac07ce5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Oct 2022 19:57:25 +0200 Subject: [PATCH 0900/1289] Clean code --- htdocs/langs/en_US/modulebuilder.lang | 1 + htdocs/modulebuilder/index.php | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 13bcfdd76de..6de9ada7e4d 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -147,6 +147,7 @@ CSSViewClass=CSS for read form CSSListClass=CSS for list NotEditable=Not editable ForeignKey=Foreign key +ForeignKeyDesc=If the value of this field must be guaranted to exists into another table. Enter here a value matching syntax: tablename.parentfieldtocheck TypeOfFieldsHelp=Example:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
'1' means we add a + button after the combo to create the record
'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' TypeOfFieldsHelpIntro=This is the type of the field/attribute. AsciiToHtmlConverter=Ascii to HTML converter diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index a3d3e9d38fd..e247b5fabb5 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2988,7 +2988,7 @@ if ($module == 'initmodule') { print '
'; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -3099,7 +3099,9 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; - print ''; - print ''; print ''; - print ''; - print ''; - print ''; - print ''; print 'boximg\n"; + $out .= "\n"; } $out .= "\n"; From ddba58b204fe8e7ec38e062c7517ec6f15f8ddbb Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Thu, 13 Oct 2022 10:08:03 +0900 Subject: [PATCH 0904/1289] fix missing translation BOMNetNeeds --- htdocs/langs/en_US/mrp.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 44fb4457999..82196b584bd 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -114,3 +114,4 @@ MoChildGenerate=Generate Child Mo 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 From 8cc88f4237a1b3d14b8de31dd438dbd3593e892e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 03:33:35 +0200 Subject: [PATCH 0905/1289] Fix creation of member --- htdocs/adherents/card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index e0f6b693eb7..45c2898c8f3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -585,7 +585,10 @@ if (empty($reshook)) { $db->commit(); $rowid = $object->id; $id = $object->id; + + $backtopage = preg_replace('/__ID__/', $id, $backtopage); } else { + $error++; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -1041,8 +1044,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Website - print ''; - print ''; + print ''; + print ''; // Address print ''; $boxgraph .= ''; $boxgraph .= '
'.$langs->trans("Property"); - print ' ('.$langs->trans("SeeExamples").')'; + print ''; + + $htmltext = $langs->trans("PropertyDesc").'

'.$langs->trans("SeeExamples").''; + print $form->textwithpicto($langs->trans("Code"), $htmltext, 1, 'help', 'extracss', 0, 3, 'propertyhelp'); + print '
'; print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")); print ''.$form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelp")).''.$form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'

'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp').'
'.$form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")).''.$form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")).''.$langs->trans("DefaultValue").''.$langs->trans("DatabaseIndex").''.$langs->trans("ForeignKey").''.$langs->trans("Position").''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp').''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp').'
'.$langs->trans("NotEditable").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).''.$form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")).''.$langs->trans("DefaultValue").''.$langs->trans("DatabaseIndex").''.$langs->trans("ForeignKey").''.$form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp').''.$langs->trans("Position").''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp').''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp').'
'; print ''; print ''; @@ -3114,7 +3116,7 @@ if ($module == 'initmodule') { print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -3188,13 +3190,15 @@ if ($module == 'initmodule') { print ''; print dol_escape_htmltag($propposition); print ''; + print ''; print $propenabled ? dol_escape_htmltag($propenabled) : ''; print ''; + // Visibility + print ''; print $propvisible ? dol_escape_htmltag($propvisible) : '0'; print ''; + // Readonly + print ''; print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; print ''; @@ -3206,16 +3210,17 @@ if ($module == 'initmodule') { print ''; print $propisameasure ? dol_escape_htmltag($propisameasure) : ''; print ''; + print ''; print $propcss ? dol_escape_htmltag($propcss) : ''; print ''; + print ''; print $propcssview ? dol_escape_htmltag($propcssview) : ''; print ''; + print ''; print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; print ''; + // Key for tooltop + print ''; print $prophelp ? dol_escape_htmltag($prophelp) : ''; print ''; From 374e56d93855f3bb052921607c2a55eb98b23596 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 00:50:55 +0200 Subject: [PATCH 0901/1289] FIX #22538 --- htdocs/install/mysql/tables/llx_establishment.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 7159a53059c..0e951e93c5a 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,6 +22,7 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, + label varchar(255), ref varchar(30), name varchar(128), address varchar(255), From b88f49f00c118521d6ad0a41bbc23da5dc330c4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 01:08:23 +0200 Subject: [PATCH 0902/1289] Position of field --- htdocs/install/mysql/tables/llx_establishment.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 1b0d2668cb0..a3542f6d9d6 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,8 +22,8 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, - label varchar(255) NOT NULL, ref varchar(30), + label varchar(255) NOT NULL, name varchar(128), address varchar(255), zip varchar(25), From 3280d800626c74e24a10be1085117801db10b8a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 02:53:22 +0200 Subject: [PATCH 0903/1289] Fix removed bad log --- htdocs/core/boxes/modules_boxes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index f87ea993acd..1a29c8e1389 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -354,7 +354,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $out .= "\n".$textnoformat."\n"; } - $out .= "
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'member_url', '', $object, 0).''.img_picto('', 'globe').'
'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).''.img_picto('', 'globe').'
'.$langs->trans("Address").''; From 96bf7016c756ea08e8d475cbe3f86ae7ae4eaf41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 04:25:20 +0200 Subject: [PATCH 0906/1289] Fix filter on membership status and graph --- htdocs/adherents/card.php | 22 ++++---- htdocs/adherents/class/adherent.class.php | 4 +- htdocs/adherents/index.php | 69 ++++++++++++++++++++--- htdocs/adherents/list.php | 17 ++++-- htdocs/core/lib/functions.lib.php | 14 +++-- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/members.lang | 1 + htdocs/partnership/partnership_list.php | 9 ++- 9 files changed, 102 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 45c2898c8f3..bd105e7a672 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1897,7 +1897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Send if (empty($user->socid)) { if (Adherent::STATUS_VALIDATED == $object->statut) { - print ''.$langs->trans('SendMail').''."\n"; + print ''.$langs->trans('SendMail').''."\n"; } } @@ -1917,7 +1917,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Modify if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans("Modify").''."\n"; } @@ -1925,7 +1925,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Validate if (Adherent::STATUS_DRAFT == $object->statut) { if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Validate").''."\n"; + print ''.$langs->trans("Validate").''."\n"; } else { print ''.$langs->trans("Validate").''."\n"; } @@ -1934,7 +1934,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Reactivate if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) { if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Reenable")."\n"; + print ''.$langs->trans("Reenable")."\n"; } else { print ''.$langs->trans("Reenable").''."\n"; } @@ -1943,7 +1943,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Resiliate if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Resiliate")."\n"; + print ''.$langs->trans("Resiliate")."\n"; } else { print ''.$langs->trans("Resiliate").''."\n"; } @@ -1952,7 +1952,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Exclude if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Exclude")."\n"; + print ''.$langs->trans("Exclude")."\n"; } else { print ''.$langs->trans("Exclude").''."\n"; } @@ -1962,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (isModEnabled('societe') && !$object->socid) { if ($user->rights->societe->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; + print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; } else { print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; } @@ -1975,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$user->socid && !$object->user_id) { if ($user->rights->user->user->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrLogin").''."\n"; + print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } else { print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } @@ -1989,16 +1989,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $isinspip = $mailmanspip->is_in_spip($object); if ($isinspip == 1) { - print ''.$langs->trans("DeleteIntoSpip").''."\n"; + print ''.$langs->trans("DeleteIntoSpip").''."\n"; } if ($isinspip == 0) { - print ''.$langs->trans("AddIntoSpip").''."\n"; + print ''.$langs->trans("AddIntoSpip").''."\n"; } } // Delete if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Delete").''."\n"; + print ''.$langs->trans("Delete").''."\n"; } else { print ''.$langs->trans("Delete").''."\n"; } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0aa1af68afc..0e37981cc84 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2352,8 +2352,8 @@ class Adherent extends CommonObject $statusType = 'status1'; $labelStatus = $langs->trans("MemberStatusActive"); $labelStatusShort = $langs->trans("MemberStatusActiveShort"); - } elseif ($date_end_subscription < dol_now()) { - $statusType = 'status3'; + } elseif ($date_end_subscription < dol_now()) { // expired + $statusType = 'status8'; $labelStatus = $langs->trans("MemberStatusActiveLate"); $labelStatusShort = $langs->trans("MemberStatusActiveLateShort"); } else { diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 388d51be376..a5f9c26f192 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -87,7 +87,9 @@ print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist $MembersValidated = array(); $MembersToValidate = array(); +$MembersWaitingSubscription = array(); $MembersUpToDate = array(); +$MembersExpired = array(); $MembersExcluded = array(); $MembersResiliated = array(); @@ -137,13 +139,36 @@ if ($resql) { $now = dol_now(); +// Members waiting subscription +$sql = "SELECT count(*) as somme , d.fk_adherent_type"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; +$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin IS NULL AND t.subscription = '1')"; +$sql .= " AND t.rowid = d.fk_adherent_type"; +$sql .= " GROUP BY d.fk_adherent_type"; + +dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $MembersWaitingSubscription[$objp->fk_adherent_type] = $objp->somme; + $i++; + } + $db->free($resql); +} + // Members up to date list -// current rule: uptodate = the end date is in future whatever is type +// current rule: uptodate = the end date is in future or no subcription required // old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future) $sql = "SELECT count(*) as somme , d.fk_adherent_type"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; -$sql .= " AND d.statut = 1 AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = 0)"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; // end date in future $sql .= " AND t.rowid = d.fk_adherent_type"; $sql .= " GROUP BY d.fk_adherent_type"; @@ -160,6 +185,28 @@ if ($resql) { $db->free($resql); } +// Members expired list +$sql = "SELECT count(*) as somme , d.fk_adherent_type"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; +$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin < '".$db->idate($now)."' AND t.subscription = '1')"; +$sql .= " AND t.rowid = d.fk_adherent_type"; +$sql .= " GROUP BY d.fk_adherent_type"; + +dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $MembersExpired[$objp->fk_adherent_type] = $objp->somme; + $i++; + } + $db->free($resql); +} + /* * Statistics */ @@ -172,8 +219,9 @@ if ($conf->use_javascript_ajax) { $boxgraph .='
'; $SumToValidate = 0; - $SumValidated = 0; + $SumWaitingSubscription = 0; $SumUpToDate = 0; + $SumExpired = 0; $SumResiliated = 0; $SumExcluded = 0; @@ -182,23 +230,26 @@ if ($conf->use_javascript_ajax) { $i = 0; foreach ($AdherentType as $key => $adhtype) { $dataval['draft'][] = array($i, isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0); + $dataval['waitingsubscription'][] = array($i, isset($MembersWaitingSubscription[$key]) ? $MembersWaitingSubscription[$key] : 0); $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); - $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0); + $dataval['expired'][] = array($i, isset($MembersExpired[$key]) ? $MembersExpired[$key] : 0); $dataval['excluded'][] = array($i, isset($MembersExcluded[$key]) ? $MembersExcluded[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumWaitingSubscription += isset($MembersWaitingSubscription[$key]) ? $MembersWaitingSubscription[$key] : 0; $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumExpired += isset($MembersExpired[$key]) ? $MembersExpired[$key] : 0; $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } - $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; + $total = $SumToValidate + $SumWaitingSubscription + $SumUpToDate + $SumExpired + $SumExcluded + $SumResiliated; $dataseries = array(); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); // Draft, not yet validated + $dataseries[] = array($langs->transnoentitiesnoconv("WaitingSubscription"), round($SumWaitingSubscription)); $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); + $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumExpired)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), round($SumExcluded)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); @@ -207,7 +258,7 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->SetDataColor(array('-'.$badgeStatus0, $badgeStatus4, '-'.$badgeStatus1, '-'.$badgeStatus8, $badgeStatus6)); + $dolgraph->SetDataColor(array('-'.$badgeStatus0, $badgeStatus1, $badgeStatus4, $badgeStatus8, '-'.$badgeStatus8, $badgeStatus6)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); @@ -217,7 +268,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .= '
'.$langs->trans("Total").''; - $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; + $boxgraph .= $SumToValidate + $SumWaitingSubscription + $SumUpToDate + $SumExpired + $SumExcluded + $SumResiliated; $boxgraph .= '
'; $boxgraph .= '
'; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 74373d95eda..aed3b5fdbfb 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -395,7 +395,10 @@ if ($search_type > 0) { $sql .= " AND t.rowid=".((int) $search_type); } if ($search_filter == 'withoutsubscription') { - $sql .= " AND (datefin IS NULL OR t.subscription = '0')"; + $sql .= " AND (datefin IS NULL)"; +} +if ($search_filter == 'waitingsubscription') { + $sql .= " AND (datefin IS NULL AND t.subscription = '1')"; } if ($search_filter == 'uptodate') { $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; @@ -524,6 +527,9 @@ if (GETPOSTISSET("search_status")) { if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') { $title = $langs->trans("MenuMembersValidated"); } + if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'waitingsubscription') { + $title = $langs->trans("MembersWithWaitingSubscription"); + } if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') { $title = $langs->trans("MembersWithSubscriptionToReceive"); } @@ -822,7 +828,8 @@ if (!empty($arrayfields['d.email']['checked'])) { // End of subscription date if (!empty($arrayfields['d.datefin']['checked'])) { print ''; - $selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + //$selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + $selectarray = array('-1'=>'', 'waitingsubscription'=>$langs->trans("WaitingSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); print $form->selectarray('search_filter', $selectarray, $search_filter); print ''; } @@ -936,7 +943,7 @@ if (!empty($arrayfields['d.email']['checked'])) { print_liste_field_titre($arrayfields['d.email']['label'], $_SERVER["PHP_SELF"], 'd.email', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['d.datefin']['checked'])) { - print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin,t.subscription', '', $param, '', $sortfield, $sortorder, 'center '); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -955,7 +962,7 @@ if (!empty($arrayfields['d.tms']['checked'])) { print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); } if (!empty($arrayfields['d.statut']['checked'])) { - print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut,t.subscription,d.datefin", "", $param, 'class="right"', $sortfield, $sortorder); } if (!empty($arrayfields['d.import_key']['checked'])) { print_liste_field_titre($arrayfields['d.import_key']['label'], $_SERVER["PHP_SELF"], "d.import_key", "", $param, '', $sortfield, $sortorder, 'center '); @@ -1200,7 +1207,7 @@ while ($i < min($num, $limit)) { } } else { if (!empty($obj->subscription)) { - print $langs->trans("SubscriptionNotReceived"); + print ''.$langs->trans("SubscriptionNotReceived").''; if ($obj->statut > 0) { print " ".img_warning(); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5a67d5b120e..d7eaa971a08 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -966,13 +966,15 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options break; case 'custom': - if (empty($filter)) { - return 'BadParameterForGETPOST - Param 3 of sanitizeVal()'; + if (!empty($out)) { + if (empty($filter)) { + return 'BadParameterForGETPOST - Param 3 of sanitizeVal()'; + } + /*if (empty($options)) { + return 'BadParameterForGETPOST - Param 4 of sanitizeVal()'; + }*/ + $out = filter_var($out, $filter, $options); } - if (empty($options)) { - return 'BadParameterForGETPOST - Param 4 of sanitizeVal()'; - } - $out = filter_var($out, $filter, $options); break; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 8dc3f1b1374..046d1da2f0e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -450,7 +450,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->rights->adherent->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->rights->adherent->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->rights->adherent->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=withoutsubscription', 'WithoutSubscription', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->rights->adherent->lire', '', 2, 6, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7fccf290d1a..91e99e7e8ba 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2405,7 +2405,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'read')); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription", $langs->trans("WaitingSubscription"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read')); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index aebe3affdae..d774a8e7434 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -36,6 +36,7 @@ DateEndSubscription=End date of membership EndSubscription=End of membership SubscriptionId=Contribution ID WithoutSubscription=Without contribution +WaitingSubscription=Waiting contribution MemberId=Member Id MemberRef=Member Ref NewMember=New member diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 49b50a037e9..838969e745e 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -359,13 +359,16 @@ foreach ($search as $key => $val) { } if ($managedfor == 'member') { if ($search_filter == 'withoutsubscription') { - $sql .= " AND (d.datefin IS NULL OR dty.subscription = 0)"; + $sql .= " AND (d.datefin IS NULL)"; + } + if ($search_filter == 'waitingsubscription') { + $sql .= " AND (d.datefin IS NULL AND t.subscription = '1')"; } if ($search_filter == 'uptodate') { - $sql .= " AND (d.datefin >= '".$db->idate($now)."' OR dty.subscription = 0)"; + $sql .= " AND (d.datefin >= '".$db->idate($now)."' OR dty.subscription = '0')"; } if ($search_filter == 'outofdate') { - $sql .= " AND (d.datefin < '".$db->idate($now)."' AND dty.subscription = 1)"; + $sql .= " AND (d.datefin < '".$db->idate($now)."' AND dty.subscription = '1')"; } } if ($search_all) { From fe9c2e1b2c78a1045fbb25601849815ab63ff0e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 04:29:33 +0200 Subject: [PATCH 0907/1289] Fix status --- htdocs/adherents/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index aed3b5fdbfb..e6d3aac27d0 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -994,6 +994,7 @@ while ($i < min($num, $limit)) { $memberstatic->morphy = $obj->morphy; $memberstatic->note_public = $obj->note_public; $memberstatic->note_private = $obj->note_private; + $memberstatic->need_subscription = $obj->subscription; if (!empty($obj->fk_soc)) { $memberstatic->fetch_thirdparty(); From b1432437ea269229087f8bfb4014d26b2844534a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 04:34:11 +0200 Subject: [PATCH 0908/1289] Fix token error --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index eebf96a6040..b11ed9a6158 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { From 4150af1bf38d085a2122930611f44b3fd004d3f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 04:37:15 +0200 Subject: [PATCH 0909/1289] css --- htdocs/societe/paymentmodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 2ba271cd936..9365ccbf011 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1596,11 +1596,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; } - print ''; + print ''; print img_picto($langs->trans("Modify"), 'edit'); print ''; - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; } From 9b1a01bbd68c9aab14ff84d43d8c94ddb9c3774f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 04:49:45 +0200 Subject: [PATCH 0910/1289] Clean code --- htdocs/langs/en_US/stripe.lang | 1 + htdocs/societe/paymentmodes.php | 2 +- htdocs/stripe/class/stripe.class.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 3ea0cf2354b..db8257ba504 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -61,6 +61,7 @@ DeleteACard=Delete Card ConfirmDeleteCard=Are you sure you want to delete this Credit or Debit card? CreateCustomerOnStripe=Create customer on Stripe CreateCardOnStripe=Create card on Stripe +CreateBANOnStripe=Create bank on Stripe ShowInStripe=Show in Stripe StripeUserAccountForActions=User account to use for email notification of some Stripe events (Stripe payouts) StripePayoutList=List of Stripe payouts diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 9365ccbf011..a7a7cd44972 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1591,7 +1591,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($permissiontoaddupdatepaymentinformation) { if (empty($rib->stripe_card_ref)) { // Add link to create BAN on Stripe - print ''; + print ''; print img_picto($langs->trans("CreateBANOnStripe"), 'stripe'); print ''; } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index cc8178d2a01..25a4edb6123 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -908,7 +908,7 @@ class Stripe extends CommonObject $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; - $sql .= " WHERE sa.rowid = '".$this->db->escape($object->id)."'"; // We get record from ID, no need for filter on entity + $sql .= " WHERE sa.rowid = ".((int) $object->id); // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) $soc = new Societe($this->db); From eabf01a42218b644feefb428863b003d1d0bb5d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 05:31:36 +0200 Subject: [PATCH 0911/1289] Debug sepa payment --- htdocs/compta/facture/prelevement.php | 17 +- htdocs/core/class/commoninvoice.class.php | 1288 ++++++++++----------- htdocs/langs/en_US/stripe.lang | 3 +- 3 files changed, 657 insertions(+), 651 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 20626bb6cdf..531106be626 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -114,11 +114,7 @@ if (empty($reshook)) { } $paymentservice = GETPOST('paymentservice'); - if (preg_match('/stripesepa/', $paymentservice)) { - $result = $object->demande_prelevement_stripe($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); - } else { - $result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); - } + $result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); if ($result > 0) { $db->commit(); @@ -142,6 +138,14 @@ if (empty($reshook)) { } } + // Payment with Direct Debit Stripe + if ($action == 'sepastripepayment' && $usercancreate) { + $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'direct-debit', 'facture'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // payments conditions if ($action == 'setconditions' && $usercancreate) { $object->fetch($id); @@ -871,7 +875,8 @@ if ($object->id > 0) { print ''; if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { - print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("SendToStripe").''; + $langs->load("stripe"); + print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").''; } print ''; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 7c45e6523f5..2d63347c029 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -848,20 +848,18 @@ abstract class CommonInvoice extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a withdrawal request for a direct debit order or a credit transfer order. * Use the remain to pay excluding all existing open direct debit requests. * * @param User $fuser User asking the direct debit transfer - * @param float $amount Amount we request direct debit for + * @param int $did ID of payment request * @param string $type 'direct-debit' or 'bank-transfer' * @param string $sourcetype Source ('facture' or 'supplier_invoice') * @return int <0 if KO, >0 if OK */ - public function demande_prelevement_stripe($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture') + public function makeStripeSepaRequest($fuser, $did = 0, $type = 'direct-debit', $sourcetype = 'facture') { - // phpcs:enable global $conf, $mysoc, $user, $langs; if (empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { @@ -871,753 +869,755 @@ abstract class CommonInvoice extends CommonObject $error = 0; - dol_syslog(get_class($this)."::demande_prelevement_stripe 0", LOG_DEBUG); + dol_syslog(get_class($this)."::makeStripeSepaRequest 0", LOG_DEBUG); if ($this->statut > self::STATUS_DRAFT && $this->paye == 0) { require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; $bac = new CompanyBankAccount($this->db); - $bac->fetch(0, $this->socid); + $result = $bac->fetch(0, $this->socid, 1, 'ban'); + if ($result <= 0 || empty($bac->id)) { + $this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount"); + $this->errors[] = $this->error; + dol_syslog(get_class($this)."::makeStripeSepaRequest ".$this->error); + return -1; + } - $sql = "SELECT count(*)"; + $sql = "SELECT rowid, date_demande, amount, fk_facture, fk_facture_fourn"; $sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande"; - $sql .= " WHERE fk_facture = ".((int) $this->id); - $sql .= " AND ext_payment_id IS NULL"; // To exclude record done for some online payments - $sql .= " AND traite = 0"; + $sql .= " WHERE rowid = ".((int) $did); - dol_syslog(get_class($this)."::demande_prelevement_stripe 1", LOG_DEBUG); + dol_syslog(get_class($this)."::makeStripeSepaRequest 1", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $row = $this->db->fetch_row($resql); + $obj = $this->db->fetch_object($resql); + if (!$obj) { + dol_print_error($this->db, 'CantFindRequestWithId'); + return -2; + } - if ($row[0] == 0) { - $now = dol_now(); + // + $amount = $obj->amount; - $totalpaye = $this->getSommePaiement(); - $totalcreditnotes = $this->getSumCreditNotesUsed(); - $totaldeposits = $this->getSumDepositsUsed(); - //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits; + $now = dol_now(); - // We can also use bcadd to avoid pb with floating points - // For example print 239.2 - 229.3 - 9.9; does not return 0. - //$resteapayer=bcadd($this->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); - //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); - if (empty($amount)) { - $amount = price2num($this->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + $totalpaye = $this->getSommePaiement(); + $totalcreditnotes = $this->getSumCreditNotesUsed(); + $totaldeposits = $this->getSumDepositsUsed(); + //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits; + + // We can also use bcadd to avoid pb with floating points + // For example print 239.2 - 229.3 - 9.9; does not return 0. + //$resteapayer=bcadd($this->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); + //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); + $amounttocheck = price2num($this->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + + // TODO We can compare $amount and $amounttocheck + + if (is_numeric($amount) && $amount != 0) { + require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; + $companypaymentmode = new CompanyPaymentMode($this->db); + $companypaymentmode->fetch($bac->id); + + // Start code for Stripe + $service = 'StripeTest'; + $servicestatus = 0; + if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { + $service = 'StripeLive'; + $servicestatus = 1; } - if (is_numeric($amount) && $amount != 0) { - require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; - $companypaymentmode = new CompanyPaymentMode($this->db); - $companypaymentmode->fetch($bac->id); + dol_syslog("makeStripeSepaRequest amount = ".$amount." service=" . $service . " servicestatus=" . $servicestatus . " thirdparty_id=" . $this->socid . " companypaymentmode=" . $companypaymentmode->id); - dol_syslog(get_class($this)."::demande_prelevement_stripe amount=$amount, companypaymentmode = " . $companypaymentmode->id, LOG_DEBUG); + $this->stripechargedone = 0; + $this->stripechargeerror = 0; + $now = dol_now(); - //Start code from sellyoursaas - $service = 'StripeTest'; - $servicestatus = 0; - if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { - $service = 'StripeLive'; - $servicestatus = 1; - } + $currency = $conf->currency; - $langs->load("agenda"); - dol_syslog("doTakePaymentStripeForThirdparty service=" . $service . " servicestatus=" . $servicestatus . " thirdparty_id=" . $this->socid . " companypaymentmode=" . $companypaymentmode->id . " noemailtocustomeriferror=" . $noemailtocustomeriferror . " nocancelifpaymenterror=" . $nocancelifpaymenterror . " calledinmyaccountcontext=" . $calledinmyaccountcontext); + global $stripearrayofkeysbyenv; + global $savstripearrayofkeysbyenv; - $this->stripechargedone = 0; - $this->stripechargeerror = 0; - $now = dol_now(); + $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop - $currency = $conf->currency; + $this->fetch_thirdparty(); - global $stripearrayofkeysbyenv; - global $savstripearrayofkeysbyenv; + dol_syslog("--- Process invoice thirdparty_id=" . $this->id . ", thirdparty_name=" . $this->thirdparty->name . " id=" . $this->id . ", ref=" . $this->ref . ", datef=" . dol_print_date($this->date, 'dayhourlog'), LOG_DEBUG); - $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop + $alreadypayed = $this->getSommePaiement(); + $amount_credit_notes_included = $this->getSumCreditNotesUsed(); + $amounttopay = $this->total_ttc - $alreadypayed - $amount_credit_notes_included; - $this->fetch_thirdparty(); + // Correct the amount according to unit of currency + // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support + $arrayzerounitcurrency = ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']; + $amountstripe = $amounttopay; + if (!in_array($currency, $arrayzerounitcurrency)) { + $amountstripe = $amountstripe * 100; + } - dol_syslog("--- Process invoice thirdparty_id=" . $this->id . ", thirdparty_name=" . $this->thirdparty->name . " id=" . $this->id . ", ref=" . $this->ref . ", datef=" . dol_print_date($this->date, 'dayhourlog'), LOG_DEBUG); + if ($amountstripe > 0) { + try { + //var_dump($companypaymentmode); + dol_syslog("We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); - $alreadypayed = $this->getSommePaiement(); - $amount_credit_notes_included = $this->getSumCreditNotesUsed(); - $amounttopay = $this->total_ttc - $alreadypayed - $amount_credit_notes_included; + $thirdparty = new Societe($this->db); + $resultthirdparty = $thirdparty->fetch($this->socid); - // Correct the amount according to unit of currency - // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support - $arrayzerounitcurrency = ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']; - $amountstripe = $amounttopay; - if (!in_array($currency, $arrayzerounitcurrency)) { - $amountstripe = $amountstripe * 100; - } + include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php + // So it inits or erases the $stripearrayofkeysbyenv + $stripe = new Stripe($this->db); - if ($amountstripe > 0) { - try { - //var_dump($companypaymentmode); - dol_syslog("We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); + if (empty($savstripearrayofkeysbyenv)) { + $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; + } + dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); + dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is " . $savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); - $thirdparty = new Societe($this->db); - $resultthirdparty = $thirdparty->fetch($this->socid); + $foundalternativestripeaccount = ''; - include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php - // So it inits or erases the $stripearrayofkeysbyenv - $stripe = new Stripe($this->db); + // Force stripe to another value (by default this value is empty) + if (!empty($thirdparty->array_options['options_stripeaccount'])) { + dol_syslog("makeStripeSepaRequest The thirdparty id=" . $thirdparty->id . " has a dedicated Stripe Account, so we switch to it."); - if (empty($savstripearrayofkeysbyenv)) { - $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; - } - dol_syslog("Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); - dol_syslog("Current Saved Stripe environment is " . $savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); + $tmparray = explode('@', $thirdparty->array_options['options_stripeaccount']); + if (!empty($tmparray[1])) { + $tmparray2 = explode(':', $tmparray[1]); + if (!empty($tmparray2[3])) { + $stripearrayofkeysbyenv = [ + 0 => [ + "publishable_key" => $tmparray2[0], + "secret_key" => $tmparray2[1] + ], + 1 => [ + "publishable_key" => $tmparray2[2], + "secret_key" => $tmparray2[3] + ] + ]; - $foundalternativestripeaccount = ''; - - // Force stripe to another value (by default this value is empty) - if (!empty($thirdparty->array_options['options_stripeaccount'])) { - dol_syslog("The thirdparty id=" . $thirdparty->id . " has a dedicated Stripe Account, so we switch to it."); - - $tmparray = explode('@', $thirdparty->array_options['options_stripeaccount']); - if (!empty($tmparray[1])) { - $tmparray2 = explode(':', $tmparray[1]); - if (!empty($tmparray2[3])) { - $stripearrayofkeysbyenv = [ - 0 => [ - "publishable_key" => $tmparray2[0], - "secret_key" => $tmparray2[1] - ], - 1 => [ - "publishable_key" => $tmparray2[2], - "secret_key" => $tmparray2[3] - ] - ]; - - $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; - \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - - $foundalternativestripeaccount = $tmparray[0]; // Store the customer id - - dol_syslog("We use now customer=" . $foundalternativestripeaccount . " publishable_key=" . $stripearrayofkeys['publishable_key'], LOG_DEBUG); - } - } - - if (!$foundalternativestripeaccount) { - $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; - - $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; + $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - dol_syslog("We found a bad value for Stripe Account for thirdparty id=" . $thirdparty->id . ", so we ignore it and keep using the global one, so " . $stripearrayofkeys['publishable_key'], LOG_WARNING); + + $foundalternativestripeaccount = $tmparray[0]; // Store the customer id + + dol_syslog("We use now customer=" . $foundalternativestripeaccount . " publishable_key=" . $stripearrayofkeys['publishable_key'], LOG_DEBUG); } - } else { + } + + if (!$foundalternativestripeaccount) { $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - dol_syslog("The thirdparty id=" . $thirdparty->id . " has no dedicated Stripe Account, so we use global one, so " . json_encode($stripearrayofkeys), LOG_DEBUG); + dol_syslog("We found a bad value for Stripe Account for thirdparty id=" . $thirdparty->id . ", so we ignore it and keep using the global one, so " . $stripearrayofkeys['publishable_key'], LOG_WARNING); } + } else { + $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; + + $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; + \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); + dol_syslog("The thirdparty id=" . $thirdparty->id . " has no dedicated Stripe Account, so we use global one, so " . json_encode($stripearrayofkeys), LOG_DEBUG); + } - dol_syslog("get stripe account", LOG_DEBUG); - $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) - dol_syslog("get stripe account return " . json_encode($stripeacc), LOG_DEBUG); + dol_syslog("makeStripeSepaRequest get stripe account", LOG_DEBUG); + $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) + dol_syslog("makeStripeSepaRequest get stripe account return " . json_encode($stripeacc), LOG_DEBUG); - if ($foundalternativestripeaccount) { - if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources']); - } else { - $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources'], ["stripe_account" => $stripeacc]); - } + if ($foundalternativestripeaccount) { + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources']); } else { - $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); - if (empty($customer) && !empty($stripe->error)) { - $this->errors[] = $stripe->error; - } - /*if (!empty($customer) && empty($customer->sources)) { - $customer = null; - $this->errors[] = '\Stripe\Customer::retrieve did not returned the sources'; - }*/ + $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources'], ["stripe_account" => $stripeacc]); + } + } else { + $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); + if (empty($customer) && !empty($stripe->error)) { + $this->errors[] = $stripe->error; + } + /*if (!empty($customer) && empty($customer->sources)) { + $customer = null; + $this->errors[] = '\Stripe\Customer::retrieve did not returned the sources'; + }*/ + } + + // $nbhoursbetweentries = (empty($conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES) ? 49 : $conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES); // Must have more that 48 hours + 1 between each try (so 1 try every 3 daily batch) + // $nbdaysbeforeendoftries = (empty($conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES) ? 35 : $conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES); + $labeltouse = ''; + $postactionmessages = []; + + if ($resultthirdparty > 0 && !empty($customer)) { + if (!$error && !empty($this->array_options['options_delayautopayment']) && $this->array_options['options_delayautopayment'] > $now && empty($calledinmyaccountcontext)) { + $errmsg = 'Payment try was canceled (invoice qualified by the automatic payment was delayed after the ' . dol_print_date($this->array_options['options_delayautopayment'], 'day') . ')'; + dol_syslog($errmsg, LOG_DEBUG); + + $error++; + $errorforinvoice++; + $this->errors[] = $errmsg; } - // $nbhoursbetweentries = (empty($conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES) ? 49 : $conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES); // Must have more that 48 hours + 1 between each try (so 1 try every 3 daily batch) - // $nbdaysbeforeendoftries = (empty($conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES) ? 35 : $conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES); - $labeltouse = ''; - $postactionmessages = []; - - if ($resultthirdparty > 0 && !empty($customer)) { - if (!$error && !empty($this->array_options['options_delayautopayment']) && $this->array_options['options_delayautopayment'] > $now && empty($calledinmyaccountcontext)) { - $errmsg = 'Payment try was canceled (invoice qualified by the automatic payment was delayed after the ' . dol_print_date($this->array_options['options_delayautopayment'], 'day') . ')'; - dol_syslog($errmsg, LOG_DEBUG); - - $error++; - $errorforinvoice++; - $this->errors[] = $errmsg; + if (!$error) { // Payment was not canceled + //erics card or sepa ? + $sepaMode = false; + if ($companypaymentmode->type == 'ban') { + $sepaMode = true; + $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); + } else { + $stripecard = $stripe->cardStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); } - if (!$error) { // Payment was not canceled - //erics card or sepa ? - $sepaMode = false; - if ($companypaymentmode->type == 'ban') { - $sepaMode = true; - $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); - } else { - $stripecard = $stripe->cardStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); - } + if ($stripecard) { // Can be card_... (old mode) or pm_... (new mode) + $FULLTAG = 'INV=' . $this->id . '-CUS=' . $thirdparty->id; + $description = 'Stripe payment from doTakePaymentStripeForThirdparty: ' . $FULLTAG . ' ref=' . $this->ref; - if ($stripecard) { // Can be card_... (old mode) or pm_... (new mode) - $FULLTAG = 'INV=' . $this->id . '-CUS=' . $thirdparty->id; - $description = 'Stripe payment from doTakePaymentStripeForThirdparty: ' . $FULLTAG . ' ref=' . $this->ref; + $stripefailurecode = ''; + $stripefailuremessage = ''; + $stripefailuredeclinecode = ''; - $stripefailurecode = ''; - $stripefailuremessage = ''; - $stripefailuredeclinecode = ''; + if (preg_match('/^card_/', $stripecard->id)) { // Using old method + dol_syslog("* Create charge on card " . $stripecard->id . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - if (preg_match('/^card_/', $stripecard->id)) { // Using old method - dol_syslog("* Create charge on card " . $stripecard->id . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); + $ipaddress = getUserRemoteIP(); - $ipaddress = getUserRemoteIP(); + $charge = null; // Force reset of $charge, so, if already set from a previous fetch, it will be empty even if there is an exception at next step + try { + $charge = \Stripe\Charge::create([ + 'amount' => price2num($amountstripe, 'MU'), + 'currency' => $currency, + 'capture' => true, // Charge immediatly + 'description' => $description, + 'metadata' => ["FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress], + 'customer' => $customer->id, + //'customer' => 'bidon_to_force_error', // To use to force a stripe error + 'source' => $stripecard, + 'statement_descriptor' => dol_trunc('INV=' . $this->id, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) + ]); + } catch (\Stripe\Error\Card $e) { + // Since it's a decline, Stripe_CardError will be caught + $body = $e->getJsonBody(); + $err = $body['error']; - $charge = null; // Force reset of $charge, so, if already set from a previous fetch, it will be empty even if there is an exception at next step - try { - $charge = \Stripe\Charge::create([ - 'amount' => price2num($amountstripe, 'MU'), - 'currency' => $currency, - 'capture' => true, // Charge immediatly - 'description' => $description, - 'metadata' => ["FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress], - 'customer' => $customer->id, - //'customer' => 'bidon_to_force_error', // To use to force a stripe error - 'source' => $stripecard, - 'statement_descriptor' => dol_trunc('INV=' . $this->id, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - ]); - } catch (\Stripe\Error\Card $e) { - // Since it's a decline, Stripe_CardError will be caught - $body = $e->getJsonBody(); - $err = $body['error']; - - $stripefailurecode = $err['code']; - $stripefailuremessage = $err['message']; - $stripefailuredeclinecode = $err['decline_code']; - } catch (Exception $e) { - $stripefailurecode = 'UnknownChargeError'; - $stripefailuremessage = $e->getMessage(); - } - } else { // Using new SCA method - if ($sepaMode) { - dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - } else { - dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - } - - // Create payment intent and charge payment (confirmnow = true) - $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1); - - $charge = new stdClass(); - //erics add processing sepa is like success ? - if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') { - $charge->status = 'ok'; - $charge->id = $paymentintent->id; - $charge->customer = $customer->id; - } elseif ($paymentintent->status === 'requires_action') { - //paymentintent->status may be => 'requires_action' (no error in such a case) - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); - - $charge->status = 'failed'; - $charge->customer = $customer->id; - $charge->failure_code = $stripe->code; - $charge->failure_message = $stripe->error; - $charge->failure_declinecode = $stripe->declinecode; - $stripefailurecode = $stripe->code; - $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; - $stripefailuredeclinecode = $stripe->declinecode; - } else { - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); - - $charge->status = 'failed'; - $charge->customer = $customer->id; - $charge->failure_code = $stripe->code; - $charge->failure_message = $stripe->error; - $charge->failure_declinecode = $stripe->declinecode; - $stripefailurecode = $stripe->code; - $stripefailuremessage = $stripe->error; - $stripefailuredeclinecode = $stripe->declinecode; - } - - //var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode); - //exit; + $stripefailurecode = $err['code']; + $stripefailuremessage = $err['message']; + $stripefailuredeclinecode = $err['decline_code']; + } catch (Exception $e) { + $stripefailurecode = 'UnknownChargeError'; + $stripefailuremessage = $e->getMessage(); + } + } else { // Using new SCA method + if ($sepaMode) { + dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); + } else { + dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); } - // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) - if (empty($charge) || $charge->status == 'failed') { - dol_syslog('Failed to charge card or payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); + // Create payment intent and charge payment (confirmnow = true) + $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1); - // Save a stripe payment was in error - $this->stripechargeerror++; + $charge = new stdClass(); + //erics add processing sepa is like success ? + if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') { + $charge->status = 'ok'; + $charge->id = $paymentintent->id; + $charge->customer = $customer->id; + } elseif ($paymentintent->status === 'requires_action') { + //paymentintent->status may be => 'requires_action' (no error in such a case) + dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + $charge->status = 'failed'; + $charge->customer = $customer->id; + $charge->failure_code = $stripe->code; + $charge->failure_message = $stripe->error; + $charge->failure_declinecode = $stripe->declinecode; + $stripefailurecode = $stripe->code; + $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; + $stripefailuredeclinecode = $stripe->declinecode; + } else { + dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + + $charge->status = 'failed'; + $charge->customer = $customer->id; + $charge->failure_code = $stripe->code; + $charge->failure_message = $stripe->error; + $charge->failure_declinecode = $stripe->declinecode; + $stripefailurecode = $stripe->code; + $stripefailuremessage = $stripe->error; + $stripefailuredeclinecode = $stripe->declinecode; + } + + //var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode); + //exit; + } + + // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) + if (empty($charge) || $charge->status == 'failed') { + dol_syslog('Failed to charge card or payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); + + // Save a stripe payment was in error + $this->stripechargeerror++; + + $error++; + $errorforinvoice++; + $errmsg = $langs->trans("FailedToChargeCard"); + if (!empty($charge)) { + if ($stripefailuredeclinecode == 'authentication_required') { + $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); + $errmsg = $errauthenticationmessage; + } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { + $errmsg .= ': ' . $charge->failure_code; + $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; + if (empty($stripefailurecode)) { + $stripefailurecode = $charge->failure_code; + } + if (empty($stripefailuremessage)) { + $stripefailuremessage = $charge->failure_message; + } + } else { + $errmsg .= ': failure_code=' . $charge->failure_code; + $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; + if (empty($stripefailurecode)) { + $stripefailurecode = $charge->failure_code; + } + if (empty($stripefailuremessage)) { + $stripefailuremessage = $charge->failure_message; + } + } + } else { + $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; + $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); + } + + $description = 'Stripe payment ERROR from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; + $this->errors[] = $errmsg; + } else { + dol_syslog('Successfuly charge card ' . $stripecard->id); + + $postactionmessages[] = 'Success to charge card (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; + + // Save a stripe payment was done in realy life so later we will be able to force a commit on recorded payments + // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. + $this->stripechargedone++; + + // Default description used for label of event. Will be overwrite by another value later. + $description = 'Stripe payment OK (' . $charge->id . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + + $db = $this->db; + + $ipaddress = getUserRemoteIP(); + + $TRANSACTIONID = $charge->id; + $currency = $conf->currency; + $paymentmethod = 'stripe'; + $emetteur_name = $charge->customer; + + // Same code than into paymentok.php... + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { + $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + } + if (empty($paymentTypeId)) { + //erics + if ($sepaMode) { + $paymentType = 'PRE'; + } else { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) { + $paymentType = 'CB'; + } + } + $paymentTypeId = dol_getIdFromCode($this->db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $currency; + + $ispostactionok = 1; + + // Creation of payment line + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($this->db); + $paiement->datepaye = $now; + $paiement->date = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = [$this->id => $amounttopay]; // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = [$this->id => $amounttopay]; // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; + $ispostactionok = -1; + // Not yet supported, so error $error++; $errorforinvoice++; - $errmsg = $langs->trans("FailedToChargeCard"); - if (!empty($charge)) { - if ($stripefailuredeclinecode == 'authentication_required') { - $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); - $errmsg = $errauthenticationmessage; - } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { - $errmsg .= ': ' . $charge->failure_code; - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; - if (empty($stripefailurecode)) { - $stripefailurecode = $charge->failure_code; - } - if (empty($stripefailuremessage)) { - $stripefailuremessage = $charge->failure_message; - } - } else { - $errmsg .= ': failure_code=' . $charge->failure_code; - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; - if (empty($stripefailurecode)) { - $stripefailurecode = $charge->failure_code; - } - if (empty($stripefailuremessage)) { - $stripefailuremessage = $charge->failure_message; - } - } - } else { - $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; - $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); - } + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_paiement = ''; + $paiement->num_payment = ''; + // Add a comment with keyword 'SellYourSaas' in text. Used by trigger. + $paiement->note_public = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; + $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; + $paiement->ext_payment_id = $charge->id . ':' . $customer->id . '@' . $stripearrayofkeys['publishable_key']; + $paiement->ext_payment_site = 'stripe'; - $description = 'Stripe payment ERROR from doTakePaymentStripeForThirdparty: ' . $FULLTAG; - $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; - $this->errors[] = $errmsg; - } else { - dol_syslog('Successfuly charge card ' . $stripecard->id); + if (!$errorforinvoice) { + dol_syslog('* Record payment for invoice id ' . $this->id . '. It includes closing of invoice and regenerating document'); - $postactionmessages[] = 'Success to charge card (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; - - // Save a stripe payment was done in realy life so later we will be able to force a commit on recorded payments - // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. - $this->stripechargedone++; - - // Default description used for label of event. Will be overwrite by another value later. - $description = 'Stripe payment OK (' . $charge->id . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; - - $db = $this->db; - - $ipaddress = getUserRemoteIP(); - - $TRANSACTIONID = $charge->id; - $currency = $conf->currency; - $paymentmethod = 'stripe'; - $emetteur_name = $charge->customer; - - // Same code than into paymentok.php... - - $paymentTypeId = 0; - if ($paymentmethod == 'paybox') { - $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; - } - if ($paymentmethod == 'paypal') { - $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; - } - if ($paymentmethod == 'stripe') { - $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; - } - if (empty($paymentTypeId)) { - //erics - if ($sepaMode) { - $paymentType = 'PRE'; - } else { - $paymentType = $_SESSION["paymentType"]; - if (empty($paymentType)) { - $paymentType = 'CB'; - } - } - $paymentTypeId = dol_getIdFromCode($this->db, $paymentType, 'c_paiement', 'code', 'id', 1); - } - - $currencyCodeType = $currency; - - $ispostactionok = 1; - - // Creation of payment line - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; - $paiement = new Paiement($this->db); - $paiement->datepaye = $now; - $paiement->date = $now; - if ($currencyCodeType == $conf->currency) { - $paiement->amounts = [$this->id => $amounttopay]; // Array with all payments dispatching with invoice id - } else { - $paiement->multicurrency_amounts = [$this->id => $amounttopay]; // Array with all payments dispatching - - $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; + // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document + $paiement_id = $paiement->create($user, 1); + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
\n", $paiement->errors); $ispostactionok = -1; - // Not yet supported, so error $error++; $errorforinvoice++; + } else { + $postactionmessages[] = 'Payment created'; } - $paiement->paiementid = $paymentTypeId; - $paiement->num_paiement = ''; - $paiement->num_payment = ''; - // Add a comment with keyword 'SellYourSaas' in text. Used by trigger. - $paiement->note_public = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; - $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; - $paiement->ext_payment_id = $charge->id . ':' . $customer->id . '@' . $stripearrayofkeys['publishable_key']; - $paiement->ext_payment_site = 'stripe'; - if (!$errorforinvoice) { - dol_syslog('* Record payment for invoice id ' . $this->id . '. It includes closing of invoice and regenerating document'); + dol_syslog("The payment has been created for invoice id " . $this->id); + } - // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document - $paiement_id = $paiement->create($user, 1); - if ($paiement_id < 0) { + if (!$errorforinvoice && isModEnabled('banque')) { + dol_syslog('* Add payment to bank'); + + $bankaccountid = 0; + if ($paymentmethod == 'paybox') { + $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + } + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($this->type == Facture::TYPE_CREDIT_NOTE) { + $label = '(CustomerInvoicePaymentBack)'; + } // Refund of a credit note + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $emetteur_name, ''); + if ($result < 0) { $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
\n", $paiement->errors); $ispostactionok = -1; $error++; $errorforinvoice++; } else { - $postactionmessages[] = 'Payment created'; + $postactionmessages[] = 'Bank transaction of payment created (by doTakePaymentStripeForThirdparty)'; } - - dol_syslog("The payment has been created for invoice id " . $this->id); - } - - if (!$errorforinvoice && isModEnabled('banque')) { - dol_syslog('* Add payment to bank'); - - $bankaccountid = 0; - if ($paymentmethod == 'paybox') { - $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; - } - if ($paymentmethod == 'paypal') { - $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; - } - if ($paymentmethod == 'stripe') { - $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; - } - - if ($bankaccountid > 0) { - $label = '(CustomerInvoicePayment)'; - if ($this->type == Facture::TYPE_CREDIT_NOTE) { - $label = '(CustomerInvoicePaymentBack)'; - } // Refund of a credit note - $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $emetteur_name, ''); - if ($result < 0) { - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
\n", $paiement->errors); - $ispostactionok = -1; - $error++; - $errorforinvoice++; - } else { - $postactionmessages[] = 'Bank transaction of payment created (by doTakePaymentStripeForThirdparty)'; - } - } else { - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; - $ispostactionok = -1; - $error++; - $errorforinvoice++; - } - } - - if ($ispostactionok < 1) { - $description = 'Stripe payment OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') but post action KO from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } else { - $description = 'Stripe payment+post action OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + $errorforinvoice++; } } - $object = $invoice; - - // Send emails - $labeltouse = 'InvoicePaymentSuccess'; - $sendemailtocustomer = 1; - - if (empty($charge) || $charge->status == 'failed') { - $labeltouse = 'InvoicePaymentFailure'; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - } - - // Track an event - if (empty($charge) || $charge->status == 'failed') { - $actioncode = 'PAYMENT_STRIPE_KO'; - $extraparams = $stripefailurecode; - $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; - $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; + if ($ispostactionok < 1) { + $description = 'Stripe payment OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') but post action KO from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } else { - $actioncode = 'PAYMENT_STRIPE_OK'; - $extraparams = ''; + $description = 'Stripe payment+post action OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } - } else { - $error++; - $errorforinvoice++; - dol_syslog("No card or payment method found for this stripe customer " . $customer->id, LOG_WARNING); - $this->errors[] = 'Failed to get card | payment method for stripe customer = ' . $customer->id; - - $labeltouse = 'InvoicePaymentFailure'; - $sendemailtocustomer = 1; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - - $description = 'Failed to find or use the payment mode - no credit card defined for the customer account'; - $stripefailurecode = 'BADPAYMENTMODE'; - $stripefailuremessage = 'Failed to find or use the payment mode - no credit card defined for the customer account'; - $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; - - $object = $invoice; - - $actioncode = 'PAYMENT_STRIPE_KO'; - $extraparams = ''; } - } else { - // If error because payment was canceled for a logical reason, we do nothing (no email and no event added) - $labeltouse = ''; - $sendemailtocustomer = 0; - - $description = ''; - $stripefailurecode = ''; - $stripefailuremessage = ''; $object = $invoice; - $actioncode = ''; + // Send emails + $labeltouse = 'InvoicePaymentSuccess'; + $sendemailtocustomer = 1; + + if (empty($charge) || $charge->status == 'failed') { + $labeltouse = 'InvoicePaymentFailure'; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + } + + // Track an event + if (empty($charge) || $charge->status == 'failed') { + $actioncode = 'PAYMENT_STRIPE_KO'; + $extraparams = $stripefailurecode; + $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; + $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; + } else { + $actioncode = 'PAYMENT_STRIPE_OK'; + $extraparams = ''; + } + } else { + $error++; + $errorforinvoice++; + dol_syslog("No card or payment method found for this stripe customer " . $customer->id, LOG_WARNING); + $this->errors[] = 'Failed to get card | payment method for stripe customer = ' . $customer->id; + + $labeltouse = 'InvoicePaymentFailure'; + $sendemailtocustomer = 1; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + + $description = 'Failed to find or use the payment mode - no credit card defined for the customer account'; + $stripefailurecode = 'BADPAYMENTMODE'; + $stripefailuremessage = 'Failed to find or use the payment mode - no credit card defined for the customer account'; + $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; + + $object = $invoice; + + $actioncode = 'PAYMENT_STRIPE_KO'; $extraparams = ''; } - } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { - if ($resultthirdparty <= 0) { - dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); - $this->errors[] = 'Failed to load customer for thirdparty_id = ' . $thirdparty->id; - } else { // $customer stripe not found - dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); - $this->errors[] = 'Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; - } - $error++; - $errorforinvoice++; + } else { + // If error because payment was canceled for a logical reason, we do nothing (no email and no event added) + $labeltouse = ''; + $sendemailtocustomer = 0; - $labeltouse = 'InvoicePaymentFailure'; - $sendemailtocustomer = 1; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - - $description = 'Failed to find or use your payment mode (no payment mode for this customer id)'; - $stripefailurecode = 'BADPAYMENTMODE'; - $stripefailuremessage = 'Failed to find or use your payment mode (no payment mode for this customer id)'; - $postactionmessages = []; + $description = ''; + $stripefailurecode = ''; + $stripefailuremessage = ''; $object = $invoice; - $actioncode = 'PAYMENT_STRIPE_KO'; + $actioncode = ''; $extraparams = ''; } - - // Send email + create action after - if ($sendemailtocustomer && $labeltouse) { - dol_syslog("* Send email with result of payment - " . $labeltouse); - - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - $outputlangs->loadLangs(["main", "members", "bills"]); - - // Get email content from templae - $arraydefaultmessage = null; - - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($this->db); - - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); - - //$substitutionarray['__SELLYOURSAAS_PAYMENT_ERROR_DESC__'] = $stripefailurecode . ' ' . $stripefailuremessage; - - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - // Set the property ->ref_customer with ref_customer of contract so __REF_CLIENT__ will be replaced in email content - // Search contract linked to invoice - $foundcontract = null; - $this->fetchObjectLinked(); - if (is_array($this->linkedObjects['contrat']) && count($this->linkedObjects['contrat']) > 0) { - //dol_sort_array($object->linkedObjects['facture'], 'date'); - foreach ($this->linkedObjects['contrat'] as $idcontract => $contract) { - $substitutionarray['__CONTRACT_REF__'] = $contract->ref_customer; - $substitutionarray['__REFCLIENT__'] = $contract->ref_customer; // For backward compatibility - $substitutionarray['__REF_CLIENT__'] = $contract->ref_customer; - $foundcontract = $contract; - break; - } - } - - dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__=' . $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - - //erics - erreur de réécriture de l'url de téléchargement direct de la facture ... le lien de base est le bon - //on cherche donc d'ou vien le pb ... - //$urlforsellyoursaasaccount = getRootUrlForAccount($foundcontract); - // if ($urlforsellyoursaasaccount) { - // $tmpforurl = preg_replace('/.*document.php/', '', $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - // if ($tmpforurl) { - // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 1, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); - // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount . '/source/document.php' . $tmpforurl; - // } else { - // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 2, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); - // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount; - // } - // } - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - // Attach a file ? - $file = ''; - $listofpaths = []; - $listofnames = []; - $listofmimes = []; - if (is_object($invoice)) { - $invoicediroutput = $conf->facture->dir_output; - //erics - choix du PDF a joindre aux mails - $fileparams = dol_most_recent_file($invoicediroutput . '/' . $this->ref, preg_quote($this->ref, '/') . '[^\-]+*.pdf'); - $file = $fileparams['fullname']; - //$file = $invoicediroutput . '/' . $this->ref . '/' . $this->ref . '.pdf'; - // $file = ''; // Disable attachment of invoice in emails - - if ($file) { - $listofpaths = [$file]; - $listofnames = [basename($file)]; - $listofmimes = [dol_mimetype($file)]; - } - } - $from = "";//$conf->global->SELLYOURSAAS_NOREPLY_EMAIL; - - $trackid = 'inv' . $this->id; - $moreinheader = 'X-Dolibarr-Info: doTakeStripePaymentForThirdParty' . "\r\n"; - - // Send email (substitutionarray must be done just before this) - include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subjecttosend, $this->thirdparty->email, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, -1, '', '', $trackid, $moreinheader); - if ($mailfile->sendfile()) { - $result = 1; - } else { - $this->error = $langs->trans("ErrorFailedToSendMail", $from, $this->thirdparty->email) . '. ' . $mailfile->error; - $result = -1; - } - - if ($result < 0) { - $errmsg = $this->error; - $postactionmessages[] = $errmsg; - $ispostactionok = -1; - } else { - if ($file) { - $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' with invoice document attached: ' . $file . ', language = ' . $outputlangs->defaultlang . ')'; - } else { - $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' without any attached document, language = ' . $outputlangs->defaultlang . ')'; - } - } + } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { + if ($resultthirdparty <= 0) { + dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); + $this->errors[] = 'Failed to load customer for thirdparty_id = ' . $thirdparty->id; + } else { // $customer stripe not found + dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); + $this->errors[] = 'Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; } - - if ($description) { - dol_syslog("* Record event for payment result - " . $description); - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - - // Insert record of payment (success or error) - $actioncomm = new ActionComm($this->db); - - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) - $actioncomm->code = 'AC_' . $actioncode; - $actioncomm->label = $description; - $actioncomm->note_private = join(",\n", $postactionmessages); - $actioncomm->fk_project = $this->fk_project; - $actioncomm->datep = $now; - $actioncomm->datef = $now; - $actioncomm->percentage = -1; // Not applicable - $actioncomm->socid = $thirdparty->id; - $actioncomm->contactid = 0; - $actioncomm->authorid = $user->id; // User saving action - $actioncomm->userownerid = $user->id; // Owner of action - // Fields when action is a real email (content is already into note) - /*$actioncomm->email_msgid = $object->email_msgid; - $actioncomm->email_from = $object->email_from; - $actioncomm->email_sender= $object->email_sender; - $actioncomm->email_to = $object->email_to; - $actioncomm->email_tocc = $object->email_tocc; - $actioncomm->email_tobcc = $object->email_tobcc; - $actioncomm->email_subject = $object->email_subject; - $actioncomm->errors_to = $object->errors_to;*/ - $actioncomm->fk_element = $this->id; - $actioncomm->elementtype = $this->element; - $actioncomm->extraparams = dol_trunc($extraparams, 250); - - $actioncomm->create($user); - } - - $this->description = $description; - $this->postactionmessages = $postactionmessages; - } catch (Exception $e) { $error++; $errorforinvoice++; - dol_syslog('Error ' . $e->getMessage(), LOG_ERR); - $this->errors[] = 'Error ' . $e->getMessage(); + + $labeltouse = 'InvoicePaymentFailure'; + $sendemailtocustomer = 1; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + + $description = 'Failed to find or use your payment mode (no payment mode for this customer id)'; + $stripefailurecode = 'BADPAYMENTMODE'; + $stripefailuremessage = 'Failed to find or use your payment mode (no payment mode for this customer id)'; + $postactionmessages = []; + + $object = $invoice; + + $actioncode = 'PAYMENT_STRIPE_KO'; + $extraparams = ''; } - } else { // If remain to pay is null + + // Send email + create action after + if ($sendemailtocustomer && $labeltouse) { + dol_syslog("* Send email with result of payment - " . $labeltouse); + + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(["main", "members", "bills"]); + + // Get email content from templae + $arraydefaultmessage = null; + + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($this->db); + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + + //$substitutionarray['__SELLYOURSAAS_PAYMENT_ERROR_DESC__'] = $stripefailurecode . ' ' . $stripefailuremessage; + + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + // Set the property ->ref_customer with ref_customer of contract so __REF_CLIENT__ will be replaced in email content + // Search contract linked to invoice + $foundcontract = null; + $this->fetchObjectLinked(); + if (is_array($this->linkedObjects['contrat']) && count($this->linkedObjects['contrat']) > 0) { + //dol_sort_array($object->linkedObjects['facture'], 'date'); + foreach ($this->linkedObjects['contrat'] as $idcontract => $contract) { + $substitutionarray['__CONTRACT_REF__'] = $contract->ref_customer; + $substitutionarray['__REFCLIENT__'] = $contract->ref_customer; // For backward compatibility + $substitutionarray['__REF_CLIENT__'] = $contract->ref_customer; + $foundcontract = $contract; + break; + } + } + + dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__=' . $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); + + //erics - erreur de réécriture de l'url de téléchargement direct de la facture ... le lien de base est le bon + //on cherche donc d'ou vien le pb ... + //$urlforsellyoursaasaccount = getRootUrlForAccount($foundcontract); + // if ($urlforsellyoursaasaccount) { + // $tmpforurl = preg_replace('/.*document.php/', '', $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); + // if ($tmpforurl) { + // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 1, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); + // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount . '/source/document.php' . $tmpforurl; + // } else { + // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 2, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); + // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount; + // } + // } + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + // Attach a file ? + $file = ''; + $listofpaths = []; + $listofnames = []; + $listofmimes = []; + if (is_object($invoice)) { + $invoicediroutput = $conf->facture->dir_output; + //erics - choix du PDF a joindre aux mails + $fileparams = dol_most_recent_file($invoicediroutput . '/' . $this->ref, preg_quote($this->ref, '/') . '[^\-]+*.pdf'); + $file = $fileparams['fullname']; + //$file = $invoicediroutput . '/' . $this->ref . '/' . $this->ref . '.pdf'; + // $file = ''; // Disable attachment of invoice in emails + + if ($file) { + $listofpaths = [$file]; + $listofnames = [basename($file)]; + $listofmimes = [dol_mimetype($file)]; + } + } + $from = "";//$conf->global->SELLYOURSAAS_NOREPLY_EMAIL; + + $trackid = 'inv' . $this->id; + $moreinheader = 'X-Dolibarr-Info: makeStripeSepaRequest' . "\r\n"; + + // Send email (substitutionarray must be done just before this) + include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subjecttosend, $this->thirdparty->email, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, -1, '', '', $trackid, $moreinheader); + if ($mailfile->sendfile()) { + $result = 1; + } else { + $this->error = $langs->trans("ErrorFailedToSendMail", $from, $this->thirdparty->email) . '. ' . $mailfile->error; + $result = -1; + } + + if ($result < 0) { + $errmsg = $this->error; + $postactionmessages[] = $errmsg; + $ispostactionok = -1; + } else { + if ($file) { + $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' with invoice document attached: ' . $file . ', language = ' . $outputlangs->defaultlang . ')'; + } else { + $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' without any attached document, language = ' . $outputlangs->defaultlang . ')'; + } + } + } + + if ($description) { + dol_syslog("* Record event for payment result - " . $description); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + + // Insert record of payment (success or error) + $actioncomm = new ActionComm($this->db); + + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) + $actioncomm->code = 'AC_' . $actioncode; + $actioncomm->label = $description; + $actioncomm->note_private = join(",\n", $postactionmessages); + $actioncomm->fk_project = $this->fk_project; + $actioncomm->datep = $now; + $actioncomm->datef = $now; + $actioncomm->percentage = -1; // Not applicable + $actioncomm->socid = $thirdparty->id; + $actioncomm->contactid = 0; + $actioncomm->authorid = $user->id; // User saving action + $actioncomm->userownerid = $user->id; // Owner of action + // Fields when action is a real email (content is already into note) + /*$actioncomm->email_msgid = $object->email_msgid; + $actioncomm->email_from = $object->email_from; + $actioncomm->email_sender= $object->email_sender; + $actioncomm->email_to = $object->email_to; + $actioncomm->email_tocc = $object->email_tocc; + $actioncomm->email_tobcc = $object->email_tobcc; + $actioncomm->email_subject = $object->email_subject; + $actioncomm->errors_to = $object->errors_to;*/ + $actioncomm->fk_element = $this->id; + $actioncomm->elementtype = $this->element; + $actioncomm->extraparams = dol_trunc($extraparams, 250); + + $actioncomm->create($user); + } + + $this->description = $description; + $this->postactionmessages = $postactionmessages; + } catch (Exception $e) { $error++; $errorforinvoice++; - dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); - $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; + dol_syslog('Error ' . $e->getMessage(), LOG_ERR); + $this->errors[] = 'Error ' . $e->getMessage(); } + } else { // If remain to pay is null + $error++; + $errorforinvoice++; + dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); + $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; + } - $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande("; - $sql .= "fk_facture, "; - $sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)"; - $sql .= " VALUES (".$this->id; - $sql .= ",".((float) price2num($amount)); - $sql .= ",'".$this->db->idate($now)."'"; - $sql .= ",".((int) $fuser->id); - $sql .= ",'".$this->db->escape($stripe_id)."'"; - $sql .= ",'".$this->db->escape($stripe_uri)."'"; - $sql .= ",'".$this->db->escape($sourcetype)."'"; - $sql .= ",".$conf->entity; - $sql .= ")"; + $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande("; + $sql .= "fk_facture, "; + $sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)"; + $sql .= " VALUES (".$this->id; + $sql .= ",".((float) price2num($amount)); + $sql .= ",'".$this->db->idate($now)."'"; + $sql .= ",".((int) $fuser->id); + $sql .= ",'".$this->db->escape($stripe_id)."'"; + $sql .= ",'".$this->db->escape($stripe_uri)."'"; + $sql .= ",'".$this->db->escape($sourcetype)."'"; + $sql .= ",".$conf->entity; + $sql .= ")"; - dol_syslog(get_class($this)."::demande_prelevement_stripe", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur'); - $error++; - } - } else { - $this->error = 'WithdrawRequestErrorNilAmount'; - dol_syslog(get_class($this).'::demande_prelevement_stripe WithdrawRequestErrorNilAmount'); + dol_syslog(get_class($this)."::makeStripeSepaRequest", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this).'::makeStripeSepaRequest Erreur'); $error++; } - - if (!$error) { - // Force payment mode of invoice to withdraw - $payment_mode_id = dol_getIdFromCode($this->db, ($type == 'bank-transfer' ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1); - if ($payment_mode_id > 0) { - $result = $this->setPaymentMethods($payment_mode_id); - } - } - - if ($error) { - return -1; - } - return 1; } else { - $this->error = "A request already exists"; - dol_syslog(get_class($this).'::demande_prelevement_stripe Impossible de creer une demande, demande deja en cours'); - return 0; + $this->error = 'WithdrawRequestErrorNilAmount'; + dol_syslog(get_class($this).'::makeStripeSepaRequest WithdrawRequestErrorNilAmount'); + $error++; } + + if (!$error) { + // Force payment mode of invoice to withdraw + $payment_mode_id = dol_getIdFromCode($this->db, ($type == 'bank-transfer' ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1); + if ($payment_mode_id > 0) { + $result = $this->setPaymentMethods($payment_mode_id); + } + } + + if ($error) { + return -1; + } + return 1; } else { $this->error = $this->db->error(); - dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur -2'); + dol_syslog(get_class($this).'::makeStripeSepaRequest Erreur -2'); return -2; } } else { $this->error = "Status of invoice does not allow this"; - dol_syslog(get_class($this)."::demande_prelevement_stripe ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); + dol_syslog(get_class($this)."::makeStripeSepaRequest ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); return -3; } } diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index db8257ba504..2a3f988cebf 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -70,4 +70,5 @@ ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mo PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. ClickHereToTryAgain=Click here to try again... CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s -TERMINAL_LOCATION=Location (address) for terminals \ No newline at end of file +TERMINAL_LOCATION=Location (address) for terminals +RequestDirectDebitWithStripe=Request Direct Debit with Stripe \ No newline at end of file From a14a546906e2dd3f476d5ebea40c0057f59e0a17 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 13 Oct 2022 07:48:52 +0200 Subject: [PATCH 0912/1289] FIX wrong var typo --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d0b64fdca77..82012400f68 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -950,7 +950,7 @@ abstract class CommonDocGenerator } } - if (array_key_exists('option_'.$key, $object->array_options)) { + if (array_key_exists('options_'.$key, $object->array_options)) { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); } else { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => '')); From a5a260b3175731400c02249a738a6391ee210651 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 13 Oct 2022 08:13:58 +0200 Subject: [PATCH 0913/1289] FIX wrong typo, remove quote --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f3eb754b48..a1e55237aa4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3491,7 +3491,7 @@ class Product extends CommonObject global $db, $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; - $sql .= " COUNT(fd.rowid) as nb_rows, SUM('fd.qty') as qty"; + $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as fd"; $sql .= ", ".MAIN_DB_PREFIX."facture_rec as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; From 9ec41c1a449e2d5b92c3f63880be94453c86f584 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 13 Oct 2022 08:34:23 +0200 Subject: [PATCH 0914/1289] FIX avoid error, fetch of product is mandatory (by id or by ref) --- htdocs/product/stats/facture.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index c62c421d6e4..9b3ee0ad5e4 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -200,12 +200,12 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + // Fetch of product is mandatory + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } From 9b37754b858d65082daa928afc0d82c09a9d4ffd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 13 Oct 2022 09:10:22 +0200 Subject: [PATCH 0915/1289] FIX check $id is already check before --- htdocs/product/stats/bom.php | 5 ++--- htdocs/product/stats/commande.php | 5 ++--- htdocs/product/stats/commande_fournisseur.php | 5 ++--- htdocs/product/stats/contrat.php | 5 ++--- htdocs/product/stats/facture.php | 1 - htdocs/product/stats/facture_fournisseur.php | 5 ++--- htdocs/product/stats/facturerec.php | 5 ++--- htdocs/product/stats/mo.php | 5 ++--- htdocs/product/stats/propal.php | 5 ++--- htdocs/product/stats/supplier_proposal.php | 5 ++--- 10 files changed, 18 insertions(+), 28 deletions(-) diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index a8e76a178bf..f423dd2ec6f 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -258,12 +258,11 @@ if ($id > 0 || !empty($ref)) { } $db->free($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 9f38f68ee33..6d13bb95f00 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -183,12 +183,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 5a236334b5e..222db432bdf 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -184,12 +184,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 03bb1828f66..f831d54d097 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -169,12 +169,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 9b3ee0ad5e4..a83472b4341 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -200,7 +200,6 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - // Fetch of product is mandatory $option .= '&id='.$product->id; if ($limit > 0 && $limit != $conf->liste_limit) { diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 59ca77d5937..be6964a26be 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -183,12 +183,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index b71c24d75cb..5a31e16c26a 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -201,12 +201,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 38bebc562ed..edd20a7ee64 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -162,12 +162,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 2f6faca07a7..d13b01c8bdc 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -185,12 +185,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 2136b9b26cf..afde5fe27f8 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -184,12 +184,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } From 21145a1d59d536f5dcd14315c49d52a0650c43ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 13 Oct 2022 09:41:49 +0200 Subject: [PATCH 0916/1289] fix warnings --- .../product/stock/stocktransfer/class/stocktransfer.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index a71098fc2bf..5ffb56ced44 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -229,7 +229,7 @@ class StockTransfer extends CommonObject // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (is_array($val['arrayofkeyval'])) { + if (isset($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } From 93e8ca25c51a46cdca6e327bd79f3afd6c1ab63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 13 Oct 2022 09:51:00 +0200 Subject: [PATCH 0917/1289] fix warnings --- htdocs/admin/emailcollector_list.php | 4 +-- htdocs/admin/stocktransfer.php | 29 +++++++------------ .../class/stocktransfer.class.php | 2 +- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 075ece751ce..3be38cca113 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/emailcollector/class/emailcollector.class.php'); +require_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollector.class.php'; // Load translation files required by page $langs->loadLangs(array("admin", "other")); @@ -50,7 +50,7 @@ $mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 099312ef491..3bcd00c1fe8 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -24,19 +24,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'; global $langs, $user; @@ -56,6 +44,8 @@ $action = GETPOST('action', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $arrayofparameters = array( 'STOCKTRANSFER_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), @@ -70,9 +60,8 @@ $setupnotempty = 0; * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + if ($action == 'updateMask') { $maskconststocktransfer = GETPOST('maskconststocktransfer', 'alpha'); @@ -131,7 +120,9 @@ if ($action == 'updateMask') { $ret = delDocumentModel($value, 'stocktransfer'); if ($ret > 0) { $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF'; - if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity); + if (getDolGlobalString($constforval) == "$value") { + dolibarr_del_const($db, $constforval, $conf->entity); + } } } elseif ($action == 'setdoc') { // Set default model $tmpobjectkey = 'StockTransfer'; @@ -294,7 +285,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { print ''; $constforvar = 'STOCKTRANSFER_'.strtoupper($myTmpObjectKey).'_ADDON'; - if ($conf->global->$constforvar == $file) { + if (getDolGlobalString($constforvar) == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; @@ -428,7 +419,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Default print ''; $constforvar = strtoupper($myTmpObjectKey).'_ADDON_PDF'; - if ($conf->global->$constforvar == $name) { + if (getDolGlobalString($constforvar) == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index a71098fc2bf..a523aa17649 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -229,7 +229,7 @@ class StockTransfer extends CommonObject // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (is_array($val['arrayofkeyval'])) { + if (isset($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } From 7b3b82940f1eed3f41ddfec46f0b356cdb9bc2e1 Mon Sep 17 00:00:00 2001 From: Faustin Date: Thu, 13 Oct 2022 10:21:34 +0200 Subject: [PATCH 0918/1289] commentary --- htdocs/adherents/admin/member.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index d00edc10fb7..d20bd784ced 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -228,7 +228,7 @@ print ''; print ''; -/** Main options */ +// Main options print load_fiche_titre($langs->trans("MemberMainOptions"), '', ''); @@ -324,7 +324,7 @@ print ''; print '
'; -/** Document templates for documents generated from member record */ +// Document templates for documents generated from member record $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -464,7 +464,7 @@ print '
'; -/** Generation of cards for members */ +// Generation of cards for members print '
'; print ''; @@ -531,7 +531,7 @@ print '
'; print '
'; -/** Membership address sheet */ +// Membership address sheet print '
'; print ''; From 4e416dbdadee3a282541647ebcdfad9d618f0a2b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 13 Oct 2022 10:24:37 +0200 Subject: [PATCH 0919/1289] Update llx_10_c_regions.sql --- htdocs/install/mysql/data/llx_10_c_regions.sql | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index ffd02aa9cf9..52a1a3bbbb6 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -4,12 +4,12 @@ -- Copyright (C) 2004 Benoit Mortier -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin --- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2010-2016 Juanjo Menent -- Copyright (C) 2012 Sebastian Neuwert --- Copyright (C) 2012 Ricardo Schluter --- Copyright (C) 2015 Ferran Marcet --- Copyright (C) 2019~ Lao Tian <281388879@qq.com> +-- Copyright (C) 2012 Ricardo Schluter +-- Copyright (C) 2015 Ferran Marcet +-- Copyright (C) 2019~ Lao Tian <281388879@qq.com> -- Copyright (C) 2020-2021 Udo Tamm -- Copyright (C) 2022 Miro Sertić -- @@ -52,11 +52,12 @@ -- Belgium -- Bolivia -- Brazil -> for Departmements +-- Burundi -- Canada -> for Departmements -- Chile -- China -- Colombie -> for Departmements --- Croatia -> for Departmements +-- Croatia -- Denmark -- France -- Germany -> for Departmements @@ -66,6 +67,7 @@ -- India -> for Departmements -- Indonesia -> for Departmements -- Italy +-- Japan -> only for Departmements -- Luxembourg -- Mauritius -- Mexique -> for Departmements @@ -332,6 +334,10 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 320, NULL, 1, 'Veneto'); +-- Japan Region (id country=123) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 123, 12301, '', 0,'日本'); + + -- Luxembourg Regions (districts) (id country=140) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 140, 14001, '', 0, 'Diekirch'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 140, 14002, '', 0, 'Grevenmacher'); @@ -533,5 +539,3 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana'); --- Japan Region (id country=123) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 123, 12301, '', 0,'日本'); From 8850412da8de3a275ddda09b0b55d56db7ca62b0 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 13 Oct 2022 11:25:42 +0200 Subject: [PATCH 0920/1289] FIX : input selector is wrong with PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES usage --- 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 f978a436354..d6b632c1bd9 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -733,7 +733,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { global->PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES)) { ?> jQuery.each(data.array_options, function( key, value ) { - jQuery('div[class$="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); + jQuery('div[class*="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); }); From 1cec84c21a9b6a2bb27cd3fd1542ed1375cb0b43 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 13 Oct 2022 12:18:25 +0200 Subject: [PATCH 0921/1289] FIX : private message ticket become public if edit action --- htdocs/comm/action/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 02f52de7388..a27404eab8c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -534,7 +534,11 @@ if (empty($reshook) && $action == 'update') { $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); } - $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + if($object->code = 'TICKET_MSG_PRIVATE') { + $object->type_code = 'TICKET_MSG_PRIVATE'; + } else { + $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + } $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; @@ -1508,7 +1512,7 @@ if ($id > 0) { if ($backtopage) { print ''; } - if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->code != "TICKET_MSG_PRIVATE") { print ''; } From 8f5c05f577907d7bfd413ac778ccc774e22bbdd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 12:22:16 +0200 Subject: [PATCH 0922/1289] Add price in local format in json response --- htdocs/core/class/html.form.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 107cf07c23d..02cfc44b284 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3146,6 +3146,8 @@ class Form 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), + 'price_ht_locale'=>price(price2num($outprice_ht)), + 'price_ttc_locale'=>price(price2num($outprice_ttc)), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'default_vat_code'=>$outdefault_vat_code, @@ -3247,9 +3249,9 @@ class Form $sql .= " pfp.supplier_reputation"; // if we use supplier description of the products if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { - $sql .= " ,pfp.desc_fourn as description"; + $sql .= ", pfp.desc_fourn as description"; } else { - $sql .= " ,p.description"; + $sql .= ", p.description"; } // Units if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -3532,7 +3534,7 @@ class Form $opt .= ' disabled'; } if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { - $opt .= ' data-product-id="'.$objp->rowid.'" data-price-id="'.$objp->idprodfournprice.'" data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'" data-tvatx="'.$objp->tva_tx.'"'; + $opt .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'" data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'" data-qty="'.dol_escape_htmltag($objp->quantity).'" data-up="'.dol_escape_htmltag($objp->unitprice).'" data-discount="'.dol_escape_htmltag($outdiscount).'" data-tvatx="'.dol_escape_htmltag($objp->tva_tx).'"'; } $opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; $opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"'; @@ -3553,9 +3555,11 @@ class Form 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, - 'price_qty_ht'=>price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty + 'price_qty_ht'=>price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty 'price_unit_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price 'price_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) + 'price_qty_ht_locale'=>price($objp->fprice), + 'price_unit_ht_locale'=>price($objp->unitprice), 'tva_tx'=>$objp->tva_tx, 'default_vat_code'=>$objp->default_vat_code, 'discount'=>$outdiscount, From 409b137ba714534b709ed5b40494e7b3294216a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 14:31:08 +0200 Subject: [PATCH 0923/1289] Try a better fix for #22535 #22536 --- htdocs/core/class/html.form.class.php | 8 ++++- htdocs/core/lib/ajax.lib.php | 11 +++++- htdocs/core/tpl/objectline_create.tpl.php | 43 ++++++++++++++--------- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 02cfc44b284..5ed1f76227b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3534,7 +3534,13 @@ class Form $opt .= ' disabled'; } if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { - $opt .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'" data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'" data-qty="'.dol_escape_htmltag($objp->quantity).'" data-up="'.dol_escape_htmltag($objp->unitprice).'" data-discount="'.dol_escape_htmltag($outdiscount).'" data-tvatx="'.dol_escape_htmltag($objp->tva_tx).'"'; + $opt .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; + $opt .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; + $opt .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; + $opt .= ' data-up="'.dol_escape_htmltag($objp->unitprice).'"'; + $opt .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; + $opt .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; + $opt .= ' data-tvatx="'.dol_escape_htmltag($objp->tva_tx).'"'; } $opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; $opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"'; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index fb3b35b31bb..a6d269a6bb2 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -143,8 +143,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen textarea[key] = item[value]; }); } + console.log("Return value from GET to the rest of code"); - return { label: label, value: item.value, id: item.key, disabled: item.disabled, + return { label: label, + value: item.value, + id: item.key, + disabled: item.disabled, update: update, textarea: textarea, pbq: item.pbq, @@ -154,6 +158,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen pricebasetype: item.pricebasetype, price_ht: item.price_ht, price_ttc: item.price_ttc, + price_unit_ht: item.price_unit_ht, + price_unit_ht_locale: item.price_unit_ht_locale, description : item.description, ref_customer: item.ref_customer, tva_tx: item.tva_tx } @@ -173,6 +179,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen // For supplier price and customer when price by quantity is off $("#'.$htmlnamejquery.'").attr("data-up", ui.item.price_ht); + $("#'.$htmlnamejquery.'").attr("data-up-locale", ui.item.price_unit_ht_locale); $("#'.$htmlnamejquery.'").attr("data-base", ui.item.pricebasetype); $("#'.$htmlnamejquery.'").attr("data-qty", ui.item.qty); $("#'.$htmlnamejquery.'").attr("data-discount", ui.item.discount); @@ -191,6 +198,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen '; } $script .= ' + // A new value has been selected, we trigger the handlers on #htmlnamejquery + console.log("Trigger changes on #'.$htmlnamejquery.'"); $("#'.$htmlnamejquery.'").val(ui.item.id).trigger("change"); // Select new value // Disable an element diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ba5c71c399b..76d2282e9cc 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -291,7 +291,9 @@ if ($nolinesbefore) { $alsoproductwithnosupplierprice = 0; } else { $ajaxoptions = array( - 'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key + // Disabled: This is useless because setting discount and price_ht after a selection is already managed + // by ths page itself with a .change on the combolist '#idprodfournprice' + //'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key ); $alsoproductwithnosupplierprice = 1; } @@ -711,7 +713,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { - console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); + console.log("objectline_create.tpl Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva jQuery('#trlinefordates').show(); @@ -724,7 +726,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0) { - console.log("We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later"); + console.log("objectline_create.tpl We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later"); } else { global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { ?> if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); } @@ -734,7 +736,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { $.post('/product/ajax/products.php?action=fetch', { 'id': $(this).val(), 'socid': socid; ?> }, function(data) { - console.log("Load unit price end, we got value "+data.price_ht); + console.log("objectline_create.tpl Load unit price end, we got value "+data.price_ht); $('#date_start').removeAttr('type'); $('#date_end').removeAttr('type'); @@ -755,6 +757,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery('#date_end').removeClass('inputmandatory'); } + console.log("objectline_create.tpl set content of price_ht"); jQuery("#price_ht").val(data.price_ht); global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) { @@ -765,7 +768,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { var proddesc = data.desc; - console.log("Load desciption into text area : "+proddesc); + console.log("objectline_create.tpl Load desciption into text area : "+proddesc); global->FCKEDITOR_ENABLE_DETAILS)) { ?> if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") @@ -829,7 +832,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { print 'costprice'; } } ?>'; - console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice); + console.log("objectline_create.tpl we will set the field for margin. defaultbuyprice="+defaultbuyprice); var i = 0; $(data).each(function() { @@ -940,11 +943,16 @@ if (!empty($usemargins) && $user->rights->margins->creer) { - //Deal with supplier - if (jQuery('#idprodfournprice').val() >0) + // Deal with supplier + if (jQuery('#idprodfournprice').val() > 0) { + console.log("objectline_create.tpl #idprodfournprice is > 0, so we set some properties into page"); + var up = parseFloat($('option:selected', this).attr('data-up')); // When select is done from HTML select - if (isNaN(up)) { up = parseFloat(jQuery('#idprodfournprice').attr('data-up'));} // When select is done from HTML input with autocomplete + if (isNaN(up)) { up = parseFloat(jQuery('#idprodfournprice').attr('data-up'));} // When select is done from HTML input with ajax autocomplete + + var up_locale = $('option:selected', this).attr('data-up-locale'); // When select is done from HTML select + if (typeof up_locale === 'undefined') { up_locale = jQuery('#idprodfournprice').attr('data-up-locale');} // When select is done from HTML input with ajax autocomplete var qty = parseFloat($('option:selected', this).attr('data-qty')); if (isNaN(qty)) { qty = parseFloat(jQuery('#idprodfournprice').attr('data-qty'));} @@ -953,11 +961,15 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if (isNaN(discount)) { discount = parseFloat(jQuery('#idprodfournprice').attr('data-discount'));} var tva_tx = parseFloat($('option:selected', this).attr('data-tvatx')); // When select is done from HTML select - if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery('#idprodfournprice').attr('data-tvatx'));} // When select is done from HTML input with autocomplete + if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery('#idprodfournprice').attr('data-tvatx'));} // When select is done from HTML input with ajax autocomplete - console.log("We find supplier price :"+up+" qty: "+qty+" tva_tx="+tva_tx+" discount: "+discount+" for product "+jQuery('#idprodfournprice').val()); + console.log("objectline_create.tpl We find supplier price : up = "+up+", up_locale = "+up_locale+", qty = "+qty+", tva_tx = "+tva_tx+", discount = "+discount+" for product "+jQuery('#idprodfournprice').val()); - jQuery("#price_ht").val(up); + if (typeof up_locale === 'undefined') { + jQuery("#price_ht").val(up); + } else { + jQuery("#price_ht").val(up_locale); + } /* $('#tva_tx option').removeAttr('selected').filter('[value='+tva_tx+']').prop('selected', true); */ $('#tva_tx option').val(tva_tx); @@ -965,8 +977,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if (jQuery("#qty").val() < qty) { jQuery("#qty").val(qty); } - if (jQuery("#remise_percent").val() < discount) - { + if (jQuery("#remise_percent").val() < discount) { jQuery("#remise_percent").val(discount); } @@ -1033,7 +1044,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* Function to set fields from choice */ function setforfree() { - console.log("Call setforfree. We show most fields"); + console.log("objectline_create.tpl::setforfree. We show most fields"); jQuery("#idprodfournprice").val('0'); // Set cursor on not selected product jQuery("#prod_entry_mode_free").prop('checked',true).change(); jQuery("#prod_entry_mode_predef").prop('checked',false).change(); @@ -1044,7 +1055,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } function setforpredef() { - console.log("Call setforpredef. We hide some fields and show dates"); + console.log("objectline_create.tpl::setforpredef We hide some fields, show dates"); jQuery("#select_type").val(-1); jQuery("#prod_entry_mode_free").prop('checked',false).change(); jQuery("#prod_entry_mode_predef").prop('checked',true).change(); From 44e774c1e1f8ec4152fed9faf6295ba254d84221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 17:22:29 +0200 Subject: [PATCH 0924/1289] css --- htdocs/core/ajax/ajaxdirtree.php | 6 +++--- htdocs/theme/eldy/global.inc.php | 7 +++++++ htdocs/theme/md/style.css.php | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 7daa715bbb9..47de50d0fd8 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -412,15 +412,15 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened)) { $collapsedorexpanded = 'expanded'; } - print '
  • '; // collapsed is opposite if expanded + print '
  • '; // collapsed is opposite if expanded - print ""; print dol_escape_htmltag($file); - print ""; + print "
  • "; print '
    '; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index da006de3616..4b1ccc36bc0 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3318,7 +3318,14 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { font-weight: bold !important; } +.divfmdirlia { + width: calc(100% - 100px); +} +a.fmdirlia { + white-space: break-spaces; + word-break: break-all; +} /* ============================================================================== */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 874e77985a2..687242d2451 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3303,6 +3303,11 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { font-weight: bold !important; } +a.fmdirlia { + white-space: break-spaces; + word-break: break-all; +} + /* ============================================================================== */ /* Onglets */ From ae67220d5f81324b89162d26e3845b7b557c68a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 17:59:13 +0200 Subject: [PATCH 0925/1289] css --- htdocs/fourn/facture/card.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 54ee8157e13..f00406d63fd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2919,7 +2919,7 @@ if ($action == 'create') { print '
    '; print '
    '; - print ''; + print '
    '; // Type print '
    '.$langs->trans('Type').''; @@ -3015,7 +3015,7 @@ if ($action == 'create') { // Default terms of the settlement $langs->load('bills'); print '
    '; - print '
    '; + print ''; } + // Note private + if (!empty($arrayfields['t.note_private']['checked'])) { + print ''; + } + // Role if (!empty($arrayfields['sc.role']['checked'])) { print ''; } elseif ($key == 'type_code') { print ''; } elseif ($key == 'category_code') { print ''; + } else { + print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; } - print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print ''; + // AWP print ''; + print ''; } print '
    '; print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions' && $form_permission) { @@ -3044,7 +3044,7 @@ if ($action == 'create') { // Mode of payment $langs->load('bills'); print '
    '; - print ''; print ''; print ''; // Customer proposals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { $nblines++; $ret = $product->load_stats_propale($socid); if ($ret < 0) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 046d1da2f0e..10c50ca99ee 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -157,15 +157,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index ee4e17ae19e..8b1261f35f0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -943,7 +943,7 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propale->lire + 'test' => $conf->propal->enabled && $user->rights->propal->lire ), 'order' => array( 'title' => "ListOrdersAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index c60f2c4bb66..9947bb49b0b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'test'=>$conf->propal->enabled && $user->rights->propale->lire, + 'test'=>$conf->propal->enabled && $user->rights->propal->lire, 'lang'=>'propal'), 'order'=>array( 'name'=>"CustomersOrders", diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 5f463e44846..9d9bd226fd6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -41,7 +41,7 @@ $module = $object->element; // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index dfa9b0e4591..9a9c5866023 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -60,7 +60,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index 60bb56ff173..81e3f9f2155 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -43,7 +43,7 @@ $value_private .= "\n"; /* // Special cases if ($module == 'propal') { -$permission = $user->rights->propale->creer; +$permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2071171feba..8eac47207cd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2831,7 +2831,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == //print '
    '; // Propals - if (isModEnabled("propal") && $user->rights->propale->creer) { + if (isModEnabled("propal") && $user->rights->propal->creer) { $propal = new Propal($db); $langs->load("propal"); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index a2bcceab0e5..b0d06f15701 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -440,7 +440,7 @@ if ($result || !($id > 0)) { continue; } - if ($graphfiles == 'propal' && !$user->rights->propale->lire) { + if ($graphfiles == 'propal' && !$user->rights->propal->lire) { continue; } if ($graphfiles == 'order' && !$user->rights->commande->lire) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 4919ffdba84..b70d2e08161 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 538fc6aa362..50b17b0ac06 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; //$sql .= " p.ref_supplier,"; $sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 01ffe38cc0d..346382c6294 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -388,7 +388,7 @@ $listofreferent = array( 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, - 'test'=>$conf->propal->enabled && $user->rights->propale->lire), + 'test'=>$conf->propal->enabled && $user->rights->propal->lire), 'order'=>array( 'name'=>"CustomersOrders", 'title'=>"ListOrdersAssociatedProject", From 0e7bd30f35c2205bfd6f1dfa559da64dd4582d28 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 16 Oct 2022 16:50:11 +0200 Subject: [PATCH 0965/1289] FIX wrong module name --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b11ed9a6158..dcf9bb7d96d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2469,7 +2469,7 @@ function printDropdownQuickadd() "title" => "NewPropal@propal", "name" => "Proposal@propal", "picto" => "object_propal", - "activation" => isModEnabled("propal") && $user->hasRight("propale", "write"), // vs hooking + "activation" => isModEnabled("propal") && $user->hasRight("propal", "write"), // vs hooking "position" => 30, ), From 134d35923fa0a52e63e24e3e6fe49e952f5a0f5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Oct 2022 19:51:15 +0200 Subject: [PATCH 0966/1289] FIX edit of date of vendor invoice --- htdocs/fourn/facture/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 42b5d34f880..6dbe069be25 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3002,8 +3002,8 @@ if ($action == 'create') { print '
    '; print ''; - $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); - $form_permission2 = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate; + //$form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); + $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate; // Date print ''; // Host server print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { print ''; // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID) ? $conf->global->MAIN_MAIL_SMTPS_ID : ''); print ''; // Host server - if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { print ''; } else { print ''; @@ -692,31 +698,31 @@ if ($action == 'edit') { // Port - if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { print ''; } else { print ''; } // SMTPS ID - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { print ''; } // AUTH method - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE', 'LOGIN'); $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; print ''; } // SMTPS PW - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") { print ''; } // SMTPS oauth service - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { $text = $oauthservices[$conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); @@ -726,7 +732,7 @@ if ($action == 'edit') { // TLS print '
    '; + print ''; if ($action != 'editmode' && $form_permission2) { @@ -3326,12 +3326,13 @@ if ($action == 'create') { $paymentstatic->type_label = $objp->payment_type; print ''; - print ''; print ''; - print ''; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; From 86af166792cb0c1a23ce82dcdbf1677bbfc451c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 18:08:42 +0200 Subject: [PATCH 0926/1289] css --- htdocs/core/class/html.form.class.php | 30 ++++++++++++++++++--------- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1479717b411..9c3e6794f4b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5612,30 +5612,40 @@ class Form * @param int $active Active or not, -1 = all * @param int $addempty 1=Add empty entry * @param string $type Type ('direct-debit' or 'bank-transfer') + * @param int $nooutput 1=Return string, no output * @return void */ - public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '') + public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '', $nooutput = 0) { // phpcs:enable global $langs; + + $out = ''; if ($htmlname != "none") { - print ''; - print ''; - print ''; + $out .= ''; + $out .= ''; + $out .= ''; if ($type) { - print ''; + $out .= ''; } - print $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); - print ''; - print ''; + $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); + $out .= ''; + $out .= ''; } else { if ($selected) { $this->load_cache_types_paiements(); - print $this->cache_types_paiements[$selected]['label']; + $out .= $this->cache_types_paiements[$selected]['label']; } else { - print " "; + $out .= " "; } } + + if ($nooutput) { + return $out; + } else { + print $out; + } + } /** diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f00406d63fd..7b318930b54 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3330,7 +3330,7 @@ if ($action == 'create') { print $paymentstatic->getNomUrl(1); print ''; print ''; - $s = $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_payment; + $s = $form->form_modes_reglement(null, $objp->paiement_type, 'none', '', 1, 0, '', 1).' '.$objp->num_payment; print ''; From 00e7df5ae9d6fac16c47a89d7d6b1a2d15bcaa4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 18:11:04 +0200 Subject: [PATCH 0927/1289] css --- 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 7b318930b54..42b5d34f880 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3331,7 +3331,7 @@ if ($action == 'create') { print ''; print ''; $s = $form->form_modes_reglement(null, $objp->paiement_type, 'none', '', 1, 0, '', 1).' '.$objp->num_payment; - print ''; if (isModEnabled("banque")) { From 5d5310d2124cddc749a2d0d9d58945df2e736b26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 18:31:45 +0200 Subject: [PATCH 0928/1289] css --- htdocs/salaries/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 639879f8e17..e0efb53915b 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -403,10 +403,10 @@ print '
    '; print $langs->trans('PaymentMode'); print '
    '; + print ''; print $paymentstatic->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dp), 'day').''; - print $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_payment; + $s = $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_payment; + print ''; + print $s; print ''.dol_print_date($db->jdate($objp->dp), 'day').''; print $s; print ''.dol_print_date($db->jdate($objp->dp), 'day').''; + print ''; print $s; print '
    '; // Ref print ''; // Label -print ''; +print ''; // Date start print ''; // Type print ''; // Bank account if (isModEnabled("banque")) { print ''; } @@ -546,7 +546,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Label payment - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -564,7 +564,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Employee - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } From 89238f05eaf1ee86ac45f8feeafa16ae374fc0be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 18:32:40 +0200 Subject: [PATCH 0929/1289] Add log --- htdocs/core/lib/ajax.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index b6ec08da434..850ccd34c1c 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -193,6 +193,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen $script .= ' $("#'.$htmlnamejquery.'").val(ui.item.id).trigger("change"); // Select new value + // Complementary actions + // Disable an element if (options.option_disabled) { console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled) @@ -224,7 +226,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen // Update an input if (ui.item.update) { - console.log("Make action update on each ui.item.update") + console.log("Make action update on each ui.item.update (if there is)") // loop on each "update" fields $.each(ui.item.update, function(key, value) { console.log("Set value "+value+" into #"+key); @@ -232,7 +234,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen }); } if (ui.item.textarea) { - console.log("Make action textarea on each ui.item.textarea") + console.log("Make action textarea on each ui.item.textarea (if there is)") $.each(ui.item.textarea, function(key, value) { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { CKEDITOR.instances[key].setData(value); From fbc10ab28acf799dc5db83b7cb232ec624ad0d32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 20:26:28 +0200 Subject: [PATCH 0930/1289] fix phpcs --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4b1ccc36bc0..aaddf1e9c62 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3319,7 +3319,7 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { } .divfmdirlia { - width: calc(100% - 100px); + width: calc(100% - 100px); } a.fmdirlia { From 220da95fa4600b37c3fd9e9a9924d0be40e396c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 13 Oct 2022 20:28:16 +0200 Subject: [PATCH 0931/1289] fix warnings --- htdocs/compta/bank/list.php | 2 +- htdocs/core/lib/company.lib.php | 14 +++++++++++++- .../core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index bccad47e2d8..c53117a6821 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -652,7 +652,7 @@ foreach ($accounts as $key => $type) { print ''.$langs->trans("ConciliationDisabled").''; } else { $result = $objecttmp->load_board($user, $objecttmp->id); - if ($result < 0) { + if (is_numeric($result) && $result < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); } else { print ''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f1cf8e43269..b5f8ced66a0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -438,7 +438,11 @@ function societe_prepare_head2($object) */ function societe_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('societe'); + $extrafields->fetch_name_optionals_label('socpeople'); $h = 0; $head = array(); @@ -456,11 +460,19 @@ function societe_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); + $nbExtrafields = $extrafields->attributes['societe']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsContacts"); + $nbExtrafields = $extrafields->attributes['socpeople']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes_contacts'; $h++; diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 67d41199594..267ca6803c9 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -23,7 +23,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield $tmpkey = 'options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && isset($obj->$tmpkey) && !is_numeric($obj->$tmpkey)) { $datenotinstring = $obj->$tmpkey; if (!is_numeric($obj->$tmpkey)) { // For backward compatibility $datenotinstring = $db->jdate($datenotinstring); From 9447bcc881c5a16be7281ee758180d6db92acfdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 20:31:56 +0200 Subject: [PATCH 0932/1289] Fix too many logs --- htdocs/install/upgrade2.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 463c2b2df4c..bbb12e8693e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -5160,9 +5160,10 @@ function migrate_contractdet_rank() $db->begin(); print '\n"; + $resultstring = '.'; + print $resultstring; $resqlUpd = $db->query($sqlUpd); if (!$resqlUpd) { dol_print_error($db); @@ -5194,12 +5196,9 @@ function migrate_contractdet_rank() $db->rollback(); } - print ''.$langs->trans('MigrationContractLineRank')."
    \n"; print ''; - if ($resultstring) { - print $resultstring; - } else { + if (!$resultstring) { print '
    \n"; } } From f481374a02408ec068a4ff811324f59104a5e9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 13 Oct 2022 20:32:15 +0200 Subject: [PATCH 0933/1289] fix warnings --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4b1ccc36bc0..aaddf1e9c62 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3319,7 +3319,7 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { } .divfmdirlia { - width: calc(100% - 100px); + width: calc(100% - 100px); } a.fmdirlia { From 57073d68c9996f595909063060ff3074aa3103b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 13 Oct 2022 20:41:16 +0200 Subject: [PATCH 0934/1289] fix warnings --- htdocs/product/stock/replenish.php | 4 ++-- htdocs/product/stock/replenishorders.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 6ec5c1d0b9b..be7f006d5a0 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -849,8 +849,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $desiredstock = $objp->desiredstock; $alertstock = $objp->seuil_stock_alerte; - $desiredstockwarehouse = ($objp->desiredstockpse ? $objp->desiredstockpse : 0); - $alertstockwarehouse = ($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : 0); + $desiredstockwarehouse = (!empty($objp->desiredstockpse) ? $objp->desiredstockpse : 0); + $alertstockwarehouse = (!empty($objp->seuil_stock_alertepse) ? $objp->seuil_stock_alertepse : 0); $warning = ''; if ($alertstock && ($stock < $alertstock)) { diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index d077c1d0ba8..c3c031b14bd 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -51,6 +51,7 @@ $search_dateyear = GETPOST('search_dateyear', 'int'); $search_datemonth = GETPOST('search_datemonth', 'int'); $search_dateday = GETPOST('search_dateday', 'int'); $search_date = dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear); +$optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -130,9 +131,9 @@ if (empty($user->rights->societe->client->voir) && !$socid) { } $sql .= ' WHERE cf.fk_soc = s.rowid '; $sql .= ' AND cf.entity = '.$conf->entity; -if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { +if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { $sql .= ' AND cf.fk_statut < 3'; -} elseif ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { +} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { $sql .= ' AND cf.fk_statut < 6'; // We want also status 5, we will keep them visible if dispatching is not yet finished (tested with function dolDispatchToDo). } else { $sql .= ' AND cf.fk_statut < 5'; From 14099b100e1a40614936b5e183512631797ed247 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 22:12:51 +0200 Subject: [PATCH 0935/1289] Fix regression in jfiletree --- htdocs/core/ajax/ajaxdirtree.php | 6 ++++-- htdocs/ecm/tpl/enablefiletreeajax.tpl.php | 5 +++-- htdocs/theme/eldy/global.inc.php | 5 +++++ htdocs/theme/md/style.css.php | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 47de50d0fd8..edc2f0166e3 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -414,13 +414,15 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, } print '
  • '; // collapsed is opposite if expanded - print '"; + print ''; + //print ''; print '
    '; diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index 1f5e52e4577..a7e601bf053 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -24,6 +24,7 @@ if (empty($conf) || !is_object($conf)) { print "Error, template enablefiletreeajax.tpl.php can't be called as URL"; exit; } +// Must have set $module, $nameforformuserfile, $preopened ?> @@ -57,7 +58,7 @@ $(document).ready(function() { multiFolder: false }, // Called if we click on a file (not a dir) function(file) { - console.log("We click on a file"); + console.log("We click on a file "+file); $("#mesg").hide(); loadandshowpreview(file,0); }, @@ -65,7 +66,7 @@ $(document).ready(function() { function(elem) { id=elem.attr('id').substr(12); // We get id that is 'fmdirlia_id_xxx' (id we want is xxx) rel=elem.attr('rel') - console.log("We click on a dir, we call the ajaxdirtree.php with modulepart=, param="); + console.log("We click on a dir id="+id+", we call the ajaxdirtree.php with modulepart=, param="); console.log("We also save id and dir name into _section_id|dir (vars into form to attach new file in filemanager.tpl.php) with id="+id+" and rel="+rel); jQuery("#_section_dir").val(rel); jQuery("#_section_id").val(id); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index aaddf1e9c62..d8c3e1a4cf4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5889,6 +5889,11 @@ ul.ecmjqft a { padding: 0px 0px; font-weight:normal; display: inline-block !important; + + width: calc(100% - 100px); + overflow: hidden; + white-space: break-spaces; + word-break: break-all; } ul.ecmjqft a:active { font-weight: bold !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 687242d2451..100cda109d4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5722,6 +5722,11 @@ ul.ecmjqft a { padding: 0px 0px; font-weight:normal; display: inline-block !important; + + width: calc(100% - 100px); + overflow: hidden; + white-space: break-spaces; + word-break: break-all; } ul.ecmjqft a:active { font-weight: bold !important; From 51ab54dc3cf03ef5fc3ef988b29515d216edd8a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2022 22:13:21 +0200 Subject: [PATCH 0936/1289] Fix regresssion in jfiletree --- htdocs/theme/eldy/global.inc.php | 7 +++---- htdocs/theme/md/style.css.php | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d8c3e1a4cf4..6f5adba2cc5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5889,11 +5889,10 @@ ul.ecmjqft a { padding: 0px 0px; font-weight:normal; display: inline-block !important; - width: calc(100% - 100px); - overflow: hidden; - white-space: break-spaces; - word-break: break-all; + overflow: hidden; + white-space: break-spaces; + word-break: break-all; } ul.ecmjqft a:active { font-weight: bold !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 100cda109d4..8fd37a2c7d2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5724,9 +5724,9 @@ ul.ecmjqft a { display: inline-block !important; width: calc(100% - 100px); - overflow: hidden; - white-space: break-spaces; - word-break: break-all; + overflow: hidden; + white-space: break-spaces; + word-break: break-all; } ul.ecmjqft a:active { font-weight: bold !important; From 121ebb671b7e37f1371f90982bdc5f21015eb149 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 14 Oct 2022 08:45:24 +0200 Subject: [PATCH 0937/1289] NEW resize parent company column in order list --- htdocs/commande/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 208889ba1a2..31d9ac1667f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1466,8 +1466,8 @@ if ($resql) { } // Parent company if (!empty($arrayfields['s2.nom']['checked'])) { - print '
  • '; } // Town @@ -1727,7 +1727,7 @@ if ($resql) { print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['s2.nom']['checked'])) { - print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER['PHP_SELF'], 's2.nom', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER['PHP_SELF'], 's2.nom', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); @@ -2032,7 +2032,7 @@ if ($resql) { // Parent company if (!empty($arrayfields['s2.nom']['checked'])) { - print ''; // Type of event - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") { print ''; } + // Private + if($object->elementtype == 'ticket') print ''; + // Title print ''; @@ -1983,13 +1991,16 @@ if ($id > 0) { print '
    '; -print ''; +print ''; print ''; @@ -435,13 +435,13 @@ print ''; -print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, '', 1); +print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1); print ''; - $form->select_comptes($search_account, 'search_account', 0, '', 1); + print $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth125', 1); print '".dol_trunc($obj->label, 40)."'.dol_escape_htmltag($obj->label)."".$userstatic->getNomUrl(1)."'.$userstatic->getNomUrl(1)."
    '; + print ''.$langs->trans('MigrationContractLineRank')."
    \n"; - $sql = "SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM ".$db->prefix()."contratdet as cd INNER JOIN ".$db->prefix()."contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0"; - $sql .=" ORDER BY c.rowid,cd.rowid"; + $sql = "SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM ".$db->prefix()."contratdet as cd INNER JOIN ".$db->prefix()."contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0"; + $sql .=" ORDER BY c.rowid,cd.rowid"; $resql = $db->query($sql); if ($resql) { @@ -5176,7 +5177,8 @@ function migrate_contractdet_rank() } $sqlUpd = "UPDATE ".$db->prefix()."contratdet SET rang=".(int) $currentRank." WHERE rowid=".(int) $obj->cdid; - $resultstring .= '
    '.$sqlUpd."
    '.$langs->trans("NothingToDo")."
    '; - print ''; + print ''; + print ''; print ''; + print ''; if ($obj->fk_parent > 0) { if (!isset($company_url_list[$obj->fk_parent])) { $companyparent = new Societe($db); From 33ef00590f73c156b38d07eca8e524cff3fbbbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 14 Oct 2022 09:28:49 +0200 Subject: [PATCH 0938/1289] fix warning --- htdocs/core/class/html.formsetup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index aef01514eba..c57ee0c5106 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1079,7 +1079,7 @@ class FormSetupItem $tmp = explode(':', $this->type); $template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue); - if ($template<0) { + if (is_numeric($template) && $template < 0) { $this->setErrors($formmail->errors); } $out.= $this->langs->trans($template->label); From a0db28756818495e08a69e9ac56ab2ce76b299ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Fri, 14 Oct 2022 09:54:30 +0200 Subject: [PATCH 0939/1289] $movement is better known as $object here --- htdocs/product/stock/tpl/extrafields_add.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 62921f0a6e0..144c638a1cf 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -38,13 +38,13 @@ if (empty($conf) || !is_object($conf)) { // Other attributes if (!isset($parameters)) $parameters = array(); -$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $movement, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; $params['cols'] = $parameters['colspanvalue']; - print $movement->showOptionals($extrafields, 'create', $params); + print $object->showOptionals($extrafields, 'create', $params); } ?> From 5dde5e1a203c9fc6699b403b117d97bcfff7141d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 14 Oct 2022 09:54:47 +0200 Subject: [PATCH 0940/1289] Input "Private Mssage" --- htdocs/comm/action/card.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a27404eab8c..eeaa81a2d48 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -71,6 +71,7 @@ $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); $remindertype = GETPOST('selectremindertype', 'aZ09'); $modelmail = GETPOST('actioncommsendmodel_mail', 'int'); $complete = GETPOST('complete', 'alpha'); // 'na' must be allowed +$private = GETPOST('private', 'alphanohtml'); if ($complete == 'na' || $complete == -2) { $complete = -1; } @@ -534,8 +535,12 @@ if (empty($reshook) && $action == 'update') { $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); } - if($object->code = 'TICKET_MSG_PRIVATE') { - $object->type_code = 'TICKET_MSG_PRIVATE'; + if($object->elementtype == 'ticket'){ + if($private){ + $object->type_code = 'TICKET_MSG_PRIVATE'; + } else { + $object->type_id = dol_getIdFromCode($db, 'AC_EMAIL', 'c_actioncomm'); + } } else { $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); } @@ -1524,7 +1529,7 @@ if ($id > 0) { print '
    '.$langs->trans("Ref").''.$object->id.'
    '.$langs->trans("Type").''; if ($object->type_code != 'AC_OTH_AUTO') { print $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ? GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto", 0, 0, 0, 1); @@ -1536,6 +1541,9 @@ if ($id > 0) { print '
    '.$langs->trans("PrivateEventMessage").'code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'>
    '.$langs->trans("Title").'
    '; // Type - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != 'ticket') { print ''; } + // Private + if($object->elementtype == 'ticket') print ''; + // Full day event print ''; From a6ea8be9a1e0676bc4280d619348d681b31b5bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Fri, 14 Oct 2022 10:20:41 +0200 Subject: [PATCH 0941/1289] $movement is better known as $object here --- htdocs/product/stock/tpl/extrafields_add.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 62921f0a6e0..144c638a1cf 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -38,13 +38,13 @@ if (empty($conf) || !is_object($conf)) { // Other attributes if (!isset($parameters)) $parameters = array(); -$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $movement, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; $params['cols'] = $parameters['colspanvalue']; - print $movement->showOptionals($extrafields, 'create', $params); + print $object->showOptionals($extrafields, 'create', $params); } ?> From 555f17f846c66b6bc65c39aaa418480a5ccbbbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 14 Oct 2022 10:33:34 +0200 Subject: [PATCH 0942/1289] fix warning --- htdocs/compta/facture/card.php | 2 +- htdocs/core/class/html.formmargin.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3e3ada6e8cf..2f69a3936c9 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5667,7 +5667,7 @@ if ($action == 'create') { && $usercancreate && !$objectidnext && $object->is_last_in_cycle() - && $conf->global->INVOICE_USE_SITUATION_CREDIT_NOTE + && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') ) { if ($usercanunvalidate) { print ''.$langs->trans("CreateCreditNote").''; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 61737ab00f3..513d964014a 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -100,7 +100,7 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) - || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && $conf->global->INVOICE_USE_SITUATION_CREDIT_NOTE && $object->situation_counter > 0)) { + || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) { $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); } else { $pa = $line->qty * $pa_ht; From d3b0c190d5de582ae1a1488dd100b97c2d4ca39e Mon Sep 17 00:00:00 2001 From: Richard Franks Date: Fri, 14 Oct 2022 09:44:49 +0100 Subject: [PATCH 0943/1289] Sorted Proposal not saving ref_ext --- htdocs/comm/propal/class/propal.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f9fd5d8ac7e..47cd50fa163 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1102,6 +1102,7 @@ class Propal extends CommonObject $sql .= ", fk_mode_reglement"; $sql .= ", fk_account"; $sql .= ", ref_client"; + $sql .= ", ref_ext"; $sql .= ", date_livraison"; $sql .= ", fk_shipping_method"; $sql .= ", fk_warehouse"; @@ -1136,6 +1137,7 @@ class Propal extends CommonObject $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", '".$this->db->escape($this->ref_client)."'"; + $sql .= ", '".$this->db->escape($this->ref_ext)."'"; $sql .= ", ".(empty($delivery_date) ? "NULL" : "'".$this->db->idate($delivery_date)."'"); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL'); @@ -1520,7 +1522,7 @@ class Propal extends CommonObject $sql .= ", p.datep as dp"; $sql .= ", p.fin_validite as dfv"; $sql .= ", p.date_livraison as delivery_date"; - $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams"; + $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, ref_ext, p.extraparams"; $sql .= ", p.note_private, p.note_public"; $sql .= ", p.fk_projet as fk_project, p.fk_statut"; $sql .= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture"; @@ -1572,6 +1574,7 @@ class Propal extends CommonObject $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; $this->remise = $obj->remise; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; From 01ad3d98b703c04f0b206d85dd79c5a7edc91781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 14 Oct 2022 10:55:14 +0200 Subject: [PATCH 0944/1289] fix warning --- htdocs/core/class/commonobject.class.php | 23 ++++++++++++++--------- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 508129ba141..3bd6991feac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4917,15 +4917,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_title.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_title.tpl.php'; } - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; @@ -5040,16 +5043,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook printObjectLine and printObjectSubLine. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php'; } - - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 041f6902040..f2d104368f4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8887,7 +8887,7 @@ class Form $form = new Form($this->db); print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; } - print ''.price($objp->total_ht).''; + print ''.(isset($objp->total_ht) ? price($objp->total_ht) : '').''; print ''; print ''; print ''; From 37290764556c22d24c7e66a46634c92b5599155c Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 13 Oct 2022 15:30:38 +0200 Subject: [PATCH 0945/1289] Add the supplier price as a hidden field when editing a supplier_proposal line. Otherwise, the relationship between the line and the supplier is removed. --- htdocs/core/tpl/objectline_edit.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 3ce3fffd28d..64404081e54 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -186,6 +186,7 @@ $coldisplay++; ?> fk_fournprice.'">'); } $coldisplay++; From e91763239acf56960cb01e41679113c51f1b207f Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Fri, 14 Oct 2022 11:14:04 +0200 Subject: [PATCH 0946/1289] relaunch stickler From e1e7ce80748f557e67406b5edf95e28275366d1f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 14 Oct 2022 12:09:02 +0200 Subject: [PATCH 0947/1289] FIX: #22581 --- htdocs/expedition/card.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8aa54ca8904..7aecd063490 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -215,6 +215,8 @@ if (empty($reshook)) { $object->size_units = GETPOST('size_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int'); + $product = new Product($db); + // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver $classname = ucfirst($object->origin); $objectsrc = new $classname($db); @@ -250,10 +252,20 @@ if (empty($reshook)) { $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; + $is_batch_or_serial=0; + if (!empty($objectsrc->lines[$i]->fk_product)) { + $resultFetch = $product->fetch($objectsrc->lines[$i]->fk_product, '', '', '', 1, 1, 1); + if ($resultFetch < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } + $is_batch_or_serial = $product->status_batch; + } + if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; + while (GETPOSTISSET($batch)) { // save line of detail into sub_qty $sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record @@ -261,7 +273,11 @@ if (empty($reshook)) { $subtotalqty += $sub_qty[$j]['q']; //var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']); - + if ($is_batch_or_serial==2 && $sub_qty[$j]['q']>1) { + setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors'); + $totalqty=0; + break 2; + } $j++; $batch = "batchl".$i."_".$j; $qty = "qtyl".$i.'_'.$j; @@ -286,6 +302,7 @@ if (empty($reshook)) { $qty .= '_'.$j; while (GETPOSTISSET($stockLocation)) { // save sub line of warehouse + $stockLine[$i][$j]['qty'] = price2num(GETPOST($qty, 'alpha'), 'MS'); $stockLine[$i][$j]['warehouse_id'] = GETPOST($stockLocation, 'int'); $stockLine[$i][$j]['ix_l'] = GETPOST($idl, 'int'); @@ -316,7 +333,6 @@ if (empty($reshook)) { } //var_dump($batch_line[2]); - if ($totalqty > 0) { // There is at least one thing to ship //var_dump($_POST);exit; for ($i = 0; $i < $num; $i++) { From 012275cb3e91188f8842de1a69b16aa9616440d3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 14 Oct 2022 12:10:04 +0200 Subject: [PATCH 0948/1289] FIX: #22581 --- htdocs/expedition/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 7aecd063490..fc443f6790b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -302,7 +302,6 @@ if (empty($reshook)) { $qty .= '_'.$j; while (GETPOSTISSET($stockLocation)) { // save sub line of warehouse - $stockLine[$i][$j]['qty'] = price2num(GETPOST($qty, 'alpha'), 'MS'); $stockLine[$i][$j]['warehouse_id'] = GETPOST($stockLocation, 'int'); $stockLine[$i][$j]['ix_l'] = GETPOST($idl, 'int'); From c002957b49a2540a602bfd279337bc2b96c21d42 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 14 Oct 2022 12:10:26 +0200 Subject: [PATCH 0949/1289] FIX: #22581 --- htdocs/expedition/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fc443f6790b..29e1bd266b8 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -265,7 +265,6 @@ if (empty($reshook)) { if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; - while (GETPOSTISSET($batch)) { // save line of detail into sub_qty $sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record From 5190bc0d043f59df05f2010b00a4840b6588ee64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Oct 2022 15:43:21 +0200 Subject: [PATCH 0950/1289] FIX css --- htdocs/core/ajax/ajaxdirtree.php | 13 ++++++++++++- htdocs/core/tpl/filemanager.tpl.php | 4 ++-- htdocs/ecm/index_auto.php | 1 + htdocs/theme/eldy/global.inc.php | 14 ++++++++------ htdocs/theme/md/style.css.php | 15 ++++++++------- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index edc2f0166e3..c8b42bbf0e8 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -275,9 +275,14 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_ print '
    '; // Nb of docs - print '
    '.$langs->trans("Type").''; print $object->getTypePicto(); print $langs->trans("Action".$object->type_code); print '
    '.$langs->trans("PrivateEventMessage").''.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).'
    '.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent ? 1 : 0, 3).'
    '.$objp->name.'
    '; print ''; @@ -664,7 +675,7 @@ if ($id > 0 || $ref) { print ''; // Price minimum print ''; } else { @@ -1043,7 +1058,11 @@ if (!$variants) { print ''; // Value purchase - print ''; + if ($usercancreadprice) { + print ''; + } else { + print ''; + } // Sell price $minsellprice = null; $maxsellprice = null; @@ -1060,14 +1079,16 @@ if (!$variants) { } } print ''; - if ($minsellprice != $maxsellprice) { - print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1); - } else { - print price(price2num($minsellprice, 'MU'), 1); + if ($usercancreadprice) { + if ($minsellprice != $maxsellprice) { + print price(price2num($minsellprice, 'MU'), 1).' - '.price(price2num($maxsellprice, 'MU'), 1); + } else { + print price(price2num($minsellprice, 'MU'), 1); + } } print ''; print $form->textwithpicto('', $langs->trans("Variable")); - } else { + } elseif ($usercancreadprice) { print price(price2num($object->price, 'MU'), 1); } print ''; @@ -1076,15 +1097,19 @@ if (!$variants) { print ''; print ''; @@ -1189,11 +1214,15 @@ if (!$variants) { print ''; print ''; print ''; // Value purchase print ''; print ''; if ($action != 'progression' && isset($object->status) && $object->status < $object::STATUS_CLOSED && !$user->socid) { - print ''; + print ''; } print '
    '; + print ''; + + print ''; + print ''; + + print ''; print ''; // Info + print ''; print '';*/ // Nb of docs + print ''; print ''; + + print ''; print ''; // Edit link + print ''; print ''; } - print ''; + if ($object->elementtype == 'ticket') print ''; // Title print ''; @@ -1999,7 +1999,7 @@ if ($id > 0) { } // Private - if($object->elementtype == 'ticket') print ''; + if ($object->elementtype == 'ticket') print ''; // Full day event print ''; From 4b404909f6dbb269d545a8a72f721a06dd2289f5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 15 Oct 2022 19:11:38 +0200 Subject: [PATCH 0958/1289] Fix php 8 error --- htdocs/ticket/class/api_tickets.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 3151f75877b..6d00317da58 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -241,7 +241,8 @@ class Tickets extends DolibarrApi if (!$socid && DolibarrApiAccess::$user->socid) { $socid = DolibarrApiAccess::$user->socid; } - + + $search_sale = null; // If the internal user must only see his customers, force searching by him if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) { $search_sale = DolibarrApiAccess::$user->id; From 2067e90f149d4dd77ec3d3588cbbacc3e8248686 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 15 Oct 2022 17:12:34 +0000 Subject: [PATCH 0959/1289] Fixing style errors. --- htdocs/ticket/class/api_tickets.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 6d00317da58..629eab03d77 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -241,7 +241,7 @@ class Tickets extends DolibarrApi if (!$socid && DolibarrApiAccess::$user->socid) { $socid = DolibarrApiAccess::$user->socid; } - + $search_sale = null; // If the internal user must only see his customers, force searching by him if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) { From 42d3d431a18e88b7d0f6ccd39e987d156a0656a3 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 15 Oct 2022 22:42:15 +0200 Subject: [PATCH 0960/1289] NEW #25594: can chose if VAT ID is unique or not for third parties --- htdocs/societe/admin/societe.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 76fd9297e2b..d466f1fe9a7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -181,6 +181,20 @@ if ($action == "setaccountancycodecustomerinvoicemandatory") { } } +//Activate Set vat id unique +if ($action == "setvatintraunique") { + $setvatintraunique = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + //Activate Set ref in list if ($action == "setaddrefinlist") { $setaddrefinlist = GETPOST('value', 'int'); @@ -731,6 +745,22 @@ if (isModEnabled('accounting')) { print "\n"; } +// VAT ID +print ''; +print '\n"; + +if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { + print ''; +} else { + print ''; +} +print ''; +print "\n"; + print "
    '; print $val['cachenbofdoc']; print ''; if ($nbofsubdir && $nboffilesinsubdir) { print '+'.$nboffilesinsubdir.' '; @@ -285,6 +290,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_ print ''; $userstatic->id = $val['fk_user_c']; $userstatic->lastname = $val['login_c']; @@ -433,9 +439,12 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print ''; print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : ' '; print ''; if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) { print '+'.$nboffilesinsubdir.' '; @@ -443,6 +452,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print ''; print ''; $userstatic->id = isset($val['fk_user_c']) ? $val['fk_user_c'] : 0; $userstatic->lastname = isset($val['login_c']) ? $val['login_c'] : 0; diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 2c4b2f5dea8..83bb06a8abb 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -269,7 +269,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { // Show the link to "Root" if ($showroot) { - print '
    '; + print '
    '; // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) print '
    '; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 9d9ff5a463f..625e69e626e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -476,6 +476,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act $htmltooltip .= ''.$langs->trans("Description").': '.$val['desc']; print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; + print ''; $nbofentries++; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6f5adba2cc5..fe31593efbf 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4325,9 +4325,9 @@ div.tabBar .noborder { /* Prepare to remove class pair - impair */ -.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven) { background: linear-gradient(bottom, var(----colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); @@ -4340,9 +4340,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nt border-bottom: 1px solid #e0e0e0; } -.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) +.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven) { background: linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); @@ -5889,6 +5889,8 @@ ul.ecmjqft a { padding: 0px 0px; font-weight:normal; display: inline-block !important; +} +ul.ecmjqft > a { width: calc(100% - 100px); overflow: hidden; white-space: break-spaces; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8fd37a2c7d2..41950369dc2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4267,9 +4267,9 @@ div .tdtop:not(.tagtdnote) { /* Prepare to remove class pair - impair */ -.noborder > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +.noborder > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven) { background: linear-gradient(to bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); @@ -4282,9 +4282,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nt border-bottom: 1px solid #ddd; } -.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) +.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven) { background: linear-gradient(to bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); @@ -5722,7 +5722,8 @@ ul.ecmjqft a { padding: 0px 0px; font-weight:normal; display: inline-block !important; - +} +ul.ecmjqft > a { width: calc(100% - 100px); overflow: hidden; white-space: break-spaces; From 746a00047b71b98c3b8b6c64956145bb64c8531f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Oct 2022 15:57:58 +0200 Subject: [PATCH 0951/1289] FIX delete ECM directory --- htdocs/core/lib/files.lib.php | 2 +- htdocs/ecm/dir_card.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 6838926a67b..ce3f8961b32 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1372,7 +1372,7 @@ function dol_delete_dir($dir, $nophperrors = 0) // Security: // We refuse transversal using .. and pipes into filenames. if (preg_match('/\.\./', $dir) || preg_match('/[<>|]/', $dir)) { - dol_syslog("Refused to delete dir ".$dir, LOG_WARNING); + dol_syslog("Refused to delete dir ".$dir.' (contains invalid char sequence)', LOG_WARNING); return false; } diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 42607aa0dab..adfd405790f 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -469,13 +469,14 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') { print ''; } + // Confirm remove file if ($action == 'deletefile') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); } -// Confirm remove file -if ($action == 'delete_dir') { +// Confirm remove dir +if ($action == 'delete' || $action == 'delete_dir') { $relativepathwithoutslash = preg_replace('/[\/]$/', '', $relativepath); //Form to close proposal (signed or not) From ecac08fa7a1ac7f9907eadb250ee901782d64dda Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Fri, 14 Oct 2022 17:00:49 +0200 Subject: [PATCH 0952/1289] FIX: Fix the function get_origin() on MouvementStock class for general case --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 31e66796a48..b1e184c3fe2 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -976,7 +976,7 @@ class MouvementStock extends CommonObject if ($origin_type) { // Separate originetype with "@" : left part is class name, right part is module name $origin_type_array = explode('@', $origin_type); - $classname = ucfirst($origin_type_array[0]); + $classname = strtolower($origin_type_array[0]); $modulename = empty($origin_type_array[1]) ? $classname : $origin_type_array[1]; $result = dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php'); if ($result) { From 3400db550371f284b7cb911769d48fbedf2e0ad1 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Fri, 14 Oct 2022 21:58:10 +0200 Subject: [PATCH 0953/1289] fix #19912: add default informations from customer to new invoices --- htdocs/projet/tasks/time.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index db2e1508e92..678577043a6 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -384,6 +384,9 @@ if ($action == 'confirm_generateinvoice') $tmpinvoice->socid = $projectstatic->thirdparty->id; $tmpinvoice->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $tmpinvoice->fk_project = $projectstatic->id; + $tmpinvoice->cond_reglement_id = $projectstatic->thirdparty->cond_reglement_id; + $tmpinvoice->mode_reglement_id = $projectstatic->thirdparty->mode_reglement_id; + $tmpinvoice->fk_account = $projectstatic->thirdparty->fk_account; if ($invoiceToUse) { $tmpinvoice->fetch($invoiceToUse); From df51c0ea519e8a22e5769ad83adbcf9621c957a3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 15 Oct 2022 13:07:07 +0200 Subject: [PATCH 0954/1289] Fix php 8 error --- htdocs/datapolicy/class/datapolicycron.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 965d93754f7..13e31581f76 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -451,8 +451,8 @@ class DataPolicyCron $this->db->begin(); foreach ($arrayofparameters as $key => $params) { - if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) { - $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); + if (getDolGlobalInt($key) != '' && is_numeric(getDolGlobalInt($key)) && (int) getDolGlobalInt($key) > 0) { + $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql); From 1044e79aa147701201fa7bf0272df1a99bb5263c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 15 Oct 2022 13:19:55 +0200 Subject: [PATCH 0955/1289] fix php 8 error --- htdocs/compta/facture/class/facture-rec.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 7cfe15b64e6..e8c965f5937 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1274,6 +1274,8 @@ class FactureRec extends CommonInvoice $tmparray = dol_getdate($now); $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day + $this->output = null; + dol_syslog("createRecurringInvoices restrictioninvoiceid=".$restrictioninvoiceid." forcevalidation=".$forcevalidation); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; From 63a62edcf6432644dc277eb574714a08e1866bb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Oct 2022 13:41:15 +0200 Subject: [PATCH 0956/1289] Fix filter on member without subscription --- htdocs/adherents/list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 607ef8117f6..6b52d516913 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -365,7 +365,7 @@ if ($search_type > 0) { $sql .= " AND t.rowid=".((int) $search_type); } if ($search_filter == 'withoutsubscription') { - $sql .= " AND (datefin IS NULL OR t.subscription = '0')"; + $sql .= " AND (datefin IS NULL)"; } if ($search_filter == 'uptodate') { $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 0f4aa61f621..aaf88dd938d 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -359,7 +359,7 @@ foreach ($search as $key => $val) { } if ($managedfor == 'member') { if ($search_filter == 'withoutsubscription') { - $sql .= " AND (d.datefin IS NULL OR dty.subscription = 0)"; + $sql .= " AND (d.datefin IS NULL)"; } if ($search_filter == 'uptodate') { $sql .= " AND (d.datefin >= '".$db->idate($now)."' OR dty.subscription = 0)"; From 042db61523b675ad0a94a8afb64ec6a3c647a5b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Oct 2022 13:52:57 +0200 Subject: [PATCH 0957/1289] Merge --- htdocs/comm/action/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index eeaa81a2d48..e3923cfb8d0 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -535,8 +535,8 @@ if (empty($reshook) && $action == 'update') { $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); } - if($object->elementtype == 'ticket'){ - if($private){ + if ($object->elementtype == 'ticket') { + if ($private) { $object->type_code = 'TICKET_MSG_PRIVATE'; } else { $object->type_id = dol_getIdFromCode($db, 'AC_EMAIL', 'c_actioncomm'); @@ -1542,7 +1542,7 @@ if ($id > 0) { } // Private - if($object->elementtype == 'ticket') print '
    '.$langs->trans("PrivateEventMessage").'code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'>
    '.$langs->trans("PrivateEventMessage").'code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'>
    '.$langs->trans("Title").'
    '.$langs->trans("PrivateEventMessage").''.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).'
    '.$langs->trans("PrivateEventMessage").''.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).'
    '.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent ? 1 : 0, 3).'
    '.$langs->trans('VATIntra')."'; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
    \n"; print ''; From e18e88a83144b451571bd0bd042e226a8c0e2fb2 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sun, 16 Oct 2022 00:40:23 +0200 Subject: [PATCH 0961/1289] advanced permission to read price stock card --- htdocs/product/stock/product.php | 79 ++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index faaf7e346fa..c53454f0fc3 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -117,6 +117,12 @@ $error = 0; $usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); $usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); +$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire'); + +if ($object->isService()) { + $label = $langs->trans('Service'); + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire'); +} if ($object->id > 0) { if ($object->type == $object::TYPE_PRODUCT) { @@ -643,6 +649,11 @@ if ($id > 0 || $ref) { $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
    ".$langs->trans("CostPriceUsage"); $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); + $costprice = $object->cost_price; + if (!$usercancreadprice) { + $costprice = ''; + } + print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print '
    '; print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); @@ -653,7 +664,7 @@ if ($id > 0 || $ref) { print $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")); print ''; - if ($object->pmp > 0) { + if ($object->pmp > 0 && $usercancreadprice) { print price($object->pmp).' '.$langs->trans("HT"); } print ''; $product_fourn = new ProductFournisseur($db); if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) { - if ($product_fourn->product_fourn_price_id > 0) { + if ($product_fourn->product_fourn_price_id > 0 && $usercancreadprice) { print $product_fourn->display_price_product_fournisseur(); } else { print $langs->trans("NotDefined"); @@ -675,19 +686,23 @@ if ($id > 0 || $ref) { if (empty($conf->global->PRODUIT_MULTIPRICES)) { // Price print '
    '.$langs->trans("SellingPrice").''; - if ($object->price_base_type == 'TTC') { - print price($object->price_ttc).' '.$langs->trans($object->price_base_type); - } else { - print price($object->price).' '.$langs->trans($object->price_base_type); + if ($usercancreadprice) { + if ($object->price_base_type == 'TTC') { + print price($object->price_ttc).' '.$langs->trans($object->price_base_type); + } else { + print price($object->price).' '.$langs->trans($object->price_base_type); + } } print '
    '.$langs->trans("MinPrice").''; - if ($object->price_base_type == 'TTC') { - print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); - } else { - print price($object->price_min).' '.$langs->trans($object->price_base_type); + if ($usercancreadprice) { + if ($object->price_base_type == 'TTC') { + print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); + } else { + print price($object->price_min).' '.$langs->trans($object->price_base_type); + } } print '
    '.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').''.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').''.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').''; if (!empty($conf->global->PRODUIT_MULTIPRICES)) { print ''; - if ($minsellprice != $maxsellprice) { - print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1); - } else { - print price(price2num($minsellprice * $obj->reel, 'MT'), 1); + if ($usercancreadprice) { + if ($minsellprice != $maxsellprice) { + print price(price2num($minsellprice * $obj->reel, 'MT'), 1).' - '.price(price2num($maxsellprice * $obj->reel, 'MT'), 1); + } else { + print price(price2num($minsellprice * $obj->reel, 'MT'), 1); + } } print ''; print $form->textwithpicto('', $langs->trans("Variable")); } else { - print price(price2num($object->price * $obj->reel, 'MT'), 1); + if ($usercancreadprice) { + print price(price2num($object->price * $obj->reel, 'MT'), 1); + } } print '
    '.$langs->trans("Total").':'.price2num($total, 'MS').''; - print ($totalwithpmp ? price(price2num($totalvalue / $totalwithpmp, 'MU')) : ' '); // This value may have rounding errors + if ($usercancreadprice) { + print ($totalwithpmp ? price(price2num($totalvalue / $totalwithpmp, 'MU')) : ' '); // This value may have rounding errors + } print ''; - print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' '; + if ($usercancreadprice) { + print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' '; + } print ''; if ($num) { @@ -1201,7 +1230,7 @@ if (!$variants) { print ''; if (!empty($conf->global->PRODUIT_MULTIPRICES)) { print $form->textwithpicto('', $langs->trans("Variable")); - } else { + } elseif ($usercancreadprice) { print price($totalvaluesell / $total, 1); } print ''; @@ -1212,7 +1241,7 @@ if (!$variants) { print ''; if ($num) { print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { + if (empty($conf->global->PRODUIT_MULTIPRICES) && $usercancreadprice) { print price(price2num($totalvaluesell, 'MT'), 1); } else { print $form->textwithpicto('', $langs->trans("Variable")); From 5bbbaab423d6a2928fc24735691ac3cc3a03306f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Oct 2022 14:23:57 +0200 Subject: [PATCH 0962/1289] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/ticket/card.php | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e098cbf3178..da74cf6dbda 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -626,11 +626,11 @@ class Form $extrastyle = ''; if ($direction < 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; padding-left: 3px !important;'; + $extrastyle = 'padding: 0px; paddingleft;'; } if ($direction > 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; padding-right: 3px !important;'; + $extrastyle = 'padding: 0px; paddingright;'; } $classfortooltip = 'classfortooltip'; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 841f810e5ec..df46ff8e77c 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -943,11 +943,14 @@ if ($action == 'create' || $action == 'presend') { } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
    '.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + $htmltooltip = $langs->trans("EmailMsgID").': '.$object->email_msgid; + $htmltooltip .= '
    '.$langs->trans("EmailDate").': '.dol_print_date($object->email_date, 'dayhour'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $htmltooltip, 1, 'help', '', 0, 3, 'tooltip').''; } elseif (!empty($object->origin_email)) { $morehtmlref .= '
    '.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; + $htmltooptip = $langs->trans("IP").': '.$object->ip; + $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByPublicPortal"), $htmltooptip, 1, 'help', '', 0, 3, 'tooltip').''; } // Thirdparty @@ -1071,7 +1074,7 @@ if ($action == 'create' || $action == 'presend') { print '
    '; print $langs->trans("AssignedTo"); if (isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { - print ''.img_edit($langs->trans('Modify'), '').''; + print ''.img_edit($langs->trans('Modify'), '').''; } print '
    '; print '
    '; @@ -1099,7 +1102,7 @@ if ($action == 'create' || $action == 'presend') { print $langs->trans('Progression').''; print ''.img_edit($langs->trans('Modify')).''.img_edit($langs->trans('Modify')).'
    '; print '
    '; From 7a50d03256e4d9ec828d10e3fb50fa787038148a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 16 Oct 2022 14:45:35 +0200 Subject: [PATCH 0963/1289] FIX wrong perm check --- htdocs/core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 83615c17fd3..e158da13f14 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -124,7 +124,7 @@ class box_dolibarr_state_board extends ModeleBoxes 'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'), 'products' => isModEnabled('product') && $user->hasRight('produit', 'lire'), 'services' => isModEnabled('service') && $user->hasRight('service', 'lire'), - 'proposals' => isModEnabled('propal') && $user->hasRight('propale', 'lire'), + 'proposals' => isModEnabled('propal') && $user->hasRight('propal', 'lire'), 'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'), 'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'), 'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'), diff --git a/htdocs/index.php b/htdocs/index.php index 903f77c0ed8..f9bedb661ac 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -176,7 +176,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of commercial customer proposals open (expired) - if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propale', 'lire')) { + if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propal', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $board = new Propal($db); $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); From 514cc76fe244f9f457ef489e305baabe1d6911f3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 16 Oct 2022 16:44:34 +0200 Subject: [PATCH 0964/1289] FIX use propal instead propale --- htdocs/comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/propal/contact.php | 6 +++--- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 2 +- .../comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/comm/prospect/index.php | 4 ++-- htdocs/core/boxes/box_activity.php | 2 +- .../boxes/box_graph_product_distribution.php | 8 ++++---- .../core/boxes/box_graph_propales_permonth.php | 4 ++-- htdocs/core/boxes/box_propales.php | 2 +- htdocs/core/lib/files.lib.php | 6 +++--- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 18 +++++++++--------- .../doc/doc_generic_project_odt.modules.php | 2 +- .../modules/project/doc/pdf_beluga.modules.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 2 +- htdocs/core/tpl/notes.tpl.php | 2 +- htdocs/hrm/core/tpl/skilldet.fiche.tpl.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/projet/element.php | 2 +- 25 files changed, 42 insertions(+), 42 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 0942e1554a8..049b70737e8 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -204,7 +204,7 @@ class CActionComm if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } - if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propal->lire)) { $qualified = 1; } if ($obj->module == 'invoice_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (isModEnabled('supplier_invoice') && !empty($user->rights->supplier_invoice->lire)))) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 97fceb99f9e..051ee9de42c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -74,7 +74,7 @@ restrictedArea($user, 'propal', $object->id); * Add a new contact */ -if ($action == 'addcontact' && $user->rights->propale->creer) { +if ($action == 'addcontact' && $user->rights->propal->creer) { if ($object->id > 0) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); @@ -92,12 +92,12 @@ if ($action == 'addcontact' && $user->rights->propale->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->propale->creer) { +} elseif ($action == 'swapstatut' && $user->rights->propal->creer) { // Toggle the status of a contact if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } -} elseif ($action == 'deletecontact' && $user->rights->propale->creer) { +} elseif ($action == 'deletecontact' && $user->rights->propal->creer) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f58ed518517..1bd6cc71d50 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -81,7 +81,7 @@ if (!$sortfield) { $object = new Propal($db); $object->fetch($id, $ref); -$permissiontoadd = $user->rights->propale->creer; +$permissiontoadd = $user->rights->propal->creer; // Security check if (!empty($user->socid)) { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index edb8e48405e..4a6d9ec63ed 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -227,7 +227,7 @@ if ($resql) { /* * Open (validated) proposals */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index d2e453eac9e..c3af3a9b73e 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -64,7 +64,7 @@ restrictedArea($user, 'propal', $object->id, 'propal'); * Actions */ -$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->propal->creer; // Used by the include of actions_setnotes.inc.php $reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index af5247fb10f..9e2e485c92a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -60,7 +60,7 @@ $endyear = $year; // Load translation files required by the page $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_proposal')); -if ($mode == 'customer' && !$user->rights->propale->lire) { +if ($mode == 'customer' && !$user->rights->propal->lire) { accessforbidden(); } if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) { diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 613f06a6feb..37c0f8d5e58 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''.dol_print_date($objectlink->date, 'day').''; - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 83c30743c77..19bde7072ad 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -119,7 +119,7 @@ if ($resql) { /* * Liste des propal brouillons */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -177,7 +177,7 @@ if (isModEnabled('agenda')) { /* * Dernieres propales ouvertes */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index fb0a60b567f..56fa8172bcb 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes // list the summary of the propals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propalstatic = new Propal($this->db); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 6b8177e5ed4..3ef8a3daddf 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -62,7 +62,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->hidden = !( (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (isModEnabled('commande') && !empty($user->rights->commande->lire)) - || (isModEnabled('propal') && !empty($user->rights->propale->lire)) + || (isModEnabled('propal') && !empty($user->rights->propal->lire)) ); } @@ -110,7 +110,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } - if (isModEnabled('propal') || empty($user->rights->propale->lire)) { + if (isModEnabled('propal') || empty($user->rights->propal->lire)) { $showpropalnb = 0; } if (!isModEnabled('commande') || empty($user->rights->commande->lire)) { @@ -152,7 +152,7 @@ class box_graph_product_distribution extends ModeleBoxes $WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320'; $HEIGHT = '150'; // Height require to have 5+1 entries into legend visible. - if (isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showpropalnb) { $langs->load("propal"); @@ -365,7 +365,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - if (isModEnabled("propal") || !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") || !empty($user->rights->propal->lire)) { $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 13f3a29ec16..ff62473c969 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = empty($user->rights->propale->lire); + $this->hidden = empty($user->rights->propal->lire); } /** @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; $param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 7114fdb5399..1a3344eedfe 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -83,7 +83,7 @@ class box_propales extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max)); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ce3f8961b32..c3eede90efd 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2539,7 +2539,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les apercu propal - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; @@ -2611,7 +2611,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) { // Wrapping pour les images des stats propales - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file; @@ -2832,7 +2832,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a1bccc1dd28..7795f927c19 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -411,7 +411,7 @@ function show_stats_for_company($product, $socid) print '
    '.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).'
    '; @@ -3033,9 +3033,9 @@ if ($action == 'create') { // Due date print '
    '; - print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); + print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); print ''; - print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); + print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { print img_warning($langs->trans('Late')); } @@ -3047,7 +3047,7 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $form_permission2) { + if ($action != 'editmode' && $form_permission) { print ''; } print '
    '; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
    '; From b8479e914483dfbec0fba3f0b2c6a9638f0a92fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Oct 2022 20:25:23 +0200 Subject: [PATCH 0967/1289] NEW Can set a commercial discount by entereing amount including VAT --- htdocs/comm/remx.php | 46 ++++++++++++++++++-------- htdocs/societe/class/societe.class.php | 27 +++++++++------ 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index b28af96527e..fe8c630fc10 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -53,6 +53,9 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); +$permissiontocreate = ($user->rights->societe->creer || $user->rights->facture->creer); + + /* * Actions @@ -63,7 +66,7 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { exit; } -if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) @@ -154,16 +157,17 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && ($user } } -if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if ($action == 'setremise' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ht = price2num(GETPOST('amount_ht', 'alpha')); + $amount = price2num(GETPOST('amount', 'alpha'), '', 2); $desc = GETPOST('desc', 'alpha'); $tva_tx = GETPOST('tva_tx', 'alpha'); $discount_type = GETPOSTISSET('discount_type') ? GETPOST('discount_type', 'alpha') : 0; + $price_base_type = GETPOST('price_base_type', 'alpha'); - if ($amount_ht > 0) { + if ($amount > 0) { $error = 0; if (empty($desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReasonDiscount")), null, 'errors'); @@ -173,14 +177,14 @@ if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->f if (!$error) { $soc = new Societe($db); $soc->fetch($id); - $discountid = $soc->set_remise_except($amount_ht, $user, $desc, $tva_tx, $discount_type); + $discountid = $soc->set_remise_except($amount, $user, $desc, $tva_tx, $discount_type, $price_base_type); if ($discountid > 0) { if (!empty($backtopage)) { - header("Location: ".$backtopage.'&discountid='.$discountid); + header("Location: ".$backtopage.'&discountid='.((int) $discountid)); exit; } else { - header("Location: remx.php?id=".$id); + header("Location: remx.php?id=".((int) $id)); exit; } } else { @@ -193,7 +197,7 @@ if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->f } } -if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) @@ -231,9 +235,8 @@ if ($socid > 0) { $isCustomer = $object->client == 1 || $object->client == 3; $isSupplier = $object->fournisseur == 1; - /* - * Display tabs - */ + // Display tabs + $head = societe_prepare_head($object); print '
    '; @@ -262,6 +265,7 @@ if ($socid > 0) { } + print '
    '; print ''; if ($isCustomer) { // Calcul avoirs client en cours @@ -324,9 +328,10 @@ if ($socid > 0) { } print '
    '; - print '
    '; + print ''; // close fichecenter + print dol_get_fiche_end(); @@ -346,6 +351,8 @@ if ($socid > 0) { print dol_get_fiche_head(); + + print '
    '; print ''; if ($isCustomer && $isSupplier) { print ''; @@ -353,9 +360,19 @@ if ($socid > 0) { print '   '; print ''; } - print ''; - print ''; + print ''; + + // Price base (HT / TTC) + print ''; + print ''; + + // VAT print ''; print ''; print "
    '.$langs->trans('DiscountType').'
    '.$langs->trans("AmountHT").''; + + // Amount + print '
    '.$langs->trans("Amount").''; print ' '.$langs->trans("Currency".$conf->currency).'
    '.$langs->trans("PriceBase").''; + print $form->selectPriceBaseType(GETPOST("price_base_type"), "price_base_type"); + print '
    '.$langs->trans("VAT").''; print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0, $mysoc, $object, 0, 0, '', 0, 1); @@ -364,6 +381,7 @@ if ($socid > 0) { print '
    "; + print '
    '; print dol_get_fiche_end(); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c01f83401cf..66f7cb6ee79 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2268,14 +2268,15 @@ class Societe extends CommonObject /** * Add a discount for third party * - * @param float $remise Amount of discount - * @param User $user User adding discount - * @param string $desc Reason of discount - * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ... - * @param int $discount_type 0 => customer discount, 1 => supplier discount - * @return int <0 if KO, id of discount record if OK + * @param float $remise Amount of discount + * @param User $user User adding discount + * @param string $desc Reason of discount + * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ... + * @param int $discount_type 0 => customer discount, 1 => supplier discount + * @param string $price_base_type Price base type 'HT' or 'TTC' + * @return int <0 if KO, id of discount record if OK */ - public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0) + public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0, $price_base_type = 'HT') { // phpcs:enable global $langs; @@ -2310,9 +2311,15 @@ class Societe extends CommonObject $discount->discount_type = $discount_type; - $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); - $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT'); - $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT'); + if ($price_base_type == 'TTC') { + $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($remise, 'MT'); + $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise / (1 + $vatrate / 100), 'MT'); + $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($discount->amount_ttc - $discount->amount_ht, 'MT'); + } else { + $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); + $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT'); + $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT'); + } $discount->tva_tx = price2num($vatrate); $discount->vat_src_code = $vat_src_code; From 34166084de3b90c38954ef6bca6d0b24520eebef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Oct 2022 20:33:00 +0200 Subject: [PATCH 0968/1289] css --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index da74cf6dbda..90bfd55cf7a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -626,11 +626,11 @@ class Form $extrastyle = ''; if ($direction < 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; paddingleft;'; + $extrastyle = 'padding: 0px; padding-left: 3px;'; } if ($direction > 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; paddingright;'; + $extrastyle = 'padding: 0px; padding-right: 3px;'; } $classfortooltip = 'classfortooltip'; From 2484fefa4d56ca7a0041f3a00f453076d3f56658 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Oct 2022 21:01:05 +0200 Subject: [PATCH 0969/1289] Fix deprecated --- htdocs/comm/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 10 +-- htdocs/contrat/class/contrat.class.php | 70 +++++++++---------- .../thirdparties_services_expired.modules.php | 6 +- htdocs/public/payment/newpayment.php | 4 -- 5 files changed, 44 insertions(+), 48 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f6ae06b1f7f..4d59a75fb1b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1165,7 +1165,7 @@ if ($object->id > 0) { $late = ''; foreach ($contrat->lines as $line) { if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) { - if (((!empty($line->date_fin_validite) ? $line->date_fin_validite : 0) + $conf->contrat->services->expires->warning_delay) < $now) { + if (((!empty($line->date_end) ? $line->date_end : 0) + $conf->contrat->services->expires->warning_delay) < $now) { $late = img_warning($langs->trans("Late")); } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 47cd50fa163..d9b7147fefa 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2110,11 +2110,11 @@ class Propal extends CommonObject * Define end validity date * * @param User $user Object user that modify - * @param int $date_fin_validite End of validity date + * @param int $date_end_validity End of validity date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function set_echeance($user, $date_fin_validite, $notrigger = 0) + public function set_echeance($user, $date_end_validity, $notrigger = 0) { // phpcs:enable if (!empty($user->rights->propal->creer)) { @@ -2122,8 +2122,8 @@ class Propal extends CommonObject $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null'); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; + $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_end_validity != '' ? "'".$this->db->idate($date_end_validity)."'" : 'null'); + $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".((int) self::STATUS_DRAFT); dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); @@ -2135,7 +2135,7 @@ class Propal extends CommonObject if (!$error) { $this->oldcopy = clone $this; - $this->fin_validite = $date_fin_validite; + $this->fin_validite = $date_end_validity; } if (!$notrigger && empty($error)) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 47dccff8ca9..4dd26d5d6a2 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3338,41 +3338,41 @@ class ContratLigne extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; - $sql .= " fk_contrat=".((int) $this->fk_contrat).","; - $sql .= " fk_product=".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : 'null').","; - $sql .= " statut=".((int) $this->statut).","; - $sql .= " label='".$this->db->escape($this->label)."',"; - $sql .= " description='".$this->db->escape($this->description)."',"; - $sql .= " date_commande=".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; - $sql .= " date_ouverture_prevue=".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null").","; - $sql .= " date_ouverture=".($this->date_start_real != '' ? "'".$this->db->idate($this->date_start_real)."'" : "null").","; - $sql .= " date_fin_validite=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null").","; - $sql .= " date_cloture=".($this->date_end_real != '' ? "'".$this->db->idate($this->date_end_real)."'" : "null").","; - $sql .= " vat_src_code='".$this->db->escape($this->vat_src_code)."',"; - $sql .= " tva_tx=".price2num($this->tva_tx).","; - $sql .= " localtax1_tx=".price2num($this->localtax1_tx).","; - $sql .= " localtax2_tx=".price2num($this->localtax2_tx).","; - $sql .= " qty=".price2num($this->qty).","; - $sql .= " remise_percent=".price2num($this->remise_percent).","; - $sql .= " remise=".($this->remise ?price2num($this->remise) : "null").","; - $sql .= " fk_remise_except=".($this->fk_remise_except > 0 ? $this->fk_remise_except : "null").","; - $sql .= " subprice=".($this->subprice != '' ? $this->subprice : "null").","; - $sql .= " price_ht=".($this->price_ht != '' ? $this->price_ht : "null").","; - $sql .= " total_ht=".$this->total_ht.","; - $sql .= " total_tva=".$this->total_tva.","; - $sql .= " total_localtax1=".$this->total_localtax1.","; - $sql .= " total_localtax2=".$this->total_localtax2.","; - $sql .= " total_ttc=".$this->total_ttc.","; - $sql .= " fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? $this->fk_fournprice : "NULL").","; - $sql .= " buy_price_ht='".price2num($this->pa_ht)."',"; - $sql .= " info_bits='".$this->db->escape($this->info_bits)."',"; - $sql .= " fk_user_author=".($this->fk_user_author >= 0 ? $this->fk_user_author : "NULL").","; - $sql .= " fk_user_ouverture=".($this->fk_user_ouverture > 0 ? $this->fk_user_ouverture : "NULL").","; - $sql .= " fk_user_cloture=".($this->fk_user_cloture > 0 ? $this->fk_user_cloture : "NULL").","; - $sql .= " commentaire='".$this->db->escape($this->commentaire)."',"; - $sql .= " fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit).","; - $sql .= " rang=".(empty($this->rang) ? '0' : (int) $this->rang); - $sql .= " WHERE rowid=".((int) $this->id); + $sql .= " fk_contrat = ".((int) $this->fk_contrat).","; + $sql .= " fk_product = ".($this->fk_product ? ((int) $this->fk_product) : 'null').","; + $sql .= " statut = ".((int) $this->statut).","; + $sql .= " label = '".$this->db->escape($this->label)."',"; + $sql .= " description = '".$this->db->escape($this->description)."',"; + $sql .= " date_commande = ".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; + $sql .= " date_ouverture_prevue = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null").","; + $sql .= " date_ouverture = ".($this->date_start_real != '' ? "'".$this->db->idate($this->date_start_real)."'" : "null").","; + $sql .= " date_fin_validite = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null").","; + $sql .= " date_cloture = ".($this->date_end_real != '' ? "'".$this->db->idate($this->date_end_real)."'" : "null").","; + $sql .= " vat_src_code = '".$this->db->escape($this->vat_src_code)."',"; + $sql .= " tva_tx = ".price2num($this->tva_tx).","; + $sql .= " localtax1_tx = ".price2num($this->localtax1_tx).","; + $sql .= " localtax2_tx = ".price2num($this->localtax2_tx).","; + $sql .= " qty = ".price2num($this->qty).","; + $sql .= " remise_percent = ".price2num($this->remise_percent).","; + $sql .= " remise = ".($this->remise ?price2num($this->remise) : "null").","; + $sql .= " fk_remise_except = ".($this->fk_remise_except > 0 ? $this->fk_remise_except : "null").","; + $sql .= " subprice = ".($this->subprice != '' ? $this->subprice : "null").","; + $sql .= " price_ht = ".($this->price_ht != '' ? $this->price_ht : "null").","; + $sql .= " total_ht = ".$this->total_ht.","; + $sql .= " total_tva = ".$this->total_tva.","; + $sql .= " total_localtax1 = ".$this->total_localtax1.","; + $sql .= " total_localtax2 = ".$this->total_localtax2.","; + $sql .= " total_ttc = ".$this->total_ttc.","; + $sql .= " fk_product_fournisseur_price = ".(!empty($this->fk_fournprice) ? $this->fk_fournprice : "NULL").","; + $sql .= " buy_price_ht = '".price2num($this->pa_ht)."',"; + $sql .= " info_bits = '".$this->db->escape($this->info_bits)."',"; + $sql .= " fk_user_author = ".($this->fk_user_author >= 0 ? $this->fk_user_author : "NULL").","; + $sql .= " fk_user_ouverture = ".($this->fk_user_ouverture > 0 ? $this->fk_user_ouverture : "NULL").","; + $sql .= " fk_user_cloture = ".($this->fk_user_cloture > 0 ? $this->fk_user_cloture : "NULL").","; + $sql .= " commentaire = '".$this->db->escape($this->commentaire)."',"; + $sql .= " fk_unit = ".(!$this->fk_unit ? 'NULL' : $this->fk_unit).","; + $sql .= " rang = ".(empty($this->rang) ? '0' : (int) $this->rang); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 979782e61a5..9083b643900 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -108,7 +108,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $now = dol_now(); // La requete doit retourner: id, email, name - $sql = "SELECT s.rowid as id, s.email, s.nom as name, cd.rowid as cdid, cd.date_ouverture, cd.date_fin_validite, cd.fk_contrat"; + $sql = "SELECT s.rowid as id, s.email, s.nom as name, cd.rowid as cdid, cd.date_ouverture as date_start_real, cd.date_fin_validite as date_end, cd.fk_contrat"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; @@ -135,8 +135,8 @@ class mailing_thirdparties_services_expired extends MailingTargets 'lastname' => $obj->name, // For thirdparties, lastname must be name 'firstname' => '', // For thirdparties, firstname is '' 'other' => - ('DateStart='.dol_print_date($this->db->jdate($obj->date_ouverture), 'day')).';'. - ('DateEnd='.dol_print_date($this->db->jdate($obj->date_fin_validite), 'day')).';'. + ('DateStart='.dol_print_date($this->db->jdate($obj->date_start_real), 'day')).';'. // date start real + ('DateEnd='.dol_print_date($this->db->jdate($obj->date_end), 'day')).';'. // date end planned ('Contract='.$obj->fk_contrat).';'. ('ContactLine='.$obj->cdid), 'source_url' => $this->url($obj->id), diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2e830a8241b..0941446b4fc 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1361,10 +1361,6 @@ if ($source == 'contractline') { if ($contractline->description) { $text .= '
    '.dol_htmlentitiesbr($contractline->description); } - //if ($contractline->date_fin_validite) { - // $text.='
    '.$langs->trans("DateEndPlanned").': '; - // $text.=dol_print_date($contractline->date_fin_validite); - //} if ($contractline->date_end) { $text .= '
    '.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_end); } From a555a3c4027fa0b916e01c9ab97d1dc1013f023a Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 16 Oct 2022 21:03:14 +0200 Subject: [PATCH 0970/1289] Add product list in phone devices --- htdocs/takepos/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index faa843aec9a..7443c380b9a 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1346,7 +1346,7 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) { onclick="MoreProducts('less');" global->TAKEPOS_WEIGHING_SCALE)) {
    +
    +
    +
    ...
    From 190fc69bfa478a50786dbb986eca20b279ded250 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 16 Oct 2022 21:04:52 +0200 Subject: [PATCH 0971/1289] Add product list in phone devices --- htdocs/takepos/css/pos.css.php | 115 +++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 1ffe5c63db3..ed968ea6f4e 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -825,3 +825,118 @@ div#moreinfo, div#infowarehouse { display: table; clear: both; } + +.div5 .price { + display: none; +} + +.div5 .imgadd { + display: none; +} + +@media screen and (max-width: 767px) { + .div4 { + height: auto; + width: 100%; + float: left; + box-sizing: border-box; + font-size: 6px; + padding-top: 10px; + padding-bottom: 2px; + margin-left: 2px; + } + + .div4 .wrapper.divempty, .div4 img, .div4 .wrapper:nth-last-child(1), .div4 .wrapper:nth-last-child(2), #prodiv22, #prodiv23, .catwatermark { + display: none!important; + } + + .tab-category { + float: left; + position: relative; + width: 25%; + height: 33%; + margin: 0; + padding: 1px; + border: 2px solid #EEE; + text-align: center; + box-sizing: border-box; + background-color: #fff; + } + + .div4 .wrapper, .tab-category { + width: auto; + height: auto; + padding: 6px; + text-align: center; + cursor: pointer; + border: 1px solid #FFF!important; + border-top: 3px solid #FFF!important; + } + + .div4 .tab-category.active { + border-right: 1px solid #CCC !important; + border-left: 1px solid #CCC !important; + border-top: 3px solid var(--colorbackhmenu1) !important; + } + + .div5 { + height: 100%; + width: 100%; + padding-top: 0px; + } + + div.description { + position: initial; + width: auto; + background-color: black; + opacity: 1; + text-align: center; + padding-top: 0px; + background: -webkit-linear-gradient(top, rgba(250,250,250,0), rgba(250,250,250,0.5), rgba(250,250,250,0.95), rgba(250,250,250,1)); + } + + .div5 .description .description_content { + font-weight: bold; + font-size: 14px; + padding-left: 10px; + } + + .div5 .wrapper2 { + width: 100%; + display: inline-flex; + align-items: center; + padding: 10px; + } + + .div5 .wrapper2.divempty { + display: none; + } + + div.wrapper2 { + float: none; + } + + .div5 .arrow { + width: auto; + height: auto; + display: none!important; + } + + .div5 .arrow .centerinmiddle { + transform: translate(0, 0); + } + + .div5 .price { + font-size: 14px; + margin-left: auto; + margin-right: 30px; + padding-right: 10px; + font-weight: bold; + color: #ff6d6d; + display: flex; + } + + .div5 .imgadd { + display: flex; + } +} \ No newline at end of file From 60cf6437e0fb24b6d3628a990a7103c9676fdaf9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 01:23:56 +0200 Subject: [PATCH 0972/1289] Disabling warning (for PHPmail usage) is now easier. --- htdocs/admin/mails.php | 74 ++++++++++++++----------- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/admin.lang | 4 +- 3 files changed, 47 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ff24a708797..1a25af49789 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -118,6 +118,11 @@ if ($action == 'update' && !$cancel) { } } +if ($action == 'disablephpmailwarning' && !$cancel) { + dolibarr_set_const($db, 'MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP', 1, 'chaine', 1, 0, $conf->entity); + + setEventMessages($langs->trans("WarningDisabled"), null, 'mesgs'); +} // Actions to send emails $id = 0; @@ -375,7 +380,7 @@ if ($action == 'edit') { // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); + print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) { @@ -383,13 +388,13 @@ if ($action == 'edit') { } $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); - print ''; + print ''; } print '
    '; print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; @@ -423,7 +428,7 @@ if ($action == 'edit') { // Port print '
    '; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -451,7 +456,7 @@ if ($action == 'edit') { print '
    '.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only @@ -467,7 +472,7 @@ if ($action == 'edit') { // OAUTH - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { print '
    '.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ' '; @@ -485,7 +490,7 @@ if ($action == 'edit') { } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW) ? $conf->global->MAIN_MAIL_SMTPS_PW : ''); print '
    '; print $form->textwithpicto($langs->trans("MAIN_MAIL_SMTPS_PW"), $langs->trans("WithGMailYouCanCreateADedicatedPassword")); @@ -502,7 +507,7 @@ if ($action == 'edit') { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { print '
    '.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only @@ -521,7 +526,7 @@ if ($action == 'edit') { } // TLS print '
    '.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (!empty($conf->global->MAIN_MAIL_EMAIL_TLS) ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1); } else { @@ -534,7 +539,7 @@ if ($action == 'edit') { // STARTTLS print '
    '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1); } else { @@ -547,7 +552,7 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED print '
    '.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (!empty($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED) ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED : 0), 1); } else { @@ -560,7 +565,7 @@ if ($action == 'edit') { // DKIM print '
    '.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (!empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED) ? $conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED : 0), 1); } else { @@ -671,20 +676,21 @@ if ($action == 'edit') { // Method print '
    '.$langs->trans("MAIN_MAIL_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } print $text; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print $form->textwithpicto('', $langs->trans("WarningPHPMail").'
    '.$langs->trans("WarningPHPMailA").'
    '.$langs->trans("WarningPHPMailB").'
    '.$langs->trans("WarningPHPMailC").'

    '.$langs->trans("WarningPHPMailD"), 1, 'warning'); + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + $textwarning = $langs->trans("WarningPHPMail").'
    '.$langs->trans("WarningPHPMailA").'
    '.$langs->trans("WarningPHPMailB").'
    '.$langs->trans("WarningPHPMailC").'

    '.$langs->trans("WarningPHPMailD"); + print $form->textwithpicto('', $textwarning, 1, 'warning'); } print '
    '.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
    '.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'
    '.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
    '.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'
    '.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
    '.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''.$text.'
    '.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
    '.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_TLS); } else { @@ -739,7 +745,7 @@ if ($action == 'edit') { // STARTTLS print '
    '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); } else { @@ -752,7 +758,7 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED print '
    '.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED); } else { @@ -767,7 +773,7 @@ if ($action == 'edit') { if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') { // DKIM print '
    '.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED')); } else { @@ -797,8 +803,14 @@ if ($action == 'edit') { print '
    '; print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print info_admin($langs->trans("WarningPHPMail").'
    '.$langs->trans("WarningPHPMailA").'
    '.$langs->trans("WarningPHPMailB").'
    '.$langs->trans("WarningPHPMailC").'

    '.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + $messagetoshow = $langs->trans("WarningPHPMail").'
    '.$langs->trans("WarningPHPMailA").'
    '.$langs->trans("WarningPHPMailB").'
    '.$langs->trans("WarningPHPMailC").'

    '.$langs->trans("WarningPHPMailD"); + $messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}'); + $linktosetvar1 = ''; + $linktosetvar2 = ''; + $messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow); + $messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow); + print info_admin($messagetoshow, 0, 0, 'warning'); } print '
    '; @@ -903,7 +915,7 @@ if ($action == 'edit') { print ''.$langs->trans("Modify").''; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { - if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) { if (function_exists('fsockopen') && $port && $server) { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -921,7 +933,7 @@ if ($action == 'edit') { print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { /* // Warning 1 if ($linuxlike) @@ -938,11 +950,11 @@ if ($action == 'edit') { if (!in_array($action, array('testconnect', 'test', 'testhtml'))) { $text = ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { //$text .= $langs->trans("WarningPHPMail"); // To encourage to use SMTPS } - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) { // List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com' $text .= ($text ? '

    ' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 91e99e7e8ba..4a6636942c4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1115,7 +1115,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); $warnpicto = ''; - if (!empty($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningPHPMailD")); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3a1056e1be7..b26761b3a49 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -501,7 +501,8 @@ WarningPHPMail=WARNING: The setup to send emails from the application is using t WarningPHPMailA=- Using the server of the Email Service Provider increases the trustability of your email, so it increases the deliverablity without being flagged as SPAM WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. -WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other. +WarningPHPMailD=It is therefore recommended to change the sending method of e-mails to the value "SMTP". +WarningPHPMailDbis=If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by %sclicking here%s. WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask your domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. ActualMailSPFRecordFound=Actual SPF record found (for email %s) : %s @@ -2328,3 +2329,4 @@ HelpCssOnViewDesc=The Css used when viewing the field. HelpCssOnListDesc=The Css used when field is inside a list table.
    Example: "tdoverflowmax200" RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions +WarningDisabled=Warning disabled \ No newline at end of file From babf1e0e27eede723a3d9076f4b736437cddbf81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 01:55:57 +0200 Subject: [PATCH 0973/1289] Fix doc --- htdocs/adherents/class/api_members.class.php | 10 +++++----- htdocs/compta/bank/class/api_bankaccounts.class.php | 4 ++-- htdocs/compta/facture/class/api_invoices.class.php | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index d30e851b9a2..abd75b262c5 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -480,11 +480,11 @@ class Members extends DolibarrApi /** * Add a subscription for a member * - * @param int $id ID of member - * @param int $start_date Start date {@from body} {@type timestamp} - * @param int $end_date End date {@from body} {@type timestamp} - * @param float $amount Amount (may be 0) {@from body} - * @param string $label Label {@from body} + * @param int $id ID of member + * @param string $start_date Start date {@from body} {@type timestamp} + * @param string $end_date End date {@from body} {@type timestamp} + * @param float $amount Amount (may be 0) {@from body} + * @param string $label Label {@from body} * @return int ID of subscription * * @url POST {id}/subscriptions diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 8e38d1ffe78..c9886a176f0 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -471,7 +471,7 @@ class BankAccounts extends DolibarrApi * Add a line to an account * * @param int $id ID of account - * @param int $date Payment date (timestamp) {@from body} {@type timestamp} + * @param string $date Payment date (timestamp) {@from body} {@type timestamp} * @param string $type Payment mode (TYP,VIR,PRE,LIQ,VAD,CB,CHQ...) {@from body} * @param string $label Label {@from body} * @param float $amount Amount (may be 0) {@from body} @@ -480,7 +480,7 @@ class BankAccounts extends DolibarrApi * @param string $cheque_writer Name of cheque writer {@from body} * @param string $cheque_bank Bank of cheque writer {@from body} * @param string $accountancycode Accountancy code {@from body} - * @param int $datev Payment date value (timestamp) {@from body} {@type timestamp} + * @param string $datev Payment date value (timestamp) {@from body} {@type timestamp} * @param string $num_releve Bank statement numero {@from body} * @return int ID of line * diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index e9f9f9e5e65..dc1917f17b4 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1450,7 +1450,6 @@ class Invoices extends DolibarrApi $multicurrency_amounts[$id] = $newvalue; } - // Creation of payment line $paymentobj = new Paiement($this->db); $paymentobj->datepaye = $datepaye; From 68f16b13d70b8bbc8e9051177f7d46069f0eca0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 02:52:03 +0200 Subject: [PATCH 0974/1289] Fix typo --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a1dcdba6f58..17ecdbd865d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -353,7 +353,8 @@ class BonPrelevement extends CommonObject if ($this->fetched == 1) { if ($date < $this->date_trans) { - $this->error = 'DateOfMovementLowerThanDateOfFileTransmission'; + $langs->load("errors"); + $this->error = $langs->trans('ErrorDateOfMovementLowerThanDateOfFileTransmission'); dol_syslog("bon-prelevment::set_infocredit 1027 ".$this->error); return -1027; } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index afcbe76e828..3d661690fd3 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -294,6 +294,7 @@ ErrorFailedToWriteInTempDirectory=Failed to write in temp directory ErrorQuantityIsLimitedTo=Quantity is limited to %s ErrorValueForTooLow=Value for %s is too low ErrorValueCantBeNull=Value for %s can't be null +ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. From c9f9fea7a84fe5ee3b098199fe3f23ae4b48fa00 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 17 Oct 2022 10:27:57 +0200 Subject: [PATCH 0975/1289] NEW private note in thirdparty contact list --- htdocs/core/lib/company.lib.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index b5f8ced66a0..61c264c38ec 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -939,6 +939,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $search_name = GETPOST("search_name", 'alpha'); $search_address = GETPOST("search_address", 'alpha'); $search_poste = GETPOST("search_poste", 'alpha'); + $search_note_private = GETPOST('search_note_private', 'alphanohtml'); $search_roles = GETPOST("search_roles", 'array'); $socialnetworks = getArrayOfSocialNetworks(); @@ -988,6 +989,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20), 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'visible'=>3, 'position'=>35), 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); @@ -998,6 +1000,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), + 't.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position'=>35), 'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40), 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), ); @@ -1032,6 +1035,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $search_roles = array(); $search_address = ''; $search_poste = ''; + $search_note_private = ''; $search = array(); $search_array_options = array(); @@ -1088,6 +1092,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if ($search_address != '') { $param .= '&search_address='.urlencode($search_address); } + if ($search_note_private != '') { + $param .= '&search_note_private='.urlencode($search_note_private); + } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } @@ -1098,6 +1105,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; + $sql .= ", t.note_private"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; $sql .= " WHERE t.fk_soc = ".((int) $object->id); @@ -1116,6 +1124,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if ($search_address) { $sql .= natural_search($searchAddressPhoneDBFields, $search_address); } + if ($search_note_private) { + $sql .= natural_search('t.note_private', $search_note_private); + } if (count($search_roles) > 0) { $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; } @@ -1297,6 +1308,15 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print '
    '; + if ($obj->note_private) { + print dol_string_nohtmltag($obj->note_private); + } + print ''; From 4d92bef61601274756ee650327a9f547306ccafd Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Mon, 17 Oct 2022 10:40:34 +0200 Subject: [PATCH 0976/1289] NEW: Change filter type on tickets list to multiselect --- htdocs/core/class/html.formticket.class.php | 28 +++++++++++---------- htdocs/ticket/list.php | 8 +++++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 12b70731896..3c9651b339d 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -670,23 +670,25 @@ class FormTicket /** * Return html list of tickets type * - * @param string $selected Id du type pre-selectionne - * @param string $htmlname Nom de la zone select - * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS + * @param string|array $selected Id du type pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS + * @param int $multiselect Is multiselect ? * @return void */ - public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') + public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $multiselect = 0) { global $langs, $user; + $selected = is_array($selected) ? $selected : (!empty($selected) ? implode(',', $selected) : array()); $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::select_types_tickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + dol_syslog(get_class($this)."::select_types_tickets ".implode(';',$selected).", ".$htmlname.", ".$filtertype.", ".$format.", ".$multiselect, LOG_DEBUG); $filterarray = array(); @@ -696,7 +698,7 @@ class FormTicket $ticketstat->loadCacheTypesTickets(); - print ''; if ($empty) { print ''; } @@ -730,9 +732,9 @@ class FormTicket } // If text is selected, we compare with code, otherwise with id - if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { + if (in_array($arraytypes['code'], $selected)) { print ' selected="selected"'; - } elseif ($selected == $id) { + } elseif (in_array($id, $selected)) { print ' selected="selected"'; } elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index c989d6f1c4d..e2f4d9c60ba 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -397,6 +397,12 @@ foreach ($search as $key => $val) { $sql .= natural_search($key, $search[$key], 2); } continue; + } elseif ($key == 'type_code') { + $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(',', $search[$key]) : array()); + if (count($newarrayoftypecodes)) { + $sql .= natural_search($key, join(',', $newarrayoftypecodes), 3); + } + continue; } $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0); @@ -814,7 +820,7 @@ foreach ($object->fields as $key => $val) { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'), 1); print ''; From eb9ec07947627ae005920460d10144fdc6196cda Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Mon, 17 Oct 2022 10:47:19 +0200 Subject: [PATCH 0977/1289] Correction Stickler CI --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 3c9651b339d..ab91cd8867b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -688,7 +688,7 @@ class FormTicket $selected = is_array($selected) ? $selected : (!empty($selected) ? implode(',', $selected) : array()); $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::select_types_tickets ".implode(';',$selected).", ".$htmlname.", ".$filtertype.", ".$format.", ".$multiselect, LOG_DEBUG); + dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG); $filterarray = array(); From 342541fb58673714771b739c57bfe4332ecfbfea Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 17 Oct 2022 11:18:35 +0200 Subject: [PATCH 0978/1289] NEW rename MAIN_LIST_ALLOW_PRIVATE_NOTES by MAIN_LIST_HIDE_PRIVATE_NOTES --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 61c264c38ec..70589dfb120 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -989,7 +989,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20), 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30), - 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'visible'=>3, 'position'=>35), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible'=>3, 'position'=>35), 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); From 2d181f01bead3b4bb27b6cc731c5ae160b2d11bc Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 17 Oct 2022 11:37:09 +0200 Subject: [PATCH 0979/1289] NEW rename MAIN_LIST_ALLOW_NOTES by MAIN_LIST_HIDE_NOTES --- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/list.php | 4 ++-- htdocs/compta/facture/list.php | 4 ++-- htdocs/fichinter/list.php | 4 ++-- htdocs/fourn/commande/list.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a5d85633bee..bd573539df3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -244,8 +244,8 @@ $arrayfields = array( 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), - 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 31d9ac1667f..213be0d2389 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -208,8 +208,8 @@ $arrayfields = array( 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), - 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), - 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), + 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135), + 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3db63c119bf..63120cad8da 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -251,8 +251,8 @@ $arrayfields = array( 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>520, 'enabled'=>'1'), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index cbaab666767..174196a23a5 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -126,8 +126,8 @@ $arrayfields = array( 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>500), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000), 'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), 'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 208a184bca2..e0434378573 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -196,8 +196,8 @@ $arrayfields = array( 'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49), 'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>50), 'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>51), - 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>100), - 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>110), + 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>100), + 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>110), ); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field From d0cff20bfddd36f35317de29213779e9d0508b60 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Mon, 17 Oct 2022 12:25:31 +0200 Subject: [PATCH 0980/1289] FIX - editfieldkey --- htdocs/product/stock/product.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c53454f0fc3..551bfd5f9d0 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -649,15 +649,19 @@ if ($id > 0 || $ref) { $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
    ".$langs->trans("CostPriceUsage"); $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); - $costprice = $object->cost_price; if (!$usercancreadprice) { - $costprice = ''; + print $form->editfieldkey($text, 'cost_price', '', $object, 0, 'amount:6'); + print '
    '; + print $form->editfieldval($text, 'cost_price', '', $object, 0, 'amount:6'); + print '
    '; + print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print '
    '; - print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print '
    '; From 1e9f89ae5a39c3539c57d1282789026042855ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 13:31:43 +0200 Subject: [PATCH 0981/1289] FIX Missing reposition on edit button --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 90bfd55cf7a..1d94646d4f6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -165,7 +165,7 @@ class Form $ret .= ''; } if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { - $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; + $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; } if (!empty($notabletag) && $notabletag == 1) { $ret .= ' : '; From 3b3c55ae4df34cc621dc829c88bf2ec7d3a683ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 13:39:19 +0200 Subject: [PATCH 0982/1289] css --- htdocs/fourn/facture/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6dbe069be25..372e1b1e458 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3019,7 +3019,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions' && $form_permission) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
    '; print '
    '; @@ -3154,7 +3154,7 @@ if ($action == 'create') { if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
    '; - print ''; print ''; print '
    '; + print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { @@ -3300,7 +3300,7 @@ if ($action == 'create') { $i = 0; print '
    '; - print '
    '; print $langs->trans('IntracommReportTransportMode'); print '
    '; + print '
    '; print ''; print ''; print ''; @@ -3326,7 +3326,7 @@ if ($action == 'create') { $paymentstatic->type_label = $objp->payment_type; print ''; - print ''; print ''; From 304cb6d04cebb133555c283a55b8d6525b43c76a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 13:58:34 +0200 Subject: [PATCH 0983/1289] CSS preview picto visible even when filename is long --- htdocs/core/class/html.formfile.class.php | 4 +++- htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 010e03e6b3b..b862e691509 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -838,6 +838,7 @@ class FormFile // Show file name with link to download $out .= ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fe31593efbf..9c0ac895a55 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1295,6 +1295,10 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.spanoverflow { + overflow-x: clip; + text-overflow: ellipsis; +} .tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 50px; overflow: hidden; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 41950369dc2..346b683f83c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1405,12 +1405,19 @@ select.flat.selectlimit { width: 130px; } /* using a tdoverflowxxx make the min-width not working */ +.tdnooverflowimp { + text-overflow: none; +} .tdoverflow { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.spanoverflow { + overflow-x: clip; + text-overflow: ellipsis; +} .tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 50px; overflow: hidden; From e1eb1c648f59e7e18baeb4a9a85500001c1ba9fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 14:31:48 +0200 Subject: [PATCH 0984/1289] Tooltip on filename --- htdocs/core/class/html.formfile.class.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b862e691509..1b684fdc236 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -837,20 +837,27 @@ class FormFile } // Show file name with link to download + $imgpreview = $this->showPreview($file, $modulepart, $relativepath, 0, $param);; + $out .= ''; // Show file size From 5dfff4a4dd622e126efe989b19bd40f090169e2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 14:43:06 +0200 Subject: [PATCH 0985/1289] Reponsive --- htdocs/core/tpl/object_discounts.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 4373f09fdb7..0770233c782 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -54,7 +54,7 @@ if ($fixedDiscount > 0) { print $langs->trans($translationKey, $fixedDiscount).'.'; } else { $translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount'; - print ''.$langs->trans($translationKey).'.'; + print ''.$langs->trans($translationKey).'.'; } if ($isNewObject) { print ' ('.$addrelativediscount.')'; @@ -115,7 +115,7 @@ if ($absolute_creditnote > 0) { if ($absolute_discount <= 0 && $absolute_creditnote <= 0) { $translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; - print '
    '.$langs->trans($translationKey).'.'; + print '
    '.$langs->trans($translationKey).'.'; if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { print ' ('.$addabsolutediscount.')'; From 7217c3e74a3be717c9c7432d2179f94b003d0e96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 14:47:03 +0200 Subject: [PATCH 0986/1289] Responsive --- htdocs/theme/eldy/badges.inc.php | 1 + htdocs/theme/md/badges.inc.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 58317deba15..1e6dfb54dbc 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -66,6 +66,7 @@ span.badgeneutral { background-color: #e4e4e4; color: #666; border-radius: 10px; + white-space: nowrap; } diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index 4a36177e852..cfa1afbc9f2 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -69,6 +69,7 @@ span.badgeneutral { background-color: #e4e4e4; color: #666; border-radius: 10px; + white-space: nowrap; } From 7b2970713789e24ea770d2fb33c8b5808d116b02 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 17 Oct 2022 15:08:32 +0200 Subject: [PATCH 0987/1289] NEW parent company column and filter in invoice list --- htdocs/compta/facture/list.php | 52 ++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3db63c119bf..005e146260f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -89,6 +89,7 @@ $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_company_alias = GETPOST('search_company_alias', 'alpha'); +$search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml')); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); $search_montant_vat = GETPOST('search_montant_vat', 'alpha'); $search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha'); @@ -220,6 +221,7 @@ $arrayfields = array( 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), + 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65), @@ -317,6 +319,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_project = ''; $search_company = ''; $search_company_alias = ''; + $search_parent_name = ''; $search_montant_ht = ''; $search_montant_vat = ''; $search_montant_localtax1 = ''; @@ -336,7 +339,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_town = ''; $search_zip = ""; $search_state = ""; - $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; $search_date_startday = ''; @@ -553,6 +555,8 @@ $bankaccountstatic = new Account($db); $facturestatic = new Facture($db); $formcompany = new FormCompany($db); $companystatic = new Societe($db); +$companyparent = new Societe($db); +$company_url_list = array(); $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { @@ -567,6 +571,8 @@ $sql .= ' f.paye as paye, f.fk_statut, f.close_code,'; $sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; +$sql .= " s.parent as fk_parent,"; +$sql .= " s2.nom as name2,"; $sql .= ' typent.code as typent_code,'; $sql .= ' state.code_departement as state_code, state.nom as state_name,'; $sql .= ' country.code as country_code,'; @@ -592,6 +598,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; @@ -666,6 +673,9 @@ if ($search_company) { if ($search_company_alias) { $sql .= natural_search('s.name_alias', $search_company_alias); } +if ($search_parent_name) { + $sql .= natural_search('s2.nom', $search_parent_name); +} if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -1040,10 +1050,13 @@ if ($resql) { $param .= '&search_type='.urlencode($search_type); } if ($search_company) { - $param .= '&search_societe='.urlencode($search_company); + $param .= '&search_company='.urlencode($search_company); } if ($search_company_alias) { - $param .= '&search_societe_alias='.urlencode($search_company_alias); + $param .= '&search_company_alias='.urlencode($search_company_alias); + } + if ($search_parent_name != '') { + $param .= '&search_parent_name='.urlencode($search_parent_name); } if ($search_town) { $param .= '&search_town='.urlencode($search_town); @@ -1054,6 +1067,9 @@ if ($resql) { if ($search_country) { $param .= "&search_country=".urlencode($search_country); } + if ($search_type_thirdparty != '') { + $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); } @@ -1369,6 +1385,12 @@ if ($resql) { if (!empty($arrayfields['s.name_alias']['checked'])) { print '
    '; } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print ''; + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1618,6 +1640,9 @@ if ($resql) { if (!empty($arrayfields['s.name_alias']['checked'])) { print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s2.nom']['checked'])) { + print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER['PHP_SELF'], 's2.nom', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -1747,6 +1772,7 @@ if ($resql) { if ($num > 0) { $i = 0; + $typenArray = $formcompany->typent_array(1); $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array(); @@ -2021,6 +2047,26 @@ if ($resql) { $totalarray['nbfield']++; } } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print '"; + if (!$i) { + $totalarray['nbfield']++; + } + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; print ''; if ($permissiontoupdatecost) { - if (empty($bomcost)) { + if (empty($bomcostupdated)) { print ''; } else { print ''; @@ -1199,17 +1200,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoupdatecost) { // Defined $manufacturingcost $manufacturingcost = 0; - if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble" - $manufacturingcost = $bomcost; + $manufacturingcostsrc = ''; + if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble") + $manufacturingcost = $bomcostupdated; + $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume"); + if (empty($manufacturingcost)) { + $manufacturingcost = $bomcost; + $manufacturingcostsrc = $langs->trans("ValueFromBom"); + } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + $manufacturingcostsrc = $langs->trans("CostPrice"); } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + $manufacturingcostsrc = $langs->trans("PMPValue"); } } - print ''; + print ''; } else { print ''; } From 7c615fafb914507843364ca326106924c759d498 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 23:14:33 +0200 Subject: [PATCH 0992/1289] Update datapolicycron.class.php --- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 13e31581f76..c357fbe7d15 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -451,7 +451,7 @@ class DataPolicyCron $this->db->begin(); foreach ($arrayofparameters as $key => $params) { - if (getDolGlobalInt($key) != '' && is_numeric(getDolGlobalInt($key)) && (int) getDolGlobalInt($key) > 0) { + if (getDolGlobalInt($key) > 0) { $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql); From 5492ea871f8b3532025a3b3c3cc92b71b58cd777 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Mon, 17 Oct 2022 23:40:32 +0200 Subject: [PATCH 0993/1289] FIX tr --- htdocs/product/stock/product.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 551bfd5f9d0..b0771bc39d9 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -653,13 +653,12 @@ if ($id > 0 || $ref) { print $form->editfieldkey($text, 'cost_price', '', $object, 0, 'amount:6'); print ''; } else { print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print ''; } + print ''; From d844980b73b10bf5332a91e961c78da709a86ca9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 23:51:20 +0200 Subject: [PATCH 0994/1289] Doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 41f9d05f752..2376592a12f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ Following changes may create regressions for some external modules, but were nec * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. * All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead +* Code standardization: $user->rights->propale is now $user->rights->propal everywhere. ***** ChangeLog for 16.0.1 compared to 16.0.0 ***** From 1f790158154e0470ecfb3ab85e839e2d952859c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 00:06:20 +0200 Subject: [PATCH 0995/1289] Fix rpm files --- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index f6d81feaea4..a992c84f0f9 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -58,7 +58,7 @@ Requires: mysql, mysql-client %if 0%{?suse_version} # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros Group: Productivity/Office/Management -Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu +Requires: apache2, apache2-mod_php, php >= 5.3.0, php-gd, php-ldap, php-imap, php-mysql, php-openssl, dejavu Requires: mysql-community-server, mysql-community-server-client BuildRequires: update-desktop-files fdupes %else diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index bd6834582ac..884e2494f74 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Productivity/Office/Management -Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu +Requires: apache2, apache2-mod_php, php >= 5.3.0, php-gd, php-ldap, php-imap, php-mysql, php-openssl, dejavu Requires: mysql-community-server, mysql-community-server-client %if 0%{?suse_version} BuildRequires: update-desktop-files fdupes From 9d4b8afc3d504392fcdd4faca536add32db2cf89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 00:12:55 +0200 Subject: [PATCH 0996/1289] Clean rpm --- build/rpm/dolibarr_opensuse.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 884e2494f74..c7113828632 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -66,7 +66,6 @@ ed essere facile da usare. Programmo web, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. -%_datadir/dolibarr/htdocs/webhook #---- prep %prep From 36777ee8c7c3ef35eabf3b685fcddac04d35e1f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 00:48:05 +0200 Subject: [PATCH 0997/1289] Fix phpunit --- htdocs/mrp/mo_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index c275cd644ec..e0b9a8f90da 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -266,17 +266,17 @@ foreach ($search as $key => $val) { $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search('t.'.$key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; } } } From 7df36e4a1f423d51766c1364c1105b5d8bcc6ef3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 00:53:13 +0200 Subject: [PATCH 0998/1289] Try fix phpunit --- htdocs/core/lib/price.lib.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 98311d093cd..a35cb659128 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -341,20 +341,18 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt } // If rounding is not using base 10 (rare) - if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) - { - if ($price_base_type == 'HT') - { - $result[0] = round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { + if ($price_base_type == 'HT') { + $result[0] = price2num(round($result[0] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[2] = price2num($result[0] + $result[1] + $result[9] + $result[10], 'MT'); } else { - $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; - $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; + $result[1] = price2num(round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[2] = price2num(round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[9] = price2num(round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); + $result[10] = price2num(round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT, 'MT'); $result[0] = price2num($result[2] - $result[1] - $result[9] - $result[10], 'MT'); } } From 3077af47cdeb890f09ad5c13bbf75ed103d453e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 03:34:24 +0200 Subject: [PATCH 0999/1289] Git: Add a tool to count nb of lines of code between tag per users. --- dev/tools/github_authors_and_commits_peryear.sh | 5 ++++- dev/tools/github_commits_perversion.sh | 8 ++++++-- dev/tools/github_lines_perusers.sh | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 dev/tools/github_lines_perusers.sh diff --git a/dev/tools/github_authors_and_commits_peryear.sh b/dev/tools/github_authors_and_commits_peryear.sh index 7184d6c44ae..bdba2a2a6ed 100755 --- a/dev/tools/github_authors_and_commits_peryear.sh +++ b/dev/tools/github_authors_and_commits_peryear.sh @@ -1,5 +1,8 @@ #!/bin/sh - +# +# Count number of different contributors and number of commits for a given year. +# + if [ "x$1" = "x" ]; then echo "Usage: $0 YEAR" exit diff --git a/dev/tools/github_commits_perversion.sh b/dev/tools/github_commits_perversion.sh index bf76e68bc43..2f3020ff721 100755 --- a/dev/tools/github_commits_perversion.sh +++ b/dev/tools/github_commits_perversion.sh @@ -1,6 +1,10 @@ #/bin/bash -Releases=("3.8" "3.9" "4.0" "5.0" "6.0" " 7.0" "develop") -Dates=("2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01", "2017-02-01", "2017-07-01", "2018-02-01", "2050-01-01") +# +# Count number of commits per user and per versions (using date for version detection) +# + +Releases=("16.0" "develop") +Dates=("2022-01-01" "2022-08-31" "2050-01-01") let "counter = 1" for i in "${Releases[@]}" diff --git a/dev/tools/github_lines_perusers.sh b/dev/tools/github_lines_perusers.sh new file mode 100755 index 00000000000..5e65ddc6bf9 --- /dev/null +++ b/dev/tools/github_lines_perusers.sh @@ -0,0 +1,16 @@ +#/bin/bash +# +# Count number of lines modified per user for a given branch +# + +if [ "x$2" = "x" ]; then + echo "Usage: $0 tagnamestart|START tagnameend|HEAD" + exit +fi + + +echo "git log $1..$2 --shortstat | grep ... | perl ... > /tmp/github_lines_perusers.tmp" +git log $1..$2 --shortstat | grep -e 'Author:' -e 'Date:' -e ' changed' -e ' insertion' -e ' deletion' | perl -n -e '/^(.*)$/; $line = $1; if ($line =~ /(changed|insertion|deletion)/) { $line =~ s/[^0-9\s]//g; my @arr=split /\s+/, $line; $tot=0; for (1..@arr) { $tot += $arr[$_]; }; print $tot."\n"; } else { print $line."\n"; };' > /tmp/github_lines_perusers.tmp + +cat /tmp/github_lines_perusers.tmp | awk 'BEGIN { FS="\n"; print "user and nb of lines"; lastuser=""; } { if ($1 ~ /Author:/) { lastuser=$1 }; if ($1 ~ /^[0-9]+$/) { aaa[lastuser]=$1; } } END { for (var in aaa) print var," ",aaa[var]; } ' + From 4cf021aeebf6409278f853a60c42eca17a9a4320 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 10:33:04 +0200 Subject: [PATCH 1000/1289] Debug --- dev/tools/github_lines_perusers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/github_lines_perusers.sh b/dev/tools/github_lines_perusers.sh index 5e65ddc6bf9..9a3fad09d62 100755 --- a/dev/tools/github_lines_perusers.sh +++ b/dev/tools/github_lines_perusers.sh @@ -12,5 +12,5 @@ fi echo "git log $1..$2 --shortstat | grep ... | perl ... > /tmp/github_lines_perusers.tmp" git log $1..$2 --shortstat | grep -e 'Author:' -e 'Date:' -e ' changed' -e ' insertion' -e ' deletion' | perl -n -e '/^(.*)$/; $line = $1; if ($line =~ /(changed|insertion|deletion)/) { $line =~ s/[^0-9\s]//g; my @arr=split /\s+/, $line; $tot=0; for (1..@arr) { $tot += $arr[$_]; }; print $tot."\n"; } else { print $line."\n"; };' > /tmp/github_lines_perusers.tmp -cat /tmp/github_lines_perusers.tmp | awk 'BEGIN { FS="\n"; print "user and nb of lines"; lastuser=""; } { if ($1 ~ /Author:/) { lastuser=$1 }; if ($1 ~ /^[0-9]+$/) { aaa[lastuser]=$1; } } END { for (var in aaa) print var," ",aaa[var]; } ' +cat /tmp/github_lines_perusers.tmp | awk 'BEGIN { FS="\n"; print "user and nb of lines"; lastuser=""; } { if ($1 ~ /Author:/) { lastuser=$1 }; if ($1 ~ /^[0-9]+$/) { aaa[lastuser]+=$1; } } END { for (var in aaa) print var," ",aaa[var]; } ' From 0e6359160490eae11ba40be5a4ac1c1f3d081ffa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 18 Oct 2022 10:45:48 +0200 Subject: [PATCH 1001/1289] FIX avoid warning (php8) missing hook parameters --- .../comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/propal/contact.php | 6 +++--- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/list.php | 18 ++++++++--------- htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 2 +- .../comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/comm/prospect/index.php | 4 ++-- htdocs/commande/list.php | 20 +++++++++---------- htdocs/compta/bank/list.php | 14 ++++++------- htdocs/compta/facture/list.php | 17 ++++++++-------- htdocs/contrat/list.php | 16 +++++++-------- htdocs/core/boxes/box_activity.php | 2 +- .../boxes/box_graph_product_distribution.php | 8 ++++---- .../boxes/box_graph_propales_permonth.php | 4 ++-- htdocs/core/boxes/box_propales.php | 2 +- htdocs/core/lib/files.lib.php | 6 +++--- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 18 ++++++++--------- .../doc/doc_generic_project_odt.modules.php | 2 +- .../project/doc/pdf_beluga.modules.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 2 +- htdocs/core/tpl/notes.tpl.php | 2 +- htdocs/fourn/facture/list.php | 20 +++++++++---------- htdocs/hrm/core/tpl/skilldet.fiche.tpl.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/projet/element.php | 2 +- 31 files changed, 94 insertions(+), 95 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 049b70737e8..0942e1554a8 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -204,7 +204,7 @@ class CActionComm if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } - if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propal->lire)) { + if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { $qualified = 1; } if ($obj->module == 'invoice_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (isModEnabled('supplier_invoice') && !empty($user->rights->supplier_invoice->lire)))) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 051ee9de42c..97fceb99f9e 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -74,7 +74,7 @@ restrictedArea($user, 'propal', $object->id); * Add a new contact */ -if ($action == 'addcontact' && $user->rights->propal->creer) { +if ($action == 'addcontact' && $user->rights->propale->creer) { if ($object->id > 0) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); @@ -92,12 +92,12 @@ if ($action == 'addcontact' && $user->rights->propal->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->propal->creer) { +} elseif ($action == 'swapstatut' && $user->rights->propale->creer) { // Toggle the status of a contact if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } -} elseif ($action == 'deletecontact' && $user->rights->propal->creer) { +} elseif ($action == 'deletecontact' && $user->rights->propale->creer) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 1bd6cc71d50..f58ed518517 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -81,7 +81,7 @@ if (!$sortfield) { $object = new Propal($db); $object->fetch($id, $ref); -$permissiontoadd = $user->rights->propal->creer; +$permissiontoadd = $user->rights->propale->creer; // Security check if (!empty($user->socid)) { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 4a6d9ec63ed..edb8e48405e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -227,7 +227,7 @@ if ($resql) { /* * Open (validated) proposals */ -if (isModEnabled("propal") && $user->rights->propal->lire) { +if (isModEnabled("propal") && $user->rights->propale->lire) { $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index bd573539df3..0d560d741ce 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -578,7 +578,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/, $/', '', $sql); $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -755,12 +755,12 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -987,7 +987,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -1104,7 +1104,7 @@ if ($resql) { $moreforfilter .= ''; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -1362,7 +1362,7 @@ if ($resql) { // Fields from hook $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListOption', $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'])) { @@ -1543,7 +1543,7 @@ if ($resql) { 'totalarray' => &$totalarray, ); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['p.datec']['checked'])) { print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); @@ -2140,7 +2140,7 @@ if ($resql) { 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 + $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'])) { @@ -2232,7 +2232,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').'
    '; + print ''; print $paymentstatic->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dp), 'day').''; + $out .= ''; $out .= 'trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); - $out .= ''."\n"; + $out .= ''; + $out .= ''."\n"; $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); $out .= ''; - $out .= ''; - $out .= 'trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); $out .= ''; $out .= ''."\n"; - $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); + $out .= $imgpreview; $out .= ''; + print ''; + print ''; + if ($obj->fk_parent > 0) { + if (!isset($company_url_list[$obj->fk_parent])) { + $companyparent = new Societe($db); + $res = $companyparent->fetch($obj->fk_parent); + if ($res > 0) { + $company_url_list[$obj->fk_parent] = $companyparent->getNomUrl(1); + } + } + if (isset($company_url_list[$obj->fk_parent])) { + print $company_url_list[$obj->fk_parent]; + } + } + print "'; From c63d310f2f8924abaf15ae202cc22d86209a59aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 15:26:42 +0200 Subject: [PATCH 0988/1289] Clean code --- htdocs/compta/facture/card.php | 18 +++++++++--------- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/fourn/facture/card.php | 21 +++++++++++++-------- htdocs/langs/en_US/bills.lang | 1 + 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2f69a3936c9..919c0372a21 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5719,32 +5719,32 @@ if ($action == 'create') { $isErasable = $object->is_erasable(); $params = array( 'attr' => array( - 'title' => '', 'class' => 'classfortooltip' ) ); if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) $enableDelete = false; $deleteHref = '#'; + $htmltooltip = ''; if ($isErasable == -4) { - $params['attr']['title'] = $langs->trans('DisabledBecausePayments'); + $htmltooltip = $langs->trans('DisabledBecausePayments'); } elseif ($isErasable == -3) { - $params['attr']['title'] = $langs->trans('DisabledBecauseNotLastSituationInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseNotLastSituationInvoice'); } elseif ($isErasable == -2) { - $params['attr']['title'] = $langs->trans('DisabledBecauseNotLastInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseNotLastInvoice'); } elseif ($isErasable == -1) { - $params['attr']['title'] = $langs->trans('DisabledBecauseDispatchedInBookkeeping'); + $htmltooltip = $langs->trans('DisabledBecauseDispatchedInBookkeeping'); } elseif ($isErasable <= 0) { // Any other cases - $params['attr']['title'] = $langs->trans('DisabledBecauseNotErasable'); + $htmltooltip = $langs->trans('DisabledBecauseNotErasable'); } elseif ($objectidnext) { - $params['attr']['title'] = $langs->trans('DisabledBecauseReplacedInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseReplacedInvoice'); } else { $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); $enableDelete = true; } - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params); + print dolGetButtonAction($htmltooltip, $langs->trans('Delete'), 'delete', $deleteHref, '', $enableDelete, $params); } else { - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false); + print dolGetButtonAction($langs->trans('Delete'), $langs->trans('Delete'), 'delete', '#', '', false); } } print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 040267e0259..6c278f4764d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10567,7 +10567,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param array $params = [ // Various params for future : recommended rather than adding more function arguments * 'attr' => [ // to add or override button attributes * 'xxxxx' => '', // your xxxxx attribute you want - * 'class' => '', // to add more css class to the button class attribute + * 'class' => 'reposition', // to add more css class to the button class attribute * 'classOverride' => '' // to replace class attribute of the button * ], * 'confirm' => [ @@ -10614,7 +10614,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = if (empty($userRight)) { $attr['class'] = 'butActionRefused'; $attr['href'] = ''; - $attr['title'] = $langs->trans('NotEnoughPermissions'); + $attr['title'] = (($label && $text && $label != $text) ? $label : $langs->trans('NotEnoughPermissions')); } if (!empty($id)) { @@ -10670,7 +10670,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $TCompiledAttr = array(); foreach ($attr as $key => $value) { - $TCompiledAttr[] = $key.'="'.$value.'"'; + $TCompiledAttr[] = $key.'= "'.$value.'"'; } $compiledAttributes = empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 372e1b1e458..44337454772 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3784,21 +3784,26 @@ if ($action == 'create') { // Delete $isErasable = $object->is_erasable(); - if ($action != 'confirm_edit' && ($user->rights->fournisseur->facture->supprimer || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) - //var_dump($isErasable); + if ($action != 'confirm_edit' && ($usercandelete || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) + $enableDelete = false; + $htmltooltip = ''; + $params = (empty($conf->use_javascript_ajax) ? array() : array('attr' => array('class' => 'reposition'))); + //var_dump($isErasable); var_dump($params); if ($isErasable == -4) { - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecausePayments"); } elseif ($isErasable == -3) { // Should never happen with supplier invoice - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotLastSituationInvoice"); } elseif ($isErasable == -2) { // Should never happen with supplier invoice - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotLastInvoice"); } elseif ($isErasable == -1) { - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseDispatchedInBookkeeping"); } elseif ($isErasable <= 0) { // Any other cases - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotErasable"); } else { - print ''.$langs->trans('Delete').''; + $enableDelete = true; + $htmltooltip = ''; } + print dolGetButtonAction($htmltooltip, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), $object->id, $enableDelete, $params); } print ''; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 7ea8295a346..f13baf06446 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -13,6 +13,7 @@ BillsStatistics=Customers invoices statistics BillsStatisticsSuppliers=Vendors invoices statistics DisabledBecauseDispatchedInBookkeeping=Disabled because invoice was dispatched into bookkeeping DisabledBecauseNotLastInvoice=Disabled because invoice is not erasable. Some invoices were recorded after this one and it will create holes in the counter. +DisabledBecauseNotLastSituationInvoice=Disabled because invoice is not erasable. This invoice is not the last one in situation invoice cycle. DisabledBecauseNotErasable=Disabled because cannot be erased InvoiceStandard=Standard invoice InvoiceStandardAsk=Standard invoice From 99962b9ade9c8eca2af1faf9359323bea2e72eb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 15:41:59 +0200 Subject: [PATCH 0989/1289] FIX Search ambigous field on MO list --- htdocs/mrp/mo_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index dfbe224e733..01bcc161a12 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -230,8 +230,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production lineparent ON t.fk_parent_line = lineparent.rowid"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo moparent ON lineparent.fk_mo = moparent.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid"; // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -266,7 +266,7 @@ foreach ($search as $key => $val) { $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search('t.'.$key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { From 159628be564850591f248ddac426dd9a8cb210b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 15:54:48 +0200 Subject: [PATCH 0990/1289] Fix the quick filter on MO --- htdocs/core/ajax/selectsearchbox.php | 1 - htdocs/core/class/html.form.class.php | 1 + htdocs/mrp/mo_list.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 54e3e1e4470..87eec4ac632 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -87,7 +87,6 @@ if (((isModEnabled('product') && $user->hasRight('produit', 'lire')) || (isModEn if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) { $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } - if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5ed1f76227b..5869a85f3cf 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8167,6 +8167,7 @@ class Form if(! data.id) return null;'; if ($callurlonselect) { + // We forge the url with 'sall=' $outdelayed .= ' var urlBase = data.url; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 01bcc161a12..c275cd644ec 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -84,7 +84,7 @@ if (!$sortorder) { } // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { From ebd7605545ea9318779bd99704e92a270eaa18aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 16:39:52 +0200 Subject: [PATCH 0991/1289] Fix bad recalculation of cost price of production of a product --- htdocs/langs/en_US/products.lang | 2 +- htdocs/mrp/mo_production.php | 41 ++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index a0a3f4e588d..38f57cda105 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -399,7 +399,7 @@ ActionAvailableOnVariantProductOnly=Action only available on the variant of prod ProductsPricePerCustomer=Product prices per customers ProductSupplierExtraFields=Additional Attributes (Supplier Prices) DeleteLinkedProduct=Delete the child product linked to the combination -AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price +AmountUsedToUpdateWAP=Unit amount to use to update the Weighted Average Price PMPValue=Weighted average price PMPValueShort=WAP mandatoryperiod=Mandatory periods diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index fb0930deede..c86fcb1f926 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -802,6 +802,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Lines to consume + $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" + if (!empty($object->lines)) { $nblinetoconsume = 0; foreach ($object->lines as $line) { @@ -820,7 +822,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linecost = price2num($tmpproduct->pmp, 'MT'); if ($object->qty > 0) { - // add free consume line cost to bomcost + // add free consume line cost to $bomcostupdated $costprice = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); if (empty($costprice)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; @@ -831,12 +833,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $costprice = 0; } } - $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); - $bomcost += $linecost; + $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities + $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy } - $bomcost = price2num($bomcost, 'MU'); - + $bomcostupdated = price2num($bomcostupdated, 'MU'); $arrayoflines = $object->fetchLinesLinked('consumed', $line->id); $alreadyconsumed = 0; foreach ($arrayoflines as $line2) { @@ -1111,7 +1112,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("Product").''.$langs->trans("Qty").''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).''; + print ''; if ($manufacturingcost) { print price($manufacturingcost); } @@ -1306,19 +1315,27 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoupdatecost) { // Defined $manufacturingcost $manufacturingcost = 0; - if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble" - $manufacturingcost = $bomcost; + $manufacturingcostsrc = ''; + if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble") + $manufacturingcost = $bomcostupdated; + $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume"); + if (empty($manufacturingcost)) { + $manufacturingcost = $bomcost; + $manufacturingcostsrc = $langs->trans("ValueFromBom"); + } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + $manufacturingcostsrc = $langs->trans("CostPrice"); } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + $manufacturingcostsrc = $langs->trans("PMPValue"); } } if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : ($manufacturingcost ? price($manufacturingcost) : '')); - print ''; print $form->editfieldval($text, 'cost_price', '', $object, 0, 'amount:6'); - print '
    '; print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print '
    '."\n"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index c3af3a9b73e..d2e453eac9e 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -64,7 +64,7 @@ restrictedArea($user, 'propal', $object->id, 'propal'); * Actions */ -$permissionnote = $user->rights->propal->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php $reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 9e2e485c92a..af5247fb10f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -60,7 +60,7 @@ $endyear = $year; // Load translation files required by the page $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_proposal')); -if ($mode == 'customer' && !$user->rights->propal->lire) { +if ($mode == 'customer' && !$user->rights->propale->lire) { accessforbidden(); } if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) { diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 37c0f8d5e58..613f06a6feb 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print '
    '.$objectlink->ref_client.''.dol_print_date($objectlink->date, 'day').''; - if ($user->rights->propal->lire) { + if ($user->rights->propale->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 19bde7072ad..83c30743c77 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -119,7 +119,7 @@ if ($resql) { /* * Liste des propal brouillons */ -if (isModEnabled("propal") && $user->rights->propal->lire) { +if (isModEnabled("propal") && $user->rights->propale->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -177,7 +177,7 @@ if (isModEnabled('agenda')) { /* * Dernieres propales ouvertes */ -if (isModEnabled("propal") && $user->rights->propal->lire) { +if (isModEnabled("propal") && $user->rights->propale->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 213be0d2389..f01518651e6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -823,7 +823,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; @@ -857,7 +857,7 @@ if ($search_user > 0) { // Add table from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' WHERE c.fk_soc = s.rowid'; @@ -1012,12 +1012,12 @@ if ($search_fk_input_reason > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -1224,7 +1224,7 @@ if ($resql) { // Add $param from hooks $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -1393,7 +1393,7 @@ if ($resql) { $moreforfilter .= ''; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -1621,7 +1621,7 @@ if ($resql) { // Fields from hook $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1826,7 +1826,7 @@ if ($resql) { 'sortorder' => $sortorder, 'totalarray' => &$totalarray, ); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['c.datec']['checked'])) { print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -2372,7 +2372,7 @@ if ($resql) { 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 + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -2595,7 +2595,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '."\n"; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index c53117a6821..1f4fc60397e 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -190,7 +190,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -242,7 +242,7 @@ if (!empty($searchCategoryBankList)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -308,7 +308,7 @@ if ($optioncss != '') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -366,7 +366,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Bank accounts $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -438,7 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { @@ -502,7 +502,7 @@ if (!empty($arrayfields['toreconcile']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['b.datec']['checked'])) { print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -684,7 +684,7 @@ foreach ($accounts as $key => $type) { 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, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp, $action); // Note that $action and $objecttmpect may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2618e688698..67b208d65ae 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -595,7 +595,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; @@ -859,7 +859,7 @@ if (!empty($searchCategoryCustomerList)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; // We disable this. It create a bug when searching with sall and sorting on status. Also it create performance troubles. @@ -1147,7 +1147,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; $arrayofmassactions = array( @@ -1265,7 +1265,7 @@ if ($resql) { $moreforfilter .= ''; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -1552,7 +1552,7 @@ if ($resql) { // Fields from hook $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['f.datec']['checked'])) { @@ -1737,7 +1737,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); @@ -1793,7 +1793,6 @@ if ($resql) { $total_margin = 0; $savnbfield = $totalarray['nbfield']; - $totalarray = array(); $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { @@ -2436,7 +2435,7 @@ if ($resql) { 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 + $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['f.datec']['checked'])) { @@ -2549,7 +2548,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '."\n"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e8267f85d58..c1b97e65e98 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -251,7 +251,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; @@ -329,7 +329,7 @@ if ($search_user > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,"; $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,'; @@ -347,7 +347,7 @@ $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $obj $sql .= $hookmanager->resPrint; // Add HAVING from hooks $parameters = array('search_dfyear' => $search_dfyear, 'search_op2df'=>$search_op2df); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($search_dfyear > 0 && $search_op2df) { if ($search_op2df == '<=') { @@ -582,7 +582,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->right } $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -674,7 +674,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['c.datec']['checked'])) { @@ -748,7 +748,7 @@ if (!empty($arrayfields['c.date_contrat']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['c.datec']['checked'])) { print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -943,7 +943,7 @@ while ($i < min($num, $limit)) { 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 + $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['c.datec']['checked'])) { @@ -1011,7 +1011,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 56fa8172bcb..fb0a60b567f 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes // list the summary of the propals - if (isModEnabled("propal") && $user->rights->propal->lire) { + if (isModEnabled("propal") && $user->rights->propale->lire) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propalstatic = new Propal($this->db); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 3ef8a3daddf..6b8177e5ed4 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -62,7 +62,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->hidden = !( (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (isModEnabled('commande') && !empty($user->rights->commande->lire)) - || (isModEnabled('propal') && !empty($user->rights->propal->lire)) + || (isModEnabled('propal') && !empty($user->rights->propale->lire)) ); } @@ -110,7 +110,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } - if (isModEnabled('propal') || empty($user->rights->propal->lire)) { + if (isModEnabled('propal') || empty($user->rights->propale->lire)) { $showpropalnb = 0; } if (!isModEnabled('commande') || empty($user->rights->commande->lire)) { @@ -152,7 +152,7 @@ class box_graph_product_distribution extends ModeleBoxes $WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320'; $HEIGHT = '150'; // Height require to have 5+1 entries into legend visible. - if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { + if (isModEnabled("propal") && !empty($user->rights->propale->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showpropalnb) { $langs->load("propal"); @@ -365,7 +365,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - if (isModEnabled("propal") || !empty($user->rights->propal->lire)) { + if (isModEnabled("propal") || !empty($user->rights->propale->lire)) { $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index ff62473c969..13f3a29ec16 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = empty($user->rights->propal->lire); + $this->hidden = empty($user->rights->propale->lire); } /** @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } - if ($user->rights->propal->lire) { + if ($user->rights->propale->lire) { $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; $param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 1a3344eedfe..7114fdb5399 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -83,7 +83,7 @@ class box_propales extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max)); - if ($user->rights->propal->lire) { + if ($user->rights->propale->lire) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c3eede90efd..ce3f8961b32 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2539,7 +2539,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les apercu propal - if ($fuser->rights->propal->{$lire}) { + if ($fuser->rights->propale->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; @@ -2611,7 +2611,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) { // Wrapping pour les images des stats propales - if ($fuser->rights->propal->{$lire}) { + if ($fuser->rights->propale->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file; @@ -2832,7 +2832,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 7795f927c19..a1bccc1dd28 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -411,7 +411,7 @@ function show_stats_for_company($product, $socid) print ''; // Customer proposals - if (isModEnabled("propal") && $user->rights->propal->lire) { + if (isModEnabled("propal") && $user->rights->propale->lire) { $nblines++; $ret = $product->load_stats_propale($socid); if ($ret < 0) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 10c50ca99ee..046d1da2f0e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -157,15 +157,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 8b1261f35f0..ee4e17ae19e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -943,7 +943,7 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propal->lire + 'test' => $conf->propal->enabled && $user->rights->propale->lire ), 'order' => array( 'title' => "ListOrdersAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 9947bb49b0b..c60f2c4bb66 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'test'=>$conf->propal->enabled && $user->rights->propal->lire, + 'test'=>$conf->propal->enabled && $user->rights->propale->lire, 'lang'=>'propal'), 'order'=>array( 'name'=>"CustomersOrders", diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 9d9bd226fd6..5f463e44846 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -41,7 +41,7 @@ $module = $object->element; // Special cases if ($module == 'propal') { - $permission = $user->rights->propal->creer; + $permission = $user->rights->propale->creer; } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 9a9c5866023..dfa9b0e4591 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -60,7 +60,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { - $permission = $user->rights->propal->creer; + $permission = $user->rights->propale->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 10df6a29137..1d7149cdb10 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -433,7 +433,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; @@ -656,7 +656,7 @@ if ($search_user > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if (!$search_all) { @@ -680,7 +680,7 @@ if (!$search_all) { } // Add GroupBy from hooks $parameters = array('all' => $search_all, 'fieldstosearchall' => $fieldstosearchall); - $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } else { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); @@ -688,7 +688,7 @@ if (!$search_all) { // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -860,7 +860,7 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -950,7 +950,7 @@ if (isModEnabled('categorie')) { $moreforfilter .= '
    '; } $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -1174,7 +1174,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['f.datec']['checked'])) { @@ -1302,7 +1302,7 @@ if (!empty($arrayfields['multicurrency_rtp']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -1725,7 +1725,7 @@ if ($num > 0) { 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 + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1793,7 +1793,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "\n"; diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index 81e3f9f2155..60bb56ff173 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -43,7 +43,7 @@ $value_private .= "\n"; /* // Special cases if ($module == 'propal') { -$permission = $user->rights->propal->creer; +$permission = $user->rights->propale->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8eac47207cd..2071171feba 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2831,7 +2831,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == //print '
    '; // Propals - if (isModEnabled("propal") && $user->rights->propal->creer) { + if (isModEnabled("propal") && $user->rights->propale->creer) { $propal = new Propal($db); $langs->load("propal"); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index b0d06f15701..a2bcceab0e5 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -440,7 +440,7 @@ if ($result || !($id > 0)) { continue; } - if ($graphfiles == 'propal' && !$user->rights->propal->lire) { + if ($graphfiles == 'propal' && !$user->rights->propale->lire) { continue; } if ($graphfiles == 'order' && !$user->rights->commande->lire) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index b70d2e08161..4919ffdba84 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propal->lire) { + if ($user->rights->propale->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 50b17b0ac06..538fc6aa362 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propal->lire) { + if ($user->rights->propale->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; //$sql .= " p.ref_supplier,"; $sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 346382c6294..01ffe38cc0d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -388,7 +388,7 @@ $listofreferent = array( 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, - 'test'=>$conf->propal->enabled && $user->rights->propal->lire), + 'test'=>$conf->propal->enabled && $user->rights->propale->lire), 'order'=>array( 'name'=>"CustomersOrders", 'title'=>"ListOrdersAssociatedProject", From 82ca472245b551df5d05f35813cf8d78b7d9a494 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:50:21 +0200 Subject: [PATCH 1002/1289] FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request --- htdocs/core/class/extrafields.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 384d4f1fba4..1fbadc2ee81 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2084,13 +2084,21 @@ class ExtraFields $enabled = 1; if (isset($this->attributes[$object->table_element]['list'][$key])) { - $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + $enabled = intval(dol_eval($this->attributes[$object->table_element]['list'][$key], 1)); } $perms = 1; if (isset($this->attributes[$object->table_element]['perms'][$key])) { $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); } - if (empty($enabled)) { + if ( + empty($enabled) + || ( + $onlykey === '@GETPOSTISSET' + && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'chkbxlst')) + && in_array(abs($enabled), array(2, 5)) + && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided + ) + ) { continue; } if (empty($perms)) { From 8856c5c3d69bf57742210e95b789d9e5b58e2e1c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 18 Oct 2022 10:52:14 +0200 Subject: [PATCH 1003/1289] FIX merge error --- htdocs/comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/propal/contact.php | 6 +++--- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 2 +- .../comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/comm/prospect/index.php | 4 ++-- htdocs/core/boxes/box_activity.php | 2 +- .../boxes/box_graph_product_distribution.php | 8 ++++---- .../core/boxes/box_graph_propales_permonth.php | 4 ++-- htdocs/core/boxes/box_propales.php | 2 +- htdocs/core/lib/files.lib.php | 6 +++--- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 18 +++++++++--------- .../doc/doc_generic_project_odt.modules.php | 2 +- .../modules/project/doc/pdf_beluga.modules.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 2 +- htdocs/core/tpl/notes.tpl.php | 2 +- htdocs/hrm/core/tpl/skilldet.fiche.tpl.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/stats/card.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/projet/element.php | 2 +- 25 files changed, 42 insertions(+), 42 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 0942e1554a8..049b70737e8 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -204,7 +204,7 @@ class CActionComm if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } - if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propal->lire)) { $qualified = 1; } if ($obj->module == 'invoice_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (isModEnabled('supplier_invoice') && !empty($user->rights->supplier_invoice->lire)))) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 97fceb99f9e..051ee9de42c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -74,7 +74,7 @@ restrictedArea($user, 'propal', $object->id); * Add a new contact */ -if ($action == 'addcontact' && $user->rights->propale->creer) { +if ($action == 'addcontact' && $user->rights->propal->creer) { if ($object->id > 0) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); @@ -92,12 +92,12 @@ if ($action == 'addcontact' && $user->rights->propale->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->propale->creer) { +} elseif ($action == 'swapstatut' && $user->rights->propal->creer) { // Toggle the status of a contact if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } -} elseif ($action == 'deletecontact' && $user->rights->propale->creer) { +} elseif ($action == 'deletecontact' && $user->rights->propal->creer) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f58ed518517..1bd6cc71d50 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -81,7 +81,7 @@ if (!$sortfield) { $object = new Propal($db); $object->fetch($id, $ref); -$permissiontoadd = $user->rights->propale->creer; +$permissiontoadd = $user->rights->propal->creer; // Security check if (!empty($user->socid)) { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index edb8e48405e..4a6d9ec63ed 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -227,7 +227,7 @@ if ($resql) { /* * Open (validated) proposals */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index d2e453eac9e..c3af3a9b73e 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -64,7 +64,7 @@ restrictedArea($user, 'propal', $object->id, 'propal'); * Actions */ -$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->propal->creer; // Used by the include of actions_setnotes.inc.php $reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index af5247fb10f..9e2e485c92a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -60,7 +60,7 @@ $endyear = $year; // Load translation files required by the page $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_proposal')); -if ($mode == 'customer' && !$user->rights->propale->lire) { +if ($mode == 'customer' && !$user->rights->propal->lire) { accessforbidden(); } if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) { diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 613f06a6feb..37c0f8d5e58 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 83c30743c77..19bde7072ad 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -119,7 +119,7 @@ if ($resql) { /* * Liste des propal brouillons */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -177,7 +177,7 @@ if (isModEnabled('agenda')) { /* * Dernieres propales ouvertes */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index fb0a60b567f..56fa8172bcb 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes // list the summary of the propals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propalstatic = new Propal($this->db); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 6b8177e5ed4..3ef8a3daddf 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -62,7 +62,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->hidden = !( (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (isModEnabled('commande') && !empty($user->rights->commande->lire)) - || (isModEnabled('propal') && !empty($user->rights->propale->lire)) + || (isModEnabled('propal') && !empty($user->rights->propal->lire)) ); } @@ -110,7 +110,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } - if (isModEnabled('propal') || empty($user->rights->propale->lire)) { + if (isModEnabled('propal') || empty($user->rights->propal->lire)) { $showpropalnb = 0; } if (!isModEnabled('commande') || empty($user->rights->commande->lire)) { @@ -152,7 +152,7 @@ class box_graph_product_distribution extends ModeleBoxes $WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320'; $HEIGHT = '150'; // Height require to have 5+1 entries into legend visible. - if (isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showpropalnb) { $langs->load("propal"); @@ -365,7 +365,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - if (isModEnabled("propal") || !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") || !empty($user->rights->propal->lire)) { $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 13f3a29ec16..ff62473c969 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = empty($user->rights->propale->lire); + $this->hidden = empty($user->rights->propal->lire); } /** @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; $param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 7114fdb5399..1a3344eedfe 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -83,7 +83,7 @@ class box_propales extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max)); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ce3f8961b32..c3eede90efd 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2539,7 +2539,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les apercu propal - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; @@ -2611,7 +2611,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) { // Wrapping pour les images des stats propales - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file; @@ -2832,7 +2832,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a1bccc1dd28..7795f927c19 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -411,7 +411,7 @@ function show_stats_for_company($product, $socid) print ''; // Customer proposals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { $nblines++; $ret = $product->load_stats_propale($socid); if ($ret < 0) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 046d1da2f0e..10c50ca99ee 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -157,15 +157,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index ee4e17ae19e..8b1261f35f0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -943,7 +943,7 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propale->lire + 'test' => $conf->propal->enabled && $user->rights->propal->lire ), 'order' => array( 'title' => "ListOrdersAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index c60f2c4bb66..9947bb49b0b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'test'=>$conf->propal->enabled && $user->rights->propale->lire, + 'test'=>$conf->propal->enabled && $user->rights->propal->lire, 'lang'=>'propal'), 'order'=>array( 'name'=>"CustomersOrders", diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 5f463e44846..9d9bd226fd6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -41,7 +41,7 @@ $module = $object->element; // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index dfa9b0e4591..9a9c5866023 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -60,7 +60,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index 60bb56ff173..81e3f9f2155 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -43,7 +43,7 @@ $value_private .= "\n"; /* // Special cases if ($module == 'propal') { -$permission = $user->rights->propale->creer; +$permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2071171feba..8eac47207cd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2831,7 +2831,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == //print '
    '; // Propals - if (isModEnabled("propal") && $user->rights->propale->creer) { + if (isModEnabled("propal") && $user->rights->propal->creer) { $propal = new Propal($db); $langs->load("propal"); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index a2bcceab0e5..b0d06f15701 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -440,7 +440,7 @@ if ($result || !($id > 0)) { continue; } - if ($graphfiles == 'propal' && !$user->rights->propale->lire) { + if ($graphfiles == 'propal' && !$user->rights->propal->lire) { continue; } if ($graphfiles == 'order' && !$user->rights->commande->lire) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 4919ffdba84..b70d2e08161 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 538fc6aa362..50b17b0ac06 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; //$sql .= " p.ref_supplier,"; $sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 01ffe38cc0d..346382c6294 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -388,7 +388,7 @@ $listofreferent = array( 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, - 'test'=>$conf->propal->enabled && $user->rights->propale->lire), + 'test'=>$conf->propal->enabled && $user->rights->propal->lire), 'order'=>array( 'name'=>"CustomersOrders", 'title'=>"ListOrdersAssociatedProject", From 6050f607043d9b83462e4a5eea0f620c393879b7 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 18 Oct 2022 11:36:17 +0200 Subject: [PATCH 1004/1289] add loadRoleMode on getlinearray --- htdocs/projet/class/project.class.php | 11 ++++++----- htdocs/projet/class/task.class.php | 23 ++++++++++++----------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b127d3aa686..63b8d0077ee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -838,7 +838,7 @@ class Project extends CommonObject } // Fetch tasks - $this->getLinesArray($user); + $this->getLinesArray($user, 0); // Delete tasks $ret = $this->deleteTasks($user); @@ -2204,14 +2204,15 @@ class Project extends CommonObject /** * Create an array of tasks of current project * - * @param User $user Object user we want project allowed to - * @return int >0 if OK, <0 if KO + * @param User $user Object user we want project allowed to + * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action + * @return int >0 if OK, <0 if KO */ - public function getLinesArray($user) + public function getLinesArray($user, $loadRoleMode = 1) { require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $taskstatic = new Task($this->db); - $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0); + $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '', '-1', '', 0, 0, array(), 0, array(), 0, $loadRoleMode); } } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index cda8494682b..2663053b549 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -772,9 +772,10 @@ class Task extends CommonObject * @param array $extrafields Show additional column from project or task * @param int $includebilltime Calculate also the time to bill and billed * @param array $search_array_options Array of search + * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action * @return array Array of tasks */ - public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array()) + public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array(), $loadRoleMode = 1) { global $conf, $hookmanager; @@ -925,18 +926,18 @@ class Task extends CommonObject $error = 0; $obj = $this->db->fetch_object($resql); - - if ((!$obj->public) && (is_object($userp))) { // If not public project and we ask a filter on project owned by a user - if (!$this->getUserRolesForProjectsOrTasks($userp, 0, $obj->projectid, 0)) { - $error++; + if ($loadRoleMode) { + if ((!$obj->public) && (is_object($userp))) { // If not public project and we ask a filter on project owned by a user + if (!$this->getUserRolesForProjectsOrTasks($userp, 0, $obj->projectid, 0)) { + $error++; + } + } + if (is_object($usert)) { // If we ask a filter on a user affected to a task + if (!$this->getUserRolesForProjectsOrTasks(0, $usert, $obj->projectid, $obj->taskid)) { + $error++; + } } } - if (is_object($usert)) { // If we ask a filter on a user affected to a task - if (!$this->getUserRolesForProjectsOrTasks(0, $usert, $obj->projectid, $obj->taskid)) { - $error++; - } - } - if (!$error) { $tasks[$i] = new Task($this->db); $tasks[$i]->id = $obj->taskid; From 71bae4f94b42d6099d50ceafd4e837e7c583d7f9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 18 Oct 2022 09:43:55 +0000 Subject: [PATCH 1005/1289] Fixing style errors. --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 63b8d0077ee..2e6bdd8cec0 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2208,7 +2208,7 @@ class Project extends CommonObject * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action * @return int >0 if OK, <0 if KO */ - public function getLinesArray($user, $loadRoleMode = 1) + public function getLinesArray($user, $loadRoleMode = 1) { require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $taskstatic = new Task($this->db); From 938bc2791725128ca8935faf2ef5c632bbf93920 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 12:59:15 +0200 Subject: [PATCH 1006/1289] Update sample for fail2ban --- dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf | 7 +++---- .../fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf | 7 +++---- .../fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf | 7 +++---- htdocs/admin/system/security.php | 7 ++++--- htdocs/langs/en_US/admin.lang | 4 +++- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf index 45b4a9b8084..2eedad18821 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect access on public pages so we can add mitigation on IP making too much +# access to your a Dolibarr instance. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /public/clicktodial/cidlookup.php" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-passforgotten +# fail2ban-client status web-dolibarr-limitpublic # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf index d5922909ba9..1e126c17693 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect try to check a couple login/password so we can add mitigation +# on IP making too much tries. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 functions_dolibarr::check_user_password_abcd Authentication KO" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-bruteforce +# fail2ban-client status web-dolibarr-rulesbruteforce # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf index edc2ca68092..8cc20dd4be4 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect access on passwordforgotten.php page so we can add mitigation on IP making too much +# access to this Dolibarr page. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-passforgotten +# fail2ban-client status web-dolibarr-rulespassforgotten # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b0ea7571a2d..1ea81cd5dd3 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -570,9 +570,10 @@ print 'For a higher security, we also recommend to implement limits and mitigati print ''; print '
    '; -print 'Login process -> This can be done using a fail2ban rule (see example into dev/setup)'."
    "; -print DOL_URL_ROOT.'/passwordforgotten.php (see example into dev/setup)'."
    "; -print DOL_URL_ROOT.'/public/* (see example into dev/setup)'."
    "; +$urlexamplebase = 'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/'; +print '- Login process (see fail2ban example on GitHub)
    '; +print '- '.DOL_URL_ROOT.'/passwordforgotten.php (see fail2ban example on GitHub)
    '; +print '- '.DOL_URL_ROOT.'/public/* (see fail2ban example on GitHub)
    '; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b26761b3a49..ba92fc4f8a1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2329,4 +2329,6 @@ HelpCssOnViewDesc=The Css used when viewing the field. HelpCssOnListDesc=The Css used when field is inside a list table.
    Example: "tdoverflowmax200" RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions -WarningDisabled=Warning disabled \ No newline at end of file +WarningDisabled=Warning disabled +LimitsAndMitigation=Access limits and mitigation + \ No newline at end of file From 46b5f80db9ba3c8f7582b87d460cec67538e16a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 13:30:51 +0200 Subject: [PATCH 1007/1289] Clean code --- htdocs/core/class/commonobject.class.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 85fc7569505..a198d74f808 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3757,25 +3757,7 @@ abstract class CommonObject $fieldlocaltax2 = 'localtax2'; $fieldttc = 'total_ttc'; // Specific code for backward compatibility with old field names - if ($this->element == 'facture' || $this->element == 'facturerec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'propal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'expensereport') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'supplier_proposal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'commande') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'order_supplier') { + if (in_array($this->element, array('propal', 'commande', 'facture', 'facturerec', 'supplier_proposal', 'order_supplier', 'facture_fourn', 'invoice_supplier', 'invoice_supplier_rec', 'expensereport'))) { $fieldtva = 'total_tva'; } From da3ae71a47b94806a783efa96e6a2fc782e93c22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 13:32:18 +0200 Subject: [PATCH 1008/1289] Try to fix rounding error --- htdocs/core/class/commonobject.class.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b2d5ac8e068..ee4a56eaa9c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3177,12 +3177,17 @@ abstract class CommonObject } $sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid; dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix); - $resqlfix = $this->db->query($sqlfix); - if (!$resqlfix) dol_print_error($this->db, 'Failed to update line'); - $this->total_tva -= $diff; - $this->total_ttc -= $diff; - $total_tva_by_vats[$obj->vatrate] -= $diff; - $total_ttc_by_vats[$obj->vatrate] -= $diff; + + $resqlfix = $this->db->query($sqlfix); + + if (!$resqlfix) { + dol_print_error($this->db, 'Failed to update line'); + } + + $this->total_tva = (float) price2num($this->total_tva - $diff, '', 1); + $this->total_ttc = (float) price2num($this->total_ttc - $diff, '', 1); + $total_tva_by_vats[$obj->vatrate] = (float) price2num($total_tva_by_vats[$obj->vatrate] - $diff, '', 1); + $total_ttc_by_vats[$obj->vatrate] = (float) price2num($total_ttc_by_vats[$obj->vatrate] - $diff, '', 1); } } @@ -3210,6 +3215,13 @@ abstract class CommonObject } } + // Clean total + $this->total_ht = (float) price2num($this->total_ht); + $this->total_tva = (float) price2num($this->total_tva); + $this->total_localtax1 = (float) price2num($this->total_localtax1); + $this->total_localtax2 = (float) price2num($this->total_localtax2); + $this->total_ttc = (float) price2num($this->total_ttc); + $this->db->free($resql); // Now update global field total_ht, total_ttc and tva From a9031505f145161a34f37516c95e72591362efd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Oct 2022 14:26:26 +0200 Subject: [PATCH 1009/1289] display count extrafields in invoice admin --- htdocs/core/lib/invoice.lib.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index b98f17e46ee..bd02d7cca53 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Charlie Benke * Copyright (C) 2017 ATM-CONSULTING * @@ -137,7 +137,13 @@ function facture_prepare_head($object) */ function invoice_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('facture'); + $extrafields->fetch_name_optionals_label('facturedet'); + $extrafields->fetch_name_optionals_label('facture_rec'); + $extrafields->fetch_name_optionals_label('facturedet_rec'); $h = 0; $head = array(); @@ -160,25 +166,41 @@ function invoice_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); + $nbExtrafields = $extrafields->attributes['facture']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['facturedet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); + $nbExtrafields = $extrafields->attributes['facture_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesrec'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); + $nbExtrafields = $extrafields->attributes['facturedet_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslinesrec'; $h++; - if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable + if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; From 9c62169da763d05b330057232de391ca9196a06a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 19:28:43 +0200 Subject: [PATCH 1010/1289] Fix typo --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 5 +++-- htdocs/product/stock/tpl/stocktransfer.tpl.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 08a66d1b8c6..77113fa8cd9 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -93,7 +93,7 @@ if ($object->element == 'product') { if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE; } - print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); + print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100 maxwidth300 widthcentpercentminusx'); print ''; } if ($object->element == 'stock') { @@ -134,9 +134,10 @@ if (!empty($conf->productbatch->enabled) && ) { print ''; print 'element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").''; - print ''; + print img_picto('', 'barcode', 'class="pictofixedwidth"').''; print ''; print ''; + print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''.$langs->trans("SellByDate").''; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index f2ecfa1d73c..35f5c28a2a3 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -104,7 +104,7 @@ if (!empty($conf->productbatch->enabled) && print ''; print ''; } else { - print ''; + print img_picto('', 'barcode', 'class="pictofixedwidth"').''; } print ''; print ''; From ae31b595e5a4a51127e21d88dea7e24b6d683140 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 19:48:49 +0200 Subject: [PATCH 1011/1289] NEW Can set a monthly frequency (or multiple) in cron tasks. --- htdocs/cron/card.php | 13 +++++++++++++ htdocs/cron/class/cronjob.class.php | 24 +++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 87a054c699f..5de627a9a9a 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -473,6 +473,16 @@ if (($action == "create") || ($action == "edit")) { } $input .= ""; print $input; + + $input = " unitfrequency == "2678400") { + $input .= ' checked />'; + } else { + $input .= ' />'; + } + $input .= ""; + print $input; + print ""; print ""; print ""; @@ -664,6 +674,9 @@ if (($action == "create") || ($action == "edit")) { if ($object->unitfrequency == "604800") { print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Weeks'); } + if ($object->unitfrequency == "2678400") { + print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Month'); + } print ""; print ''; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index db48c0e7fce..8f4b32ae502 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2022 Laurent Destailleur * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -23,6 +23,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; /** @@ -1408,21 +1409,30 @@ class Cronjob extends CommonObject if (empty($this->datenextrun)) { if (empty($this->datestart)) { - $this->datenextrun = $now + ($this->frequency * $this->unitfrequency); + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($now, $this->frequency, 'm'); + } else { + $this->datenextrun = $now + ($this->frequency * $this->unitfrequency); + } } else { - $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency); + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($this->datestart, $this->frequency, 'm'); + } else { + $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency); + } } } if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0) { // Loop until date is after future while ($this->datenextrun < $now) { - $this->datenextrun += ($this->frequency * $this->unitfrequency); - - // TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit) + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($this->datenextrun, $this->frequency, 'm'); + } else { + $this->datenextrun += ($this->frequency * $this->unitfrequency); + } } } else { - //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency); dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it"); } From 99d56f74ae47860587c69d8dc3a27ee564e88275 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 19:49:02 +0200 Subject: [PATCH 1012/1289] NEW Can set a monthly frequency (or multiple) in cron tasks. --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 9aaf0771d44..03223a7b65a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -169,7 +169,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend } else { $date->add($interval); } - //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) + //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (so php returns March 1, 2 or 3 respectively) if ($ruleforendofmonth == 1 && $duration_unit == 'm') { $timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m'); From dcc7962757d3905eff0ea5aea04931d20e2d95c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:00:50 +0200 Subject: [PATCH 1013/1289] Fix default email templates --- .../mysql/data/llx_c_email_templates.sql | 16 +++++----- .../install/mysql/migration/15.0.0-16.0.0.sql | 31 +++++++++++++++++++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index bce46a70e49..21775cba58a 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -21,18 +21,18 @@ -- -- Bank Thirdparty -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

    \n\n__(FindYourSEPAMandate)__ :
    \n__MYCOMPANY_NAME__
    \n__MYCOMPANY_FULLADDRESS__

    \n__(Sincerely)__
    \n__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__,

    \n\n__(FindYourSEPAMandate)__ :
    \n__MYCOMPANY_NAME__
    \n__MYCOMPANY_FULLADDRESS__

    \n__(Sincerely)__
    \n__USER_SIGNATURE__',null, 0); -- Members -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipWasValidated)__
    __(FirstName)__ : __MEMBER_FIRSTNAME__
    __(LastName)__ : __MEMBER_LASTNAME__
    __(ID)__ : __MEMBER_ID__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
    \n\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(YourMembershipWasCanceled)__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

    \n\n__(ThisIsContentOfYourCard)__
    \n__(ID)__ : __ID__
    \n__(Civility)__ : __MEMBER_CIVILITY__
    \n__(Firstname)__ : __MEMBER_FIRSTNAME__
    \n__(Lastname)__ : __MEMBER_LASTNAME__
    \n__(Fullname)__ : __MEMBER_FULLNAME__
    \n__(Company)__ : __MEMBER_COMPANY__
    \n__(Address)__ : __MEMBER_ADDRESS__
    \n__(Zip)__ : __MEMBER_ZIP__
    \n__(Town)__ : __MEMBER_TOWN__
    \n__(Country)__ : __MEMBER_COUNTRY__
    \n__(Email)__ : __MEMBER_EMAIL__
    \n__(Birthday)__ : __MEMBER_BIRTH__
    \n__(Photo)__ : __MEMBER_PHOTO__
    \n__(Login)__ : __MEMBER_LOGIN__
    \n__(Phone)__ : __MEMBER_PHONE__
    \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
    \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipWasValidated)__
    __(FirstName)__ : __MEMBER_FIRSTNAME__
    __(LastName)__ : __MEMBER_LASTNAME__
    __(ID)__ : __MEMBER_ID__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
    \n\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(YourMembershipWasCanceled)__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

    \n\n__(ThisIsContentOfYourCard)__
    \n__(ID)__ : __ID__
    \n__(Civility)__ : __MEMBER_CIVILITY__
    \n__(Firstname)__ : __MEMBER_FIRSTNAME__
    \n__(Lastname)__ : __MEMBER_LASTNAME__
    \n__(Fullname)__ : __MEMBER_FULLNAME__
    \n__(Company)__ : __MEMBER_COMPANY__
    \n__(Address)__ : __MEMBER_ADDRESS__
    \n__(Zip)__ : __MEMBER_ZIP__
    \n__(Town)__ : __MEMBER_TOWN__
    \n__(Country)__ : __MEMBER_COUNTRY__
    \n__(Email)__ : __MEMBER_EMAIL__
    \n__(Birthday)__ : __MEMBER_BIRTH__
    \n__(Photo)__ : __MEMBER_PHOTO__
    \n__(Login)__ : __MEMBER_LOGIN__
    \n__(Phone)__ : __MEMBER_PHONE__
    \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
    \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -- Recruiting -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -- Event organization INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

    __(OrganizationEventConfRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 795726bd89c..df7102d105f 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -734,3 +734,34 @@ ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity); ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); + + + +-- Bank Thirdparty +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__,

    \n\n__(FindYourSEPAMandate)__ :
    \n__MYCOMPANY_NAME__
    \n__MYCOMPANY_FULLADDRESS__

    \n__(Sincerely)__
    \n__USER_SIGNATURE__',null, 0); + +-- Members +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipWasValidated)__
    __(FirstName)__ : __MEMBER_FIRSTNAME__
    __(LastName)__ : __MEMBER_LASTNAME__
    __(ID)__ : __MEMBER_ID__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
    \n\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(YourMembershipWasCanceled)__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

    \n\n__(ThisIsContentOfYourCard)__
    \n__(ID)__ : __ID__
    \n__(Civility)__ : __MEMBER_CIVILITY__
    \n__(Firstname)__ : __MEMBER_FIRSTNAME__
    \n__(Lastname)__ : __MEMBER_LASTNAME__
    \n__(Fullname)__ : __MEMBER_FULLNAME__
    \n__(Company)__ : __MEMBER_COMPANY__
    \n__(Address)__ : __MEMBER_ADDRESS__
    \n__(Zip)__ : __MEMBER_ZIP__
    \n__(Town)__ : __MEMBER_TOWN__
    \n__(Country)__ : __MEMBER_COUNTRY__
    \n__(Email)__ : __MEMBER_EMAIL__
    \n__(Birthday)__ : __MEMBER_BIRTH__
    \n__(Photo)__ : __MEMBER_PHOTO__
    \n__(Login)__ : __MEMBER_LOGIN__
    \n__(Phone)__ : __MEMBER_PHONE__
    \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
    \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); + +-- Recruiting +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); + +-- Event organization +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

    __(OrganizationEventConfRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,

    __(OrganizationEventBoothRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfBoothWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfRegistrationWasReceived)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,

    __(OrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,

    __(OrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); + +-- Partnership +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipWillSoonBeCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__', 0, '\n

    __(Hello)__,

    \n__(YourPartnershipWillSoonBeCanceledContent)__

    \n
    \n\n
    \n\n __(Sincerely)__
    \n __[MAIN_INFO_SOCIETE_NOM]__
    \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipCanceledTopic)__', 0, '\n

    __(Hello)__,

    \n__(YourPartnershipCanceledContent)__

    \n
    \n\n
    \n\n __(Sincerely)__
    \n __[MAIN_INFO_SOCIETE_NOM]__
    \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipRefused)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipRefusedTopic)__', 0, '\n

    __(Hello)__,

    \n__(YourPartnershipRefusedContent)__

    \n
    \n\n
    \n\n __(Sincerely)__
    \n __[MAIN_INFO_SOCIETE_NOM]__
    \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipAccepted)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipAcceptedTopic)__', 0, '\n

    __(Hello)__,

    \n__(YourPartnershipAcceptedContent)__

    \n
    \n\n
    \n\n __(Sincerely)__
    \n __[MAIN_INFO_SOCIETE_NOM]__
    \n \n'); From c5c9262a3ca0b578b42c5e3627a11733963e37af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:09:19 +0200 Subject: [PATCH 1014/1289] Fix template of emails --- htdocs/install/mysql/data/llx_c_email_templates.sql | 5 +++-- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 21775cba58a..d2886631942 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -38,8 +38,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

    __(OrganizationEventConfRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,

    __(OrganizationEventBoothRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfBoothWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfRegistrationWasReceived)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfBoothWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfRegistrationWasReceived)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +-- INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,

    __(OrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,

    __(OrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index df7102d105f..517930eb490 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -755,8 +755,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

    __(OrganizationEventConfRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,

    __(OrganizationEventBoothRequestWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfBoothWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfRegistrationWasReceived)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfBoothWasReceived)__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

    __(OrganizationEventPaymentOfRegistrationWasReceived)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +-- INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,

    __(OrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,

    __(OrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); From a6ff67a161870585f253ace45e34248854541ce9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:12:15 +0200 Subject: [PATCH 1015/1289] Fix debug module eventorganization --- htdocs/admin/eventorganization.php | 37 +++++++++++++++-------- htdocs/core/class/html.formmail.class.php | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 40c86d79e13..cc9b8d7bca8 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -220,7 +220,7 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ''; + print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; @@ -302,7 +302,8 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ''; + print ''; + print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); print $form->textwithpicto($langs->trans($constname), $tooltiphelp); @@ -320,12 +321,17 @@ if ($action == 'edit') { $formmail = new FormMail($db); $tmp = explode(':', $val['type']); - - $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template < 0) { - setEventMessages(null, $formmail->errors, 'errors'); + $labelemailtemplate = getDolGlobalString($constname); + if ($labelemailtemplate && $labelemailtemplate != '-1') { + $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); + if (is_numeric($template) && $template < 0) { + setEventMessages($formmail->error, $formmail->errors, 'errors'); + } else { + if ($template->label != 'default') { + print $langs->trans($template->label); + } + } } - print $langs->trans($template->label); } } elseif (preg_match('/category:/', $val['type'])) { if (getDolGlobalString($constname)) { @@ -353,16 +359,21 @@ if ($action == 'edit') { } } elseif ($val['type'] == 'product') { $product = new Product($db); - $resprod = $product->fetch(getDolGlobalString($constname)); - if ($resprod > 0) { - print $product->getNomUrl(1); - } elseif ($resprod < 0) { - setEventMessages($product->error, $product->errors, "errors"); + $idproduct = getDolGlobalString($constname); + if ($idproduct > 0) { + $resprod = $product->fetch($idproduct); + if ($resprod > 0) { + print $product->getNomUrl(1); + } elseif ($resprod < 0) { + setEventMessages($product->error, $product->errors, "errors"); + } } } else { print getDolGlobalString($constname); } - print ''; + print ''; + + print ''; } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index debfbbf1b8e..16302dc3c1a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1284,7 +1284,7 @@ class FormMail extends Form * @param int $id Id of template to get, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $active 1=Only active template, 0=Only disabled, -1=All * @param string $label Label of template to get - * @return ModelMail|integer One instance of ModelMail or -1 if error + * @return ModelMail|integer One instance of ModelMail or < 0 if error */ public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') { From ac6f187d392c1d6a1b63066ae631f44eedbd9e29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:12:40 +0200 Subject: [PATCH 1016/1289] Better setup by default for module eventorganization --- .../modules/modEventOrganization.class.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index f600ef633aa..9ad2ede9b77 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -370,6 +370,28 @@ class modEventOrganization extends DolibarrModules $init = $this->_init($sql, $options); + + // Insert some vars + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($this->db); + + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskConf)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskBooth)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailBoothPayment)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailRegistrationPayment)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT', $template->id, 'chaine', 0, '', $conf->entity); + } + return $init; } From 391df5043b1b16a37204053f61036f811b5ddd62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:18:22 +0200 Subject: [PATCH 1017/1289] Fix css --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 1b5f8353f12..5a4eac7bcca 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1173,7 +1173,7 @@ if ($num) { $class .= ' tdoverflowmax100'; } if ($value == 'topic') { - $class .= 'tdoverflowmax200 small'; + $class .= ' tdoverflowmax200 small'; } if ($value == 'type_template') { $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; From 2bfc60587e4e749d8f889876b6ee1692a3f1de87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:28:47 +0200 Subject: [PATCH 1018/1289] Fix title of emails sents on payment --- htdocs/public/payment/paymentok.php | 40 ++++++++--------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 4d1336351b3..bb50440aff3 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1289,7 +1289,7 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived"); } @@ -1493,7 +1493,7 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived"); } @@ -1542,6 +1542,14 @@ if ($ispaymentok) { } } + +// Set $appli for emails title +$appli = constant('DOL_APPLICATION_TITLE'); +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; +} + + if ($ispaymentok) { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; @@ -1600,19 +1608,6 @@ if ($ispaymentok) { //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); @@ -1740,21 +1735,6 @@ if ($ispaymentok) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content = ""; From 0db1863429154ae0962769c006e992a30f934cf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:31:32 +0200 Subject: [PATCH 1019/1289] Fix title of emails sents on payment --- htdocs/public/payment/paymentko.php | 19 ++++--------------- htdocs/public/payment/paymentok.php | 5 +---- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 29adb2947d0..2504260cbc5 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -136,6 +136,10 @@ foreach ($_POST as $k => $v) { dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); +// Set $appli for emails title +$appli = $mysoc->name; + + if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice // Get on url call $fulltag = $FULLTAG; @@ -173,21 +177,6 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice $from = $conf->global->MAILING_EMAIL_FROM; $sendto = $sendemail; - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content = ""; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index bb50440aff3..ea1de4ca7ef 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1544,10 +1544,7 @@ if ($ispaymentok) { // Set $appli for emails title -$appli = constant('DOL_APPLICATION_TITLE'); -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; -} +$appli = $mysoc->name; if ($ispaymentok) { From 2b2d01cdc96d94d3f2831d6cdba3de4411ab9b18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:18:22 +0200 Subject: [PATCH 1020/1289] Fix css --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f9fe30ef6d7..c3912dc2b67 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1173,7 +1173,7 @@ if ($num) { $class .= ' tdoverflowmax100'; } if ($value == 'topic') { - $class .= 'tdoverflowmax200 small'; + $class .= ' tdoverflowmax200 small'; } if ($value == 'type_template') { $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; From b562ab994841fb264a21412da3b5f4d5841d79bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:12:15 +0200 Subject: [PATCH 1021/1289] Fix debug module eventorganization --- htdocs/admin/eventorganization.php | 37 +++++++++++++++-------- htdocs/core/class/html.formmail.class.php | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index f91f8ef13f1..8efbfcdb669 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -220,7 +220,7 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ''; + print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; @@ -313,7 +313,8 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ''; + print ''; + print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); $tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '

    '."\n".$langs->trans($constname . 'Tooltip2') : ''); print $form->textwithpicto($langs->trans($constname), $tooltiphelp); @@ -331,12 +332,17 @@ if ($action == 'edit') { $formmail = new FormMail($db); $tmp = explode(':', $val['type']); - - $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template < 0) { - setEventMessages(null, $formmail->errors, 'errors'); + $labelemailtemplate = getDolGlobalString($constname); + if ($labelemailtemplate && $labelemailtemplate != '-1') { + $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); + if (is_numeric($template) && $template < 0) { + setEventMessages($formmail->error, $formmail->errors, 'errors'); + } else { + if ($template->label != 'default') { + print $langs->trans($template->label); + } + } } - print $langs->trans($template->label); } } elseif (preg_match('/category:/', $val['type'])) { if (getDolGlobalString($constname)) { @@ -364,16 +370,21 @@ if ($action == 'edit') { } } elseif ($val['type'] == 'product') { $product = new Product($db); - $resprod = $product->fetch(getDolGlobalString($constname)); - if ($resprod > 0) { - print $product->getNomUrl(1); - } elseif ($resprod < 0) { - setEventMessages($product->error, $product->errors, "errors"); + $idproduct = getDolGlobalString($constname); + if ($idproduct > 0) { + $resprod = $product->fetch($idproduct); + if ($resprod > 0) { + print $product->getNomUrl(1); + } elseif ($resprod < 0) { + setEventMessages($product->error, $product->errors, "errors"); + } } } else { print getDolGlobalString($constname); } - print ''; + print ''; + + print ''; } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 281cfaca58d..74f0eadfdf2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1277,7 +1277,7 @@ class FormMail extends Form * @param int $id Id of template to get, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $active 1=Only active template, 0=Only disabled, -1=All * @param string $label Label of template to get - * @return ModelMail|integer One instance of ModelMail or -1 if error + * @return ModelMail|integer One instance of ModelMail or < 0 if error */ public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') { From 8d8230795614927bffa999405a134511e3ebb9c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:28:47 +0200 Subject: [PATCH 1022/1289] Fix title of emails sents on payment --- htdocs/public/payment/paymentok.php | 40 ++++++++--------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b4a099333c9..96eeff1cad2 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1287,7 +1287,7 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived"); } @@ -1491,7 +1491,7 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived"); } @@ -1540,6 +1540,14 @@ if ($ispaymentok) { } } + +// Set $appli for emails title +$appli = constant('DOL_APPLICATION_TITLE'); +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; +} + + if ($ispaymentok) { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; @@ -1598,19 +1606,6 @@ if ($ispaymentok) { //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); @@ -1738,21 +1733,6 @@ if ($ispaymentok) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content = ""; From 2101611bd519d1353242a76ec9544c6b9893adc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 23:31:32 +0200 Subject: [PATCH 1023/1289] Fix title of emails sents on payment --- htdocs/public/payment/paymentko.php | 19 ++++--------------- htdocs/public/payment/paymentok.php | 5 +---- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 606bed0c490..bed4a3d63f0 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -135,6 +135,10 @@ foreach ($_POST as $k => $v) { dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); +// Set $appli for emails title +$appli = $mysoc->name; + + if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice // Get on url call $fulltag = $FULLTAG; @@ -172,21 +176,6 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice $from = $conf->global->MAILING_EMAIL_FROM; $sendto = $sendemail; - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content = ""; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 96eeff1cad2..154e4606cd5 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1542,10 +1542,7 @@ if ($ispaymentok) { // Set $appli for emails title -$appli = constant('DOL_APPLICATION_TITLE'); -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; -} +$appli = $mysoc->name; if ($ispaymentok) { From 4cbd19e6bd4da96acb481d0b893bf06c39bc5fb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 00:01:18 +0200 Subject: [PATCH 1024/1289] Debug attendee registration --- .../class/conferenceorboothattendee.class.php | 7 +++++-- htdocs/public/payment/paymentok.php | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 222a0c78946..909758ca3f2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -103,12 +103,13 @@ class ConferenceOrBoothAttendee extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1), 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'email_company' => array('type'=>'mail', 'label'=>'EmailCompany', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>-2, 'searchall'=>1), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'$conf->facture->enabled', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'), 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), @@ -125,11 +126,13 @@ class ConferenceOrBoothAttendee extends CommonObject ); public $rowid; public $ref; - public $fk_soc; public $fk_actioncomm; + public $fk_project; public $email; public $firstname; public $lastname; + public $fk_soc; + public $email_company; public $date_subscription; public $fk_invoice; public $amount; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ea1de4ca7ef..c56732f5938 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1266,7 +1266,7 @@ if ($ispaymentok) { $thirdparty = new Societe($db); $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); if ($resultthirdparty < 0) { - setEventMessages(null, $attendeetovalidate->errors, "errors"); + setEventMessages($resultthirdparty->error, $resultthirdparty->errors, "errors"); } else { require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -1293,7 +1293,6 @@ if ($ispaymentok) { $msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived"); } - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); complete_substitutions_array($substitutionarray, $outputlangs, $object); @@ -1301,6 +1300,13 @@ if ($ispaymentok) { $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); $sendto = $attendeetovalidate->email; + $cc = ''; + if ($thirdparty->email) { + $cc = $thirdparty->email; + } + if ($attendeetovalidate->email_company && $attendeetovalidate->email_company != $thirdparty->email) { + $cc = ($cc ? ', ' : '').$attendeetovalidate->email_company; + } $from = $conf->global->MAILING_EMAIL_FROM; $urlback = $_SERVER["REQUEST_URI"]; @@ -1321,7 +1327,7 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); $result = $mailfile->sendfile(); if ($result) { From fee00a3655e66ba4fb9a966c2d4c81bbd9a2a18c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 00:29:23 +0200 Subject: [PATCH 1025/1289] Look and feel --- htdocs/comm/mailing/cibles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 1beefca8cf6..ed3cfce4163 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -544,7 +544,7 @@ if ($object->fetch($id) >= 0) { if ($allowaddtarget) { $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").' id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").''; } - $morehtmlcenter .= '   id.'">'.$langs->trans("Download").''; + $morehtmlcenter .= '   id.'">'.img_picto('', 'download', 'class="pictofixedwidth"').$langs->trans("Download").''; $massactionbutton = ''; From 87339de68da4232024d8cc090b75cf6597be8468 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 19 Oct 2022 09:29:11 +0200 Subject: [PATCH 1026/1289] add human readeable trad --- htdocs/langs/en_US/dict.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index 9eaeb52f8f2..00ab5a05f24 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -250,9 +250,9 @@ CountryMF=Saint Martin ##### Civilities ##### CivilityMME=Mrs. -CivilityMMEShort=CivilityMMEShort +CivilityMMEShort=Mrs. CivilityMR=Mr. -CivilityMRShort=CivilityMRShort +CivilityMRShort=Mr. CivilityMLE=Ms. CivilityMTRE=Master CivilityDR=Doctor From 5d12903b3458699a65da1d87bedce50a68a4c4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Oct 2022 10:22:55 +0200 Subject: [PATCH 1027/1289] add count extrafields badge in bank admin --- htdocs/core/lib/bank.lib.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 8920808766a..736b200bea3 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -131,7 +131,12 @@ function bank_prepare_head(Account $object) */ function bank_admin_prepare_head($object) { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('bank_account'); + $extrafields->fetch_name_optionals_label('bank'); + $h = 0; $head = array(); @@ -154,11 +159,19 @@ function bank_admin_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')'; + $nbExtrafields = $extrafields->attributes['bank_account']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')'; + $nbExtrafields = $extrafields->attributes['bank']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'bankline_extrafields'; $h++; From 477f5e2890fc841cc9b87fedb2b4358b27b6a0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Wed, 19 Oct 2022 11:53:17 +0200 Subject: [PATCH 1028/1289] FIX: Missing return 0 if object not found --- htdocs/commande/class/commande.class.php | 6 ++++++ htdocs/compta/facture/class/facture.class.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 54e50baa9f7..97bd4d36fa4 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4138,6 +4138,12 @@ class OrderLine extends CommonOrderLine $result = $this->db->query($sql); if ($result) { $objp = $this->db->fetch_object($result); + + if (!$objp) { + $this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_commande = $objp->fk_commande; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 862a86e9e16..8804e58b1c1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5293,6 +5293,11 @@ class FactureLigne extends CommonInvoiceLine if ($result) { $objp = $this->db->fetch_object($result); + if (!$objp) { + $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_facture = $objp->fk_facture; From d4344a736f9a70d98f986d665bb3232487698576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 19 Oct 2022 12:28:51 +0200 Subject: [PATCH 1029/1289] add accessible values --- htdocs/product/dynamic_price/class/price_parser.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 764ff919cc7..412d015f8b9 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -150,6 +150,8 @@ class PriceParser "length" => $product->length, "surface" => $product->surface, "price_min" => $product->price_min, + "cost_price" => $product->cost_price, + "pmp" => $product->pmp, )); //Retrieve all extrafield for product and add it to values From 801af96fcdb95ba0ad564116f7f2d459362cdd11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 16:09:02 +0200 Subject: [PATCH 1030/1289] FIX Import contact when duplicate thirdparties FIX Import of socialnetwork field --- .../modules/import/import_csv.modules.php | 21 +++++++++--- .../modules/import/import_xlsx.modules.php | 32 +++++++++++++------ htdocs/langs/en_US/errors.lang | 1 + 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 594ab96d955..09f93a436ea 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -458,17 +458,27 @@ class ImportCsv extends ModeleImports $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -729,9 +739,13 @@ class ImportCsv extends ModeleImports if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + $listvalues[$socialkey] = ''; } + //var_dump($newval); var_dump($arrayrecord[($key - 1)]['type']); if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + //var_dump('sk='.$socialkey); // socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -833,7 +847,6 @@ class ImportCsv extends ModeleImports if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM ".$tablename; - $data = array_combine($listfields, $listvalues); $where = array(); // filters to forge SQL request $filters = array(); // filters to forge output error message diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 3637ce105c1..a6470aef520 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -502,17 +502,28 @@ class ImportXlsx extends ModeleImports }*/ $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -770,12 +781,14 @@ class ImportXlsx extends ModeleImports } // Define $listfields and $listvalues to build SQL request - if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 + $listvalues[$socialkey] = ''; } if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -797,7 +810,7 @@ class ImportXlsx extends ModeleImports } elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) { $listvalues[] = "''"; } else { - $listvalues[] = "'" . $this->db->escape($newval) . "'"; + $listvalues[] = "'".$this->db->escape($newval)."'"; } } } @@ -810,7 +823,7 @@ class ImportXlsx extends ModeleImports if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { // Loop on each hidden fields to add them into listfields/listvalues foreach ($objimport->array_import_fieldshidden[0] as $key => $val) { - if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) { + if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) { continue; // Not a field of current table } if ($val == 'user->id') { @@ -876,17 +889,16 @@ class ImportXlsx extends ModeleImports if (!empty($updatekeys)) { // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) - $where = array(); - if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM " . $tablename; $data = array_combine($listfields, $listvalues); - $filters = array(); + $where = array(); // filters to forge SQL request + $filters = array(); // filters to forge output error message foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; $key = preg_replace('/^.*\./i', '', $key); - if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) { $tmp = explode("_", $key); $key = $tmp[0]; $socialnetwork = $tmp[1]; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 6ff5a63196a..8c64ccf7874 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -97,6 +97,7 @@ ErrorWrongValueForField=Field %s: '%s' does not match regex rule < ErrorHtmlInjectionForField=Field %s: The value '%s' contains a malicious data not allowed ErrorFieldValueNotIn=Field %s: '%s' is not a value found in field %s of %s ErrorFieldRefNotIn=Field %s: '%s' is not a %s existing ref +ErrorMultipleRecordFoundFromRef=Several record found when searching from ref %s. No way to know which ID to use. ErrorsOnXLines=%s errors found ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module. From 0d1702627601ec1842213b025779b5f78d6b3abe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 16:09:02 +0200 Subject: [PATCH 1031/1289] FIX Import contact when duplicate thirdparties FIX Import of socialnetwork field --- .../modules/import/import_csv.modules.php | 21 +++++++++--- .../modules/import/import_xlsx.modules.php | 32 +++++++++++++------ htdocs/langs/en_US/errors.lang | 1 + 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 0bea7d1d739..b251d70ad8f 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -458,17 +458,27 @@ class ImportCsv extends ModeleImports $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -729,9 +739,13 @@ class ImportCsv extends ModeleImports if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + $listvalues[$socialkey] = ''; } + //var_dump($newval); var_dump($arrayrecord[($key - 1)]['type']); if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + //var_dump('sk='.$socialkey); // socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -833,7 +847,6 @@ class ImportCsv extends ModeleImports if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM ".$tablename; - $data = array_combine($listfields, $listvalues); $where = array(); // filters to forge SQL request $filters = array(); // filters to forge output error message diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 8652f106ca2..4023c1ecc99 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -502,17 +502,28 @@ class ImportXlsx extends ModeleImports }*/ $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -770,12 +781,14 @@ class ImportXlsx extends ModeleImports } // Define $listfields and $listvalues to build SQL request - if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 + $listvalues[$socialkey] = ''; } if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -797,7 +810,7 @@ class ImportXlsx extends ModeleImports } elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) { $listvalues[] = "''"; } else { - $listvalues[] = "'" . $this->db->escape($newval) . "'"; + $listvalues[] = "'".$this->db->escape($newval)."'"; } } } @@ -810,7 +823,7 @@ class ImportXlsx extends ModeleImports if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { // Loop on each hidden fields to add them into listfields/listvalues foreach ($objimport->array_import_fieldshidden[0] as $key => $val) { - if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) { + if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) { continue; // Not a field of current table } if ($val == 'user->id') { @@ -880,12 +893,13 @@ class ImportXlsx extends ModeleImports $sqlSelect = "SELECT ".$fname." FROM " . $tablename; $data = array_combine($listfields, $listvalues); - $where = array(); - $filters = array(); + + $where = array(); // filters to forge SQL request + $filters = array(); // filters to forge output error message foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; $key = preg_replace('/^.*\./i', '', $key); - if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) { $tmp = explode("_", $key); $key = $tmp[0]; $socialnetwork = $tmp[1]; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 3d661690fd3..3e2f4aa44d3 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -96,6 +96,7 @@ ErrorWrongValueForField=Field %s: '%s' does not match regex rule < ErrorHtmlInjectionForField=Field %s: The value '%s' contains a malicious data not allowed ErrorFieldValueNotIn=Field %s: '%s' is not a value found in field %s of %s ErrorFieldRefNotIn=Field %s: '%s' is not a %s existing ref +ErrorMultipleRecordFoundFromRef=Several record found when searching from ref %s. No way to know which ID to use. ErrorsOnXLines=%s errors found ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s" From b32ee6320dcf65d9cf56284dc826828d03fca8ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:01:18 +0200 Subject: [PATCH 1032/1289] FIX Search on social networks --- htdocs/contact/list.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1a2dac09da3..605fafd9e01 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -500,7 +500,15 @@ if (strlen($search_fax)) { if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && strlen($search_[$key])) { - $sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'"; + $searchkeyinjsonformat = preg_replace('/"$/', '', preg_replace('/^"/', '', json_encode($search_[$key]))); + if (in_array($db->type, array('mysql', 'mysqli'))) { + $sql .= " AND p.socialnetworks REGEXP '\"".$db->escapeforlike($db->escape($key))."\":\"[^\"]*".$db->escapeforlike($db->escape($searchkeyinjsonformat))."'"; + } elseif ($db->type == 'pgsql') { + $sql .= " AND p.socialnetworks ~ '\"".$db->escapeforlike($db->escape($key))."\":\"[^\"]*".$db->escapeforlike($db->escape($searchkeyinjsonformat))."'"; + } else { + // Works with all database but not reliable because search only for social network code starting with earched value + $sql .= " AND p.socialnetworks LIKE '%\"".$db->escapeforlike($db->escape($key))."\":\"".$db->escapeforlike($db->escape($searchkeyinjsonformat))."%'"; + } } } } @@ -555,6 +563,7 @@ if ($view == "recent") { } else { $sql .= $db->order($sortfield, $sortorder); } +//print $sql; // Count total nb of records $nbtotalofrecords = ''; From 8d515b9c2f2b206a03b890f248e47e00dd490e5e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 19 Oct 2022 17:06:20 +0200 Subject: [PATCH 1033/1289] FIX - php 8 Warning newonlinessign --- htdocs/public/onlinesign/newonlinesign.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 91c3ec2ce73..09d8eccd66f 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -78,6 +78,9 @@ $message = GETPOST('message', 'aZ09'); $suffix = GETPOST("suffix", 'aZ09'); $source = GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); +$urlok = ''; +$urlko = ''; + if (empty($source)) { $source = 'proposal'; From 2eb3b62c8389eed0884d3217d91930f124580bdc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:21:42 +0200 Subject: [PATCH 1034/1289] Fix trans --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 78378c6c5d3..b6368a7d374 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -36,6 +36,7 @@ Language_en_SA=English (Saudi Arabia) Language_en_SG=English (Singapore) Language_en_US=English (United States) Language_en_ZA=English (South Africa) +Language_en_ZW=English (Zimbabwe) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) Language_es_BO=Spanish (Bolivia) From e507eac37d75572bb0409053fd4adeb851b08303 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:35:40 +0200 Subject: [PATCH 1035/1289] Fix consistency of test --- htdocs/accountancy/admin/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index e70bc39bfd0..9eabd378e11 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -85,7 +85,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { + if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { $account_number = $account_number; } else { $account_number = clean_account($account_number); @@ -148,7 +148,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if (isset($conf->global->ACCOUNTING_MANAGE_ZERO) && $conf->global->ACCOUNTING_MANAGE_ZERO == 1) { + if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { $account_number = $account_number; } else { $account_number = clean_account($account_number); From 39daea97551b4fda3769db4755658d96f3120463 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:43:36 +0200 Subject: [PATCH 1036/1289] Exclude .git dir fom package generation --- build/makepack-dolibarrmodule.pl | 1 + htdocs/modulebuilder/index.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarrmodule.pl b/build/makepack-dolibarrmodule.pl index 4a9a217b570..8fbb28dc35f 100755 --- a/build/makepack-dolibarrmodule.pl +++ b/build/makepack-dolibarrmodule.pl @@ -293,6 +293,7 @@ foreach my $PROJECT (@PROJECTLIST) { } print "Clean $BUILDROOT\n"; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.cache`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/.git`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.project`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.settings`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/index.php`; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e247b5fabb5..705dc202932 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1780,7 +1780,7 @@ if ($dirins && $action == 'generatepackage') { dol_mkdir($dirofmodule); } // Note: We exclude /bin/ to not include the already generated zip - $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\//', $modulelowercase); + $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\/|\.git/', $modulelowercase); } else { $result = -1; } From 92d556caf26ee0dc10bc5de60194db5596c0d9dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:53:06 +0200 Subject: [PATCH 1037/1289] Fix phpunit --- test/phpunit/CodingSqlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 96ae1f61ab0..582d22d30cc 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -193,7 +193,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $result=strpos($filecontent, '"'); if ($result) { - $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"')); + $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"') && ! strpos($filecontent, '("')); } //print __METHOD__." Result for checking we don't have double quote = ".$result."\n"; $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) into '.$file.'. Bad.'); From 01abfe538f576bdc6092327ddf21c76d7086d2cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:54:20 +0200 Subject: [PATCH 1038/1289] Doc --- test/phpunit/CodingSqlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 582d22d30cc..9a1490caeb2 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -196,7 +196,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"') && ! strpos($filecontent, '("')); } //print __METHOD__." Result for checking we don't have double quote = ".$result."\n"; - $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) into '.$file.'. Bad.'); + $this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) neither (" (used for content with string like isModEnabled("")) into '.$file.'. Bad.'); $result=strpos($filecontent, 'int('); //print __METHOD__." Result for checking we don't have 'int(' instead of 'integer' = ".$result."\n"; From ba855257950c441fb7a692e3a4e8472622955d81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 17:55:50 +0200 Subject: [PATCH 1039/1289] Fix missing $user --- htdocs/core/modules/modEventOrganization.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 9ad2ede9b77..437fa691713 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -327,7 +327,7 @@ class modEventOrganization extends DolibarrModules */ public function init($options = '') { - global $conf, $langs; + global $conf, $langs, $user; // Permissions $this->remove($options); From 2670c2f33f6c6b7a0f1ab085503f7c531dd17d59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2022 18:48:43 +0200 Subject: [PATCH 1040/1289] NEW On a bank reconciled line, we can modify the bank receipt --- htdocs/compta/bank/line.php | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 49edf3c3a1a..cb10a7310c6 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -657,13 +657,13 @@ if ($result) { if ($user->rights->banque->consolidate) { print ''; if ($objp->rappro) { - print 'rappro ? ' disabled' : '').'>'; - print ''; + print 'rappro ? ' disabled' : '').'>'; + print ''; } else { - print 'rappro ? ' disabled' : '').'>'; + print 'rappro ? ' disabled' : '').'>'; } if ($objp->num_releve) { - print '   ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; + print '   ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; } print ''; } else { @@ -675,6 +675,28 @@ if ($result) { if ($user->rights->banque->consolidate) { print ''; print 'rappro ? ' checked="checked"' : '')).'">'; + + print ' + + '; + print ''; } else { print ''.yn($objp->rappro).''; From d9aaf3e4d36461fb5547c6b4c04b08906bc42237 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:02:04 +0200 Subject: [PATCH 1041/1289] ajax.php Add price --- htdocs/takepos/ajax/ajax.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 1ee27c51f8b..671ef27ba96 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -84,6 +84,7 @@ if ($action == 'getProducts') { } unset($prod->fields); unset($prod->db); + $prod->price_formated=price(price2num($prod->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency); $res[] = $prod; } } @@ -301,7 +302,7 @@ if ($action == 'getProducts') { 'object' => 'product', 'img' => $ig, 'qty' => 1, - //'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) + 'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) ); // Add entries to row from hooks $parameters=array(); From bdc979eaadfe75c46f727e5643a557424456960b Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:03:26 +0200 Subject: [PATCH 1042/1289] pos.css.php Add price --- htdocs/takepos/css/pos.css.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index ed968ea6f4e..f4a130dc5f1 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -826,10 +826,6 @@ div#moreinfo, div#infowarehouse { clear: both; } -.div5 .price { - display: none; -} - .div5 .imgadd { display: none; } @@ -925,18 +921,12 @@ div#moreinfo, div#infowarehouse { .div5 .arrow .centerinmiddle { transform: translate(0, 0); } - - .div5 .price { - font-size: 14px; - margin-left: auto; - margin-right: 30px; - padding-right: 10px; - font-weight: bold; - color: #ff6d6d; - display: flex; - } .div5 .imgadd { display: flex; } + + div.wrapper2{ + height:10%; + } } \ No newline at end of file From 6b1e4dbf6b83c3c34065f381118edd092ccc4364 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Oct 2022 22:05:01 +0200 Subject: [PATCH 1043/1289] Index Add price --- htdocs/takepos/index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7443c380b9a..8be5a97e465 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1375,9 +1375,6 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) {
    -
    -
    -
    ...
    From 3362fec9e2fc7778786c99638aa913b8e3500409 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 11:44:22 +0200 Subject: [PATCH 1044/1289] Fix log --- htdocs/core/login/functions_ldap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index cd4ed16eae6..0d4f19d1a3f 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -94,9 +94,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($ldapdebug) { dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType); - dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); + dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); print "DEBUG: Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."
    \n"; - print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
    \n"; + print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
    \n"; } $resultFetchLdapUser = 0; From e3435bc301523f63b22f2dfbcca633d805c79216 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 12:14:11 +0200 Subject: [PATCH 1045/1289] Add debug for ldap --- htdocs/core/class/ldap.class.php | 22 ++++++++++++++++++++-- htdocs/core/login/functions_ldap.php | 6 +++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 4f77cfbaae5..426dec37962 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -193,12 +193,20 @@ class Ldap { // phpcs:enable global $conf; + global $dolibarr_main_auth_ldap_debug; $connected = 0; $this->bind = 0; $this->error = 0; $this->connectedServer = ''; + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); + + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind"); + print "DEBUG: connect_bind
    \n"; + } + // Check parameters if (count($this->server) == 0 || empty($this->server[0])) { $this->error = 'LDAP setup (file conf.php) is not complete'; @@ -223,18 +231,28 @@ class Ldap } if ($this->serverPing($host, $this->serverPort) === true) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { if (preg_match('/^ldaps/i', $host)) { // With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so - // we test this case and continue in suche a case even if serverPing fails. + // we test this case and continue in such a case even if serverPing fails. + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { continue; } } - if (is_resource($this->connection) || is_object($this->connection)) { + if (is_resource($this->connection) || is_object($this->connection)) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind this->connection is ok", LOG_DEBUG); + } + // Upgrade connexion to TLS, if requested by the configuration if (!empty($conf->global->LDAP_SERVER_USE_TLS)) { // For test/debug diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 0d4f19d1a3f..faf0024d801 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -77,7 +77,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $ldapdn = $dolibarr_main_auth_ldap_dn; $ldapadminlogin = $dolibarr_main_auth_ldap_admin_login; $ldapadminpass = $dolibarr_main_auth_ldap_admin_pass; - $ldapdebug = (empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false" ? false : true); + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); if ($ldapdebug) { print "DEBUG: Logging LDAP steps
    \n"; @@ -94,9 +94,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($ldapdebug) { dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType); - dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); + dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)); print "DEBUG: Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."
    \n"; - print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
    \n"; + print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)."
    \n"; } $resultFetchLdapUser = 0; From 69ca6c02d7156e28cfd788219a2fdc9a9a71d169 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 12:14:11 +0200 Subject: [PATCH 1046/1289] Add debug for ldap --- htdocs/core/class/ldap.class.php | 22 ++++++++++++++++++++-- htdocs/core/login/functions_ldap.php | 6 +++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 83e3adeda93..7b3c6c4ac2c 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -193,12 +193,20 @@ class Ldap { // phpcs:enable global $conf; + global $dolibarr_main_auth_ldap_debug; $connected = 0; $this->bind = 0; $this->error = 0; $this->connectedServer = ''; + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); + + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind"); + print "DEBUG: connect_bind
    \n"; + } + // Check parameters if (count($this->server) == 0 || empty($this->server[0])) { $this->error = 'LDAP setup (file conf.php) is not complete'; @@ -223,18 +231,28 @@ class Ldap } if ($this->serverPing($host, $this->serverPort) === true) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { if (preg_match('/^ldaps/i', $host)) { // With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so - // we test this case and continue in suche a case even if serverPing fails. + // we test this case and continue in such a case even if serverPing fails. + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { continue; } } - if (is_resource($this->connection) || is_object($this->connection)) { + if (is_resource($this->connection) || is_object($this->connection)) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind this->connection is ok", LOG_DEBUG); + } + // Upgrade connexion to TLS, if requested by the configuration if (!empty($conf->global->LDAP_SERVER_USE_TLS)) { // For test/debug diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 3f217573b18..68ad25168f0 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -77,7 +77,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $ldapdn = $dolibarr_main_auth_ldap_dn; $ldapadminlogin = $dolibarr_main_auth_ldap_admin_login; $ldapadminpass = $dolibarr_main_auth_ldap_admin_pass; - $ldapdebug = (empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false" ? false : true); + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); if ($ldapdebug) { print "DEBUG: Logging LDAP steps
    \n"; @@ -94,9 +94,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($ldapdebug) { dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType); - dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); + dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)); print "DEBUG: Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."
    \n"; - print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
    \n"; + print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)."
    \n"; } $resultFetchLdapUser = 0; From 11ef2517e972ade70d578d66114ad4e525eb52d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 20 Oct 2022 12:30:10 +0200 Subject: [PATCH 1047/1289] add extrafields count badge --- htdocs/core/lib/fichinter.lib.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index eaa1f85d142..87c9ce4a3fc 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -139,7 +139,11 @@ function fichinter_prepare_head($object) */ function fichinter_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('fichinter'); + $extrafields->fetch_name_optionals_label('fichinterdet'); $h = 0; $head = array(); @@ -159,19 +163,25 @@ function fichinter_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['fichinter']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['fichinterdet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesdet'; $h++; - - complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove'); - return $head; + return $head; } /** From 01eb097e5edfe2e36435c401cde6db141246dc8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 12:48:06 +0200 Subject: [PATCH 1048/1289] Doc --- dev/examples/ldap/ldapsearch_sample1.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/dev/examples/ldap/ldapsearch_sample1.txt b/dev/examples/ldap/ldapsearch_sample1.txt index a02ad632cd0..2a30f19ab22 100644 --- a/dev/examples/ldap/ldapsearch_sample1.txt +++ b/dev/examples/ldap/ldapsearch_sample1.txt @@ -1,28 +1,29 @@ # ldapsearch_sample1.txt # ldapsearch is into package ldap-utils on debian. # -# Use this sample to search into a ldap +# Use this samples to test a ldap_bind or to make a search into a ldap # # Anonymous access -# ldapsearch -h hostname -p 389 +# ldapsearch -h hostname -p 389 # # Login access (using a Bind DN) -# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# Such access must succeed to use LDAP as login module. +# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password # # Login access in SSL (using a Bind DN) -# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local +# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" # If it fails, you may try to use "hostname" that is real name of certificate. # You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt # What to search -# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" -# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra" -# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)" +# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)" # # Example to test a ldap search: -# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password +# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password From 36fd3f78167670d1b9cbec860bf93747a14cae86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 13:11:46 +0200 Subject: [PATCH 1049/1289] Fix top_httphead method not found --- htdocs/core/ajax/selectsearchbox.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 5d47aeff430..f2e44577260 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -21,12 +21,9 @@ * \brief This script returns content of possible search */ - // This script is called with a POST method or as an include. if (!isset($usedbyinclude) || empty($usedbyinclude)) { - top_httphead('application/json'); - if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', 1); // Disables token renewal } @@ -45,6 +42,9 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) { } $res = @include '../../main.inc.php'; + + top_httphead('application/json'); + if ($res == 'ERROR_NOT_LOGGED') { $langs->load("other"); $arrayresult['jumptologin'] = array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>' '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php'); From ae845fccc5f006466d66bc0b1be7ceb157936cce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 13:40:46 +0200 Subject: [PATCH 1050/1289] Clean code --- htdocs/public/recruitment/view.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 24c0eaf6088..57cb82d9b08 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -94,7 +94,7 @@ if ($cancel) { $action = 'view'; } -if ($action == "view" || $action == "presend" || $action == "close" || $action == "confirm_public_close" || $action == "add_message") { +if ($action == "view" || $action == "presend" || $action == "dosubmit") { $error = 0; $display_ticket = false; if (!strlen($ref)) { @@ -119,11 +119,11 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action = } /* - if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message')) + if (!$error && $action == "dosubmit") { - // TODO Add message... - $ret = $object->newMessage($user, $action, 0, 1); + // Test MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS + // TODO Create job application @@ -136,7 +136,7 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action = if ($error || $errors) { setEventMessages($object->error, $object->errors, 'errors'); - if ($action == "add_message") { + if ($action == "dosubmit") { $action = 'presend'; } else { $action = ''; @@ -185,7 +185,7 @@ print ''."\n"; print '
    '."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; From eb4a260fca948fae4c780b43c18a15913d2699c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 13:52:51 +0200 Subject: [PATCH 1051/1289] NEW: Add option FICHINTER_ALLOW_EXTERNAL_DOWNLOAD --- htdocs/core/class/commonobject.class.php | 3 +++ htdocs/core/lib/functions.lib.php | 11 +++++++++++ htdocs/fichinter/card.php | 8 +++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a198d74f808..7d1c1295cb6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5611,6 +5611,9 @@ abstract class CommonObject if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } + if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { + $setsharekey = true; + } if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6c278f4764d..e8537b03391 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7782,6 +7782,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $typeforonlinepayment = 'contract'; } + if (is_object($object) && $object->element == 'fichinter') { + $typeforonlinepayment = 'ficheinter'; + } $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']); $paymenturl = $url; } @@ -7814,6 +7817,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, } else { $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = ''; } + if (!empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = $object->getLastMainDocLink($object->element); + } else { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = ''; + } if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element); } else { @@ -7832,6 +7840,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id; } + if (is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id; + } if (is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index cef3f737c53..ff8492f6d14 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1713,7 +1713,13 @@ if ($action == 'create') { $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - + //Show direct download link + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) + { + print '
    '."\n"; + print showDirectDownloadLink($object).'
    '; + } + print '
    '; // List of actions on element From 2aea86dc8c3b21cb65d5aa23622640615da44063 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 13:58:59 +0200 Subject: [PATCH 1052/1289] FIX #yogosha12673 --- htdocs/langs/en_US/users.lang | 2 +- htdocs/user/passwordforgotten.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index c6b5c2fe106..3f2c7f5f53a 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -47,7 +47,7 @@ RemoveFromGroup=Remove from group PasswordChangedAndSentTo=Password changed and sent to %s. PasswordChangeRequest=Request to change password for %s PasswordChangeRequestSent=Request to change password for %s sent to %s. -IfLoginExistPasswordRequestSent=If this login is a valid account, an email to reset password has been sent. +IfLoginExistPasswordRequestSent=If this login is a valid account (with a valid email), an email to reset password has been sent. IfEmailExistPasswordRequestSent=If this email is a valid account, an email to reset password has been sent. ConfirmPasswordReset=Confirm password reset MenuUsersAndGroups=Users & Groups diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index eee3816ca67..30c5da0b2af 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -139,7 +139,12 @@ if (empty($reshook)) { $username = ''; } else { if (!$edituser->email) { - $message = '
    '.$langs->trans("ErrorLoginHasNoEmail").'
    '; + //$message = '
    '.$langs->trans("ErrorLoginHasNoEmail").'
    '; + if (!$isanemail) { + $message .= $langs->trans("IfLoginExistPasswordRequestSent"); + } else { + $message .= $langs->trans("IfEmailExistPasswordRequestSent"); + } } else { $newpassword = $edituser->setPassword($user, '', 1); if ($newpassword < 0) { From 57ca1e9e3ca9f29aa73e051a7fb0e562c34445be Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Oct 2022 12:02:06 +0000 Subject: [PATCH 1053/1289] Fixing style errors. --- htdocs/fichinter/card.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index ff8492f6d14..384049ab92a 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1714,12 +1714,11 @@ if ($action == 'create') { $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); //Show direct download link - if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) - { + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { print '
    '."\n"; print showDirectDownloadLink($object).'
    '; } - + print '
    '; // List of actions on element From 765e619cee2fa6d246aab8eec825879d93c83fc9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 20 Oct 2022 14:47:55 +0200 Subject: [PATCH 1054/1289] FIX avoid unnecessary multiple calculation (#22637) --- htdocs/core/lib/project.lib.php | 10 ++++++---- htdocs/projet/activity/perday.php | 9 ++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 776d0f0776f..e32eb092a46 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1226,13 +1226,14 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec print convertSecondToTime($lines[$i]->timespent_duration, 'allhourmin'); - $modeinput = 'hours'; + // Comment for avoid unnecessary multiple calculation + /*$modeinput = 'hours'; print ''; + print '';*/ print ''; @@ -1613,13 +1614,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr //$tableCell.=' '; print $tableCell; - $modeinput = 'hours'; + // Comment for avoid unnecessary multiple calculation + /*$modeinput = 'hours'; print ''; + print '';*/ print ''; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index c191b3baeaa..86df142d40c 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -795,12 +795,12 @@ print '
    '; print ''; -$modeinput = 'hours'; - -if ($conf->use_javascript_ajax) { +if (!empty($conf->use_javascript_ajax)) { + $modeinput = 'hours'; print "\n\n"; print ''; } From dc85e0df88e64ef0a0d841e68258a7af3505d9e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 15:08:23 +0200 Subject: [PATCH 1055/1289] Fix #yogosha12949 --- htdocs/core/class/utils.class.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index d67bee7abac..f5c33bac652 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -354,6 +354,8 @@ class Utils $handle = ''; + // If $lowmemorydump is set, it means we want to make the compression using an external pipe instead retreiving the + // content of the dump in PHP memory array $output_arr and then print it into the PHP pipe open with xopen(). $lowmemorydump = GETPOSTISSET("lowmemorydump") ? GETPOST("lowmemorydump") : getDolGlobalString('MAIN_LOW_MEMORY_DUMP'); // Start call method to execute dump @@ -371,22 +373,22 @@ class Utils } } else { if ($compression == 'none') { - $fullcommandclear .= " > ".$outputfile; - $fullcommandcrypted .= " > ".$outputfile; + $fullcommandclear .= " > ".dol_sanitizePathName($outputfile); + $fullcommandcrypted .= " > ".dol_sanitizePathName($outputfile); $handle = 1; } elseif ($compression == 'gz') { - $fullcommandclear .= " | gzip > ".$outputfile; - $fullcommandcrypted .= " | gzip > ".$outputfile; + $fullcommandclear .= " | gzip > ".dol_sanitizePathName($outputfile); + $fullcommandcrypted .= " | gzip > ".dol_sanitizePathName($outputfile); $paramcrypted.=" | gzip"; $handle = 1; } elseif ($compression == 'bz') { - $fullcommandclear .= " | bzip2 > ".$outputfile; - $fullcommandcrypted .= " | bzip2 > ".$outputfile; + $fullcommandclear .= " | bzip2 > ".dol_sanitizePathName($outputfile); + $fullcommandcrypted .= " | bzip2 > ".dol_sanitizePathName($outputfile); $paramcrypted.=" | bzip2"; $handle = 1; } elseif ($compression == 'zstd') { - $fullcommandclear .= " | zstd > ".$outputfile; - $fullcommandcrypted .= " | zstd > ".$outputfile; + $fullcommandclear .= " | zstd > ".dol_sanitizePathName($outputfile); + $fullcommandcrypted .= " | zstd > ".dol_sanitizePathName($outputfile); $paramcrypted.=" | zstd"; $handle = 1; } @@ -411,8 +413,8 @@ class Utils } - // TODO Replace with executeCLI function but - // we must first introduce a low memory mode + // TODO Replace with Utils->executeCLI() function but + // we must first introduce the variant with $lowmemorydump into this method. if ($execmethod == 1) { $output_arr = array(); $retval = null; From 0fc3b99a06298f8ddde0b4ce5d8436264d59f619 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 15:11:07 +0200 Subject: [PATCH 1056/1289] css --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index c8c1a234f02..61a7d7f6d81 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -127,7 +127,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { } if ($message) { - print $message; + print $message.'
    '; //$message.='
    '; //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); } From 510125ceb06ef904ed1906ba2e452a879fe19531 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 15:47:44 +0200 Subject: [PATCH 1057/1289] Fix sanitize data --- htdocs/admin/tools/dolibarr_export.php | 4 +-- htdocs/admin/tools/export.php | 2 +- htdocs/core/class/utils.class.php | 44 ++++++++++++++------------ htdocs/core/lib/functions.lib.php | 2 ++ htdocs/langs/en_US/admin.lang | 2 +- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 779db36fb2f..d01efa0ea5b 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -212,10 +212,10 @@ function hideoptions(){ if (div.style.display === "none") { div.style.display = "block"; - lnk.innerText="'.$langs->trans("HideAdvancedoptions").'"; + lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'"; } else { div.style.display = "none"; - lnk.innerText="'.$langs->trans("ShowAdvancedOptions").'..."; + lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'..."; } } '; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8299e2198ee..8e7643ffc5d 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -35,7 +35,7 @@ $langs->load("admin"); $action = GETPOST('action', 'aZ09'); $what = GETPOST('what', 'alpha'); $export_type = GETPOST('export_type', 'alpha'); -$file = GETPOST('filename_template', 'alpha'); +$file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha')); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index f5c33bac652..3ab8ff836bf 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -215,6 +215,9 @@ class Utils dol_syslog("Utils::dumpDatabase type=".$type." compression=".$compression." file=".$file, LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // Clean data + $file = dol_sanitizeFileName($file); + // Check compression parameter if (!in_array($compression, array('none', 'gz', 'bz', 'zip', 'zstd'))) { $langs->load("errors"); @@ -373,23 +376,23 @@ class Utils } } else { if ($compression == 'none') { - $fullcommandclear .= " > ".dol_sanitizePathName($outputfile); - $fullcommandcrypted .= " > ".dol_sanitizePathName($outputfile); + $fullcommandclear .= ' > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' > "'.dol_sanitizePathName($outputfile).'"'; $handle = 1; } elseif ($compression == 'gz') { - $fullcommandclear .= " | gzip > ".dol_sanitizePathName($outputfile); - $fullcommandcrypted .= " | gzip > ".dol_sanitizePathName($outputfile); - $paramcrypted.=" | gzip"; + $fullcommandclear .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | gzip'; $handle = 1; } elseif ($compression == 'bz') { - $fullcommandclear .= " | bzip2 > ".dol_sanitizePathName($outputfile); - $fullcommandcrypted .= " | bzip2 > ".dol_sanitizePathName($outputfile); - $paramcrypted.=" | bzip2"; + $fullcommandclear .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | bzip2'; $handle = 1; } elseif ($compression == 'zstd') { - $fullcommandclear .= " | zstd > ".dol_sanitizePathName($outputfile); - $fullcommandcrypted .= " | zstd > ".dol_sanitizePathName($outputfile); - $paramcrypted.=" | zstd"; + $fullcommandclear .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | zstd'; $handle = 1; } } @@ -473,15 +476,16 @@ class Utils } } - - if ($compression == 'none') { - fclose($handle); - } elseif ($compression == 'gz') { - gzclose($handle); - } elseif ($compression == 'bz') { - bzclose($handle); - } elseif ($compression == 'zstd') { - fclose($handle); + if (!$lowmemorydump) { + if ($compression == 'none') { + fclose($handle); + } elseif ($compression == 'gz') { + gzclose($handle); + } elseif ($compression == 'bz') { + bzclose($handle); + } elseif ($compression == 'zstd') { + fclose($handle); + } } if (!empty($conf->global->MAIN_UMASK)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6c278f4764d..f026d58e2de 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1233,6 +1233,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); + $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); return $tmp; } @@ -1257,6 +1258,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); + $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); return $tmp; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ba92fc4f8a1..fc793a1f465 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2270,7 +2270,7 @@ LateWarningAfter="Late" warning after TemplateforBusinessCards=Template for a business card in different size InventorySetup= Inventory Setup ExportUseLowMemoryMode=Use a low memory mode -ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails. +ExportUseLowMemoryModeHelp=Use the low memory mode to generate the dump file (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that the file is complete and error message can't be reported if it fails. Use it if you experience not enough memory errors. ModuleWebhookName = Webhook ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL From c3fb0fde85e8f787da18f6b0f56aeb45973ee4fe Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 20 Oct 2022 15:53:03 +0200 Subject: [PATCH 1058/1289] FIX : we must be able to select only bom of a specific product + several fixes on select_bom() function --- htdocs/core/class/html.form.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5869a85f3cf..7388da7596e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2428,7 +2428,7 @@ class Form * @param int $forcecombo Force to use combo box * @return void|string */ - public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 1, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0) + public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = []) { // phpcs:enable global $conf, $user, $langs, $db; @@ -2450,8 +2450,9 @@ class Form $sql.= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; $sql.= ' WHERE b.entity IN ('.getEntity('bom').')'; if (!empty($status)) $sql.= ' AND status = '. (int) $status; - if (!empty($type)) $sql.= ' AND status = '. (int) $type; - if (!empty($limit)) $sql.= 'LIMIT '. (int) $limit; + if (!empty($type)) $sql.= ' AND bomtype = '. (int) $type; + if(! empty($TProducts)) $sql .= ' AND fk_product IN ('.implode(',', $TProducts).')'; + if (!empty($limit)) $sql.= ' LIMIT '. (int) $limit; $resql = $db->query($sql); if ($resql) { if ($showempty) { From 06646d45409002f31e8bfda104693d3ebf71812e Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 20 Oct 2022 15:56:32 +0200 Subject: [PATCH 1059/1289] FIX : php doc --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7388da7596e..5dd4db65bab 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2426,6 +2426,7 @@ class Form * @param string $morecss Add more css on select * @param string $nooutput No print, return the output into a string * @param int $forcecombo Force to use combo box + * @param array $TProducts Add filter on a defined product * @return void|string */ public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = []) From fea4cf4305e7942ff544318a3ed4941405ca330b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 16:05:37 +0200 Subject: [PATCH 1060/1289] trans --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index fc793a1f465..a78c19f5dd9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -646,9 +646,9 @@ Module2400Name=Events/Agenda Module2400Desc=Track events. Log automatic events for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management. Module2500Name=DMS / ECM Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. -Module2600Name=API/Web services (SOAP server) +Module2600Name=API / Web services (SOAP server) Module2600Desc=Enable the Dolibarr SOAP server providing API services -Module2610Name=API/Web services (REST server) +Module2610Name=API / Web services (REST server) Module2610Desc=Enable the Dolibarr REST server providing API services Module2660Name=Call WebServices (SOAP client) Module2660Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Only Purchase orders are currently supported.) From 72d163b896faa17bfd6f2130c6e40c2a26ec69d9 Mon Sep 17 00:00:00 2001 From: melina Date: Thu, 20 Oct 2022 16:21:31 +0200 Subject: [PATCH 1061/1289] Added hidden constant and modified edit on reference --- htdocs/product/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8eac47207cd..8ddef85682a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,7 +1866,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Ref - print ''; + if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { + print ''; + } + else { + print ''; + } + // Label print ''; From 02d9c9897a19573cc5043ca16090e9baac3a1509 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 20 Oct 2022 16:27:20 +0200 Subject: [PATCH 1062/1289] FIX : bug on selected value for select_bom() function --- htdocs/core/class/html.form.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5dd4db65bab..564c917ef1a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2464,8 +2464,9 @@ class Form while ($obj = $db->fetch_object($resql)) { $product = new Product($db); $res = $product->fetch($obj->fk_product); - if ($obj->rowid == $selected) $out .= ''; - $out .= ''; + $out .= ''; } } else { $error++; From d9d38ee2656e8aa7d8bef5415752968ec762a421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 16:33:48 +0200 Subject: [PATCH 1063/1289] Add admin fichinter checkboxes --- htdocs/admin/fichinter.php | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 4e4438263c3..9bd82d3d766 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -208,6 +208,32 @@ if ($action == 'updateMask') { $error++; } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") { + $val = GETPOST('FICHINTER_ALLOW_ONLINE_SIGN', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") { + $val = GETPOST('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -594,6 +620,39 @@ print ''; print ''; print ''; +// Allow online signing +print '
    '; +print ''; +print ''; +print '
    '; +print ''; +print ''; +print ''; +print ''; +print ''; +// Allow external download +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + print '
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Label").'
    '; +print $langs->trans("allowonlinesign"); +print ''; +print ''; +print ''; +print ''; +print '
    '; +print $langs->trans("allowexternaldownload"); +print ''; +print ''; +print ''; +print ''; +print '
    '; print '
    '; From 57e62867387ea540b0bce55e7fca2a6a6508936e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 20 Oct 2022 16:36:50 +0200 Subject: [PATCH 1064/1289] FIX value can be a string --- htdocs/core/ajax/constantonoff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index b8beec3111a..fb750d346bd 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); $entity = GETPOST('entity', 'int'); -$value = ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1); +$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1)); /* From 556664f246883a9100afba9421b457b6e213a1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 16:41:27 +0200 Subject: [PATCH 1065/1289] Modify fichinter card and class --- htdocs/fichinter/card.php | 7 +++++++ htdocs/fichinter/class/fichinter.class.php | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index cef3f737c53..baf15232219 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1713,6 +1713,13 @@ if ($action == 'create') { $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show online signature link + if ($object->statut != Fichinter::STATUS_DRAFT && $conf->global->FICHINTER_ALLOW_ONLINE_SIGN) { + print '
    '; + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; + + print showOnlineSignatureUrl('fichinter', $object->ref).'
    '; + } print '
    '; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7a5f3bc73ad..8a1698ca8fb 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -442,7 +442,7 @@ class Fichinter extends CommonObject $sql .= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,"; $sql .= " f.date_valid as datev,"; $sql .= " f.tms as datem,"; - $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat, f.entity as entity"; + $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.last_main_doc, f.extraparams, fk_contrat, f.entity as entity"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if ($ref) { $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -482,6 +482,8 @@ class Fichinter extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); + $this->last_main_doc = $obj->last_main_doc; + if ($this->statut == 0) { $this->brouillon = 1; } From 56892e32e82bc95409bf30f76de7cbcd517877ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 16:45:08 +0200 Subject: [PATCH 1066/1289] FIX #yogosha13195 --- htdocs/comm/action/class/actioncomm.class.php | 12 ++++++------ htdocs/comm/action/index.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 45dbbbf12c0..228ff397607 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1591,16 +1591,16 @@ class ActionComm extends CommonObject $tooltip = img_picto('', $this->picto).' '.$langs->trans('Action').''; if (!empty($this->ref)) { - $tooltip .= '
    '.$langs->trans('Ref').': '.$this->ref; + $tooltip .= '
    '.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); } if (!empty($label)) { - $tooltip .= '
    '.$langs->trans('Title').': '.$label; + $tooltip .= '
    '.$langs->trans('Title').': '.dol_escape_htmltag($label); } if (!empty($labeltype)) { - $tooltip .= '
    '.$langs->trans('Type').': '.$labeltype; + $tooltip .= '
    '.$langs->trans('Type').': '.dol_escape_htmltag($labeltype); } if (!empty($this->location)) { - $tooltip .= '
    '.$langs->trans('Location').': '.$this->location; + $tooltip .= '
    '.$langs->trans('Location').': '.dol_escape_htmltag($this->location); } if (isset($this->transparency)) { $tooltip .= '
    '.$langs->trans('Busy').': '.yn($this->transparency); @@ -1609,7 +1609,7 @@ class ActionComm extends CommonObject $langs->load("mails"); $tooltip .= '
    '; //$tooltip .= '
    '.img_picto('', 'email').' '.$langs->trans("Email").''; - $tooltip .= '
    '.$langs->trans('MailTopic').': '.$this->email_subject; + $tooltip .= '
    '.$langs->trans('MailTopic').': '.dol_escape_htmltag($this->email_subject); $tooltip .= '
    '.$langs->trans('MailFrom').': '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_from); $tooltip .= '
    '.$langs->trans('MailTo').': '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_to); if (!empty($this->email_tocc)) { @@ -1697,7 +1697,7 @@ class ActionComm extends CommonObject if ($withpicto) { $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); } - $result .= $labelshort; + $result .= dol_escape_htmltag($labelshort); $result .= $linkend; global $action; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f46b0adc3cb..bfb5ca991b9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1272,9 +1272,9 @@ if (count($listofextcals)) { $event->datef = $dateend + $usertime; if ($icalevent['SUMMARY']) { - $event->label = $icalevent['SUMMARY']; + $event->label = dol_string_nohtmltag($icalevent['SUMMARY']); } elseif ($icalevent['DESCRIPTION']) { - $event->label = dol_nl2br($icalevent['DESCRIPTION'], 1); + $event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1); } else { $event->label = $langs->trans("ExtSiteNoLabel"); } @@ -1985,7 +1985,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show title $titletoshow = $daterange; - $titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle); + $titletoshow .= ($titletoshow ? ' ' : '').dol_escape_htmltag($event->label ? $event->label : $event->libelle); if ($event->type_code != 'ICALEVENT') { $savlabel = $event->label ? $event->label : $event->libelle; From 1f02fb24199e266e830fa97b9dc0f1838c907602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 16:52:57 +0200 Subject: [PATCH 1067/1289] Change signature lib to take fichinter into account --- htdocs/core/ajax/onlineSign.php | 87 +++++++++++++++++++++++++++++++ htdocs/core/lib/signature.lib.php | 15 ++++++ 2 files changed, 102 insertions(+) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 7866b972db1..0c0b63bbe0c 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -313,6 +313,93 @@ if ($action == "importSignature") { // Document format not supported to insert online signature. // We should just create an image file with the signature. } + } + } elseif ($mode == 'fichinter') { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; + $object = new Fichinter($db); + $object->fetch(0, $ref); + + $upload_dir = !empty($conf->ficheinter->multidir_output[$object->entity])?$conf->ficheinter->multidir_output[$object->entity]:$conf->ficheinter->dir_output; + $upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/'; + $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); + $filename = "signatures/".$date."_signature.png"; + if (!is_dir($upload_dir."signatures/")) { + if (!dol_mkdir($upload_dir."signatures/")) { + $response ="Error mkdir. Failed to create dir ".$upload_dir."signatures/"; + $error++; + } + } + + if (!$error) { + $return = file_put_contents($upload_dir.$filename, $data); + if ($return == false) { + $error++; + $response = 'Error file_put_content: failed to create signature file.'; + } + } + + if (!$error) { + // Defined modele of doc + $last_main_doc_file = $object->last_main_doc; + $directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc + if (preg_match('/\.pdf/i', $last_main_doc_file)) { + // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile + $newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf"; + $sourcefile = $upload_dir.$ref.".pdf"; + + if (dol_is_file($sourcefile)) { + // We build the new PDF + $pdf = pdf_getInstance(); + if (class_exists('TCPDF')) { + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + } + $pdf->SetFont(pdf_getPDFFont($langs)); + + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { + $pdf->SetCompression(false); + } + + + //$pdf->Open(); + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF + $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + for ($i=1; $i<($pagecount+1); $i++) { + try { + $tppl = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tppl); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tppl); + } catch (Exception $e) { + dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR); + $response = $e->getMessage(); + $error++; + } + } + + // A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF + // TODO Get position of box from PDF template + $xforimgstart = 105; + $yforimgstart = (empty($s['h']) ? 250 : $s['h'] - 57); + $wforimg = $s['w']/1 - ($xforimgstart + 16); + $pdf->Image($upload_dir.$filename, $xforimgstart, $yforimgstart, $wforimg, round($wforimg / 4)); + //$pdf->Close(); + $pdf->Output($newpdffilename, "F"); + + // Index the new file and update the last_main_doc property of object. + $object->indexFile($newpdffilename, 1); + } + if (!$error) { + $response = "success"; + } + } elseif (preg_match('/\.odt/i', $last_main_doc_file)) { + // Adding signature on .ODT not yet supported + // TODO + } else { + // Document format not supported to insert online signature. + // We should just create an image file with the signature. + } } } } else { diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 070cbe0801f..9cc8f1f03a9 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -131,6 +131,21 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) } else { $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); } + } elseif ($type == 'fichinter') { + $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; + $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ? '' : ''); + if ($mode == 1) { + $out .= 'fichinter_ref'; + } + if ($mode == 0) { + $out .= urlencode($ref); + } + $out .= ($mode ? '' : ''); + if ($mode == 1) { + $out .= "hash('".$securekeyseed."' + '".$type."' + fichinter_ref)"; + } else { + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); + } } // For multicompany From 8c9e5dda1bc38f53edf6d2a541f722293f54082e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 16:53:18 +0200 Subject: [PATCH 1068/1289] FIX #yogosha12673 --- htdocs/user/passwordforgotten.php | 39 +++++++++++++------------------ 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 30c5da0b2af..658c45a3753 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -128,41 +128,34 @@ if (empty($reshook)) { $result = $edituser->fetch('', '', '', 1, -1, $username); } + // Set the message to show (must be the same if login/email exists or not + // to avoid to guess them. + $messagewarning = ''; + if ($result <= 0 && $edituser->error == 'USERNOTFOUND') { - $message = ''; + $message .= $messagewarning; $username = ''; } else { - if (!$edituser->email) { - //$message = '
    '.$langs->trans("ErrorLoginHasNoEmail").'
    '; - if (!$isanemail) { - $message .= $langs->trans("IfLoginExistPasswordRequestSent"); - } else { - $message .= $langs->trans("IfEmailExistPasswordRequestSent"); - } + if (empty($edituser->email)) { + $message .= $messagewarning; } else { $newpassword = $edituser->setPassword($user, '', 1); if ($newpassword < 0) { - // Failed + // Technical failure $message = '
    '.$langs->trans("ErrorFailedToChangePassword").'
    '; } else { // Success if ($edituser->send_password($user, $newpassword, 1) > 0) { - $message = ''; + $message .= $messagewarning; $username = ''; } else { + // Technical failure $message .= '
    '.$edituser->error.'
    '; } } From da0a62c11a6da12567ea9b07b3b6089135a34749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 17:33:43 +0200 Subject: [PATCH 1069/1289] Public intervention sign --- htdocs/public/onlinesign/newonlinesign.php | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 91c3ec2ce73..fa16492a169 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -130,6 +130,8 @@ if ($source == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); } elseif ($source == 'contract') { $securekeyseed = getDolGlobalString('CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN'); +} elseif ($source == 'fichinter') { + $securekeyseed = getDolGlobalString('FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN'); } if (!dol_verifyHash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? $entity : ''), $SECUREKEY, '0')) { httponly_accessforbidden('Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref), 403, 1); @@ -143,6 +145,10 @@ if ($source == 'proposal') { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $object = new Contrat($db); $result= $object->fetch(0, $ref); +} elseif ($source == 'fichinter') { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $object = new Fichinter($db); + $result= $object->fetch(0, $ref); } else { httponly_accessforbidden($langs->trans('ErrorBadParameters')." - Bad value for source", 400, 1); } @@ -289,6 +295,9 @@ if (empty($text)) { } elseif ($source == 'contract') { $text .= '
    '.$langs->trans("WelcomeOnOnlineSignaturePageContract", $mysoc->name).''."\n"; $text .= ''.$langs->trans("ThisScreenAllowsYouToSignDocFromContract", $creditor).'

    '."\n"; + } elseif ($source == 'fichinter') { + $text .= '
    '.$langs->trans("WelcomeOnOnlineSignaturePageFichinter", $mysoc->name).''."\n"; + $text .= ''.$langs->trans("ThisScreenAllowsYouToSignDocFromFichinter", $creditor).'

    '."\n"; } } print $text; @@ -300,6 +309,8 @@ if ($source == 'proposal') { print ''.$langs->trans("ThisIsInformationOnDocumentToSignProposal").' :'."\n"; } elseif ($source == 'contract') { print ''.$langs->trans("ThisIsInformationOnDocumentToSignContract").' :'."\n"; +} elseif ($source == 'fichinter') { + print ''.$langs->trans("ThisIsInformationOnDocumentToSignFichinter").' :'."\n"; } $found = false; $error = 0; @@ -430,6 +441,55 @@ if ($source == 'proposal') { } + print ''; + print ''; + print ''."\n"; +} elseif ($source == 'fichinter') { // Signature on fichinter + $found = true; + $langs->load("fichinter"); + + $result = $object->fetch_thirdparty($object->socid); + // Proposer + print ''.$langs->trans("Proposer"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; + print ''; + print ''."\n"; + + // Target + print ''.$langs->trans("ThirdParty"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$object->thirdparty->name.''; + print ''."\n"; + + // Object + $text = ''.$langs->trans("SignatureFichinterRef", $object->ref).''; + print ''.$langs->trans("Designation"); + print ''.$text; + + $last_main_doc_file = $object->last_main_doc; + + if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { + // It seems document has never been generated, or was generated and then deleted. + // So we try to regenerate it with its default template. + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. + $object->generateDocument($defaulttemplate, $langs); + } + + $directdownloadlink = $object->getLastMainDocLink('fichinter'); + if ($directdownloadlink) { + print '
    '; + print img_mime($object->last_main_doc, ''); + if ($message == "signed") { + print $langs->trans("DownloadSignedDocument").''; + } else { + print $langs->trans("DownloadDocument").''; + } + } + + print ''; print ''; print ''."\n"; @@ -542,6 +602,12 @@ if ($action == "dosign" && empty($cancel)) { } else { print ''; } + } elseif ($source == 'fichinter') { + if ($message == 'signed') { + print ''.$langs->trans("FichinterSigned").''; + } else { + print ''; + } } } print ''."\n"; From b048d95cc82243b411a3478680a99d4d52e7312f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Oct 2022 16:09:26 +0000 Subject: [PATCH 1070/1289] Fixing style errors. --- htdocs/product/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8ddef85682a..e8edb5d1d8b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,13 +1866,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Ref - if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { + if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { print ''; - } - else { + } else { print ''; } - + // Label print ''; From d2ec1285951c23b31bdca882c2f984208bd403ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:14:00 +0200 Subject: [PATCH 1071/1289] Fix field fk_user_create of event registration must be null --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +++ htdocs/langs/en_US/eventorganization.lang | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 517930eb490..7c38fb59b6d 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -698,6 +698,9 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstnam ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email; +-- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_user_creat integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_user_creat DROP NOT NULL; + ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles text; ALTER TABLE llx_c_email_templates ADD COLUMN email_from varchar(255); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index b4179b04be6..23f063e9a50 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -157,7 +157,7 @@ VoteOk = Your vote has been accepted. AlreadyVoted = You have already voted for this event. VoteError = An error has occurred during the vote, please try again. -SubscriptionOk = Your registration has been validated +SubscriptionOk=Your registration has been recorded ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment From 8173841ff97d13036ad08335cc6efc554e332837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 18:19:17 +0200 Subject: [PATCH 1072/1289] Translations --- htdocs/langs/en_US/commercial.lang | 4 ++++ htdocs/langs/en_US/interventions.lang | 2 ++ htdocs/langs/en_US/propal.lang | 2 ++ htdocs/langs/es_ES/commercial.lang | 15 ++++++++++++--- htdocs/langs/es_ES/interventions.lang | 5 +++++ htdocs/langs/es_ES/main.lang | 1 + htdocs/langs/es_ES/propal.lang | 4 ++++ 7 files changed, 30 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 9978118f763..eba95a8aabb 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -76,10 +76,14 @@ NoLimit=No limit ToOfferALinkForOnlineSignature=Link for online signature WelcomeOnOnlineSignaturePageProposal=Welcome to the page to accept commercial proposals from %s WelcomeOnOnlineSignaturePageContract=Welcome to %s Contract PDF Signing Page +WelcomeOnOnlineSignaturePageFichinter=Welcome to %s Intervention PDF Signing Page ThisScreenAllowsYouToSignDocFromProposal=This screen allow you to accept and sign, or refuse, a quote/commercial proposal ThisScreenAllowsYouToSignDocFromContract=This screen allow you to sign contract on PDF format online. +ThisScreenAllowsYouToSignDocFromFichinter=This screen allow you to sign intervention on PDF format online. ThisIsInformationOnDocumentToSignProposal=This is information on document to accept or refuse ThisIsInformationOnDocumentToSignContract=This is information on contract to sign +ThisIsInformationOnDocumentToSignFichinter=This is information on intervention to sign SignatureProposalRef=Signature of quote/commercial proposal %s SignatureContractRef=Signature of contract %s +SignatureFichinterRef=Signature of intervention %s FeatureOnlineSignDisabled=Feature for online signing disabled or document generated before the feature was enabled diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 767688a4ce8..7524439f3ec 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -69,3 +69,5 @@ GenerateInter=Generate intervention FichinterNoContractLinked=Intervention %s has been created without a linked contract. ErrorFicheinterCompanyDoesNotExist=Company does not exist. Intervention has not been created. NextDateToIntervention=Date for next intervention generation +AllowOnlineSign=Allow online signing +AllowExternalDownload=Allow external download \ No newline at end of file diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index d07d6d2efba..7e9afd4e27c 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -104,6 +104,7 @@ IdProduct=Product ID LineBuyPriceHT=Buy Price Amount net of tax for line SignPropal=Accept proposal SignContract=Sign contract +SignFichinter=Sign intervention RefusePropal=Refuse proposal Sign=Sign NoSign=Refuse @@ -111,5 +112,6 @@ PropalAlreadySigned=Proposal already accepted PropalAlreadyRefused=Proposal already refused PropalSigned=Proposal accepted ContractSigned=Contract signed +FichinterSigned=Intervention signed PropalRefused=Proposal refused ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal? diff --git a/htdocs/langs/es_ES/commercial.lang b/htdocs/langs/es_ES/commercial.lang index 5fe49a5b4f4..8292b6391d6 100644 --- a/htdocs/langs/es_ES/commercial.lang +++ b/htdocs/langs/es_ES/commercial.lang @@ -68,13 +68,22 @@ ActionAC_OTH_AUTO=Eventos creados automáticamente ActionAC_MANUAL=Eventos creados manualmente ActionAC_AUTO=Eventos creados automáticamente ActionAC_OTH_AUTOShort=Auto +ActionAC_EVENTORGANIZATION=Eventos de organización Stats=Estadísticas de venta StatusProsp=Estado prospección DraftPropals=Presupuestos borrador NoLimit=Sin límite ToOfferALinkForOnlineSignature=Enlace para la firma en línea -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar presupuestos de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una presupuesto/propuesta comercial -ThisIsInformationOnDocumentToSign=Esta es la información del documento para aceptar o rechazar +WelcomeOnOnlineSignaturePageProposal=Bienvenido a la página para firmar presupuestos de %s +WelcomeOnOnlineSignaturePageContract=Bienvenido a la página para firmar contratos de %s +WelcomeOnOnlineSignaturePageFichinter=Bienvenido a la página para firmar intervenciones de %s +ThisScreenAllowsYouToSignDocFromProposal=Esta página permite aceptar y firmar o rechazar un presupuesto o propuesta comercial. +ThisScreenAllowsYouToSignDocFromContract=Esta página permite aceptar y firmar el contrato PDF online. +ThisScreenAllowsYouToSignDocFromFichinter=Esta página permite aceptar y firmar una intervención en formato PDF online. +ThisIsInformationOnDocumentToSignProposal=Esta es la información del presupuesto para aceptar o rechazar +ThisIsInformationOnDocumentToSignContract=Esta es la información del contrato a firmar +ThisIsInformationOnDocumentToSignFichinter=Esta es la información de la intervención a firmar SignatureProposalRef=Firma del presupuesto/propuesta comercial %s +SignatureContractRef=Firma del contrato %s +SignatureFichinterRef=Firma de la intervención %s FeatureOnlineSignDisabled=Característica para la firma en línea inhabilitada o documento generado antes de que se habilitara la característica diff --git a/htdocs/langs/es_ES/interventions.lang b/htdocs/langs/es_ES/interventions.lang index 83471928031..b335c533713 100644 --- a/htdocs/langs/es_ES/interventions.lang +++ b/htdocs/langs/es_ES/interventions.lang @@ -66,3 +66,8 @@ RepeatableIntervention=Plantilla de intervención ToCreateAPredefinedIntervention=Para crear una intervención predefinida o recurrente, cree una intervención común y conviértala en plantilla de intervención ConfirmReopenIntervention=¿Está seguro de querer volver a abrir la intervención %s ? GenerateInter=Generar intervención +FichinterNoContractLinked=La intervención %s se ha creado sin un contacto vinculado. +ErrorFicheinterCompanyDoesNotExist=La compañía no existe, la intervención no se ha creado. +NextDateToIntervention=Fecha para la próxima generación de intervención +AllowOnlineSign=Permitir firma online +AllowExternalDownload=Permitir descarga externa \ No newline at end of file diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 2af1c00c5cf..00488783f8a 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -926,6 +926,7 @@ DirectDownloadInternalLink=Enlace de descarga privado PrivateDownloadLinkDesc=Debe iniciar sesión y necesita permisos para ver o descargar el archivo Download=Descargar DownloadDocument=Descargar el documento +DownloadSignedDocument=Descargar el documento firmado ActualizeCurrency=Actualizar el tipo de cambio Fiscalyear=Año fiscal ModuleBuilder=Módulo Builder diff --git a/htdocs/langs/es_ES/propal.lang b/htdocs/langs/es_ES/propal.lang index 2f31aab4e89..159daf31178 100644 --- a/htdocs/langs/es_ES/propal.lang +++ b/htdocs/langs/es_ES/propal.lang @@ -103,11 +103,15 @@ IdProposal=ID de Presupuesto IdProduct=ID del Producto LineBuyPriceHT=Precio de compra Importe neto de impuestos por línea SignPropal=Aceptar presupuesto +SignContract=Firmar contrato +SignFichinter=Firmar intervención RefusePropal=Rechazar presupuesto Sign=Firma NoSign=Establecer no firmado PropalAlreadySigned=Presupuesto ya aceptado PropalAlreadyRefused=Presupuesto ya rechazado PropalSigned=Presupuesto aceptado +ContractSigned=Contrato firmado +FichinterSigned=Intervención firmada PropalRefused=Presupuesto rechazado ConfirmRefusePropal=¿Está seguro de querer rechazar este presupuesto? From 2db3f6f70932add5b303b7ddd2dda90eeae28afd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:23:41 +0200 Subject: [PATCH 1073/1289] Fix price style --- htdocs/product/price.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b129a1ff4e5..5dcb08dc238 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2240,7 +2240,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ''; // Print the search button print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -2289,6 +2289,8 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print '"; + + // VAT Rate print '"; - print '"; + print '"; - print '"; + print '"; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '"; - print ''; + print ''; } print ''; @@ -2367,6 +2369,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ""; print '"; + // VAT Rate print '"; + print '"; print '"; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '"; - print ''; + print ''; } print ''; From 3e38d30956e1d65228741056a62491dcb5afe32a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 18:41:23 +0200 Subject: [PATCH 1074/1289] Fix price must be including tax --- htdocs/public/eventorganization/attendee_new.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 8bb85022b2e..161f56dc6f8 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -474,7 +474,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } - // Create invoice + // Create the draft invoice for the payment if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -528,7 +528,11 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If there is no lines yet, we add one if (empty($facture->lines)) { - $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); + $pu_ttc = floatval($project->price_registration); + $pu_ht = 0; + $price_base_type = 'TTC'; + + $result = $facture->addline($labelforproduct, $pu_ht, 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', $price_base_type, $pu_ttc, 1); if ($result <= 0) { $confattendee->error = $facture->error; $confattendee->errors = $facture->errors; From 80fea518de86e5d609c752a5a61741c55a05a1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 18:46:24 +0200 Subject: [PATCH 1075/1289] Fix little translation bug --- htdocs/admin/fichinter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 9bd82d3d766..2d48a9ebcb1 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -626,7 +626,7 @@ print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; -// Allow online signing +// Allow online signing print ''; print ''; print ''; @@ -635,7 +635,7 @@ print ''; print ''; -print ''; +print ''; // Allow external download print ''; print ''; diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 0c0b63bbe0c..c71fed19f6d 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -313,7 +313,7 @@ if ($action == "importSignature") { // Document format not supported to insert online signature. // We should just create an image file with the signature. } - } + } } elseif ($mode == 'fichinter') { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 8a1698ca8fb..e36598d04bc 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -483,7 +483,7 @@ class Fichinter extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); $this->last_main_doc = $obj->last_main_doc; - + if ($this->statut == 0) { $this->brouillon = 1; } From 2d378ecede8d96ed279d1d11cb7681a8aace5c52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:16:25 +0200 Subject: [PATCH 1078/1289] CSS --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 14 ++++++++------ htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 23f063e9a50..e9d434651b2 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -165,6 +165,7 @@ PaymentBoothLocation = Booth location payment DeleteConferenceOrBoothAttendee=Remove attendee RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s EmailAttendee=Attendee email +EmailCompany=Company email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 161f56dc6f8..af49d142f51 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -652,21 +652,23 @@ print '
    '; print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); print '
    '; $maxattendees = 0; -if ($conference->id) { +if ($conference->id > 0) { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($conference->datep); if ($conference->date_end) { print ' - '; print dol_print_date($conference->datef); - } + }*/ } else { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($project->date_start); if ($project->date_end) { print ' - '; print dol_print_date($project->date_end); - } - $maxattendees = $project->max_attendees; + }*/ + $maxattendees = $project->max_attendees; // Max attendeed for the project/event } print '
    '; @@ -729,7 +731,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS // Email company for invoice if ($project->price_registration) { - print '
    ' . "\n"; } @@ -780,7 +782,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS if ($project->price_registration) { print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f0208223cf4..c68b39d38df 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4835,8 +4835,12 @@ input#cardholder-name { } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3357a2f8c7a..dd1194972b5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4684,8 +4684,12 @@ span.buttonpaymentsmall { #tablepublicpayment tr.liste_total td { border-top: none; } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; From 84d47e9b0ca3b175644641250cdbc77b77ceee24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:26:24 +0200 Subject: [PATCH 1079/1289] Fix max nb of attendees reached --- htdocs/langs/en_US/eventorganization.lang | 4 ++-- htdocs/public/eventorganization/attendee_new.php | 6 ++++-- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index e9d434651b2..f9531260c97 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -122,7 +122,7 @@ ViewAndVote = View and vote for suggested events PublicAttendeeSubscriptionGlobalPage = Public link for registration to the event PublicAttendeeSubscriptionPage = Public link for registration to this event only MissingOrBadSecureKey = The security key is invalid or missing -EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event : %s +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s @@ -132,7 +132,7 @@ LabelOfconference=Conference label ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s - +MaxNbOfAttendeesReached=The maximum number of participants has been reached NewSubscription=Registration OrganizationEventConfRequestWasReceived=Your suggestion for a conference has been received OrganizationEventBoothRequestWasReceived=Your request for a booth has been received diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index af49d142f51..371d69710b7 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -645,11 +645,13 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center') print '
    '; print '
    '; -print '
    '; +print '
    '; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); +print $langs->trans("EvntOrgWelcomeMessage"); +print '
    '; +print ''.$project->title . ' '. $conference->label.''; print '
    '; $maxattendees = 0; if ($conference->id > 0) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c68b39d38df..1415f420e92 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4837,6 +4837,7 @@ input#cardholder-name { .divmainbodylarge { margin-left: 40px; margin-right: 40px; } .publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } #tablesubscribe tr td { font-size: 1.15em; } #tablesubscribe .price-registration { font-size: 1.5em; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index dd1194972b5..be49f427eae 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4686,6 +4686,7 @@ span.buttonpaymentsmall { .divmainbodylarge { margin-left: 40px; margin-right: 40px; } .publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } #tablesubscribe tr td { font-size: 1.15em; } #tablesubscribe .price-registration { font-size: 1.5em; } From 89261d51e395b691ff375c0dbe2c1861177e0465 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 19:30:19 +0200 Subject: [PATCH 1080/1289] css --- htdocs/public/eventorganization/attendee_new.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 371d69710b7..e0ad4a0420b 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -681,7 +681,6 @@ if ($maxattendees && $currentnbofattendees >= $maxattendees) { } -print '
    '; dol_htmloutput_errors($errmsg, $errors); From 6dc17dc5a4146939fb4955b1e09c0d65ea634097 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 20 Oct 2022 22:10:19 +0200 Subject: [PATCH 1081/1289] Move title column on thead from td to th --- htdocs/core/tpl/objectline_title.tpl.php | 54 ++++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 6d8238cd885..7fe63613ea1 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -49,19 +49,19 @@ print '
    '; // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Description -print ''; +print ''; // Supplier ref if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { - print ''; + print ''; } // VAT -print ''; // Price HT -print ''; +print ''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { - print ''; + print ''; } if ($inputalsopricewithtax) { - print ''; + print ''; } // Qty -print ''; +print ''; // Unit if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print ''; + print ''; } // Reduction short -print ''; // Fields for situation invoice if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { - print ''; - print ''; + print ''; + print ''; } // Purchase price if ($usemargins && isModEnabled('margin') && empty($user->socid)) { if (!empty($user->rights->margins->creer)) { if ($conf->global->MARGIN_TYPE == "1") { - print ''; + print ''; } else { - print ''; + print ''; } } if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { - print ''; + print ''; } if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) { - print ''; + print ''; } } // Total HT -print ''; +print ''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { - print ''; + print ''; } if ($outputalsopricetotalwithtax) { - print ''; + print ''; } if (isModEnabled('asset') && $object->element == 'invoice_supplier') { - print ''; + print ''; } -print ''; // No width to allow autodim +print ''; // No width to allow autodim -print ''; +print ''; -print ''; +print ''; if ($action == 'selectlines') { - print ''; } print "\n"; From a52de14003e891ca4407a00d78efbfbc8fd73892 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 22:56:07 +0200 Subject: [PATCH 1082/1289] Debug hrm module --- htdocs/adherents/card.php | 2 +- htdocs/adherents/class/adherent.class.php | 38 ++- htdocs/adherents/list.php | 10 +- htdocs/adherents/type.php | 10 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/position.class.php | 4 +- htdocs/hrm/core/tpl/objectline_title.tpl.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_card.php | 109 +++---- htdocs/hrm/evaluation_contact.php | 49 +-- htdocs/hrm/evaluation_document.php | 8 +- htdocs/hrm/evaluation_list.php | 1 + htdocs/hrm/evaluation_note.php | 2 +- htdocs/hrm/position_list.php | 289 +++++++++++------- htdocs/hrm/skill_list.php | 15 - .../install/mysql/migration/16.0.0-17.0.0.sql | 1 + htdocs/langs/en_US/hrm.lang | 4 +- .../modulebuilder/template/myobject_card.php | 1 + .../modulebuilder/template/myobject_list.php | 4 +- .../inventory/class/inventory.class.php | 8 +- htdocs/theme/eldy/global.inc.php | 6 + htdocs/theme/md/style.css.php | 6 + 22 files changed, 315 insertions(+), 258 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index bd105e7a672..35829b5dcbf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1728,7 +1728,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '\n"; // Morphy - print ''; + print ''; print ''; // Company diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0e37981cc84..dd9d58eb7d3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -520,21 +520,45 @@ class Adherent extends CommonObject * Return translated label by the nature of a adherent (physical or moral) * * @param string $morphy Nature of the adherent (physical or moral) + * @param int $addbadge Add badge (1=Full label, 2=First letter only) * @return string Label */ - public function getmorphylib($morphy = '') + public function getmorphylib($morphy = '', $addbadge = 0) { global $langs; + + // Clean var if (!$morphy) { $morphy = $this->morphy; } - if ($morphy == 'phy') { - return $langs->trans("Physical"); + + if ($addbadge) { + $s = ''; + if ($morphy == 'phy') { + if ($addbadge == 2) { + $labeltoshow = dol_substr($langs->trans("Physical"), 0, 1); + } else { + $labeltoshow = $langs->trans("Physical"); + } + $s .= ''.$labeltoshow.''; + } + if ($morphy == 'mor') { + if ($addbadge == 2) { + $labeltoshow = dol_substr($langs->trans("Moral"), 0, 1); + } else { + $labeltoshow = $langs->trans("Moral"); + } + $s .= ''.$labeltoshow.''; + } + } else { + if ($morphy == 'phy') { + $s = $langs->trans("Physical"); + } elseif ($morphy == 'mor') { + $s = $langs->trans("Moral"); + } } - if ($morphy == 'mor') { - return $langs->trans("Moral"); - } - return $morphy; + + return $s; } /** diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 8118c4f9d4a..4b3a5cdb82c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -947,6 +947,7 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $datefin = $db->jdate($obj->datefin); + $memberstatic->id = $obj->rowid; $memberstatic->ref = $obj->ref; $memberstatic->civility_id = $obj->civility; @@ -1063,14 +1064,7 @@ while ($i < min($num, $limit)) { // Nature (Moral/Physical) if (!empty($arrayfields['d.morphy']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c26a9d13536..cc3c697e032 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -720,7 +720,7 @@ if ($rowid > 0) { */ // Moral/Physique - print "\n"; + print "\n"; // EMail print "\n"; @@ -740,9 +740,9 @@ if ($rowid > 0) { } print ''; } else { - print '"; @@ -845,7 +845,7 @@ if ($rowid > 0) { print '"; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 879acff61fa..b35a23a6389 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -119,7 +119,7 @@ class Evaluation extends CommonObject 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '6' => 'Closed'),), 'date_eval' => array('type'=>'date', 'label'=>'DateEval', 'enabled'=>'1', 'position'=>502, 'notnull'=>1, 'visible'=>1,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'enabled'=>'1', 'position'=>504, 'notnull'=>1, 'visible'=>1,), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), ); public $rowid; public $ref; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 19246dc2313..5d0c04a4f47 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -110,10 +110,10 @@ class Position extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), 'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,), 'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,), - 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,), + 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")', 'position'=>502, 'notnull'=>0, 'visible'=>1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), diff --git a/htdocs/hrm/core/tpl/objectline_title.tpl.php b/htdocs/hrm/core/tpl/objectline_title.tpl.php index 3801288543a..ae835ea2bca 100644 --- a/htdocs/hrm/core/tpl/objectline_title.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_title.tpl.php @@ -65,7 +65,7 @@ print ''; print ''; // Note -print ''; +print ''; //print ''; // No width to allow autodim diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index a6c6c2a9406..732b91d756f 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -158,7 +158,7 @@ if ($object->id > 0) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 9f9b937a467..08854e2d88e 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -94,7 +94,9 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled("hrm")) { + accessforbidden(); +} if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); @@ -283,11 +285,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
    '; - print ''; - print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage - print '
    '; + print $form->buttonsSaveCancel("Create", "Cancel"); print ''; } @@ -321,9 +319,7 @@ if (($id || $ref) && $action == 'edit') { print dol_get_fiche_end(); - print '
    '; - print '   '; - print '
    '; + print $form->buttonsSaveCancel(); print ''; } @@ -381,8 +377,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - // Confirmation of action xxxx + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { + $text = $langs->trans('ConfirmActionMyObject', $object->ref); + $formquestion = array(); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); @@ -412,7 +410,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; @@ -446,11 +444,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Lines */ - if (!empty($object->table_element_line)) { - if ($object->status == Evaluation::STATUS_DRAFT) { - $result = $object->getLinesArray(); + if (!empty($object->table_element_line) && $object->status == Evaluation::STATUS_DRAFT) { + // Show object lines + $result = $object->getLinesArray(); + if ($result < 0) { + dol_print_error($db, $object->error, $object->errors); + } - print ' + print '
    '; + + print ' @@ -458,46 +461,44 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea '; - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print '
    '; - /*if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Label").'
     '; @@ -2252,7 +2252,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '
    '.$langs->trans("ThirdParty").'' . $langs->trans('RefCustomer') . ''.$langs->trans('RefCustomer').''.$langs->trans("AppliedPricesFrom").''.$langs->trans("PriceBase").''.$langs->trans("DefaultTaxRate").'' . $langs->trans('Default') . ''.$langs->trans($object->price_base_type)."'; $positiverates = ''; @@ -2310,12 +2312,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { //print $object->default_vat_code?' ('.$object->default_vat_code.')':''; print "'.price($object->price)."'.price($object->price)."'.price($object->price_ttc)."'.price($object->price_ttc)."' . price($object->price_ttc) . "'.price($resultarray[2]).''.price($resultarray[2]).''.price($object->price_min).''.dol_escape_htmltag($line->ref_customer).'".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; $positiverates = ''; @@ -2386,12 +2389,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { echo vatrate($positiverates.($line->default_vat_code ? ' ('.$line->default_vat_code.')' : ''), '%', ($line->tva_npr ? $line->tva_npr : $line->recuperableonly)); print "'.price($line->price)."'.price($line->price_ttc)."' . price($line->price_ttc) . "'.price($resultarray[2]).''.price($resultarray[2]).''.price($line->price_min).'
    '; -print $langs->trans("allowonlinesign"); +print $langs->trans("AllowOnlineSign"); print ''; print ''; @@ -642,7 +642,7 @@ print ''; print ''; print '
    '; -print $langs->trans("allowexternaldownload"); +print $langs->trans("AllowExternalDownload"); print ''; print ''; From dfbcc2a045e2008a82b330f7c4483c7ba074186c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20N=C3=BA=C3=B1ez?= Date: Thu, 20 Oct 2022 18:50:48 +0200 Subject: [PATCH 1076/1289] Fix bug in checkboxes --- htdocs/admin/fichinter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 2d48a9ebcb1..e0da7ba9eb3 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -629,7 +629,7 @@ print ''; print $langs->trans("AllowOnlineSign"); print ''; -print ''; +print ''; print ''; print ''; @@ -645,7 +645,7 @@ print ''; print $langs->trans("AllowExternalDownload"); print ''; -print ''; +print ''; print ''; print ''; From fadd77ef47660f7965c172cf495b5f899b0dcf79 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Oct 2022 16:54:45 +0000 Subject: [PATCH 1077/1289] Fixing style errors. --- htdocs/admin/fichinter.php | 4 ++-- htdocs/core/ajax/onlineSign.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index e0da7ba9eb3..cf637d37329 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -620,7 +620,7 @@ print ''; print '
    '; print ''; print '
    ' . $langs->trans("EmailCompanyForInvoice") . ''; + print '
    ' . $form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")) . ''; print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    ' . $langs->trans('Price') . ''; - print price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency); + print ''.price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency).''; print '
      '.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans("SupplierRef").''.$langs->trans("SupplierRef").''; +print ''; if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) { print $langs->trans('Taxes'); } else { @@ -82,30 +82,30 @@ if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_ print ''; } } -print ''; +print ''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''.$langs->trans('PriceUTTC').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('Qty').''.$langs->trans('Unit').''.$langs->trans('Unit').''; +print ''; print $langs->trans('ReductionShort'); if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { @@ -122,59 +122,59 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec print ''; } } -print ''; +print ''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$langs->trans('BuyingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('CostPrice').''.$langs->trans('CostPrice').''.$langs->trans('MarginRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarkRate').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''.$langs->trans('TotalTTCShort').''.$langs->trans('TotalTTCShort').''; + print ''; print ''; print ''; - print ''; + print '
    '.$langs->trans("Type").''.$adht->getNomUrl(1)."
    '.$langs->trans("MemberNature").''.$object->getmorphylib().'
    '.$langs->trans("MemberNature").''.$object->getmorphylib('', 1).'
    '; - $s = ''; - if ($obj->morphy == 'phy') { - $s .= ''.dol_substr($langs->trans("Physical"), 0, 1).''; - } - if ($obj->morphy == 'mor') { - $s .= ''.dol_substr($langs->trans("Moral"), 0, 1).''; - } - print $s; + print $memberstatic->getmorphylib('', 2); print "".$adh->getmorphylib($objp->morphy)."".$adh->getmorphylib($objp->morphy, 1)."".dol_print_email($objp->email, 0, 0, 1)."'; + print ''; if (!empty($objp->subscription)) { - print $langs->trans("SubscriptionNotReceived"); + print ''.$langs->trans("SubscriptionNotReceived").''; if ($objp->status > 0) { print " ".img_warning(); } @@ -758,7 +758,7 @@ if ($rowid > 0) { print ''.img_edit().''; } if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print "
    '.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('comment', $object->note_public, '', 220, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print "
    '.$langs->trans('Label').''.$langs->trans('Description').''.$langs->trans('EmployeeRank').''.$form->textwithpicto($langs->trans("Level"), $langs->trans('EmployeeRank')).'
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - }*/ - - - if (!empty($object->lines)) { - $conf->modules_parts['tpl']['hrm']='/hrm/core/tpl/'; // Pour utilisation du tpl hrm sur cet écran - print '
    '.$langs->trans('Skill').''.$langs->trans('Description').''.$langs->trans('Rank').'
    '; - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, ''); - print '
    '; - } - - - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print ''; - - if ($object->status == $object::STATUS_DRAFT && $permissiontoadd) { - print '
    '; - print ''; - print '
    '; - } - } - - - print '
    '; - - print "\n"; - print "
    "; + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } + + $conf->modules_parts['tpl']['hrm']='/hrm/core/tpl/'; // Pour utilisation du tpl hrm sur cet écran + + print '
    '; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + //if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + //} + + // Form to add new line + /* + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, $soc); + } + } + */ + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
    '; + } + print '
    '; + + print "\n"; + + print "
    "; } // list of comparison diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 1c1d9ed26fd..4ea2e8e81be 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -31,8 +31,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; // Load translation files required by the page $langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); @@ -138,43 +139,13 @@ if ($object->id) { $linkback = ''.$langs->trans("BackToList").''; $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 (isModEnabled('project')) - { - $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 .= ''; - } - } - }*/ + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= '
    '; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 23f9d260f0f..84bc6023291 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; // Load translation files required by the page $langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); @@ -138,7 +138,7 @@ if ($object->id) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= '
    '; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index f475cef7af7..cf3272b894e 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -54,6 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 5c02b533bb7..ff0921cc59e 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= '
    '; diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index e79af867a74..739dc8bee02 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -54,6 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -115,11 +116,11 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1, 1, '1'); + $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -136,18 +137,15 @@ $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; -// Security check -if (empty($conf->hrm->enabled)) { - accessforbidden('Module not enabled'); -} - // Security check (enable the most restrictive one) if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden(); //$socid = 0; if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) { + accessforbidden('Module hrm not enabled'); +} if (!$permissiontoread) accessforbidden(); @@ -250,23 +248,23 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; } } } @@ -290,7 +288,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$key.", "; + $sql .= "t.".$db->escape($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -305,8 +303,6 @@ $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); */ -$sql .= $db->order($sortfield, $sortorder); - // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -316,24 +312,24 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $page = 0; $offset = 0; } + $db->free($resql); } -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $nbtotalofrecords; -} else { - if ($limit) { - $sql .= $db->plimit($limit + 1, $offset); - } - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); } +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + + // Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); @@ -366,6 +362,9 @@ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -374,11 +373,17 @@ if ($limit > 0 && $limit != $conf->liste_limit) { } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { + if (is_array($search[$key])) { foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); + if ($skey != '') { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } } - } else { + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } } @@ -399,7 +404,7 @@ $arrayofmassactions = array( //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { @@ -418,6 +423,7 @@ print ''; print ''; print ''; print ''; +print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create', '', $permissiontoadd); @@ -431,9 +437,12 @@ $trackid = 'xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { + $setupstring = ''; foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; } + print ''."\n"; print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; } @@ -457,7 +466,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table @@ -467,7 +476,15 @@ print ''; +// Action column +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} foreach ($object->fields as $key => $val) { + $searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -475,7 +492,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -483,9 +500,7 @@ foreach ($object->fields as $key => $val) { if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { - print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); - } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
    '; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -493,6 +508,12 @@ foreach ($object->fields as $key => $val) { print '
    '; print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
    '; + } elseif ($key == 'lang') { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin = new FormAdmin($db); + print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); + } else { + print ''; } print ''; } @@ -505,16 +526,23 @@ $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print '
    '; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -523,21 +551,26 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} +$totalarray['nbfield']++; print ''."\n"; @@ -555,9 +588,11 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // Loop on record // -------------------------------------------------------------------- $i = 0; +$savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; -while ($i < ($limit ? min($num, $limit) : $num)) { +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { break; // Should not happen @@ -566,75 +601,107 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; - foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; } - - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; - - if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - if ($key == 'status') { - print $object->getLibStatut(5); - } elseif ($key == 'rowid') { - print $object->getNomUrl(1); - } else { - print $object->showOutputField($val, $key, $object->$key, ''); + } else { + // Show here line of result + $j = 0; + print ''; + // Action column + if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!empty($val['isameasure']) && $val['isameasure'] == 1) { - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; - } - if (!isset($totalarray['val'])) { - $totalarray['val'] = array(); - } - if (!isset($totalarray['val']['t.'.$key])) { - $totalarray['val']['t.'.$key] = 0; - } - $totalarray['val']['t.'.$key] += $object->$key; - } } - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Action column - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } - print ''."\n"; + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + } $i++; } @@ -650,14 +717,14 @@ if ($num == 0) { $colspan++; } } - print ''; + print ''; } $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
    '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
    '; + print '
    '; } - - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + // Output Kanban + print $object->getKanbanView(''); + if ($i == ($imaxinloop - 1)) { + print '
    '; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; } 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($object->id, $arrayofselected)) { - $selected = 1; - } - print ''; - } - 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($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '.$langs->trans("NoRecordFound").'
    '."\n"; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 664d54212a3..ddf385b170e 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -344,21 +344,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); -// Example : Adding jquery code -// print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; 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 618e001b21c..f9eb9968f4f 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 @@ -195,3 +195,4 @@ ALTER TABLE llx_bank_url ADD INDEX idx_bank_url_url_id (url_id); ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_code varchar(3) NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) NULL; +ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index cbd3dc91663..966f2399a13 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -26,8 +26,8 @@ HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift DateEval=Evaluation date JobCard=Job card -JobPosition=Job -JobsPosition=Jobs +JobPosition=Job profile +JobsPosition=Job profiles NewSkill=New Skill SkillType=Skill type Skilldets=List of ranks for this skill diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 093a17aed94..95f10b5b90c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -356,6 +356,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea }*/ $formquestion = array(); + /* $forcecombo=0; if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 009b7b7de3a..30ccdd22e44 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -136,7 +136,7 @@ if (!$sortorder) { } // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -198,7 +198,7 @@ if ($user->socid > 0) accessforbidden(); //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); if (!isModEnabled("mymodule")) { - accessforbidden(); + accessforbidden('Module mymodule not enabled'); } if (!$permissiontoread) accessforbidden(); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 281d58ea99e..9acc4232490 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -104,10 +104,10 @@ class Inventory extends CommonObject 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'categories_product' => array('type'=>'chkbxlst:categorie:label:rowid::type=0:0:', 'label'=>'OrProductsWithCategories', 'visible'=>3, 'enabled'=>1, 'position'=>33, 'help'=>'', 'picto'=>'category', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx'), - 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), - 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502), + 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35, 'csslist'=>'nowraponall'), // This date is not used so disabled by default. + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500, 'csslist'=>'nowraponall'), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501, 'csslist'=>'nowraponall'), + 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502, 'csslist'=>'nowraponall'), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax200'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax200'), 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512, 'csslist'=>'tdoverflowmax200'), diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9c0ac895a55..30427202cc1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -846,6 +846,9 @@ textarea.centpercent { .paddingleft { padding-: 4px; } +.paddingleftimp { + padding-: 4px !important; +} .paddingleft2 { padding-: 2px; } @@ -855,6 +858,9 @@ textarea.centpercent { .paddingright { padding-: 4px; } +.paddingrightimp { + padding-: 4px !important; +} .paddingright2 { padding-: 2px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 346b683f83c..8f06afd20d8 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -997,6 +997,9 @@ textarea.centpercent { .paddingleft { padding-: 4px; } +.paddingleftimp { + padding-: 4px !important; +} .paddingleft2 { padding-: 2px; } @@ -1006,6 +1009,9 @@ textarea.centpercent { .paddingright { padding-: 4px; } +.paddingrightimp { + padding-: 4px !important; +} .paddingright2 { padding-: 2px; } From dde7f6f65576013da57b737567fb1453fbe9ddf3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Oct 2022 23:33:36 +0200 Subject: [PATCH 1083/1289] Look and feel v17 --- htdocs/core/lib/functions.lib.php | 6 +-- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- .../class/knowledgerecord.class.php | 4 +- .../knowledgerecord_card.php | 37 +++++++++++++++++-- htdocs/theme/eldy/global.inc.php | 6 ++- htdocs/theme/md/style.css.php | 6 ++- 6 files changed, 50 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f026d58e2de..8d6a0ff9414 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1820,7 +1820,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0 * @param array $links Array of tabs. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name * @param string $title Title - * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after) + * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom' * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title @@ -1994,8 +1994,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $out .= "
    \n"; } - if (!$notab || $notab == -1 || $notab == -2) { - $out .= "\n".'
    '."\n"; + if (!$notab || $notab == -1 || $notab == -2 || $notab == -3) { + $out .= "\n".'
    '."\n"; } $parameters = array('tabname' => $active, 'out' => $out); diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index be91d7b28a5..24fddc2fda4 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -35,7 +35,7 @@ if (empty($conf) || !is_object($conf)) { $object->fields = dol_sort_array($object->fields, 'position'); foreach ($object->fields as $key => $val) { - // Discard if extrafield is a hidden field on form + // Discard if field is a hidden field on form if (abs($val['visible']) != 1 && abs($val['visible']) != 3) { continue; } diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index c20fa91c621..3e78b5b557c 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -105,7 +105,6 @@ class KnowledgeRecord extends CommonObject 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1), 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'tdcss'=>'titlefieldcreate nowraponall', "csslist"=>"tdoverflowmax100"), - 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,), 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), @@ -115,7 +114,8 @@ class KnowledgeRecord extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), - 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), ); public $rowid; diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index ce3fceeff1c..c28bc9e1c9c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -182,12 +182,14 @@ if ($action == 'create') { print ''; } - print dol_get_fiche_head(array(), ''); + print dol_get_fiche_head(array(), '', '', -3); print ''."\n"; // Common attributes + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; + $object->fields['answer']['enabled'] = 1; if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); @@ -205,6 +207,14 @@ if ($action == 'create') { print '
    '."\n"; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%'); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); print $form->buttonsSaveCancel('Create'); @@ -229,12 +239,14 @@ if (($id || $ref) && $action == 'edit') { print ''; } - print dol_get_fiche_head(); + print dol_get_fiche_head(array(), '', '', -3); print ''."\n"; // Common attributes + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; + $object->fields['answer']['enabled'] = 1; if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); @@ -260,6 +272,14 @@ if (($id || $ref) && $action == 'edit') { print '
    '; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%'); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); print $form->buttonsSaveCancel(); @@ -408,11 +428,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $keyforbreak='fk_c_ticket_category'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + $object->fields['answer']['enabled'] = 1; // Categories if (isModEnabled('categorie')) { - print ''.$langs->trans("Categories").''; + print ''.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print ""; } @@ -421,11 +443,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; + print '
    '; print '
    '; print '
    '; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%', 1); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 30427202cc1..3fba934bf4e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5606,8 +5606,12 @@ a.cke_dialog_ui_button } .cke_dialog_ui_hbox_last { - vertical-align: bottom ! important; + vertical-align: bottom !important; } +.cke_dialog_ui_hbox_first { + vertical-align: middle !important; +} + /* .cke_editable { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8f06afd20d8..9ebabb5fc5f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5448,7 +5448,11 @@ a.cke_dialog_ui_button } .cke_dialog_ui_hbox_last { - vertical-align: bottom ! important; + vertical-align: bottom !important; +} +.cke_dialog_ui_hbox_last +{ + vertical-align: bottom !important; } /* .cke_editable From 8b61fd5c1a1ee5c6464c426c1a1644f4b93c23ad Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:31:31 +0200 Subject: [PATCH 1084/1289] Lang --- htdocs/langs/en_US/cron.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 9705f8823b0..021de63de05 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -84,6 +84,7 @@ MakeLocalDatabaseDumpShort=Local database backup MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep MakeSendLocalDatabaseDumpShort=Send local database backup MakeSendLocalDatabaseDump=Send local database backup by email. Parameters are: to, from, subject, message, filename (Name of file sent), filter ('sql' for backup of database only) +BackupIsTooLargeSend=Sorry, last backup file is too large to be send by email WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. DATAPOLICYJob=Data cleaner and anonymizer JobXMustBeEnabled=Job %s must be enabled From 0e5f01dd13fec2a74c2905c457132ad99dc8a80a Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:33:04 +0200 Subject: [PATCH 1085/1289] Add param --- htdocs/core/class/utils.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9a330c7aba5..daaebd09ecf 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1237,9 +1237,10 @@ class Utils * @param string $message Message * @param string $filename List of files to attach (full path of filename on file system) * @param string $filter Filter file send + * @param string $sizelimit Limit size to send file * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '') + public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '', $sizelimit = 100000000) { global $conf, $langs; From 1db5ab30a944aa41718a1540234a0c8a48960234 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 21 Oct 2022 00:34:52 +0200 Subject: [PATCH 1086/1289] Link download file in mail --- htdocs/core/class/utils.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index daaebd09ecf..1d3df8191a6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1298,9 +1298,13 @@ class Utils } if ($filepath) { - if ($filesize > 100000000) { - $output = 'Sorry, last backup file is too large to be send by email'; - $error++; + if ($filesize > $sizelimit) { + $message .= '
    '.$langs->trans("BackupIsTooLargeSend"); + $documenturl = $dolibarr_main_url_root.'/document.php?modulepart=systemtools&atachement=1&file=backup/'.urlencode($filename[0]); + $message .= '
    Lien de téléchargement'; + $filepath = ''; + $mimetype = ''; + $filename = ''; } } else { $output = 'No backup file found'; From 2fabbf846a8553eb68ade5c0830c5717c38fdcd5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 06:35:40 +0200 Subject: [PATCH 1087/1289] FIX more simple --- htdocs/core/ajax/constantonoff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index fb750d346bd..405424229ab 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); $entity = GETPOST('entity', 'int'); -$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1)); +$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1); /* From a96a623c0ee9af7b074d9a1cb842d52424784720 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 06:48:33 +0200 Subject: [PATCH 1088/1289] FIX remove unused code for avoid error --- htdocs/core/class/translate.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 5bfdbc7e0f1..394f328ccdf 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -721,9 +721,9 @@ class Translate return $str; } else { - if ($key[0] == '$') { + /*if ($key[0] == '$') { return dol_eval($key, 1, 1, '1'); - } + }*/ return $this->getTradFromKey($key); } } From f57412107ba586af84b4d8531d5802d2946013ad Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 11:09:36 +0200 Subject: [PATCH 1089/1289] FIX missing hook parameters --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f01518651e6..bb296fae10b 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -823,7 +823,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; From 3e5273d83b2c6e8d4135d4f7822ed1e199078589 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 11:14:28 +0200 Subject: [PATCH 1090/1289] NEW Option PRODUIT_DESC_IN_FORM accept (desktop only or +smartphone) --- htdocs/admin/fckeditor.php | 2 +- htdocs/contact/consumption.php | 6 +++--- htdocs/contrat/card.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 6 ------ htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/conf.class.php | 5 ++++- htdocs/core/lib/sendings.lib.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 2 +- htdocs/delivery/card.php | 4 ++-- htdocs/expedition/card.php | 6 +++--- htdocs/expedition/shipment.php | 4 ++-- .../class/knowledgerecord.class.php | 2 +- htdocs/langs/en_US/admin.lang | 3 ++- htdocs/langs/en_US/knowledgemanagement.lang | 2 +- htdocs/main.inc.php | 10 +++++++++- htdocs/product/admin/product.php | 5 +++-- htdocs/reception/card.php | 8 ++++---- htdocs/societe/consumption.php | 6 +++--- 18 files changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index dd4748a99f1..eeeb5035e16 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -93,7 +93,7 @@ foreach ($modules as $const => $desc) { if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms - if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($const == 'PRODUCTDESC' && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fcab597d43a..bbd5bf005d2 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -520,7 +520,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { @@ -571,7 +571,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -608,7 +608,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4c6c07da2cb..111b2d58fd9 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1589,7 +1589,7 @@ if ($action == 'create') { $description = $objp->description; // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $text .= (!empty($objp->description) && $objp->description != $objp->plabel) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; $description = ''; // Already added into main visible desc } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9ec279fe2d0..3d1e640f34b 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -169,12 +169,6 @@ class box_services_contracts extends ModeleBoxes } $description = $objp->description; - // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - //$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; - $description = ''; // Already added into main visible desc - } - $s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, (!empty($objp->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { $s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a198d74f808..d8eb8789d6e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5015,7 +5015,7 @@ abstract class CommonObject } $text .= ' - '.(!empty($line->label) ? $line->label : $label); - $description .= (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. + $description .= (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. } $line->pu_ttc = price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU'); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 234f8d80e0c..42927d398aa 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -347,7 +347,7 @@ class Conf $db->free($resql); } - // Include other local consts.php files and fetch their values to the corresponding database constants. + // Include other local file xxx/zzz_consts.php to overwrite some variables if (!empty($this->global->LOCAL_CONSTS_FILES)) { $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); foreach ($filesList as $file) { @@ -675,6 +675,9 @@ class Conf } $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE; + // Set PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE, may be modified later according to browser + $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0); + // conf->theme et $this->css if (empty($this->global->MAIN_THEME)) { $this->global->MAIN_THEME = "eldy"; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 110dcabb0f0..6d9598a04ae 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -341,14 +341,14 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $product_static->status_batch = $objp->product_tobatch; $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 11104f61798..03e98e1147d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -213,7 +213,7 @@ if (($line->info_bits & 2) == 2) { } // Add description in form - if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($line->fk_product > 0 && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { if ($line->element == 'facturedetrec') { print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '
    ').'
    '.dol_htmlentitiesbr($line->description) : ''; } elseif ($line->element == 'invoice_supplier_det_rec') { diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 8ab49d36990..d458b14b0cb 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -577,11 +577,11 @@ if ($action == 'create') { } $text .= ' '.$object->lines[$i]->product_ref.''; $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); //print $description; print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range($object->lines[$i]->date_start, $object->lines[$i]->date_end); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '
    '.dol_htmlentitiesbr($object->lines[$i]->description) : ''; } } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 17173088eed..6c880a6e425 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1143,7 +1143,7 @@ if ($action == 'create') { $product_static->status_buy = $line->product_tobuy; $product_static->status_batch = $line->product_tobatch; - $showdescinproductdesc = (getDolGlobalString('PRODUIT_DESC_IN_FORM') == 2 ? 1 : 0); + $showdescinproductdesc = getDolGlobalString('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE'); $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); @@ -2202,10 +2202,10 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : ''); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '
    '.dol_htmlentitiesbr($lines[$i]->description) : ''; } print "\n"; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 769642d305a..97162f4aaf2 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -733,7 +733,7 @@ if ($id > 0 || !empty($ref)) { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($objp->description)).'
    '; + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)).'
    '; $description .= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); print $form->textwithtooltip($text, $description, 3, '', '', $i); @@ -741,7 +741,7 @@ if ($id > 0 || !empty($ref)) { print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($objp->description && $objp->description != $objp->product_label) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 3e78b5b557c..fee18df2478 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -114,7 +114,7 @@ class KnowledgeRecord extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), - 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'isModEnabled("ticket")', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), ); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a78c19f5dd9..e8f8f5bac6d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2331,4 +2331,5 @@ RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions WarningDisabled=Warning disabled LimitsAndMitigation=Access limits and mitigation - \ No newline at end of file +DesktopsOnly=Desktops only +DesktopsAndSmartphones=Desktops et smartphones \ No newline at end of file diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 1746b0671ce..38c1624afad 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,7 +47,7 @@ KnowledgeRecord = Article KnowledgeRecordExtraFields = Extrafields for Article GroupOfTicket=Group of tickets YouCanLinkArticleToATicketCategory=You can link the article to a ticket group (so the article will be highlighted on any tickets in this group) -SuggestedForTicketsInGroup=Suggested for tickets when group is +SuggestedForTicketsInGroup=Suggested on ticket creation SetObsolete=Set as obsolete ConfirmCloseKM=Do you confirm the closing of this article as obsolete ? diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index dcf9bb7d96d..32d442008eb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1207,14 +1207,22 @@ if (GETPOST('dol_no_mouse_hover', 'int') || !empty($_SESSION['dol_no_mouse_hover if (GETPOST('dol_use_jmobile', 'int') || !empty($_SESSION['dol_use_jmobile'])) { $conf->dol_use_jmobile = 1; } +// If not on Desktop if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') { $conf->dol_no_mouse_hover = 1; } + +// If on smartphone or optmized for small screen if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') || (!empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) - || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400) + || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400 + || !empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) ) { $conf->dol_optimize_smallscreen = 1; + + if (isset($conf->global->PRODUIT_DESC_IN_FORM) && $conf->global->PRODUIT_DESC_IN_FORM == 1) { + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; + } } // Replace themes bugged with jmobile with eldy if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) { diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 7462431d087..a8106a9ae88 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -133,7 +133,7 @@ if ($action == 'other') { /*$value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity);*/ - $value = GETPOST('activate_viewProdDescInForm', 'alpha'); + $value = GETPOST('PRODUIT_DESC_IN_FORM', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $value, 'chaine', 0, '', $conf->entity); $value = GETPOST('activate_viewProdTextsInThirdpartyLanguage', 'alpha'); @@ -689,7 +689,8 @@ print ''; print ''; print ''.$langs->trans("ViewProductDescInFormAbility").''; print ''; -print $form->selectyesno("activate_viewProdDescInForm", $conf->global->PRODUIT_DESC_IN_FORM, 1); +$arrayofchoices = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes").' ('.$langs->trans("DesktopsOnly").')', '2' => $langs->trans("Yes").' ('.$langs->trans("DesktopsAndSmartphones").')'); +print $form->selectarray("PRODUIT_DESC_IN_FORM", $arrayofchoices, getDolGlobalInt('PRODUIT_DESC_IN_FORM'), 0); print ''; print ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d69806f2517..011781f33e2 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1102,14 +1102,14 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($line->desc)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($line->desc && $line->desc != $line->product_label) ? '
    '.dol_htmlentitiesbr($line->desc) : ''; } } @@ -1825,10 +1825,10 @@ if ($action == 'create') { if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { $text = $lines[$i]->product->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
    '.dol_htmlentitiesbr($lines[$i]->description) : ''; } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0ddbe7f2ad5..c74b5e68985 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -564,7 +564,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { ?> @@ -619,7 +619,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -656,7 +656,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; } From 71364a67170bd653320cdd2879bdcdf7380f3016 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 21 Oct 2022 11:28:20 +0200 Subject: [PATCH 1091/1289] FIX missing token --- 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 4ec5fcc02c6..c3794a74ec7 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -735,7 +735,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { // Get the HT price for the product and display it console.log("Load unit price without tax and set it into #price_ht for product id="+$(this).val()+" socid=socid; ?>"); $.post('/product/ajax/products.php?action=fetch', - { 'id': $(this).val(), 'socid': socid; ?> }, + { 'id': $(this).val(), 'socid': socid; ?>, 'token': '' }, function(data) { console.log("objectline_create.tpl Load unit price end, we got value ht="+data.price_ht+" ttc="+data.price_ttc+" pricebasetype="+data.pricebasetype); From 11aaf4748c08e2c7811574d0ff3c9c41b77281fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 11:32:12 +0200 Subject: [PATCH 1092/1289] css --- htdocs/compta/prelevement/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index c03a2eea6b5..8be48493d08 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -285,7 +285,7 @@ if ($id > 0 || $ref) { print ''.$langs->trans("TransMetod").''; print $form->selectarray("methode", $object->methodes_trans); print ''; - print '
    '; + print ''; print '
    '; print ''; print '
    '; From c74cc53b2205fdb30ff0e6f7f7befd630a3538b3 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 21 Oct 2022 12:16:52 +0200 Subject: [PATCH 1093/1289] Fix migration script when running on mysql 8 --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index f9eb9968f4f..1dfcd489ee9 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 @@ -195,4 +195,5 @@ ALTER TABLE llx_bank_url ADD INDEX idx_bank_url_url_id (url_id); ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_code varchar(3) NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) NULL; -ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; +-- VMYSQL4.3 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN `rank` rankorder integer; +-- VPGSQL8.2 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; From 4a3a72245f00b6b9a0f6eba2049f4adc74f2b5ef Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 19 Oct 2022 12:16:44 +0200 Subject: [PATCH 1094/1289] Use shared entity on supplier order create --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9e59dbceda6..c535ad14b72 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1398,7 +1398,7 @@ class CommandeFournisseur extends CommonOrder $sql .= ", '".$this->db->escape($this->ref_supplier)."'"; $sql .= ", '".$this->db->escape($this->note_private)."'"; $sql .= ", '".$this->db->escape($this->note_public)."'"; - $sql .= ", ".((int) $conf->entity); + $sql .= ", ".setEntity($this); $sql .= ", ".((int) $this->socid); $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null"); $sql .= ", '".$this->db->idate($date)."'"; From 1d21d734006acca77978a5f1252f8f2cb4988956 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 13:19:21 +0200 Subject: [PATCH 1095/1289] NEW Add date event (!= date project) and location on event organization --- .../conferenceorbooth_list.php | 29 +++- .../conferenceorboothattendee_list.php | 29 +++- .../install/mysql/migration/16.0.0-17.0.0.sql | 5 + htdocs/install/mysql/tables/llx_projet.sql | 5 +- htdocs/projet/card.php | 154 +++++++++++++----- htdocs/projet/class/project.class.php | 86 +++++++--- htdocs/projet/comment.php | 18 +- htdocs/projet/contact.php | 18 +- htdocs/projet/element.php | 18 +- htdocs/projet/ganttview.php | 18 +- htdocs/projet/list.php | 6 +- htdocs/projet/tasks.php | 22 +-- htdocs/projet/tasks/comment.php | 18 +- htdocs/projet/tasks/contact.php | 18 +- htdocs/projet/tasks/document.php | 18 +- htdocs/projet/tasks/list.php | 5 +- htdocs/projet/tasks/note.php | 18 +- htdocs/projet/tasks/task.php | 20 +-- htdocs/projet/tasks/time.php | 25 +-- .../public/eventorganization/attendee_new.php | 24 +-- 20 files changed, 351 insertions(+), 203 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 520435c9cdc..cf7ffcb607a 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -348,8 +348,15 @@ if ($projectid > 0) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($project->budget_amount, '')) { + print ''.price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").' ('.$langs->trans("Project").')'; $start = dol_print_date($project->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($project->date_end, 'day'); @@ -360,13 +367,23 @@ if ($projectid > 0) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($project->budget_amount, '')) { - print price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + // Date start - end of event + print ''.$langs->trans("Dates").' ('.$langs->trans("Event").')'; + $start = dol_print_date($project->date_start_event, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($project->date_end_event, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) { + print img_warning("Late"); } print ''; + // Location event + print ''.$langs->trans("Location").''; + print $project->location; + print ''; + // Other attributes $cols = 2; $objectconf = $object; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 167a79959f5..dccad6b9583 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -474,8 +474,15 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").' ('.$langs->trans("Project").')'; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -486,13 +493,23 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + // Date start - end of event + print ''.$langs->trans("Dates").' ('.$langs->trans("Event").')'; + $start = dol_print_date($projectstatic->date_start_event, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($projectstatic->date_end_event, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($projectstatic->hasDelay()) { + print img_warning("Late"); } print ''; + // Location event + print ''.$langs->trans("Location").''; + print $projectstatic->location; + print ''; + // Other attributes $cols = 2; $objectconf = $object; 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 f9eb9968f4f..f796ac441ee 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 @@ -196,3 +196,8 @@ ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_code varchar(3) N ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) NULL; ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; + +ALTER TABLE llx_projet ADD COLUMN date_start_event datetime; +ALTER TABLE llx_projet ADD COLUMN date_end_event datetime; +ALTER TABLE llx_projet ADD COLUMN location varchar(255); + diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 197a92ac2be..5b3df54ba14 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -47,7 +47,10 @@ create table llx_projet usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices - usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event or receive attendees registration + usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event or receive attendees registration + date_start_event datetime, -- date start event + date_end_event datetime, -- date end event + location varchar(255), -- location accept_conference_suggestions integer DEFAULT 0, -- Set to 1 if you want to allow unknown people to suggest conferences accept_booth_suggestions integer DEFAULT 0, -- Set to 1 if you want to Allow unknown people to suggest booth max_attendees integer DEFAULT 0, diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 17d5c042389..e3a916c0be0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -55,13 +55,15 @@ $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $status = GETPOST('status', 'int'); $opp_status = GETPOST('opp_status', 'int'); -$opp_percent = price2num(GETPOST('opp_percent', 'alpha')); -$objcanvas = GETPOST("objcanvas", "alpha"); -$comefromclone = GETPOST("comefromclone", "alpha"); +$opp_percent = price2num(GETPOST('opp_percent', 'alphanohtml')); +$objcanvas = GETPOST("objcanvas", "alphanohtml"); +$comefromclone = GETPOST("comefromclone", "alphanohtml"); +$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); +$date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); +$date_start_event = dol_mktime(0, 0, 0, GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); +$date_end_event = dol_mktime(0, 0, 0, GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); +$location = GETPOST('location', 'alphanohtml'); -if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && !GETPOST("cancel"))) { - accessforbidden(); -} $mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects @@ -88,14 +90,15 @@ if ($id > 0 || !empty($ref)) { // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); - // Security check $socid = GETPOST('socid', 'int'); //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. restrictedArea($user, 'projet', $object->id, 'projet&project'); +if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && !GETPOST("cancel"))) { + accessforbidden(); +} + $permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php @@ -187,6 +190,9 @@ if (empty($reshook)) { $object->date_c = dol_now(); $object->date_start = $date_start; $object->date_end = $date_end; + $object->date_start_event = $date_start_event; + $object->date_end_event = $date_end_event; + $object->location = $location; $object->statut = $status; $object->opp_status = $opp_status; $object->opp_percent = $opp_percent; @@ -281,6 +287,9 @@ if (empty($reshook)) { $object->public = GETPOST('public', 'alpha'); $object->date_start = (!GETPOST('projectstart')) ? '' : $date_start; $object->date_end = (!GETPOST('projectend')) ? '' : $date_end; + $object->date_start_event = (!GETPOST('date_start_event')) ? '' : $date_start_event; + $object->date_end_event = (!GETPOST('date_end_event')) ? '' : $date_end_event; + $object->location = $location; if (GETPOSTISSET('opp_amount')) { $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha')); } @@ -603,6 +612,23 @@ if ($action == 'create' && $user->rights->projet->creer) { print ' '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; + print ''; } print ''; print ''; @@ -673,16 +699,6 @@ if ($action == 'create' && $user->rights->projet->creer) { } print ''; - // Date start - print ''.$langs->trans("DateStart").''; - print $form->selectDate(($date_start ? $date_start : ''), 'projectstart', 0, 0, 0, '', 1, 0); - print ''; - - // Date end - print ''.$langs->trans("DateEnd").''; - print $form->selectDate(($date_end ? $date_end : -1), 'projectend', 0, 0, 0, '', 1, 0); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status print ''.$langs->trans("OpportunityStatus").''; @@ -708,6 +724,27 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; + // Date project + print ''.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; + print $form->selectDate(($date_start ? $date_start : ''), 'projectstart', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end ? $date_end : -1), 'projectend', 0, 0, 0, '', 1, 0); + print ''; + + if (isModEnabled('eventorganization')) { + // Date event + print ''.$langs->trans("Date").' ('.$langs->trans("Event").')'; + print $form->selectDate(($date_start_event ? $date_start_event : -1), 'date_start_event', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end_event ? $date_end_event : -1), 'date_end_event', 0, 0, 0, '', 1, 0); + print ''; + + // Location + print ''.$langs->trans("Location").''; + print ''; + print ''; + } + // Description print ''.$langs->trans("Description").''; print ''; @@ -852,11 +889,12 @@ if ($action == 'create' && $user->rights->projet->creer) { // Status print ''.$langs->trans("Status").''; - print ''; foreach ($object->statuts_short as $key => $val) { - print ''; + print ''; } print ''; + print ajax_combobox('status'); print ''; // Usage @@ -902,6 +940,21 @@ if ($action == 'create' && $user->rights->projet->creer) { print 'usage_organize_event ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; + print ''; } print ''; } @@ -981,9 +1034,18 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; } - // Date start - print ''.$langs->trans("DateStart").''; + // Budget + print ''.$langs->trans("Budget").''; + print ''; + print $langs->getCurrencySymbol($conf->currency); + print ''; + print ''; + + // Date project + print ''.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0); print '     rights->projet->creer) { print '/>'; print ''; - // Date end - print ''.$langs->trans("DateEnd").''; - print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0); - print ''; + if (isModEnabled('eventorganization')) { + // Date event + print ''.$langs->trans("Date").' ('.$langs->trans("Event").')'; + print $form->selectDate(($date_start_event ? $date_start_event : ($object->date_start_event ? $object->date_start_event : -1)), 'date_start_event', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end_event ? $date_end_event : ($object->date_end_event ? $object->date_end_event : -1)), 'date_end_event', 0, 0, 0, '', 1, 0); + print ''; - // Budget - print ''.$langs->trans("Budget").''; - print ''; - print $langs->getCurrencySymbol($conf->currency); - print ''; - print ''; + // Location + print ''.$langs->trans("Location").''; + print ''; + print ''; + } // Description print ''.$langs->trans("Description").''; @@ -1143,18 +1207,6 @@ if ($action == 'create' && $user->rights->projet->creer) { */ } - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; - $start = dol_print_date($object->date_start, 'day'); - print ($start ? $start : '?'); - $end = dol_print_date($object->date_end, 'day'); - print ' - '; - print ($end ? $end : '?'); - if ($object->hasDelay()) { - print img_warning("Late"); - } - print ''; - // Budget print ''.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) { @@ -1162,6 +1214,18 @@ if ($action == 'create' && $user->rights->projet->creer) { } print ''; + // Date start - end project + print ''.$langs->trans("Dates").''; + $start = dol_print_date($object->date_start, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($object->date_end, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) { + print img_warning("Late"); + } + print ''; + // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 9987f9bc4f0..38bb55b5a24 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -87,29 +87,44 @@ class Project extends CommonObject public $title; /** - * @var int Date start + * @var int Date start * @deprecated * @see $date_start */ public $dateo; /** - * @var int Date start + * @var int Date start */ public $date_start; /** - * @var int Date end + * @var int Date end * @deprecated * @see $date_end */ public $datee; /** - * @var int Date end + * @var int Date end */ public $date_end; + /** + * @var int Date start event + */ + public $date_start_event; + + /** + * @var int Date end event + */ + public $date_end_event; + + /** + * @var string Location + */ + public $location; + /** * @var int Date close */ @@ -264,30 +279,35 @@ class Project extends CommonObject 'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>1), 'public' =>array('type'=>'integer', 'label'=>'Visibility', 'enabled'=>1, 'visible'=>1, 'position'=>65), - 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'visible'=>1, 'position'=>75), - 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'visible'=>1, 'position'=>80), + 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>75), + 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>80), 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85, 'searchall'=>1), 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90, 'searchall'=>1), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>95), 'date_close' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>0, 'position'=>105), 'fk_user_close' =>array('type'=>'integer', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'position'=>115), + 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position'=>115), 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>119), 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>130), 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>146), - 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>147), - 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>148), - 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>149), - 'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>200), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>205), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>220), - 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>250, 'help'=>'EmailMsgIDWhenSourceisEmail'), + // Properties for event organization + 'date_start_event' =>array('type'=>'date', 'label'=>'DateStartEvent', 'enabled'=>1, 'visible'=>1, 'position'=>200), + 'date_end_event' =>array('type'=>'date', 'label'=>'DateEndEvent', 'enabled'=>1, 'visible'=>1, 'position'=>201), + 'location' =>array('type'=>'text', 'label'=>'Location', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>202), + 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>211), + 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>212), + 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + // Generic + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>400), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>405), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>410), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>415), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>420), + 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>450, 'help'=>'EmailMsgIDWhenSourceisEmail'), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500) ); // END MODULEBUILDER PROPERTIES @@ -408,6 +428,9 @@ class Project extends CommonObject $sql .= ", price_registration"; $sql .= ", price_booth"; $sql .= ", max_attendees"; + $sql .= ", date_start_event"; + $sql .= ", date_end_event"; + $sql .= ", location"; $sql .= ", email_msgid"; $sql .= ", note_private"; $sql .= ", note_public"; @@ -436,6 +459,9 @@ class Project extends CommonObject $sql .= ", ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : 'null'); $sql .= ", ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : 'null'); $sql .= ", ".(strcmp($this->max_attendees, '') ? ((int) $this->max_attendees) : 'null'); + $sql .= ", ".($this->date_start_event != '' ? "'".$this->db->idate($this->date_start_event)."'" : 'null'); + $sql .= ", ".($this->date_end_event != '' ? "'".$this->db->idate($this->date_end_event)."'" : 'null'); + $sql .= ", ".($this->location ? "'".$this->db->escape($this->location)."'" : 'null'); $sql .= ", ".($this->email_msgid ? "'".$this->db->escape($this->email_msgid)."'" : 'null'); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null'); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null'); @@ -530,11 +556,11 @@ class Project extends CommonObject $sql .= ", fk_opp_status = ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'null'); $sql .= ", opp_percent = ".((is_numeric($this->opp_percent) && $this->opp_percent != '') ? $this->opp_percent : 'null'); $sql .= ", public = ".($this->public ? 1 : 0); - $sql .= ", datec=".($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); - $sql .= ", dateo=".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); - $sql .= ", datee=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); - $sql .= ", date_close=".($this->date_close != '' ? "'".$this->db->idate($this->date_close)."'" : 'null'); - $sql .= ", fk_user_close=".($this->fk_user_close > 0 ? $this->fk_user_close : "null"); + $sql .= ", datec = ".($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); + $sql .= ", dateo = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql .= ", datee = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); + $sql .= ", date_close = ".($this->date_close != '' ? "'".$this->db->idate($this->date_close)."'" : 'null'); + $sql .= ", fk_user_close = ".($this->fk_user_close > 0 ? $this->fk_user_close : "null"); $sql .= ", opp_amount = ".(strcmp($this->opp_amount, '') ? price2num($this->opp_amount) : "null"); $sql .= ", budget_amount = ".(strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null"); $sql .= ", fk_user_modif = ".$user->id; @@ -547,6 +573,9 @@ class Project extends CommonObject $sql .= ", price_registration = ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : "null"); $sql .= ", price_booth = ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : "null"); $sql .= ", max_attendees = ".(strcmp($this->max_attendees, '') ? price2num($this->max_attendees) : "null"); + $sql .= ", date_start_event = ".($this->date_start_event != '' ? "'".$this->db->idate($this->date_start_event)."'" : 'null'); + $sql .= ", date_end_event = ".($this->date_end_event != '' ? "'".$this->db->idate($this->date_end_event)."'" : 'null'); + $sql .= ", location = '".$this->db->escape($this->location)."'"; $sql .= ", entity = ".((int) $this->entity); $sql .= " WHERE rowid = ".((int) $this->id); @@ -631,9 +660,9 @@ class Project extends CommonObject } $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; - $sql .= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; + $sql .= " tms, dateo as date_start, datee as date_end, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; $sql .= " note_private, note_public, model_pdf, usage_opportunity, usage_task, usage_bill_time, usage_organize_event, email_msgid,"; - $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees"; + $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees, date_start_event, date_end_event, location"; $sql .= " FROM ".MAIN_DB_PREFIX."projet"; if (!empty($id)) { $sql .= " WHERE rowid = ".((int) $id); @@ -665,8 +694,8 @@ class Project extends CommonObject $this->datec = $this->db->jdate($obj->datec); // TODO deprecated $this->date_m = $this->db->jdate($obj->tms); $this->datem = $this->db->jdate($obj->tms); // TODO deprecated - $this->date_start = $this->db->jdate($obj->dateo); - $this->date_end = $this->db->jdate($obj->datee); + $this->date_start = $this->db->jdate($obj->date_start); + $this->date_end = $this->db->jdate($obj->date_end); $this->date_close = $this->db->jdate($obj->date_close); $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; @@ -692,6 +721,9 @@ class Project extends CommonObject $this->price_registration = $obj->price_registration; $this->price_booth = $obj->price_booth; $this->max_attendees = $obj->max_attendees; + $this->date_start_event = $this->db->jdate($obj->date_start_event); + $this->date_end_event = $this->db->jdate($obj->date_end_event); + $this->location = $obj->location; $this->email_msgid = $obj->email_msgid; $this->db->free($resql); diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 5ea5b920f8c..872aab6046c 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -134,15 +134,6 @@ if ($object->public) { } print ''; -// Date start - end -print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; -print dol_print_date($object->date_start, 'day'); -$end = dol_print_date($object->date_end, 'day'); -if ($end) { - print ' - '.$end; -} -print ''; - // Budget print ''.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) { @@ -150,6 +141,15 @@ if (strcmp($object->budget_amount, '')) { } print ''; +// Date start - end project +print ''.$langs->trans("Dates").''; +print dol_print_date($object->date_start, 'day'); +$end = dol_print_date($object->date_end, 'day'); +if ($end) { + print ' - '.$end; +} +print ''; + // Other attributes $cols = 2; // include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index ee37aa68fdd..3e2e85a3757 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -385,8 +385,15 @@ if ($id > 0 || !empty($ref)) { print ''; } - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -397,13 +404,6 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).''; - } - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 346382c6294..7bf40647783 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -307,8 +307,15 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; } -// Date start - end -print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; +// Budget +print ''.$langs->trans("Budget").''; +if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; +} +print ''; + +// Date start - end project +print ''.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -319,13 +326,6 @@ if ($object->hasDelay()) { } print ''; -// Budget -print ''.$langs->trans("Budget").''; -if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; -} -print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index c5549429edb..c04614c859e 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -179,8 +179,15 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -191,13 +198,6 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 9ca5fc63c76..696888a75dd 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1355,7 +1355,8 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date start + + // Date start project if (!empty($arrayfields['p.dateo']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_start), 'day'); @@ -1364,7 +1365,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date end + // Date end project if (!empty($arrayfields['p.datee']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_end), 'day'); @@ -1373,6 +1374,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } + // Visibility if (!empty($arrayfields['p.public']['checked'])) { print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 73d3c238026..f957b59b3c2 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -614,8 +614,15 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -626,13 +633,6 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -750,12 +750,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } print ''; - // Date start + // Date start task print ''.$langs->trans("DateStart").''; print $form->selectDate((!empty($date_start) ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1); print ''; - // Date end + // Date end task print ''.$langs->trans("DateEnd").''; print $form->selectDate((!empty($date_end) ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1); print ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 1f5628bb050..e6749612f46 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -221,8 +221,15 @@ if ($id > 0 || !empty($ref)) { print ''; } - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -233,13 +240,6 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 14a87b375e8..4427af86f52 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -257,8 +257,15 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -269,13 +276,6 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 3e569cd557f..fb89ba372e7 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -214,8 +214,15 @@ if ($object->id > 0) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -226,13 +233,6 @@ if ($object->id > 0) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1f0130bd7b4..76261480ffe 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -1117,7 +1117,8 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date start + + // Date start project if (!empty($arrayfields['t.dateo']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_start), 'day'); @@ -1126,7 +1127,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date end + // Date end project if (!empty($arrayfields['t.datee']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_end), 'day'); diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 40f8f636e72..7c02dad5785 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -203,8 +203,15 @@ if ($object->id > 0) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -215,13 +222,6 @@ if ($object->id > 0) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 77cd9f09c9e..95c755097eb 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -325,8 +325,15 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -337,13 +344,6 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -578,7 +578,7 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - Date end + // Date start - Date end task print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; $start = dol_print_date($object->date_start, 'dayhour'); print ($start ? $start : '?'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 00d45eedea7..d268a72b12d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -967,8 +967,15 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print ''; - // Date start - end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print ''; + + // Date start - end project + print ''.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -979,16 +986,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print ''; - // Budget - print ''.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print ''; - // Other attributes $cols = 2; - //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + $savobject = $object; + $object = $projectstatic; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + $object = $savobject; print ''; @@ -1127,7 +1130,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print ''; - // Date start - Date end + // Date start - Date end task print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; $start = dol_print_date($object->date_start, 'dayhour'); print ($start ? $start : '?'); diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 589bf2c8dac..995b5f7a44c 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -646,7 +646,7 @@ print '
    '; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); +print ''.$langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label).''; print '
    '; $maxattendees = 0; if ($conference->id) { @@ -691,8 +691,8 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print ''; print '
    '; - - print '
    ' . $langs->trans("FieldsWithAreMandatory", '*') . '
    '; + print '
    '; + //print '' . $langs->trans("FieldsWithAreMandatory", '*') . '
    '; //print $langs->trans("FieldsWithIsForPublic",'**').'
    '; print dol_get_fiche_head(''); @@ -711,18 +711,22 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print '' . "\n"; // Email - print '' . "\n"; + print '' . "\n"; // Company - print '' . "\n"; + print 'price_registration)) ? '' : ' required').'>' . "\n"; // Email company for invoice if ($project->price_registration) { @@ -743,7 +747,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print ''; // Country - print ''; // Location @@ -1056,9 +1056,9 @@ if ($action == 'create' && $user->rights->projet->creer) { if (isModEnabled('eventorganization')) { // Date event print ''; // Location diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 21cf0052eca..8d7e4503c6b 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -524,8 +524,11 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); $labelforproduct = $outputlangs->trans("EventFee", $project->title); - $date_start = $project->date_start; - $date_end = $project->date_end; + if ($project->location) { + $labelforproduct .= ' - '.$project->location; + } + $date_start = $project->date_start_event; + $date_end = $project->date_end_event; // If there is no lines yet, we add one if (empty($facture->lines)) { @@ -652,8 +655,36 @@ print '
    '; print ''.$langs->trans("EvntOrgWelcomeMessage").''; print '
    '; -print ''.$project->title . ' '. $conference->label.''; -print '
    '; +print ''.$project->title . ' '. $conference->label.'
    '; +if ($project->date_start_event || $project->date_end_event) { + print ''; +} +if ($project->date_start_event) { + $format = 'day'; + $tmparray = dol_getdate($project->date_start_event, false, ''); + if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) { + $format = 'dayhour'; + } + print dol_print_date($project->date_start_event, $format); +} +if ($project->date_start_event && $project->date_end_event) { + print ' - '; +} +if ($project->date_end_event) { + $format = 'day'; + $tmparray = dol_getdate($project->date_end_event, false, ''); + if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) { + $format = 'dayhour'; + } + print dol_print_date($project->date_end_event, $format); +} +if ($project->date_start_event || $project->date_end_event) { + print '
    '; +} +if ($project->location) { + print ''.$project->location.'
    '; +} + $maxattendees = 0; if ($conference->id > 0) { /* date of project is not date of event so commented @@ -812,8 +843,8 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS } print '
    '; - print "\n"; + print "
    "; print ''; } From 330a1199e4f5e30acf1b1330f56e795281ebf940 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 15:08:54 +0200 Subject: [PATCH 1098/1289] Look and feel v17 --- htdocs/comm/propal/card.php | 12 ++++++------ htdocs/comm/propal/contact.php | 8 ++++---- htdocs/comm/propal/document.php | 8 ++++---- htdocs/comm/propal/info.php | 6 +++--- htdocs/comm/propal/note.php | 6 +++--- htdocs/commande/card.php | 10 +++++----- htdocs/commande/contact.php | 6 +++--- htdocs/commande/document.php | 6 +++--- htdocs/commande/info.php | 6 +++--- htdocs/commande/note.php | 6 +++--- htdocs/compta/facture/card.php | 10 +++++----- htdocs/compta/facture/contact.php | 6 +++--- htdocs/compta/facture/document.php | 6 +++--- htdocs/compta/facture/info.php | 6 +++--- htdocs/compta/facture/note.php | 6 +++--- htdocs/compta/facture/prelevement.php | 2 +- htdocs/contrat/agenda.php | 6 +++--- htdocs/contrat/card.php | 8 ++++---- htdocs/contrat/contact.php | 6 +++--- htdocs/contrat/document.php | 6 +++--- htdocs/contrat/note.php | 6 +++--- htdocs/core/class/html.form.class.php | 5 +++-- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/delivery/card.php | 11 +++++------ htdocs/eventorganization/conferenceorbooth_card.php | 2 +- .../eventorganization/conferenceorbooth_contact.php | 2 +- .../eventorganization/conferenceorbooth_document.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/card.php | 11 +++++------ htdocs/expedition/contact.php | 6 +++--- htdocs/expedition/document.php | 10 +++++----- htdocs/expedition/note.php | 6 +++--- htdocs/expedition/shipment.php | 10 +++++----- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 7 +++---- htdocs/fourn/commande/contact.php | 6 +++--- htdocs/fourn/commande/dispatch.php | 6 +++--- htdocs/fourn/commande/document.php | 6 +++--- htdocs/fourn/commande/info.php | 6 +++--- htdocs/fourn/commande/note.php | 6 +++--- htdocs/fourn/facture/card.php | 10 +++++----- htdocs/fourn/facture/contact.php | 6 +++--- htdocs/fourn/facture/document.php | 6 +++--- htdocs/fourn/facture/info.php | 6 +++--- htdocs/fourn/facture/note.php | 6 +++--- htdocs/fourn/paiement/document.php | 2 +- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/card.php | 2 +- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 2 +- htdocs/projet/document.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/projet/ganttview.php | 2 +- htdocs/projet/info.php | 2 +- htdocs/projet/note.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/reception/card.php | 9 ++++----- htdocs/reception/contact.php | 9 ++++----- htdocs/reception/document.php | 9 ++++----- htdocs/reception/note.php | 9 ++++----- htdocs/supplier_proposal/contact.php | 8 ++++---- htdocs/ticket/agenda.php | 9 ++++----- htdocs/ticket/card.php | 8 ++++---- htdocs/ticket/contact.php | 9 ++++----- htdocs/ticket/document.php | 9 ++++----- htdocs/ticket/list.php | 4 ++-- htdocs/ticket/messaging.php | 9 ++++----- 75 files changed, 204 insertions(+), 213 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f835ae3ae29..a18056e1003 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2297,20 +2297,20 @@ if ($action == 'create') { $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 .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').''; + $morehtmlref .= '
    '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref .= '
    '; $morehtmlref .= ''; $morehtmlref .= ''; @@ -2318,13 +2318,13 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 051ee9de42c..5039335007f 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -137,15 +137,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->propal->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -162,7 +162,7 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 1bd6cc71d50..a2f638a8ad2 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -135,15 +135,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->propal->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -160,7 +160,7 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 933791bbec2..fdf1f1d1bb9 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -82,15 +82,15 @@ $morehtmlref = '
    '; $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').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->propal->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index c3af3a9b73e..fd10809bac5 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -107,15 +107,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->propal->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7b447aaf941..bc445b90bb4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2326,17 +2326,17 @@ if ($action == 'create' && $usercancreate) { $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 .= '
    '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$soc->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 ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -2347,13 +2347,13 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index c353287962e..91ecc261b80 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -130,15 +130,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->commande->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index c341ae59b4e..181cb50ef3a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -129,15 +129,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->commande->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 4442af6a679..e259d3e5749 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -82,15 +82,15 @@ $morehtmlref = '
    '; $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').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->commande->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 452e58076c7..82a58e40cf3 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -101,15 +101,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->commande->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 919c0372a21..a30541dadcf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4363,17 +4363,17 @@ if ($action == 'create') { $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 .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -4384,13 +4384,13 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 62705ffd876..1da25ab3c64 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -136,15 +136,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index ee3700fd67e..5088db34ade 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -140,15 +140,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 0d70f095d31..6de7793a4b3 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -96,15 +96,15 @@ $morehtmlref = '
    '; $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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 451ccbab8c4..b47dbe2eabd 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -118,15 +118,15 @@ 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').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 531106be626..b3a881797b5 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -349,7 +349,7 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); } // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if ($type == 'bank-transfer') { if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index d46f2cb24a7..1c7d1ea8e67 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -166,18 +166,18 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->contrat->creer) { if ($action != 'classify') { //$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 111b2d58fd9..94cfc7d2954 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1372,17 +1372,17 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->contrat->creer) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -1393,7 +1393,7 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 8ceefe2f168..14ddc998305 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -153,15 +153,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->contrat->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 19248769ef8..bfeb2536662 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -139,18 +139,18 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->contrat->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 391b10718ce..0e578e45735 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -110,15 +110,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->contrat->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 02f9dc5c712..9c0f4041b51 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5384,9 +5384,10 @@ class Form * @param int $maxlength Max length * @param int $forcefocus Force focus on field (works with javascript only) * @param int $nooutput No print is done. String is returned. + * @param string $textifnoproject Text to show if no project * @return string Return html content */ - public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0) + public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0, $textifnoproject = '') { // phpcs:enable global $langs; @@ -5414,7 +5415,7 @@ class Form $projet->fetch($selected); $out .= $projet->getNomUrl(1, '', 1); } else { - $out .= " "; + $out .= ''.$textifnoproject.''; } $out .= ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8d6a0ff9414..de5a63df281 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2302,13 +2302,13 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi // Add alias for thirdparty if (!empty($object->name_alias)) { - $morehtmlref .= '
    '.$object->name_alias.'
    '; + $morehtmlref .= '
    '.$object->name_alias.'
    '; } // Add label if (in_array($object->element, array('product', 'bank_account', 'project_task'))) { if (!empty($object->label)) { - $morehtmlref .= '
    '.$object->label.'
    '; + $morehtmlref .= '
    '.$object->label.'
    '; } } @@ -2323,7 +2323,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && ($conf->global->MAIN_SHOW_TECHNICAL_ID == '1' || preg_match('/'.preg_quote($object->element, '/').'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) { $morehtmlref .= '
    '; - $morehtmlref .= '
    '; + $morehtmlref .= '
    '; $morehtmlref .= $langs->trans("TechnicalID").': '.$object->id; $morehtmlref .= '
    '; } diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index d458b14b0cb..6a8c1be63dd 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -328,14 +328,14 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); $morehtmlref .= '
    '.$langs->trans("RefDeliveryReceipt").' : '.$object->ref; // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$expedition->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1); @@ -346,14 +346,13 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$expedition->id, $expedition->socid, $expedition->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$expedition->id, $expedition->socid, $expedition->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 46e41dec78e..b6932c2cf09 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -203,7 +203,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 2c304bd8562..7810114aec1 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -187,7 +187,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 56b34f68b03..78f74ded42d 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -160,7 +160,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index cf7ffcb607a..f69d86c62e7 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -287,7 +287,7 @@ if ($projectid > 0) { $morehtmlref .= $project->title; // Thirdparty if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$project->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$project->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 20d7e588bf3..9bab2a7f49d 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -234,7 +234,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index dccad6b9583..1bc9c12d4f6 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -413,7 +413,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6c880a6e425..d76bd40a8a6 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1742,14 +1742,14 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -1760,16 +1760,15 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { // We don't have project on shipment, so we will use the project or source object instead // TODO Add project on shipment - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 4c540adcd9e..b2eec02f879 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -148,14 +148,14 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 71e325677e6..a27a5390c65 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -118,18 +118,18 @@ if ($id > 0 || !empty($ref)) { $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); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index d23bb0298ea..364b5400ff3 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -109,14 +109,14 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 97162f4aaf2..91805e9d0a9 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -283,17 +283,17 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); + $morehtmlref .= '
    '.$soc->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->commande->creer) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index cef3f737c53..d172a865811 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1159,7 +1159,7 @@ if ($action == 'create') { $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 67cfffdeb7c..d6961a1323e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2033,9 +2033,8 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); + $morehtmlref .= '
    '; if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && !empty($usercancreate) && $action == 'edit_thirdparty') { - $morehtmlref .= ' : '; $morehtmlref .= '
    '; $morehtmlref .= ''; $morehtmlref .= ''; @@ -2070,13 +2069,13 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 92859d2eb1f..e7e2daf0386 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -134,15 +134,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 1a8834941c9..1fcc3daacb8 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -541,15 +541,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 0eba3dbc601..e457170d323 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -130,15 +130,15 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 698fead1a43..c764302244f 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -141,15 +141,15 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 167c506b651..21c9379fa75 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -110,15 +110,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 44337454772..c17be415e3a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2873,17 +2873,17 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'supplier'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -2894,13 +2894,13 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index f9f7a754b8f..e4740b47d8a 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -133,18 +133,18 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index fa08b721370..9ac4d53486d 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -112,18 +112,18 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index a4322c2448e..bd6f8b10ee2 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -75,18 +75,18 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->facture->creer) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index e1eb788723f..d5b4042fdf4 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -106,18 +106,18 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { if ($action != 'classify') { // $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index e26734ed9c6..2e61322997a 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -123,7 +123,7 @@ if ($object->id > 0) { $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Amount $morehtmlref .= '
    '.$langs->trans('Amount').' : '. price($object->amount, '', $langs, 0, 0, -1, $conf->currency); diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 037ddd1c4e1..c61d794fcdc 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -38,6 +38,7 @@ OpportunitiesStatusForProjects=Leads amount of projects by status ShowProject=Show project ShowTask=Show task SetProject=Set project +OutOfProject=Out of project NoProject=No project defined or owned NbOfProjects=Number of projects NbOfTasks=Number of tasks diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 9da183534fd..718aeecec82 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1107,7 +1107,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Title $morehtmlref .= dol_escape_htmltag($object->title); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '; + $morehtmlref .= '
    '; if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 872aab6046c..024dce3abc9 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -105,7 +105,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 3e2e85a3757..f6827fc19b3 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -296,7 +296,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 0a2acc4c3bc..bb50bf0def6 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -138,7 +138,7 @@ if ($object->id > 0) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 7bf40647783..f96f5737cf4 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -218,7 +218,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index c04614c859e..f2889d7c469 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -117,7 +117,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index bef020d9a38..e6aaca355e1 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -132,7 +132,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index ce099c04745..3ca7949b35a 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index f957b59b3c2..18a75449f24 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index e6749612f46..4540112f4c3 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -132,7 +132,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 4427af86f52..4bbc48900af 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index fb89ba372e7..6a62e973a62 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -153,7 +153,7 @@ if ($object->id > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 7c02dad5785..01c39c990f4 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -142,7 +142,7 @@ if ($object->id > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 95c755097eb..331b29acb96 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -264,7 +264,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (!empty($projectstatic->thirdparty->id) &&$projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d268a72b12d..8e30664232b 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -906,7 +906,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $morehtmlref .= $projectstatic->title; // Thirdparty if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 011781f33e2..452061a9276 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1380,14 +1380,14 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -1403,11 +1403,10 @@ if ($action == 'create') { } else { // We don't have project on reception, so we will use the project or source object instead // TODO Add project on reception - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 442657ecf43..d484ab8bc48 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -146,14 +146,14 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -169,11 +169,10 @@ if ($id > 0 || !empty($ref)) { } else { // We don't have project on reception, so we will use the project or source object instead // TODO Add project on reception - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index 10227373015..2b2a2f3ffed 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -118,15 +118,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on shipment if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -142,11 +142,10 @@ if ($id > 0 || !empty($ref)) { } else { // We don't have project on shipment, so we will use the project or source object instead // TODO Add project on shipment - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 617d260e643..c5ffc5c6bb7 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -123,14 +123,14 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -146,11 +146,10 @@ if ($id > 0 || !empty($ref)) { } else { // We don't have project on reception, so we will use the project or source object instead // TODO Add project on reception - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index fde016c78c4..7c4fd273579 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -133,15 +133,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($permissiontoedit) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -158,7 +158,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9adffdfd720..202aacb98cd 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -177,11 +177,10 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); + $morehtmlref .= '
    '; /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; }*/ - $morehtmlref .= ' : '; if ($action == 'editcustomer') { $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); } else { @@ -192,11 +191,11 @@ if (isModEnabled("societe")) { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project'); + $morehtmlref .= '
    '; if ($user->rights->ticket->write) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index df46ff8e77c..b9629841979 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -955,9 +955,9 @@ if ($action == 'create' || $action == 'presend') { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' '; + $morehtmlref .= '
    '; if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' '; } if ($action == 'editcustomer') { $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); @@ -969,7 +969,7 @@ if ($action == 'create' || $action == 'presend') { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->ticket->write) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; @@ -984,7 +984,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index bf39f123708..cc0923a89e1 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -212,11 +212,10 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); + $morehtmlref .= '
    '; /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; }*/ - $morehtmlref .= ' : '; if ($action == 'editcustomer') { $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); } else { @@ -227,11 +226,11 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->ticket->write) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 5a7d46540c4..70edaf475d6 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -147,11 +147,10 @@ if ($object->id) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); + $morehtmlref .= '
    '; /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; }*/ - $morehtmlref .= ' : '; if ($action == 'editcustomer') { $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); } else { @@ -162,11 +161,11 @@ if ($object->id) { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($user->rights->ticket->write) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index e2f4d9c60ba..66bda452ccf 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -578,7 +578,7 @@ if ($projectid > 0 || $project_ref) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; @@ -593,7 +593,7 @@ if ($projectid > 0 || $project_ref) { print '
    '; print '
    '; - print '
    ' . $langs->trans("EmailAttendee") . '*'; + print '
    ' . $langs->trans("EmailAttendee") . ''; print img_picto('', 'email', 'class="pictofixedwidth"'); - print '
    ' . $langs->trans("Company"); + print '
    '; if (!empty(floatval($project->price_registration))) { - print '*'; + print ''; } - print ' '; + print $langs->trans("Company"); + if (!empty(floatval($project->price_registration))) { + print ''; + } + print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); - print '
    ' . $langs->trans('Country') . '*'; + print '
    trans('Country') . ''; print img_picto('', 'country', 'class="pictofixedwidth"'); $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { From 48c42b7f7f93ccb05a9f4bca575089b8b8a44495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 21 Oct 2022 13:43:35 +0200 Subject: [PATCH 1096/1289] Update modStockTransfer.class.php --- htdocs/core/modules/modStockTransfer.class.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index c834900c2cf..6c8f068adf6 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -51,7 +51,7 @@ class modStockTransfer extends DolibarrModules $this->rights_class = 'stocktransfer'; // 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 = "products"; // Module position in the family on 2 digits ('01', '10', '20', ...) $this->module_position = '90'; // Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) @@ -125,7 +125,6 @@ class modStockTransfer extends DolibarrModules $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("stocktransfer@stocktransfer"); $this->phpmin = array(7, 0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) //$this->automatic_activation = array('FR'=>'StockTransferWasAutomaticallyActivatedBecauseOfYourCountryChoice'); @@ -138,12 +137,6 @@ class modStockTransfer extends DolibarrModules // ); $this->const = array(); - // Some keys to add into the overwriting translation tables - /*$this->overwrite_translation = array( - 'en_US:ParentCompany'=>'Parent company or reseller', - 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' - )*/ - if (!isset($conf->stocktransfer) || !isset($conf->stocktransfer->enabled)) { $conf->stocktransfer = new stdClass(); $conf->stocktransfer->enabled = 0; @@ -435,15 +428,6 @@ class modStockTransfer extends DolibarrModules $result = $this->_load_tables('/install/mysql/tables/', 'stocktransfer'); if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') - // Create extrafields during init - //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - //$extrafields = new ExtraFields($this->db); - //$result1=$extrafields->addExtraField('stocktransfer_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result2=$extrafields->addExtraField('stocktransfer_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result3=$extrafields->addExtraField('stocktransfer_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result4=$extrafields->addExtraField('stocktransfer_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result5=$extrafields->addExtraField('stocktransfer_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - // Permissions $this->remove($options); From 4b50bf996386f230d5ea695beff19081ee4bfc1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 14:01:36 +0200 Subject: [PATCH 1097/1289] Show dates and location on registration page --- htdocs/projet/card.php | 12 +++--- .../public/eventorganization/attendee_new.php | 41 ++++++++++++++++--- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e3a916c0be0..9da183534fd 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -60,8 +60,8 @@ $objcanvas = GETPOST("objcanvas", "alphanohtml"); $comefromclone = GETPOST("comefromclone", "alphanohtml"); $date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); $date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); -$date_start_event = dol_mktime(0, 0, 0, GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); -$date_end_event = dol_mktime(0, 0, 0, GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); +$date_start_event = dol_mktime(GETPOST('date_start_eventhour', 'int'), GETPOST('date_start_eventmin', 'int'), GETPOST('date_start_eventsec', 'int'), GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); +$date_end_event = dol_mktime(GETPOST('date_end_eventhour', 'int'), GETPOST('date_end_eventmin', 'int'), GETPOST('date_end_eventsec', 'int'), GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); $location = GETPOST('location', 'alphanohtml'); @@ -734,9 +734,9 @@ if ($action == 'create' && $user->rights->projet->creer) { if (isModEnabled('eventorganization')) { // Date event print '
    '.$langs->trans("Date").' ('.$langs->trans("Event").')'; - print $form->selectDate(($date_start_event ? $date_start_event : -1), 'date_start_event', 0, 0, 0, '', 1, 0); + print $form->selectDate(($date_start_event ? $date_start_event : -1), 'date_start_event', 1, 1, 1, '', 1, 0); print ' '.$langs->trans("to").' '; - print $form->selectDate(($date_end_event ? $date_end_event : -1), 'date_end_event', 0, 0, 0, '', 1, 0); + print $form->selectDate(($date_end_event ? $date_end_event : -1), 'date_end_event', 1, 1, 1, '', 1, 0); print '
    '.$langs->trans("Date").' ('.$langs->trans("Event").')'; - print $form->selectDate(($date_start_event ? $date_start_event : ($object->date_start_event ? $object->date_start_event : -1)), 'date_start_event', 0, 0, 0, '', 1, 0); + print $form->selectDate(($date_start_event ? $date_start_event : ($object->date_start_event ? $object->date_start_event : -1)), 'date_start_event', 1, 1, 1, '', 1, 0); print ' '.$langs->trans("to").' '; - print $form->selectDate(($date_end_event ? $date_end_event : ($object->date_end_event ? $object->date_end_event : -1)), 'date_end_event', 0, 0, 0, '', 1, 0); + print $form->selectDate(($date_end_event ? $date_end_event : ($object->date_end_event ? $object->date_end_event : -1)), 'date_end_event', 1, 1, 1, '', 1, 0); print '
    '; + print '
    '; // Visibility print ''; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 99003f00276..6342e08a34e 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -165,9 +165,10 @@ class FormActions * @param int $max Max number of record * @param string $moreparambacktopage More param for the backtopage * @param string $morehtmlcenter More html text on center of title line + * @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions) * @return int <0 if KO, >=0 if OK */ - public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '') + public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0) { global $langs, $conf, $user; @@ -225,9 +226,21 @@ class FormActions $taskid = $object->id; } + $usercanaddaction = 0; + if (empty($assignedtouser) || $assignedtouser == $user->id) { + $usercanaddaction = $user->hasRight('agenda', 'myactions', 'create'); + $assignedtouser = 0; + } else { + $usercanaddaction = $user->hasRight('agenda', 'allactions', 'create'); + } + $newcardbutton = ''; - if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage); + if (isModEnabled('agenda') && $usercanaddaction) { + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')); + $url .= '&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')); + $url .= ($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : ''); + $url .= ($assignedtouser > 0 ? '&assignedtouser='.$assignedtouser : ''); + $url .= '&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3c65d018e6b..a539dad3505 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2829,7 +2829,7 @@ if ($action == 'create' || $action == 'adduserldap') { // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'user', $socid, 1); + $somethingshown = $formactions->showactions($object, 'user', $socid, 1, 'listactions', 0, '', '', $object->id); print ''; } From c1213cfde8c69f2fb7c860432a85fa3296cea75b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 16:34:13 +0200 Subject: [PATCH 1100/1289] Fix missing code for triggers --- .../install/mysql/migration/16.0.0-17.0.0.sql | 153 ++++++++++++++++++ .../mysql/tables/llx_c_action_trigger.sql | 2 +- 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index f796ac441ee..b10aa69767b 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 @@ -201,3 +201,156 @@ ALTER TABLE llx_projet ADD COLUMN date_start_event datetime; ALTER TABLE llx_projet ADD COLUMN date_end_event datetime; ALTER TABLE llx_projet ADD COLUMN location varchar(255); + +ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(128); + +-- +-- List of all managed triggered events (used for trigger agenda automatic events and for notification) +-- + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_MODIFY','Customer proposal modified','Executed when a customer proposal is modified','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_MODIFY','Customer order modified','Executed when a customer order is set modified','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_MODIFY','Price request modified','Executed when a commercial proposal is modified','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10); +--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CREATE','Supplier order created','Executed when a supplier order is created','order_supplier',11); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',12); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_MODIFY','Supplier order request modified','Executed when a supplier order is modified','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_MODIFY','Supplier invoice modified','Executed when a supplier invoice is modified','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_MODIFY','Contract modified','Executed when a contract is modified','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_MODIFY','Shipping modified','Executed when a shipping is modified','shipping',20); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_DELETE','Shipping sent is deleted','Executed when a shipping is deleted','shipping',21); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_EXCLUDE','Member excluded','Executed when a member is excluded','member',27); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',30); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modify','Executed when a intervention is modify','ficheinter',30); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',32); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',33); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',34); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',35); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',40); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',42); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',202); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',212); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is modified','ticket',164); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_CREATE','User created','Executed when a user is created','user',301); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_MODIFY','User update','Executed when a user is updated','user',302); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_DELETE','User update','Executed when a user is deleted','user',303); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','mrp',660); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','mrp',661); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','mrp',662); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','mrp',663); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',52); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',53); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516); + +-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...) +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700); + +-- holiday +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CREATE','Holiday created','Executed when a holiday is created','holiday',800); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Holiday validated','Executed when a holiday is validated','holiday',802); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Holiday aprouved','Executed when a holiday is aprouved','holiday',803); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804); + +-- facture rec +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_CREATE','Template invoices created','Executed when a Template invoices is created','facturerec',900); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903); diff --git a/htdocs/install/mysql/tables/llx_c_action_trigger.sql b/htdocs/install/mysql/tables/llx_c_action_trigger.sql index 8f7450d0fe9..be1c8580541 100644 --- a/htdocs/install/mysql/tables/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/tables/llx_c_action_trigger.sql @@ -23,7 +23,7 @@ create table llx_c_action_trigger ( rowid integer AUTO_INCREMENT PRIMARY KEY, elementtype varchar(64) NOT NULL, - code varchar(64) NOT NULL, + code varchar(128) NOT NULL, label varchar(128) NOT NULL, description varchar(255), rang integer DEFAULT 0 From d9c2528b62002fb53a5e47b526001d6c555af7aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 23:49:45 +0200 Subject: [PATCH 1101/1289] Clean code --- htdocs/comm/propal/card.php | 17 ++----- htdocs/comm/propal/contact.php | 24 +++------- htdocs/comm/propal/document.php | 24 +++------- htdocs/comm/propal/info.php | 26 ++++------- htdocs/comm/propal/note.php | 26 ++++------- htdocs/commande/card.php | 17 ++----- htdocs/commande/contact.php | 27 ++++------- htdocs/commande/document.php | 27 ++++------- htdocs/commande/info.php | 26 ++++------- htdocs/commande/note.php | 30 ++++-------- htdocs/compta/facture/card.php | 17 ++----- htdocs/compta/facture/contact.php | 26 ++++------- htdocs/compta/facture/document.php | 26 ++++------- htdocs/compta/facture/info.php | 26 ++++------- htdocs/compta/facture/note.php | 26 ++++------- htdocs/compta/facture/prelevement.php | 23 ++------- htdocs/contrat/agenda.php | 26 ++++------- htdocs/contrat/card.php | 22 ++------- htdocs/contrat/contact.php | 26 ++++------- htdocs/contrat/document.php | 24 +++------- htdocs/contrat/note.php | 25 +++------- htdocs/core/class/html.form.class.php | 3 +- htdocs/delivery/card.php | 21 ++------- htdocs/expedition/card.php | 23 ++------- htdocs/expedition/contact.php | 26 +++-------- htdocs/expedition/document.php | 44 ++++++++++-------- htdocs/expedition/note.php | 26 +++-------- htdocs/expedition/shipment.php | 25 +++------- htdocs/fourn/commande/card.php | 25 +++------- htdocs/fourn/commande/contact.php | 32 +++++-------- htdocs/fourn/commande/dispatch.php | 29 ++++-------- htdocs/fourn/commande/document.php | 26 +++-------- htdocs/fourn/commande/info.php | 28 ++++------- htdocs/fourn/commande/note.php | 28 ++++------- htdocs/fourn/facture/card.php | 19 ++------ htdocs/fourn/facture/contact.php | 27 ++++------- htdocs/fourn/facture/document.php | 24 +++------- htdocs/fourn/facture/info.php | 27 ++++------- htdocs/fourn/facture/note.php | 26 ++++------- htdocs/reception/card.php | 29 +++--------- htdocs/reception/contact.php | 41 ++++++++-------- htdocs/reception/document.php | 67 ++++++++++++++++++--------- htdocs/reception/note.php | 59 +++++++++++------------ htdocs/supplier_proposal/contact.php | 22 +++------ htdocs/ticket/agenda.php | 24 ++++------ htdocs/ticket/card.php | 23 +++------ htdocs/ticket/contact.php | 23 +++------ htdocs/ticket/document.php | 23 +++------ htdocs/ticket/messaging.php | 24 +++------- 49 files changed, 432 insertions(+), 873 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a18056e1003..87906426b44 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2306,30 +2306,19 @@ if ($action == 'create') { $langs->load("projects"); $morehtmlref .= '
    '; if ($usercancreate) { + $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->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, $langs->trans("OutOfProject")); - } + $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 5039335007f..f1dff7991ef 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -69,6 +69,8 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Add a new contact @@ -142,32 +144,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->propal->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index a2f638a8ad2..569a9d2494e 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -90,6 +90,8 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Actions @@ -140,32 +142,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->propal->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index fdf1f1d1bb9..ed15c4d7615 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -53,6 +53,8 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * View @@ -87,32 +89,20 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->propal->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index fd10809bac5..272ef300db2 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -59,6 +59,8 @@ $hookmanager->initHooks(array('propalnote')); restrictedArea($user, 'propal', $object->id, 'propal'); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Actions @@ -112,32 +114,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->propal->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bc445b90bb4..0bffd98e739 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2335,30 +2335,19 @@ if ($action == 'create' && $usercancreate) { $langs->load("projects"); $morehtmlref .= '
    '; if ($usercancreate) { + $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->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); - } + $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 91ecc261b80..7637d1e62ba 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -47,8 +47,11 @@ if ($user->socid) { } $result = restrictedArea($user, 'commande', $id, ''); +$usercancreate = $user->hasRight("commande", "creer"); + $object = new Commande($db); + /* * Ajout d'un nouveau contact */ @@ -135,32 +138,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->commande->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 181cb50ef3a..1cda0476355 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -73,7 +73,8 @@ if (!$sortfield) { $object = new Commande($db); -$permissiontoadd = $user->rights->commande->creer; +$usercancreate = $user->hasRight("commande", "creer"); +$permissiontoadd = $usercancreate; // Security check if ($user->socid) { @@ -134,32 +135,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->commande->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index e259d3e5749..9b091c47397 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -50,6 +50,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'commande', $comid, ''); +$usercancreate = $user->hasRight("commande", "creer"); + $object = new Commande($db); if (!$object->fetch($id, $ref) > 0) { dol_print_error($db); @@ -87,32 +89,20 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->commande->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 82a58e40cf3..7ab5fa96310 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -52,6 +52,10 @@ $hookmanager->initHooks(array('ordernote')); $result = restrictedArea($user, 'commande', $id, ''); +$usercancreate = $user->hasRight("commande", "creer"); + +$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php + $object = new Commande($db); if (!$object->fetch($id, $ref) > 0) { @@ -59,8 +63,6 @@ if (!$object->fetch($id, $ref) > 0) { exit; } -$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php - /* * Actions @@ -106,32 +108,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->commande->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a30541dadcf..a193383836b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4372,30 +4372,19 @@ if ($action == 'create') { $langs->load("projects"); $morehtmlref .= '
    '; if ($usercancreate) { + $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->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, $langs->trans("OutOfProject")); - } + $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 1da25ab3c64..0bc058a05d6 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -58,6 +58,8 @@ if ($id > 0 || !empty($ref)) { $result = restrictedArea($user, 'facture', $object->id); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Add a new contact @@ -141,32 +143,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 5088db34ade..a38fd572e09 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -81,6 +81,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'facture', $object->id, ''); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Actions @@ -145,32 +147,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 6de7793a4b3..7cbfdb50a14 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -59,6 +59,8 @@ $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +$usercancreate = $user->hasRight("facture", "creer"); + /* * View @@ -101,32 +103,20 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index b47dbe2eabd..3066b5adfc6 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -59,6 +59,8 @@ $hookmanager->initHooks(array('invoicenote')); $result = restrictedArea($user, 'facture', $id, ''); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Actions @@ -123,32 +125,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index b3a881797b5..d7a674867d0 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -364,32 +364,19 @@ if ($object->id > 0) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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 .= ''; - $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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 1c7d1ea8e67..5b649c5b850 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -76,6 +76,8 @@ if (!$sortorder) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendacontract', 'globalcard')); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + /* * Actions @@ -174,32 +176,20 @@ if ($id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->contrat->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 94cfc7d2954..b2a89ab63ec 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -977,7 +977,6 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->contrat->multidir_output[$object->entity]; - $permissiontoadd = $user->rights->contrat->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -1380,31 +1379,20 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->contrat->creer) { + 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->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $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->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); - } + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 14ddc998305..7f1187853c8 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -54,6 +54,8 @@ $object = new Contrat($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contractcard', 'globalcard')); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + /* * Actions @@ -158,32 +160,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->contrat->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index bfeb2536662..55fb5c690a1 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -147,32 +147,20 @@ if ($object->id) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->contrat->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 0e578e45735..94aa8369b3f 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -54,6 +54,7 @@ $result = restrictedArea($user, 'contrat', $id); $object = new Contrat($db); $object->fetch($id, $ref); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php @@ -115,32 +116,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->contrat->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $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(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9c0f4041b51..0b108d8b759 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5401,7 +5401,6 @@ class Form $langs->load("project"); if ($htmlname != "none") { - $out .= "\n"; $out .= '
    '; $out .= ''; $out .= ''; @@ -5413,7 +5412,7 @@ class Form if ($selected) { $projet = new Project($this->db); $projet->fetch($selected); - $out .= $projet->getNomUrl(1, '', 1); + $out .= $projet->getNomUrl(0, '', 1); } else { $out .= ''.$textifnoproject.''; } diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 6a8c1be63dd..0b019bec92c 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -333,31 +333,20 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment + if (0) { // Do not change on shipment + $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=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($expedition->socid, $expedition->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$expedition->id, $expedition->socid, $expedition->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d76bd40a8a6..5e9dc8fb1a7 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1747,33 +1747,20 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment + if (0) { // Do not change on shipment + $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->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, $langs->trans("OutOfProject")); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index b2eec02f879..4ef381dfc9a 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -153,34 +153,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment + if (0) { // Do not change on shipment + $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->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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index a27a5390c65..4aca218a611 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -66,8 +66,26 @@ if (!$sortfield) { $object = new Expedition($db); -if ($object->fetch($id, $ref)) { +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); $object->fetch_thirdparty(); + + if (!empty($object->origin)) { + $typeobject = $object->origin; + $origin = $object->origin; + $object->fetch_origin(); + } + + // Linked documents + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + $objectsrc = new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + } + if ($typeobject == 'propal' && $object->$typeobject->id && isModEnabled("propal")) { + $objectsrc = new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + } + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); } @@ -127,34 +145,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment + if (0) { // Do not change on shipment + $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->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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 364b5400ff3..2e98169f042 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -114,34 +114,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment + if (0) { // Do not change on shipment + $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->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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 91805e9d0a9..c1b4a04fcee 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -291,31 +291,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->commande->creer) { + if (0) { // Do not change on shipment + $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->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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - if (!empty($object->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $proj->fetch($objectsrc->fk_project); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d6961a1323e..ce85f581859 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2046,7 +2046,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $object->statut == CommandeFournisseur::STATUS_DRAFT) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty')).''; } - $morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1, 'supplier'); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } @@ -2055,32 +2055,21 @@ if ($action == 'create') { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($usercancreate) { + $morehtmlref .= '
    '; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - 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((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 1, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index e7e2daf0386..dd945ef3d39 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -50,9 +50,12 @@ $hookmanager->initHooks(array('ordersuppliercardcontact')); $object = new CommandeFournisseur($db); +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php + /* - * Add a new contact + * Actions */ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { @@ -100,6 +103,7 @@ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $ /* * View */ + $form = new Form($db); $formcompany = new FormCompany($db); $contactstatic = new Contact($db); @@ -139,32 +143,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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); + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 1fcc3daacb8..b7fd424054c 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -100,6 +100,9 @@ if (!isModEnabled('stock')) { accessforbidden(); } +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php + /* * Actions @@ -546,32 +549,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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); + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index e457170d323..a598dd4b83d 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -135,32 +135,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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); + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index c764302244f..df9f52abae1 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -84,6 +84,8 @@ if (empty($user->rights->fournisseur->commande->lire)) { // Init Hooks $hookmanager->initHooks(array('ordersuppliercardinfo')); +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* @@ -146,32 +148,20 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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); + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 21c9379fa75..53cb80f9e55 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -56,6 +56,8 @@ $object->fetch($id, $ref); // Permissions $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* @@ -115,32 +117,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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); + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c17be415e3a..a66f48fc2e0 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2881,31 +2881,20 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + 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->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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, $langs->trans("OutOfProject")); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index e4740b47d8a..5242fce001c 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -51,6 +51,9 @@ $hookmanager->initHooks(array('invoicesuppliercardcontact')); $object = new FactureFournisseur($db); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; + /* * Ajout d'un nouveau contact @@ -141,32 +144,20 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 9ac4d53486d..cdc045b60fc 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -120,32 +120,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index bd6f8b10ee2..b451d6fa63d 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -49,6 +49,9 @@ $hookmanager->initHooks(array('invoicesuppliercardinfo')); $object = new FactureFournisseur($db); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; + /* * View @@ -83,32 +86,20 @@ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0 if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->facture->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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->thirdparty->id, $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->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index d5b4042fdf4..20c8f6d977c 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -53,6 +53,8 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); $object = new FactureFournisseur($db); $object->fetch($id, $ref); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; $permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php @@ -114,32 +116,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 452061a9276..d5106a3b5ea 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -51,10 +51,8 @@ if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } @@ -1386,32 +1384,19 @@ if ($action == 'create') { $langs->load("projects"); $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - 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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index d484ab8bc48..01ff7218f9e 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -35,6 +35,8 @@ if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $langs->loadLangs(array("orders", "receptions", "companies")); @@ -75,6 +77,20 @@ if ($origin == 'reception') { } } +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} + /* * Actions @@ -152,32 +168,19 @@ if ($id > 0 || !empty($ref)) { $langs->load("projects"); $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - 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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } @@ -190,7 +193,7 @@ if ($id > 0 || !empty($ref)) { //print '
    '; print '
    '; - print '
    '.$langs->trans("Visibility").''; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 88ac4ef686c..ed9639f21bf 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -173,11 +173,10 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); + $morehtmlref .= '
    '; /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; }*/ - $morehtmlref .= ' : '; if ($action == 'editcustomer') { $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); } else { @@ -188,11 +187,11 @@ if (isModEnabled("societe")) { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project'); + $morehtmlref .= '
    '; if ($user->rights->ticket->write) { if ($action != 'classify') { //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; - $morehtmlref .= ' : '; + //$morehtmlref .= ' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); From 9a5a3a35171a781d9acfd4396d3d5984a39c14af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Oct 2022 16:18:25 +0200 Subject: [PATCH 1099/1289] Fix link to create event from user card --- htdocs/comm/action/card.php | 5 +++-- htdocs/core/class/html.formactions.class.php | 19 ++++++++++++++++--- htdocs/user/card.php | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 39d5a43bc55..8b42e6df6e2 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1181,9 +1181,10 @@ if ($action == 'create') { // Type of event if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print '
    '.$langs->trans("Type").''; - $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); + $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV'); print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot + $selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default); + print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot print '
    '; + print '
    '; // Linked documents if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { print ''; -print ''; - print ''; + +// Allow external download +print ''; +print ''; +print ''; print '
    '; diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index 2b2a2f3ffed..6ef302f4143 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'other')); @@ -65,19 +67,48 @@ if (!$sortfield) { } $object = new Reception($db); - -if ($object->fetch($id, $ref)) { +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); $object->fetch_thirdparty(); + + if (!empty($object->origin)) { + $origin = $object->origin; + + $object->fetch_origin(); + $typeobject = $object->origin; + } + + // Linked documents + if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { + $objectsrc = new CommandeFournisseur($db); + $objectsrc->fetch($object->$typeobject->id); + } + $upload_dir = $conf->reception->dir_output."/".dol_sanitizeFileName($object->ref); } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('receptiondocument')); + // Security check -if ($user->socid) { +if ($user->socid > 0) { $socid = $user->socid; } $result = restrictedArea($user, 'reception', $object->id, ''); -$permissiontoadd = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} /* @@ -117,6 +148,9 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; + // Ref customer reception + $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); @@ -124,33 +158,20 @@ if ($id > 0 || !empty($ref)) { if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '; - if (0) { // Do not change on shipment - if ($action != 'classify') { + if (0) { // Do not change on reception + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - 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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index c5ffc5c6bb7..5b04e971702 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -28,11 +28,12 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; -dol_include_once('/fourn/class/fournisseur.commande.class.php'); if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal')); @@ -46,32 +47,41 @@ if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); if (!empty($object->origin)) { - $typeobject = $object->origin; $origin = $object->origin; + $object->fetch_origin(); + $typeobject = $object->origin; } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { - $objectsrc = new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - } - if ($typeobject == 'propal' && $object->$typeobject->id && isModEnabled("propal")) { - $objectsrc = new Propal($db); + if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { + $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } } -$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('receptionnote')); // Security check if ($user->socid > 0) { $socid = $user->socid; } - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('receptionnote')); +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} +$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php if ($origin == 'reception') { $result = restrictedArea($user, $origin, $object->id); @@ -106,7 +116,7 @@ if (empty($reshook)) { * View */ -llxHeader('', 'Reception'); +llxHeader('', $langs->trans('Reception')); $form = new Form($db); @@ -129,32 +139,19 @@ if ($id > 0 || !empty($ref)) { $langs->load("projects"); $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } - 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); - } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 7c4fd273579..6b01d2af35a 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; // Load translation files required by the page $langs->loadLangs(array("propal", "supplier_proposal", "facture", "orders", "sendings", "companies")); @@ -139,31 +141,19 @@ if ($id > 0 || !empty($ref)) { $langs->load("projects"); $morehtmlref .= '
    '; if ($permissiontoedit) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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 .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 202aacb98cd..eae0ae829e2 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -94,6 +94,7 @@ if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && accessforbidden(); } +$permissiontoadd = $user->rights->ticket->write; /* @@ -192,29 +193,20 @@ if (isModEnabled("societe")) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->ticket->write) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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', 0, 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); + $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); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } } } } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index b9629841979..eb824beb1d3 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -970,29 +970,20 @@ if ($action == 'create' || $action == 'presend') { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->ticket->write) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $morehtmlref .= '
    '; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, $langs->trans("OutOfProject")); + $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); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } } } } diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index cc0923a89e1..f045923e75d 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -227,29 +227,20 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->ticket->write) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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', 0, 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); + $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); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } } } } diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 70edaf475d6..daa74536d1a 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -162,29 +162,20 @@ if ($object->id) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->ticket->write) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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', 0, 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); + $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); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } } } } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index ed9639f21bf..6817268eca8 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -188,30 +188,20 @@ if (isModEnabled("societe")) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($user->rights->ticket->write) { + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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', 0, 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); + $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)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } } } } From a2d9dd3388ed150f999ed24cee30eb7274df153e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 00:08:10 +0200 Subject: [PATCH 1102/1289] Clean code --- htdocs/api/class/api.class.php | 3 +-- htdocs/contrat/class/contrat.class.php | 3 ++- htdocs/core/class/commonobject.class.php | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index fa5e2ff1de8..e0acc8faac8 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -113,9 +113,8 @@ class DolibarrApi unset($object->pass); unset($object->pass_indatabase); - // Remove linkedObjects. We should already have linkedObjectsIds that avoid huge responses + // Remove linkedObjects. We should already have and keep only linkedObjectsIds that avoid huge responses unset($object->linkedObjects); - unset($object->linkedObjectsFullLoaded); //unset($object->lines[$i]->linked_objects); // This is the array to create linked object during create unset($object->fields); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 4dd26d5d6a2..73d907a374e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2805,7 +2805,8 @@ class ContratLigne extends CommonObjectLine public $table_element = 'contratdet'; /** - * @var string Name to use for 'features' parameter to check module permissions with restrictedArea() + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. */ public $element_for_permission = 'contrat'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d8eb8789d6e..31ca9706889 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -78,7 +78,7 @@ abstract class CommonObject /** * @var array To store error results of ->validateField() */ - public $validateFieldsErrors = array(); + private $validateFieldsErrors = array(); /** * @var string ID to identify managed object @@ -86,7 +86,8 @@ abstract class CommonObject public $element; /** - * @var string Name to use for 'features' parameter to check module permissions with restrictedArea(). Undefined means same value than $element. + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. */ public $element_for_permission; @@ -136,9 +137,9 @@ abstract class CommonObject public $linkedObjects; /** - * @var boolean Array of boolean with object id as key and value as true if linkedObjects full loaded. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction. + * @var boolean[] Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction. */ - public $linkedObjectsFullLoaded = array(); + private $linkedObjectsFullLoaded = array(); /** * @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties @@ -7831,7 +7832,7 @@ abstract class CommonObject * get field error message * * @param string $fieldKey Key of attribute - * @return string + * @return string Error message of validation ('' if no error) */ public function getFieldError($fieldKey) { From f87ec74b9f327199adbac2c5b9668fe1c5e6df0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 00:22:54 +0200 Subject: [PATCH 1103/1289] Replace LEFT JOIN with EXISTS --- .../comm/propal/class/propalestats.class.php | 4 +- htdocs/commande/class/commandestats.class.php | 4 +- .../facture/class/facturestats.class.php | 4 +- .../reception/class/receptionstats.class.php | 50 ++++++++++++++++++- 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 1e688457623..81d49bb87ad 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -109,9 +109,7 @@ class PropaleStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; - $this->where .= ' AND c.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = p.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index d02d56175ff..5f13cf780f4 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -109,9 +109,7 @@ class CommandeStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; - $this->where .= ' AND cat.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.$this->categ_link.' as cats WHERE cats.fk_soc = c.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 55ae05ff0a5..5637fd740a0 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -118,9 +118,7 @@ class FactureStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; - $this->where .= ' AND c.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index a27f458d01a..7a8562b706d 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -69,7 +69,7 @@ class ReceptionStats extends Stats $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - $this->where .= " AND c.entity = ".$conf->entity; + $this->where .= " AND c.entity IN (".getEntity('reception').")"; if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -128,6 +128,54 @@ class ReceptionStats extends Stats return $this->_getNbByYear($sql); } + /** + * Return the orders amount by month for a year + * + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array with amount by month + */ + public function getAmountByMonth($year, $format = 0) + { + global $user; + + $sql = "SELECT date_format(c.date_valid,'%m') as dm, SUM(c.".$this->field.")"; + $sql .= " FROM ".$this->from; + if (empty($user->rights->societe->client->voir) && !$this->socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + $res = $this->_getAmountByMonth($year, $sql, $format); + return $res; + } + + /** + * Return the orders amount average by month for a year + * + * @param int $year year for stats + * @return array array with number by month + */ + public function getAverageByMonth($year) + { + global $user; + + $sql = "SELECT date_format(c.date_valid,'%m') as dm, AVG(c.".$this->field.")"; + $sql .= " FROM ".$this->from; + if (empty($user->rights->societe->client->voir) && !$this->socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + return $this->_getAverageByMonth($year, $sql); + } + /** * Return nb, total and average * From 8486919e3d91ab45036316102feb05489bb25ad8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 01:45:24 +0200 Subject: [PATCH 1104/1289] css --- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 365e4a37219..9a3c800acb4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6615,6 +6615,7 @@ dl.dropdown { max-height: 264px; overflow: auto; border-radius: 2px; + z-index: 1; } .dropdown dd ul.selectedfieldsleft { right: auto; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 82948bf6583..8487f9d59e5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6374,6 +6374,7 @@ dl.dropdown { list-style:none; max-height: 264px; overflow: auto; + z-index: 1; } .dropdown dd ul.selectedfieldsleft { right: auto; From ce494354e24b79f0f455e4334d250de5b2822fd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 01:54:50 +0200 Subject: [PATCH 1105/1289] NEW Finish removal of code using adodbtime --- htdocs/admin/system/constall.php | 2 -- htdocs/admin/system/dolibarr.php | 1 - htdocs/core/lib/functions.lib.php | 3 +++ htdocs/filefunc.inc.php | 7 ------- htdocs/install/inc.php | 10 +--------- htdocs/install/step1.php | 7 +------ 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 4acb8e0ff59..dcf41aacf25 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -73,7 +73,6 @@ $configfileparameters = array( '?dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug', 'separator', - '?dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH', '?dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH', @@ -122,7 +121,6 @@ $configfilelib = array( 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug', 'separator', - 'dolibarr_lib_ADODB_PATH', 'dolibarr_lib_TCPDF_PATH', 'dolibarr_lib_FPDI_PATH', 'dolibarr_lib_NUSOAP_PATH', diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 86c76ca1604..7fa1ef252cb 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -342,7 +342,6 @@ $configfileparameters = array( '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', 'separator3' => '', - '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index de5a63df281..c7c699fc170 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2638,6 +2638,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0); //$useadodb = 1; // To switch to adodb + if (!empty($useadodb)) { + include_once DOL_DOCUMENT_ROOT.'/includes/adodbtime/adodb-time.inc.php'; + } // Analyze date $reg = array(); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ccd85e47810..54c7885e080 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -311,9 +311,6 @@ define('MAIN_DB_PREFIX', $dolibarr_main_db_prefix); * To use other version than embeded libraries, define here constant to path. Use '' to use include class path autodetect. */ // Path to root libraries -if (!defined('ADODB_PATH')) { - define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/adodbtime/' : (empty($dolibarr_lib_ADODB_PATH) ? '' : $dolibarr_lib_ADODB_PATH.'/')); -} if (!defined('TCPDF_PATH')) { define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH.'/'); } @@ -354,10 +351,6 @@ if (!defined('DOL_DEFAULT_TTF_BOLD')) { * Include functions */ -if (!defined('ADODB_DATE_VERSION')) { - include_once ADODB_PATH.'adodb-time.inc.php'; -} - // If password is encoded, we decode it. Note: When page is called for install, $dolibarr_main_db_pass may not be defined yet. if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c717d55850e..e68f0d70a96 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -35,24 +35,16 @@ require_once '../filefunc.inc.php'; -// Define DOL_DOCUMENT_ROOT and ADODB_PATH used for install/upgrade process +// Define DOL_DOCUMENT_ROOT used for install/upgrade process if (!defined('DOL_DOCUMENT_ROOT')) { define('DOL_DOCUMENT_ROOT', '..'); } -if (!defined('ADODB_PATH')) { - $foundpath = DOL_DOCUMENT_ROOT.'/includes/adodbtime/'; - if (!is_dir($foundpath)) { - $foundpath = '/usr/share/php/adodb/'; - } - define('ADODB_PATH', $foundpath); -} require_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/conf.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once ADODB_PATH.'adodb-time.inc.php'; $conf = new Conf(); diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 24b5dba4d01..7958012b0a1 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -825,7 +825,7 @@ function write_conf_file($conffile) global $dolibarr_main_distrib; global $db_host, $db_port, $db_name, $db_user, $db_pass, $db_type, $db_character_set, $db_collation; global $conffile, $conffiletoshow, $conffiletoshowshort; - global $force_dolibarr_lib_ADODB_PATH, $force_dolibarr_lib_NUSOAP_PATH; + global $force_dolibarr_lib_NUSOAP_PATH; global $force_dolibarr_lib_TCPDF_PATH, $force_dolibarr_lib_FPDI_PATH; global $force_dolibarr_lib_GEOIP_PATH; global $force_dolibarr_lib_ODTPHP_PATH, $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP; @@ -944,11 +944,6 @@ function write_conf_file($conffile) } fputs($fp, '$dolibarr_lib_TCPDI_PATH=\''.$force_dolibarr_lib_TCPDI_PATH.'\';'); fputs($fp, "\n"); - if (empty($force_dolibarr_lib_ADODB_PATH)) { - fputs($fp, '//'); $force_dolibarr_lib_ADODB_PATH = ''; - } - fputs($fp, '$dolibarr_lib_ADODB_PATH=\''.$force_dolibarr_lib_ADODB_PATH.'\';'); - fputs($fp, "\n"); if (empty($force_dolibarr_lib_GEOIP_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_GEOIP_PATH = ''; } From 66cae76747352a29422c80fd9e6719b4c4461705 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 02:03:51 +0200 Subject: [PATCH 1106/1289] NEW Finish removal of code using adodbtime --- COPYRIGHT | 1 - build/debian/control | 1 - build/debian/copyright | 25 ------------------------- build/debian/dolibarr.postinst | 1 - build/debian/install.forced.php.install | 1 - build/debian/rules | 1 - build/rpm/dolibarr_fedora.spec | 4 +--- build/rpm/dolibarr_generic.spec | 4 +--- build/rpm/dolibarr_mandriva.spec | 1 - build/rpm/dolibarr_opensuse.spec | 1 - build/rpm/install.forced.php.fedora | 1 - build/rpm/install.forced.php.mandriva | 1 - build/rpm/install.forced.php.opensuse | 1 - 13 files changed, 2 insertions(+), 41 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 46e2f093900..d980219c420 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -23,7 +23,6 @@ Licence of dependencies of third-party components used by Dolibarr (all compatib Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- PHP libraries: -ADOdb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package) EvalMath 1.0 BSD Yes Safe math expressions evaluation Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers GeoIP2 0.2.0 Apache License 2.0 Yes Lib to make geoip convert diff --git a/build/debian/control b/build/debian/control index 059325eecb9..b2890253b32 100755 --- a/build/debian/control +++ b/build/debian/control @@ -19,7 +19,6 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php-pear, php-mail-mime, # php-tcpdf, # libfpdf-tpl-php, php-fpdf, -# libphp-adodb, # libnusoap-php, # libphp-pclzip, # Required javascript libraries diff --git a/build/debian/copyright b/build/debian/copyright index 403763544a5..b99b8a65b5d 100644 --- a/build/debian/copyright +++ b/build/debian/copyright @@ -61,31 +61,6 @@ License: GPL-3+ ------------------------------------------------------------ -Files: htdocs/includes/adodbtime/* -Copyright: 2003-2005, John Lim - unknown, jackbbs -License: BSD-3-Clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - Neither the name of the John Lim nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. -Comment: - Those files are not shipped in the binary package since we use - the library as packaged in "libphp-adodb". - - ------------------------------------------------------------- - Files: htdocs/includes/ckeditor/* Copyright: 2003-2012 CKSource - Frederico Knabben License: GPL-2+ diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 26a08a55826..6ba9123ede4 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -146,7 +146,6 @@ case "$1" in #else # File already exist. We add params not found. #echo Add new params to overwrite path to use shared libraries/fonts - #grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config ##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config #grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config #grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index 1d10699f1d4..801b1b372af 100644 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -31,7 +31,6 @@ $force_install_distrib='debian'; // - not removed from package (see rm in rules file), // - declared into dependencies (see Depends in control file) //$force_dolibarr_lib_TCPDF_PATH=''; -//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; diff --git a/build/debian/rules b/build/debian/rules index dab5d84fd11..b63fcffde93 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -89,7 +89,6 @@ override_dh_install: rm -fr build/zip # clean from all PHP embedded libraries (we use package dependencies instead) -# rm -fr htdocs/includes/adodbtime # rm -fr htdocs/includes/geoip # rm -fr htdocs/includes/nusoap # rm -fr htdocs/includes/odtphp/zip/pclzip diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 1c6716408b7..c94863e8919 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts Requires: mysql-server, mysql #BuildRequires: desktop-file-utils @@ -104,7 +104,6 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source -%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts @@ -274,7 +273,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index a992c84f0f9..8e71713146e 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -46,7 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml Requires: mysql-server, mysql BuildRequires: desktop-file-utils %else @@ -169,7 +169,6 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} -%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts %else @@ -425,7 +424,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a371e3ab02f..5c8a8e39aae 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -271,7 +271,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index c7113828632..ea79a50af58 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -281,7 +281,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/install.forced.php.fedora b/build/rpm/install.forced.php.fedora index a8bc0d390c6..636514260cf 100644 --- a/build/rpm/install.forced.php.fedora +++ b/build/rpm/install.forced.php.fedora @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmfedora'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; diff --git a/build/rpm/install.forced.php.mandriva b/build/rpm/install.forced.php.mandriva index a254eebbf7b..5471d146391 100644 --- a/build/rpm/install.forced.php.mandriva +++ b/build/rpm/install.forced.php.mandriva @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmmandriva'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse index 24da4417121..ea50180caf4 100644 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmopensuse'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; From 003df66f6a8a14dfa90d33f6be49a43258aca995 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 02:32:43 +0200 Subject: [PATCH 1107/1289] Clean code --- htdocs/comm/action/card.php | 29 +++++++------------- htdocs/comm/action/document.php | 26 +++++++++++------- htdocs/comm/action/info.php | 25 +++++++++++------- htdocs/comm/propal/card.php | 4 +-- htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/info.php | 2 +- htdocs/comm/propal/note.php | 2 +- htdocs/commande/contact.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/commande/info.php | 2 +- htdocs/commande/note.php | 2 +- htdocs/compta/facture/contact.php | 2 +- htdocs/compta/facture/document.php | 2 +- htdocs/compta/facture/info.php | 2 +- htdocs/compta/facture/note.php | 2 +- htdocs/compta/facture/prelevement.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/expensereport/card.php | 38 --------------------------- htdocs/fourn/commande/contact.php | 2 +- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/fourn/commande/document.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/fourn/commande/note.php | 2 +- htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/document.php | 2 +- htdocs/fourn/facture/info.php | 2 +- htdocs/fourn/facture/note.php | 2 +- htdocs/resource/element_resource.php | 26 +++++++++++------- 33 files changed, 87 insertions(+), 115 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8b42e6df6e2..27d3c049c64 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -151,6 +151,8 @@ 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); + /* * Actions @@ -2152,34 +2154,21 @@ if ($id > 0) { // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
    '.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').' '; - if ($user->rights->agenda->allactions->create || - (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { + //$morehtmlref .= '
    '; + if ($usercancreate) { + $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->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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9a4a4e6a869..f80476c2f9a 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -89,7 +89,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$permissiontoadd = $usercancreate; /* @@ -162,17 +163,22 @@ if ($object->id > 0) { // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
    '.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
    '; + if (0) { + $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 { - $morehtmlref .= ''; + 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/comm/action/info.php b/htdocs/comm/action/info.php index 807a8e6f412..e009c9fccf7 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -50,6 +50,8 @@ 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); + /* * View @@ -89,17 +91,22 @@ $morehtmlref = '
    '; // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
    '.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
    '; + if (0) { + $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 { - $morehtmlref .= ''; + 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/comm/propal/card.php b/htdocs/comm/propal/card.php index 87906426b44..9180be4f99b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2332,7 +2332,7 @@ if ($action == 'create') { print '
    '; print '
    '; - print ''; + print '
    '; // Link for thirdparty discounts if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -2392,7 +2392,7 @@ if ($action == 'create') { // Date end proposal print ''; print ''; } // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Module source @@ -2129,8 +2129,9 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -2139,8 +2140,9 @@ if ($resql) { // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f7aa1990f13..daff55c7615 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5439,22 +5439,26 @@ class Form * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) + * @param int $nooutput No print is done. String is returned. * @return void */ - public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1) + public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0) { // phpcs:enable global $langs; + + $out = ''; + if ($htmlname != "none") { - print ''; - print ''; - print ''; + $out .= ''; + $out .= ''; + $out .= ''; if ($type) { - print ''; + $out .= ''; } - print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); - print ''; - print ''; + $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); + $out .= ''; + $out .= ''; } else { if ($selected) { $this->load_cache_conditions_paiements(); @@ -5465,15 +5469,21 @@ class Form $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label); } - print $label; + $out .= $label; } else { $langs->load('errors'); - print $langs->trans('ErrorNotInDictionaryPaymentConditions'); + $out .= $langs->trans('ErrorNotInDictionaryPaymentConditions'); } } else { - print " "; + $out .= ' '; } } + + if (empty($nooutput)) { + print $out; + return ''; + } + return $out; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 83afee60470382c3b82597bb76ed7362f09253b5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Oct 2022 07:47:43 +0200 Subject: [PATCH 1134/1289] FIX can not set prospect status "Do not contact" --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 624dcda170a..8961d70a4cc 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1479,7 +1479,7 @@ class Societe extends CommonObject $sql .= ",fk_effectif = ".($this->effectif_id > 0 ? ((int) $this->effectif_id) : "null"); if (isset($this->stcomm_id)) { - $sql .= ",fk_stcomm=".($this->stcomm_id > 0 ? ((int) $this->stcomm_id) : "0"); + $sql .= ",fk_stcomm=".($this->stcomm_id >= -1 ? ((int) $this->stcomm_id) : "0"); } if (isset($this->typent_id)) { $sql .= ",fk_typent = ".($this->typent_id > 0 ? ((int) $this->typent_id) : "0"); From d9f067eabb17ba32f54c2293a65adb59404672da Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 24 Oct 2022 09:46:41 +0200 Subject: [PATCH 1135/1289] FIX : travis & stickler feedbacks --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 564c917ef1a..5efbdeae8e1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2452,7 +2452,7 @@ class Form $sql.= ' WHERE b.entity IN ('.getEntity('bom').')'; if (!empty($status)) $sql.= ' AND status = '. (int) $status; if (!empty($type)) $sql.= ' AND bomtype = '. (int) $type; - if(! empty($TProducts)) $sql .= ' AND fk_product IN ('.implode(',', $TProducts).')'; + if (!empty($TProducts)) $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; if (!empty($limit)) $sql.= ' LIMIT '. (int) $limit; $resql = $db->query($sql); if ($resql) { From a53a3fb9bf0d70f8892193780dbbc8f29e9e8df2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 10:26:46 +0200 Subject: [PATCH 1136/1289] Look and feel v17, search on multibox not too large --- htdocs/accountancy/bookkeeping/listbyaccount.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/style.css.php | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index c4b27dce418..7ab6666d4c4 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -743,12 +743,12 @@ print ''; // Movement number if (!empty($arrayfields['t.piece_num']['checked'])) { - print ''; + print ''; } // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; } // Date document diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9a3c800acb4..7b1983ec7a4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1393,6 +1393,7 @@ select.flat.selectlimit { -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; + height: auto !important; } .tablelistofcalendars { @@ -6438,9 +6439,14 @@ ul.select2-results__options li { @media only screen and (min-width: 767px) { + /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { min-width: 200px !important; } + .select2-container.select2-container--open .select2-dropdown--below { + min-width: 200px !important; + } + .select2-container--open .select2-dropdown--below { border-top: 1px solid var(--inputbordercolor); /* border-top: 1px solid #aaaaaa; */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8487f9d59e5..1a625052cb2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1512,6 +1512,7 @@ select.flat.selectlimit { -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; + height: auto !important; } .tablelistofcalendars { @@ -6204,9 +6205,14 @@ ul.select2-results__options li { @media only screen and (min-width: 767px) { + /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { min-width: 200px !important; } + .select2-container.select2-container--open .select2-dropdown--below { + min-width: 200px !important; + } + .select2-container--open .select2-dropdown--below { border-top: 1px solid var(--inputbordercolor); /* border-top: 1px solid #aaaaaa; */ From 774f57910f50942b0f6b563f819aba04cc4dc12e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 10:56:25 +0200 Subject: [PATCH 1137/1289] css --- htdocs/contact/card.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index fbe8b4d0c04..8e9c6f2a321 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1473,39 +1473,38 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Categories if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''; - print ''; } if (!empty($object->socid)) { print ''; - print ''; } // Other attributes - $cols = 3; $parameters = array('socid'=>$socid); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; $object->load_ref_elements(); if (isModEnabled("propal")) { - print ''; } if (isModEnabled('commande') || isModEnabled("expedition")) { - print ''; } if (isModEnabled('facture')) { - print ''; } - print ''; // Column with checkbox diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 7a02d0b4564..b90a8a2c573 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -503,7 +503,7 @@ if ($result) { // Suggested accounting account print ''; print ''; // Column with checkbox diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 7b1983ec7a4..05f00488123 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6441,10 +6441,10 @@ ul.select2-results__options li { { /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { - min-width: 200px !important; + min-width: 220px !important; } .select2-container.select2-container--open .select2-dropdown--below { - min-width: 200px !important; + min-width: 220px !important; } .select2-container--open .select2-dropdown--below { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1a625052cb2..df1bd11dc4f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6207,10 +6207,10 @@ ul.select2-results__options li { { /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { - min-width: 200px !important; + min-width: 220px !important; } .select2-container.select2-container--open .select2-dropdown--below { - min-width: 200px !important; + min-width: 220px !important; } .select2-container--open .select2-dropdown--below { From 77af5f3cc8e7ee7174aaee6ed5ccd783fccc1f0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 12:24:02 +0200 Subject: [PATCH 1139/1289] Fix old value of lines were not correctly loaded --- htdocs/contrat/card.php | 2 ++ htdocs/contrat/class/contrat.class.php | 2 +- htdocs/core/lib/functions.lib.php | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 802305b6306..b691524ad92 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -694,6 +694,8 @@ if (empty($reshook)) { $error++; } $objectline->fetch_optionals(); + + $objectline->oldcopy = dol_clone($objectline); } $db->begin(); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 5c72bf51c69..7d43da46b37 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3392,7 +3392,7 @@ class ContratLigne extends CommonObjectLine } } - // If we change a planned date (start or end), sync dates for all services + // If we change a planned date (start or end) of one contract line, sync dates for all other services too if (!$error && !empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES)) { dol_syslog(get_class($this)."::update CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES is on so we update date for all lines", LOG_DEBUG); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0bf63ee9b0b..160dd0b7575 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1160,26 +1160,26 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) /** * Create a clone of instance of object (new instance with same value for properties) - * With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object is not valid. + * With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid. * With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object. * * @param object $object Object to clone - * @param int $native 0=Full isolation method, 1=Native PHP method + * @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended) * @return object Clone object * @see https://php.net/manual/language.oop5.cloning.php */ function dol_clone($object, $native = 0) { - if (empty($native)) { + if ($native == 0) { $tmpsavdb = null; if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { $tmpsavdb = $object->db; - unset($object->db); // Such property can not be serialized when PgSql/Connection + unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection') } $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields - if ($tmpsavdb) { + if (!empty($tmpsavdb)) { $object->db = $tmpsavdb; } } else { From 6530f3a1cd12d64d5703ad74617b72274549ed2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 12:28:11 +0200 Subject: [PATCH 1140/1289] CSS --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 1520897c4f7..e9836c4efbf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -985,7 +985,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) { // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; } // Date document From baccf336f20bea38699db1a803d1a7116e823c55 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Oct 2022 16:41:31 +0200 Subject: [PATCH 1141/1289] FIX remove > 0 and -1 --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8961d70a4cc..83de127f254 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1479,7 +1479,7 @@ class Societe extends CommonObject $sql .= ",fk_effectif = ".($this->effectif_id > 0 ? ((int) $this->effectif_id) : "null"); if (isset($this->stcomm_id)) { - $sql .= ",fk_stcomm=".($this->stcomm_id >= -1 ? ((int) $this->stcomm_id) : "0"); + $sql .= ",fk_stcomm=".(($this->stcomm_id > 0 || $this->stcomm_id = -1) ? ((int) $this->stcomm_id) : "0"); } if (isset($this->typent_id)) { $sql .= ",fk_typent = ".($this->typent_id > 0 ? ((int) $this->typent_id) : "0"); From cd9984cd3e3cc380fdb69a935b397f1f12d6b20f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 19:19:41 +0200 Subject: [PATCH 1142/1289] Update card.php --- htdocs/product/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index e8edb5d1d8b..7c51da5d02a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1866,10 +1866,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; - print '
    '; + print ''; if ($action != 'editecheance' && $usercancreate && $caneditfield) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index f1dff7991ef..835dcc70fd0 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -144,7 +144,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 569a9d2494e..799539d97b1 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -142,7 +142,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index ed15c4d7615..26a65f9a66e 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -89,7 +89,7 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 272ef300db2..64fe59edea5 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -114,7 +114,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 7637d1e62ba..aa61426e435 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 1cda0476355..ef1e1ce1697 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 9b091c47397..e319cb95d36 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -89,7 +89,7 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 7ab5fa96310..946902e1a11 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -108,7 +108,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 0bc058a05d6..7b7dd41ef7e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index a38fd572e09..c4b11cea186 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 7cbfdb50a14..340c40afa4a 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -103,7 +103,7 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'customer'); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 3066b5adfc6..f6c81bbf800 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -125,7 +125,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index d7a674867d0..172ec0c1120 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -363,7 +363,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($usercancreate) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 5b649c5b850..9ddab3b6487 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -176,7 +176,7 @@ if ($id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 7f1187853c8..3c3bb00baeb 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 55fb5c690a1..477d8818c4b 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -147,7 +147,7 @@ if ($object->id) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 94aa8369b3f..1038fe83de3 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -116,7 +116,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c7c699fc170..4e7acd5fc52 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8155,7 +8155,7 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = ' * * @param int $date_start Start date * @param int $date_end End date - * @param string $format Output format + * @param string $format Output date format ('day', 'dayhour', ...) * @param Translate $outputlangs Output language * @param integer $withparenthesis 1=Add parenthesis, 0=no parenthesis * @return string String diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index bb4f41861ec..4bb9bf378ee 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1694,44 +1694,6 @@ if ($action == 'create') { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
    '; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (isModEnabled('project')) - { - $langs->load("projects"); - $morehtmlref.='
    '.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) - { - if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - 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.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ $morehtmlref .= '
    '; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index dd945ef3d39..3a8a5a5c49a 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index b7fd424054c..1f63c5a594b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -549,7 +549,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index a598dd4b83d..b7d8ba118a0 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -135,7 +135,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index df9f52abae1..4129947282f 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -148,7 +148,7 @@ $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 53cb80f9e55..27e74006d85 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -117,7 +117,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 5242fce001c..1317fe2f0a7 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -144,7 +144,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index cdc045b60fc..45189f5395e 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -120,7 +120,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index b451d6fa63d..0dc58debba3 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -86,7 +86,7 @@ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0 if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 20c8f6d977c..0136ee1d11d 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -116,7 +116,7 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index a5ca456310e..7e94465219f 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -350,21 +350,29 @@ if (!$ret) { // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project + $savobject = $object; + $object = $act; if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
    '.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($act->fk_project)) { - $proj = new Project($db); - $proj->fetch($act->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
    '; + if (0) { + $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 { - $morehtmlref .= ''; + 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); + } + } } } + $object = $savobject; $morehtmlref .= ''; dol_banner_tab($act, 'element_id', $linkback, ($user->socid ? 0 : 1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', ''); From cae2f26c0500b6e1726cc52ab86768fb279ab41d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 02:38:44 +0200 Subject: [PATCH 1108/1289] Responsive --- htdocs/user/group/card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index c17893e7eb4..a9a16826ee3 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -418,6 +418,7 @@ if ($action == 'create') { print '
    '."\n"; print ''; print ''; + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
    '; print $langs->trans('DateEndPropal'); print '
    '."\n"; print ''."\n"; print ''."\n"; - print '
    '.$langs->trans("NonAffectedUsers").''; @@ -426,8 +427,10 @@ if ($action == 'create') { print ''; print ''; print '
    '."\n"; - print '
    '; + print '
    '; + print ''; + print ''."\n"; + //print '
    '; } /* From 67c38dc0039ae8f5ddf95563d09a2cc1bbb60434 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 02:46:22 +0200 Subject: [PATCH 1109/1289] Debug v17 --- htdocs/hrm/admin/job_extrafields.php | 2 +- htdocs/hrm/lib/hrm.lib.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 8dff50f4b6f..6ac0773c00f 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv("Job"); +$textobject = $langs->transnoentitiesnoconv("JobPosition"); $help_url = ''; $page_name = "HrmSetup"; diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index 2fef293784d..88a851f0137 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -54,13 +54,13 @@ function hrmAdminPrepareHead() $head[$h][2] = 'establishments'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; - $head[$h][1] = $langs->trans("EvaluationsExtraFields"); - $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; + $head[$h][1] = $langs->trans("SkillsExtraFields"); + $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ''.$nbExtrafields.''; } - $head[$h][2] = 'evaluationsAttributes'; + $head[$h][2] = 'skillsAttributes'; $h++; $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; @@ -72,13 +72,13 @@ function hrmAdminPrepareHead() $head[$h][2] = 'jobsAttributes'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; - $head[$h][1] = $langs->trans("SkillsExtraFields"); - $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; + $head[$h][1] = $langs->trans("EvaluationsExtraFields"); + $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ''.$nbExtrafields.''; } - $head[$h][2] = 'skillsAttributes'; + $head[$h][2] = 'evaluationsAttributes'; $h++; // Show more tabs from modules From 87f82c1064ceedf3f5f1fe2f615b9ee573f2034d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 03:12:03 +0200 Subject: [PATCH 1110/1289] Fix format date --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4e7acd5fc52..0bf63ee9b0b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2670,8 +2670,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $dtts->setTimestamp($time); $dtts->setTimezone($tzo); $newformat = str_replace( - array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), - array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), $format); $ret = $dtts->format($newformat); $ret = str_replace( @@ -2696,8 +2696,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $dtts->setTimestamp($timetouse); $dtts->setTimezone($tzo); $newformat = str_replace( - array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), - array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), $format); $ret = $dtts->format($newformat); $ret = str_replace( From 2bf2faef723198b26bf492e2bc3e45048d8824d1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 22 Oct 2022 09:22:12 +0200 Subject: [PATCH 1111/1289] FIX avoid access forbidden with numeric ref --- htdocs/core/lib/security.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 1d3f013e9f3..798ba265643 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -289,6 +289,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f return 1; } + // To avoid access forbidden with numeric ref + if ($dbt_select != 'rowid' && $dbt_select != 'id') { + $objectid = "'".$objectid."'"; + } + // Features/modules to check $featuresarray = array($features); if (preg_match('/&/', $features)) { From eabafde91fac69002ee6c3a643a5ff2a9b6ada8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 13:41:25 +0200 Subject: [PATCH 1112/1289] FIX Do not generate the contract PDF if not default template defined --- htdocs/contrat/class/contrat.class.php | 19 +++++++++++-------- .../class/fournisseur.commande.class.php | 14 ++++++++------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 73d907a374e..5c72bf51c69 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2441,18 +2441,15 @@ class Contrat extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param null|array $moreparams Array to provide more information + * @return int < 0 if KO, 0 = no doc generated, > 0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $langs; - $langs->load("contracts"); - $outputlangs->load("products"); - if (!dol_strlen($modele)) { - $modele = 'strato'; + $modele = ''; // No doc template/generation by default if (!empty($this->model_pdf)) { $modele = $this->model_pdf; @@ -2463,9 +2460,15 @@ class Contrat extends CommonObject } } - $modelpath = "core/modules/contract/doc/"; + if (empty($modele)) { + return 0; + } else { + $langs->load("contracts"); + $outputlangs->load("products"); - return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + $modelpath = "core/modules/contract/doc/"; + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } } /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9e59dbceda6..1faa0b0c49c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3187,26 +3187,28 @@ class CommandeFournisseur extends CommonOrder * @param int $hidedesc Hide description * @param int $hideref Hide ref * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @return int < 0 if KO, 0 = no doc generated, > 0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $langs; - $langs->load("suppliers"); - $outputlangs->load("products"); - if (!dol_strlen($modele)) { - $modele = ''; - if ($this->model_pdf) { + $modele = ''; // No doc template/generation by default + + if (!empty($this->model_pdf)) { $modele = $this->model_pdf; } elseif (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) { $modele = $conf->global->COMMANDE_SUPPLIER_ADDON_PDF; } } + if (empty($modele)) { return 0; } else { + $langs->load("suppliers"); + $outputlangs->load("products"); + $modelpath = "core/modules/supplier_order/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } From 3cd16d80f4e54e7f445f13d81e770f95b68ef5c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 14:43:22 +0200 Subject: [PATCH 1113/1289] NEW Can edit label of an emailing even once sent --- htdocs/comm/mailing/card.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 2372f24a929..915a7a7ce9b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -729,8 +729,11 @@ if ($action == 'create') { print dol_get_fiche_head(); print ''; + print ''; + print ''; + print ''; // Other attributes @@ -742,7 +745,7 @@ if ($action == 'create') { } print '
    '.$langs->trans("MailTitle").'
    '.$langs->trans("MailFrom").'
    '.$langs->trans("MailErrorsTo").'
    '; - print '

    '; + print '

    '; print ''; print ''; @@ -887,16 +890,16 @@ if ($action == 'create') { // Description print ''; // From print ''; From 2fa0e34b097492e2abc3d854f4dc75f95774035b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 22 Oct 2022 15:32:54 +0200 Subject: [PATCH 1115/1289] Fix api product : rang is now position --- htdocs/product/class/api_products.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2566ca24919..484a09947a5 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1014,7 +1014,7 @@ class Products extends DolibarrApi throw new RestException(401); } - $sql = "SELECT t.rowid, t.ref, t.ref_ext, t.label, t.rang, t.entity"; + $sql = "SELECT t.rowid, t.ref, t.ref_ext, t.label, t.position, t.entity"; $sql .= " FROM ".$this->db->prefix()."product_attribute as t"; $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; @@ -1051,7 +1051,7 @@ class Products extends DolibarrApi $tmp->ref = $result->ref; $tmp->ref_ext = $result->ref_ext; $tmp->label = $result->label; - $tmp->rang = $result->rang; + $tmp->position = $result->position; $tmp->entity = $result->entity; $return[] = $this->_cleanObjectDatas($tmp); @@ -1088,7 +1088,7 @@ class Products extends DolibarrApi throw new RestException(404, "Product attribute not found"); } - $fields = ["id", "ref", "ref_ext", "label", "rang", "entity"]; + $fields = ["id", "ref", "ref_ext", "label", "position", "entity"]; foreach ($prodattr as $field => $value) { if (!in_array($field, $fields)) { From 6c87982838d8010af3b7368dca24b67d1fe55246 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 22 Oct 2022 19:42:44 +0200 Subject: [PATCH 1116/1289] Fix newpayment.php with stripeconnect --- htdocs/public/payment/newpayment.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 14d455b5496..c0cfc869e9b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2390,7 +2390,17 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme // Code for payment with option STRIPE_USE_NEW_CHECKOUT set // Create a Stripe client. + var stripe = Stripe(''); + + var stripe = Stripe('', { stripeAccount: '' }); + // Create an instance of Elements var elements = stripe.elements(); @@ -2433,9 +2443,19 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme } elseif (!empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { ?> // Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set to 1 or 2 - + // Create a Stripe client. + var stripe = Stripe(''); + + var stripe = Stripe('', { stripeAccount: '' }); + Date: Sat, 22 Oct 2022 17:43:17 +0000 Subject: [PATCH 1117/1289] Fixing style errors. --- htdocs/public/payment/newpayment.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index c0cfc869e9b..e9b402b08dd 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2392,13 +2392,13 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme // Create a Stripe client. + ?> var stripe = Stripe(''); - + ?> var stripe = Stripe('', { stripeAccount: '' }); - @@ -2447,13 +2447,13 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme // Create a Stripe client. + ?> var stripe = Stripe(''); - + ?> var stripe = Stripe('', { stripeAccount: '' }); - From 57927cac06cafb27996bd16d481fd752059643d2 Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Sun, 23 Oct 2022 03:00:09 +0200 Subject: [PATCH 1118/1289] Send expensereports-related e-mails from MAIN_MAIL_EMAIL_FROM address --- htdocs/expensereport/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1da36a72e32..beb9c501b3e 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -414,7 +414,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailTo && $emailFrom) { $filename = array(); $filedir = array(); $mimetype = array(); @@ -521,7 +521,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailFrom && $emailTo) { $filename = array(); $filedir = array(); $mimetype = array(); @@ -637,7 +637,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_approve > 0 ? $object->fk_user_approve : $object->fk_user_validator); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailFrom && $emailTo) { $filename = array(); $filedir = array(); $mimetype = array(); @@ -745,7 +745,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_refuse); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailFrom && $emailTo) { $filename = array(); $filedir = array(); $mimetype = array(); @@ -859,7 +859,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_cancel); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailFrom && $emailTo) { $filename = array(); $filedir = array(); $mimetype = array(); @@ -1039,7 +1039,7 @@ if (empty($reshook)) { // FROM $expediteur = new User($db); $expediteur->fetch($user->id); - $emailFrom = $expediteur->email; + $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM; if ($emailFrom && $emailTo) { $filename = array(); $filedir = array(); $mimetype = array(); From 7ff84f4e42bc4bcb86d3ad424a081c6fcd87ed98 Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Sun, 23 Oct 2022 03:25:55 +0200 Subject: [PATCH 1119/1289] Add help picto to remind users to respect SPF/DKIM in FROM e-mails --- htdocs/admin/mailing.php | 3 ++- htdocs/admin/mails.php | 6 ++++-- htdocs/core/lib/admin.lib.php | 7 +++++-- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 37735a43ed3..4d12a87f7bd 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -136,7 +136,8 @@ print ''; print "\n"; print ''; // From - print ''; + $help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; print ''; @@ -702,7 +703,8 @@ if ($action == 'edit') { print ''; // From - print ''; + $help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; print '\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d0c73a562f5..7dd27ff29ab 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -294,6 +294,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (default value in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix-like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix-like systems) MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (default value in php.ini: %s) +EMailHelpMsgSPFDKIM=To prevent Dolibarr emails to be classified as spam, make sure that the server is authorized to send e-mails from this address by SPF and DKIM configuration MAIN_MAIL_ERRORS_TO=Email used for error returns emails (fields 'Errors-To' in emails sent) MAIN_MAIL_AUTOCOPY_TO= Copy (Bcc) all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all email sending (for test purposes or demos) From 022f0db1e87b5edef7ade1623bd415b95d45d401 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 11:06:21 +0200 Subject: [PATCH 1120/1289] Fix scrutinizer partnership_type.class.php 9 issues --- .../class/partnership_type.class.php | 132 ------------------ 1 file changed, 132 deletions(-) diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 0074d2e80ee..0c42dae87d2 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -129,9 +129,6 @@ class PartnershipType extends CommonObject public function create(User $user, $notrigger = false) { $resultcreate = $this->createCommon($user, $notrigger); - - //$resultvalidate = $this->validate($user, $notrigger); - return $resultcreate; } @@ -145,9 +142,6 @@ class PartnershipType extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } return $result; } @@ -253,79 +247,6 @@ class PartnershipType extends CommonObject public function delete(User $user, $notrigger = false) { return $this->deleteCommon($user, $notrigger); - //return $this->deleteCommon($user, $notrigger, 1); - } - - /** - * Set draft status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, >0 if OK - */ - public function setDraft($user, $notrigger = 0) - { - // Protection - if ($this->status <= self::STATUS_DRAFT) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'PARTNERSHIPTYPE_UNVALIDATE'); - } - - /** - * Set cancel status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function cancel($user, $notrigger = 0) - { - // Protection - if ($this->status != self::STATUS_VALIDATED) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'PARTNERSHIPTYPE_CANCEL'); - } - - /** - * Set back to validated status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function reopen($user, $notrigger = 0) - { - // Protection - if ($this->status != self::STATUS_CANCELED) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'PARTNERSHIPTYPE_REOPEN'); } /** @@ -445,59 +366,6 @@ class PartnershipType extends CommonObject return $result; } - /** - * Return the label of the status - * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function getLabelStatus($mode = 0) - { - return $this->LibStatut($this->status, $mode); - } - - /** - * Return the label of the status - * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function getLibStatut($mode = 0) - { - return $this->LibStatut($this->status, $mode); - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return the status - * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable - if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - global $langs; - //$langs->load("mymodule@mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); - } - - $statusType = 'status'.$status; - //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; - if ($status == self::STATUS_CANCELED) { - $statusType = 'status6'; - } - - return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); - } - /** * Load the info information in the object * From 39934a9a81607dd8d0760cdf40f544167fc41537 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 11:19:23 +0200 Subject: [PATCH 1121/1289] Fix scrutinizer api_thirdparties.class.php 5 issues --- htdocs/societe/class/api_thirdparties.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 962bbf021b8..b5d9f7bfc48 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1082,7 +1082,7 @@ class Thirdparties extends DolibarrApi $invoice = new Facture($this->db); $result = $invoice->list_replacable_invoices($id); if ($result < 0) { - throw new RestException(405, $this->thirdparty->error); + throw new RestException(405, $invoice->error); } return $result; @@ -1125,7 +1125,7 @@ class Thirdparties extends DolibarrApi $invoice = new Facture($this->db); $result = $invoice->list_qualified_avoir_invoices($id); if ($result < 0) { - throw new RestException(405, $this->thirdparty->error); + throw new RestException(405, $invoice->error); } return $result; @@ -1164,10 +1164,9 @@ class Thirdparties extends DolibarrApi $sql .= " WHERE fk_soc = ".((int) $id); } - $result = $this->db->query($sql); - if ($result->num_rows == 0) { + if ($this->db->num_rows($result) == 0) { throw new RestException(404, 'Account not found'); } @@ -1409,7 +1408,7 @@ class Thirdparties extends DolibarrApi if ($result > 0) { return array("success" => $result); } else { - throw new RestException(500, 'Error generating the document '.$this->error); + throw new RestException(500, 'Error generating the document '.$this->company->error); } } From 7e1a37c1387107ef2958d24e57bf78cb4bef37ea Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 11:35:58 +0200 Subject: [PATCH 1122/1289] Fix : remove duplicate code and fix #22176 --- htdocs/core/modules/modProduct.class.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index b18d10a29b1..dc0cff86353 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -650,16 +650,7 @@ class modProduct extends DolibarrModules } // End add extra fields $this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) - $this->import_regex_array[$r] = array( - 'p.ref'=>'[^ ]', - 'p.price_base_type' => 'HT|TTC', - 'p.tosell'=>'^[0|1]$', - 'p.tobuy'=>'^[0|1]$', - 'p.fk_product_type'=>'^[0|1]$', - 'p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', - 'p.recuperableonly' => '^[0|1]$', - 'p.finished' => '^[0|1]$' - ); + // field order as per structure of table llx_product $import_sample = array( 'p.ref' => "ref:PREF123456", From 7bf0287c65862c7ed8ee29de67d1374ccfc4abf1 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 11:46:15 +0200 Subject: [PATCH 1123/1289] Fix : remove nonsense code --- htdocs/compta/tva/card.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 3a34d71c11d..3d6f4f4d329 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -74,17 +74,6 @@ $hookmanager->initHooks(array('taxvatcard', 'globalcard')); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); - -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - if (empty($action) && empty($id) && empty($ref)) { $action = 'view'; } From 92ad656bf02faa5b9ffb9c5d89598f7f36397998 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 12:06:13 +0200 Subject: [PATCH 1124/1289] Fix : dict data too long error --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ab7eaf73653..85455dd4be9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -842,7 +842,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } else { - dol_print_error($db); + setEventMessages($db->error(), null, 'errors'); } } } From cb2f9407188c7ae9b0731d97cd3c1aaec432d039 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Oct 2022 12:20:11 +0200 Subject: [PATCH 1125/1289] Fix SQL error on install llx_establishment --- htdocs/install/mysql/tables/llx_establishment.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 1b1f38074ad..a3542f6d9d6 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,7 +22,6 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, - label varchar(255), ref varchar(30), label varchar(255) NOT NULL, name varchar(128), From b6d0f9b997880b2a407583ff0f01e4cfea04f2ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 17:14:23 +0200 Subject: [PATCH 1126/1289] NEW Can copy/paste images into emails sent. --- htdocs/admin/mails.php | 10 +- htdocs/core/actions_sendmails.inc.php | 6 +- htdocs/core/class/CMailFile.class.php | 155 +++++++++++++++++++--- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/smtps.class.php | 23 ++-- 5 files changed, 159 insertions(+), 37 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1a25af49789..dfa0bccb06b 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -34,14 +34,15 @@ $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "err $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); +$trackid = GETPOST('trackid'); + if (!$user->admin) { accessforbidden(); } $usersignature = $user->signature; -// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. - -if ($action == 'test' || $action == 'send') { +// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html. +if ($action == 'test' || ($action == 'send' && $trackid = 'test')) { $usersignature = dol_string_nohtmltag($usersignature, 2); } @@ -130,7 +131,7 @@ $actiontypecode = ''; // Not an event for agenda $triggersendname = ''; // Disable triggers $paramname = 'id'; $mode = 'emailfortest'; -$trackid = (($action == 'testhtml') ? "testhtml" : "test"); +$trackid = ($action == 'send' ? GETPOST('trackid', 'aZ09') : $action); $sendcontext = ''; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; @@ -143,7 +144,6 @@ if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') { - /* * View */ diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 3749b403469..772d2b7ed5d 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -108,6 +108,10 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $trackid = GETPOST('trackid', 'aZ09'); } + // Set tmp user directory (used to convert images embedded as img src=data:image) + $vardir = $conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path + $subject = ''; //$actionmsg = ''; $actionmsg2 = ''; @@ -359,7 +363,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO if (empty($sendcontext)) { $sendcontext = 'standard'; } - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext, '', $upload_dir_tmp); if (!empty($mailfile->error) || !empty($mailfile->errors)) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index b3ff0aae930..ffd1d6e8e5d 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -120,6 +120,10 @@ class CMailFile * @var array filenames list (List of attached file name in message) */ public $mimefilename_list = array(); + /** + * @var array filenames cid + */ + public $cid_list = array(); // Image public $html; @@ -159,8 +163,9 @@ class CMailFile * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'mail' and 'smtps' for the moment) * @param string $sendcontext 'standard', 'emailing', ... (used to define which sending mode and parameters to use) * @param string $replyto Reply-to email (will be set to same value than From by default if not provided) + * @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image) */ - public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '') + public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '') { global $conf, $dolibarr_main_data_root, $user; @@ -171,6 +176,8 @@ class CMailFile } } + $cid_list = array(); + $this->sendcontext = $sendcontext; // Define this->sendmode ('mail', 'smtps', 'siwftmailer', ...) according to $sendcontext ('standard', 'emailing', 'ticket') @@ -248,26 +255,41 @@ class CMailFile $findimg = 0; if (!empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS)) { + // Search into the body for ]*>/", " ", $strContent); - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); + // TODO We could replace with [Filename.ext] like Gmail do. + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags $strContentAltText = trim(wordwrap($strContentAltText, 75, empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA) ? "\r\n" : "\n")); // Check if html header already in message, if not complete the message @@ -1447,9 +1470,10 @@ class CMailFile * @param array $filename_list Tableau * @param array $mimetype_list Tableau * @param array $mimefilename_list Tableau - * @return string Chaine fichiers encodes + * @param array $cidlist Array of CID if file must be completed with CID code + * @return string String with files encoded */ - public function write_files($filename_list, $mimetype_list, $mimefilename_list) + private function write_files($filename_list, $mimetype_list, $mimefilename_list, $cidlist) { // phpcs:enable $out = ''; @@ -1472,6 +1496,10 @@ class CMailFile $out .= "Content-Type: ".$mimetype_list[$i]."; name=\"".$filename_list[$i]."\"".$this->eol; $out .= "Content-Transfer-Encoding: base64".$this->eol; $out .= "Content-Description: ".$filename_list[$i].$this->eol; + if (!empty($cidlist) && is_array($cidlist) && $cidlist[$i]) { + $out .= "X-Attachment-Id: ".$cidlist[$i].$this->eol; + $out .= "Content-ID: <".$cidlist[$i].'>'.$this->eol; + } $out .= $this->eol; $out .= $encoded; $out .= $this->eol; @@ -1628,41 +1656,46 @@ class CMailFile /** * Seearch images into html message and init array this->images_encoded if found * - * @param string $images_dir Location of physical images files + * @param string $images_dir Location of physical images files. For example $dolibarr_main_data_root.'/medias' * @return int >0 if OK, <0 if KO */ - public function findHtmlImages($images_dir) + private function findHtmlImages($images_dir) { - // Build the list of image extensions + // Build the array of image extensions $extensions = array_keys($this->image_types); + // We search (into mail body this->html), if we find some strings like "... file=xxx.img" + // For example when: + // $matches = array(); preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found if (!empty($matches)) { $i = 0; + // We are interested in $matches[1] only (the second set of parenthesis into regex) foreach ($matches[1] as $full) { + $regs = array(); if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i', $full, $regs)) { // If xxx is 'file=aaa' $img = $regs[1]; if (file_exists($images_dir.'/'.$img)) { // Image path in src $src = preg_quote($full, '/'); - // Image full path $this->html_images[$i]["fullpath"] = $images_dir.'/'.$img; - // Image name $this->html_images[$i]["name"] = $img; - // Content type - if (preg_match('/^.+\.(\w{3,4})$/', $img, $reg)) { - $ext = strtolower($reg[1]); + $regext = array(); + if (preg_match('/^.+\.(\w{3,4})$/', $img, $regext)) { + $ext = strtolower($regext[1]); $this->html_images[$i]["content_type"] = $this->image_types[$ext]; } - // cid $this->html_images[$i]["cid"] = dol_hash(uniqid(time()), 3); // Force md5 hash (does not contains special chars) + // type + $this->html_images[$i]["type"] = 'cidfromurl'; + $this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html); } $i++; @@ -1682,6 +1715,7 @@ class CMailFile // Read image file if ($image = file_get_contents($fullpath)) { // On garde que le nom de l'image + $regs = array(); preg_match('/([A-Za-z0-9_-]+[\.]?[A-Za-z0-9]+)?$/i', $img["name"], $regs); $imgName = $regs[1]; @@ -1706,6 +1740,85 @@ class CMailFile } } + /** + * Seearch images with data:image format into html message + * + * @param string $images_dir Location of where to store physicaly images files. For example $dolibarr_main_data_root.'/medias' + * @return int >0 if OK, <0 if KO + */ + private function findHtmlImagesIsSrcData($images_dir) + { + global $conf; + + // Build the array of image extensions + $extensions = array_keys($this->image_types); + + if ($images_dir && !dol_is_dir($images_dir)) { + dol_mkdir($images_dir, DOL_DATA_ROOT); + } + + // Uncomment this for debug + /* + global $dolibarr_main_data_root; + $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; + $fp = fopen($outputfile, "w"); + fwrite($fp, $this->html); + fclose($fp); + */ + + // We search (into mail body this->html), if we find some strings like "... file=xxx.img" + // For example when: + // + $matches = array(); + preg_match_all('/src="data:image\/('.implode('|', $extensions).');base64,([^"]+)"/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found + + if (!empty($matches)) { + if (empty($images_dir)) { + // No temp directory provided, so we are not able to support convertion of data:image into physical images. + $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; + return -1; + } + + $i = 0; + foreach ($matches[1] as $key => $ext) { + // We save the image to send in disk + $filecontent = $matches[2][$key]; + $cid = dol_hash(uniqid(time()), 3); + $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; + + $fhandle = @fopen($destfiletmp, 'w'); + if ($fhandle) { + $nbofbyteswrote = fwrite($fhandle, base64_decode($filecontent)); + fclose($fhandle); + @chmod($destfiletmp, octdec($conf->global->MAIN_UMASK)); + } else { + $this->errors[] = "Failed to open file '".$destfiletmp."' for write"; + return -1; + } + + if (file_exists($destfiletmp)) { + // Image full path + $this->html_images[$i]["fullpath"] = $destfiletmp; + // Image name + $this->html_images[$i]["name"] = basename($destfiletmp); + // Content type + $this->html_images[$i]["content_type"] = $this->image_types[strtolower($ext)]; + // cid + $this->html_images[$i]["cid"] = $cid; + // type + $this->html_images[$i]["type"] = 'cidfromdata'; + + $this->html = preg_replace('/src="data:image\/'.$ext.';base64,'.preg_quote($filecontent, '/').'"/', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); + } + $i++; + } + + return 1; + } else { + return 0; + } + } + /** * Return a formatted address string for SMTP protocol * diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 16302dc3c1a..41cf2482f9a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1193,7 +1193,7 @@ class FormMail extends Form $out .= "\n"; } else { $out = '\n"; } return $out; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 06ada5c4911..92b835caf7f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1577,11 +1577,14 @@ class SMTPs // loop through all attachments foreach ($_content as $_file => $_data) { $content .= "--".$this->_getBoundary('mixed')."\r\n" - . 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n" - . 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n" - . 'Content-Transfer-Encoding: base64'."\r\n" - . 'Content-Description: '.$_data['fileName']."\r\n"; - + . 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n" + . 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n" + . 'Content-Transfer-Encoding: base64'."\r\n" + . 'Content-Description: '.$_data['fileName']."\r\n"; + if (!empty($_data['cid'])) { + $content .= "X-Attachment-Id: ".$_data['cid']."\r\n"; + $content .= "Content-ID: <".$_data['cid'].">\r\n"; + } if ($this->getMD5flag()) { $content .= 'Content-MD5: '.$_data['md5']."\r\n"; } @@ -1595,9 +1598,9 @@ class SMTPs $content .= "--".$this->_getBoundary('related')."\r\n"; // always related for an inline image $content .= 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['imageName'].'"'."\r\n" - . 'Content-Transfer-Encoding: base64'."\r\n" - . 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n" - . 'Content-ID: <'.$_data['cid'].'> '."\r\n"; + . 'Content-Transfer-Encoding: base64'."\r\n" + . 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n" + . 'Content-ID: <'.$_data['cid'].'> '."\r\n"; if ($this->getMD5flag()) { $content .= 'Content-MD5: '.$_data['md5']."\r\n"; @@ -1664,9 +1667,10 @@ class SMTPs * @param string $strContent File data to attach to message * @param string $strFileName File Name to give to attachment * @param string $strMimeType File Mime Type of attachment + * @param string $strCid File Cid of attachment (if defined, to be shown inline) * @return void */ - public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown') + public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown', $strCid = '') { if ($strContent) { $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); // 76 max is defined into http://tools.ietf.org/html/rfc2047 @@ -1674,6 +1678,7 @@ class SMTPs $this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType; $this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName; $this->_msgContent['attachment'][$strFileName]['data'] = $strContent; + $this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline if ($this->getMD5flag()) { $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, 3); From 9f0eaf58a9c88fb956064c1f38ae7330324b9d24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 17:56:54 +0200 Subject: [PATCH 1127/1289] Remove specialchar button --- htdocs/core/class/doleditor.class.php | 4 ++-- htdocs/theme/eldy/ckeditor/config.js | 8 ++++---- htdocs/theme/md/ckeditor/config.js | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 007210c8888..edaf088e949 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -163,7 +163,7 @@ class DolEditor $skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa } - $pluginstodisable = 'elementspath,save,flash,div,specialchar'; + $pluginstodisable = 'elementspath,save,flash,div,specialchar,anchor'; if (!empty($conf->dol_optimize_smallscreen)) { $pluginstodisable .= ',scayt,wsc,find,undo'; } @@ -198,7 +198,7 @@ class DolEditor htmlEncodeOutput:'.$htmlencode_force.', allowedContent:'.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */ extraAllowedContent: \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */ - disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */ + disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */ fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */ toolbar: \''.$this->toolbarname.'\', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index 4ec222217a1..d2a87a4a4d8 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -46,8 +46,8 @@ CKEDITOR.editorConfig = function( config ) ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['BidiLtr', 'BidiRtl'], - ['Link','Unlink','Anchor'], - ['Image','Table','HorizontalRule','Smiley','SpecialChar'], + ['Link','Unlink'], + ['Image','Table','HorizontalRule','Smiley'], ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Source'] @@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; @@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js index 06fa5746e7f..e463e6db9a3 100644 --- a/htdocs/theme/md/ckeditor/config.js +++ b/htdocs/theme/md/ckeditor/config.js @@ -46,8 +46,8 @@ CKEDITOR.editorConfig = function( config ) ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['BidiLtr', 'BidiRtl'], - ['Link','Unlink','Anchor'], - ['Image','Table','HorizontalRule','Smiley','SpecialChar'], + ['Link','Unlink'], + ['Image','Table','HorizontalRule','Smiley'], ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Source'] @@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; @@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; @@ -91,7 +91,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], // ,'Subscript','Superscript' useless ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','SpecialChar'], + ['Link','Unlink'], ['Source'] ]; From 5b22eeab31c6e47dd961ffbc324350ec99222a17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 20:45:27 +0200 Subject: [PATCH 1128/1289] Fix support of inline src data --- htdocs/comm/mailing/card.php | 13 ++++++++----- scripts/emailings/mailing-send.php | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e5c125d14cd..72ec408524c 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -84,6 +84,8 @@ if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ accessforbidden(); } +$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); + /* * Actions @@ -124,8 +126,6 @@ if (empty($reshook)) { setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings'); $action = ''; } else { - $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); - if ($object->statut == 0) { dol_print_error('', 'ErrorMailIsNotValidated'); exit; @@ -318,7 +318,8 @@ if (empty($reshook)) { // Mail making $trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid; - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing'); + $upload_dir_tmp = $upload_dir; + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp); if ($mail->error) { $res = 0; @@ -478,7 +479,8 @@ if (empty($reshook)) { } $trackid = 'emailing-test'; - $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing'); + $upload_dir_tmp = $upload_dir; + $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', '', $upload_dir_tmp); $result = $mailfile->sendfile(); if ($result) { @@ -1265,8 +1267,9 @@ if ($action == 'create') { $out .= '
    '; } } else { - $out .= ''.$langs->trans("NoAttachedFiles").'
    '; + //$out .= ''.$langs->trans("NoAttachedFiles").'
    '; } + // Add link to add file $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index f427e42d8cb..78e4488ec46 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -307,7 +307,8 @@ if ($resql) { } // Fabrication du mail $trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid; - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing'); + $upload_dir_tmp = $upload_dir; + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp); if ($mail->error) { $res = 0; From 0f8d87da3b5638e44ffaaf85bb40bb3cbe8ebfa5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 21:25:52 +0200 Subject: [PATCH 1129/1289] Clean code --- htdocs/core/class/html.form.class.php | 27 ++++++++++++++------------- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/class/project.class.php | 4 ++-- htdocs/ticket/agenda.php | 21 ++++++++++++--------- htdocs/ticket/card.php | 16 ++++++++-------- htdocs/ticket/contact.php | 21 ++++++++++++--------- htdocs/ticket/document.php | 21 ++++++++++++--------- 7 files changed, 61 insertions(+), 50 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0b108d8b759..f7aa1990f13 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5916,19 +5916,20 @@ class Form /** * Output html select to select thirdparty * - * @param string $page Page - * @param string $selected Id preselected - * @param string $htmlname Name of HTML select - * @param string $filter Optional filters criteras. Do not use a filter coming from input of users. - * @param int $showempty Add an empty field - * @param int $showtype Show third party type in combolist (customer, prospect or supplier) - * @param int $forcecombo Force to use combo box - * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) - * @param int $nooutput No print output. Return it only. - * @param array $excludeids Exclude IDs from the select combo + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select + * @param string $filter Optional filters criteras. Do not use a filter coming from input of users. + * @param int $showempty Add an empty field + * @param int $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int $forcecombo Force to use combo box + * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int $nooutput No print output. Return it only. + * @param array $excludeids Exclude IDs from the select combo + * @param string $textifnothirdparty Text to show if no thirdparty * @return void|string */ - public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array()) + public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array(), $textifnothirdparty = '') { // phpcs:enable global $langs; @@ -5946,9 +5947,9 @@ class Form require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $soc = new Societe($this->db); $soc->fetch($selected); - $out .= $soc->getNomUrl($langs); + $out .= $soc->getNomUrl(0, ''); } else { - $out .= " "; + $out .= ''.$textifnothirdparty.''; } } diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index c61d794fcdc..b6001b2b27b 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -37,6 +37,7 @@ OpportunitiesStatusForOpenedProjects=Leads amount of open projects by status OpportunitiesStatusForProjects=Leads amount of projects by status ShowProject=Show project ShowTask=Show task +SetThirdParty=Set third party SetProject=Set project OutOfProject=Out of project NoProject=No project defined or owned diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 38bb55b5a24..1495df77df7 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1279,7 +1279,7 @@ class Project extends CommonObject $label .= ($label ? '
    ' : '').''.$langs->trans('Label').': '.$this->title; // The space must be after the : to not being explode when showing the title in img_picto if (isset($this->public)) { $label .= '
    '.$langs->trans("Visibility").": "; - $label .= ($this->public ? img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"').$langs->trans("SharedProject") : img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"').$langs->trans("PrivateProject")); + $label .= ($this->public ? img_picto($langs->trans('SharedProject'), 'world', 'class="pictofixedwidth"').$langs->trans("SharedProject") : img_picto($langs->trans('PrivateProject'), 'private', 'class="pictofixedwidth"').$langs->trans("PrivateProject")); } if (!empty($this->thirdparty_name)) { $label .= ($label ? '
    ' : '').''.$langs->trans('ThirdParty').': '.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto @@ -1340,7 +1340,7 @@ class Project extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth em088"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="pictofixedwidth"' : '') : 'class="'.(($withpicto != 2) ? 'pictofixedwidth ' : '').'classfortooltip pictofixedwidth em088"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index eae0ae829e2..ac121045597 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'other', 'ticket')); @@ -179,21 +184,18 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { $morehtmlref .= '
    '; - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; - }*/ - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { + $morehtmlref .= '
    '; $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; @@ -201,6 +203,7 @@ if (isModEnabled('project')) { $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index eb824beb1d3..650735b7ec0 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -953,24 +953,24 @@ if ($action == 'create' || $action == 'presend') { $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByPublicPortal"), $htmltooptip, 1, 'help', '', 0, 3, 'tooltip').''; } + $permissiontoedit = $object->status < 8 && !$user->socid && $user->rights->ticket->write; + //$permissiontoedit = 0; + // Thirdparty if (isModEnabled("societe")) { $morehtmlref .= '
    '; - if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' '; - } - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && $permissiontoedit) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if ($permissiontoedit) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index f045923e75d..5e7cadf07fe 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -34,6 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'ticket')); @@ -213,21 +218,18 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { // Thirdparty if (isModEnabled("societe")) { $morehtmlref .= '
    '; - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; - }*/ - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { + $morehtmlref .= '
    '; $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; @@ -235,6 +237,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index daa74536d1a..8a95623444f 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -33,6 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array("companies", "other", "ticket", "mails")); @@ -148,21 +153,18 @@ if ($object->id) { // Thirdparty if (isModEnabled("societe")) { $morehtmlref .= '
    '; - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; - }*/ - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { + $morehtmlref .= '
    '; $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; @@ -170,6 +172,7 @@ if ($object->id) { $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); From 780c6e3ce19c5aaa3ff841c4fca7586092c12ec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 21:43:00 +0200 Subject: [PATCH 1130/1289] FIX Debug add event on a ticket --- htdocs/comm/action/card.php | 14 ++++++++------ htdocs/core/lib/ticket.lib.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/messaging.php | 24 ++++++++++++++---------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 27d3c049c64..53ac5846628 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -90,6 +90,14 @@ if ($fulldayevent) { $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); } +$reg = array(); +if (GETPOST('datep')) { + if (GETPOST('datep') == 'now') { + $datep = dol_now(); + } elseif (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { // Try to not use this. Use insteead '&datep=now' + $datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1], 'tzuser'); + } +} // Security check $socid = GETPOST('socid', 'int'); @@ -1070,7 +1078,6 @@ if (empty($reshook)) { } - /* * View */ @@ -1498,11 +1505,6 @@ if ($action == 'create') { } } - $reg = array(); - if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { - $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); - } - // Priority if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { print '
    '; + // Private message (not visible by customer/external user) if (!$user->socid) { print ''; } - print ''; - // Zone to select its email template if (count($modelmail_array) > 0) { print '
    '.$langs->trans("MailTopic").'
    '; - print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string'); print ''; - print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string'); print '
    '; - print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); print ''; - print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); $email = CMailFile::getValidAddress($object->email_from, 2); if ($email && !isValidEmail($email)) { $langs->load("errors"); @@ -910,9 +913,9 @@ if ($action == 'create') { // Errors to print '
    '; - print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); print ''; - print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); $email = CMailFile::getValidAddress($object->email_errorsto, 2); if ($email && !isValidEmail($email)) { $langs->load("errors"); @@ -977,11 +980,11 @@ if ($action == 'create') { if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) { print "\n\n
    \n"; - if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) { + if (($object->statut == 1) && ($user->hasRight('mailing', 'valider') || $object->user_validation == $user->id)) { print ''.$langs->trans("SetToDraft").''; } - if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { + if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->hasRight('mailing', 'creer')) { if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { print ''.$langs->trans("EditWithEditor").''; } else { @@ -1011,7 +1014,7 @@ if ($action == 'create') { } } - if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider) { + if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->hasRight('mailing', 'valider')) { if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { print ''.$langs->trans("SendMailing").''; } elseif (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { @@ -1021,11 +1024,11 @@ if ($action == 'create') { } } - if ($user->rights->mailing->creer) { + if ($user->hasRight('mailing', 'creer')) { print ''.$langs->trans("ToClone").''; } - if (($object->statut == 2 || $object->statut == 3) && $user->rights->mailing->valider) { + if (($object->statut == 2 || $object->statut == 3) && $user->hasRight('mailing', 'valider')) { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("ResetMailing").''; } else { @@ -1033,7 +1036,7 @@ if ($action == 'create') { } } - if (($object->statut <= 1 && $user->rights->mailing->creer) || $user->rights->mailing->supprimer) { + if (($object->statut <= 1 && $user->hasRight('mailing', 'creer')) || $user->hasRight('mailing', 'supprimer')) { if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) { print ''.$langs->trans("DeleteMailing").''; } else { From c9573510de5e7d792d6b96df04be3cf368f25aea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Oct 2022 15:23:07 +0200 Subject: [PATCH 1114/1289] css --- htdocs/comm/mailing/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 915a7a7ce9b..e5c125d14cd 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1275,7 +1275,7 @@ if ($action == 'create') { } $out .= ''; $out .= ' '; - $out .= ''; + $out .= ''; print $out; print '
    '.$langs->trans("Example").'
    '; -print $langs->trans("MailingEMailFrom").''; +$help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); +print $langs->trans("MailingEMailFrom").' '.$help.''; print ''; if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) { print ' '.img_warning($langs->trans("BadEMail")); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 67bf775bdd9..5b470eafdc0 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -505,7 +505,8 @@ if ($action == 'edit') { print '
    '.$langs->trans("OtherOptions").'
    '.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'
    '.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.'
    '.$langs->trans("OtherOptions").'
    '.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'
    '.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (empty($conf->global->MAIN_MAIL_EMAIL_FROM)) { print img_warning($langs->trans("Mandatory")); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index fdecb7a73fb..a07f16c06cb 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1709,14 +1709,14 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&adminpw=%MAILMAN_ADMINPW%&subscribe_or_invite=0&send_welcome_msg_to_this_batch=0&notification_to_list_owner=0'; print ''; } - if ($const == 'ADHERENT_MAILMAN_UNSUB_URL') { + elseif ($const == 'ADHERENT_MAILMAN_UNSUB_URL') { print '. '.$langs->trans("Example").': '.img_down().'
    '; print ''; //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; } - if ($const == 'ADHERENT_MAILMAN_LISTS') { + elseif ($const == 'ADHERENT_MAILMAN_LISTS') { print '. '.$langs->trans("Example").': '.img_down().'
    '; print ''; //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; } + elseif ($const == 'ADHERENT_MAIL_FROM') { + print ' '.img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); + } print "
    '.$langs->trans("MailErrorsTo").''; - $out .= ''; + $out .= ''; $out .= "
    '.$langs->trans("Priority").''; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 9223c1c4dd8..42fbc9786cb 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -567,7 +567,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } } - // Set $out to sow events + // Set $out to show events $out = ''; if (!isModEnabled('agenda')) { diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index ac121045597..d14cff7a474 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -253,7 +253,7 @@ if (!empty($object->id)) { // Show link to add event (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep=now&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 6817268eca8..6e5ee567805 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'other', 'ticket')); @@ -173,14 +178,13 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '; - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ' '; - }*/ - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + if (isModEnabled("societe")) { + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; + } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } } @@ -188,7 +192,7 @@ if (isModEnabled("societe")) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoadd) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; @@ -245,7 +249,7 @@ if (!empty($object->id)) { // Show link to add event (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep=now&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); From 26d11828382d277901782a4372087591ece4ed97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Oct 2022 22:32:52 +0200 Subject: [PATCH 1131/1289] FIX Debug ticket module (no double event when sending private message) FIX The backtopage after sending ticket message was ko. --- htdocs/core/class/CMailFile.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 14 +++++++------- htdocs/langs/en_US/ticket.lang | 3 +-- htdocs/public/ticket/view.php | 2 +- htdocs/ticket/card.php | 9 +++------ htdocs/ticket/class/actions_ticket.class.php | 2 +- htdocs/ticket/class/ticket.class.php | 6 +++--- 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index ffd1d6e8e5d..ed2bcef8034 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1772,7 +1772,7 @@ class CMailFile $matches = array(); preg_match_all('/src="data:image\/('.implode('|', $extensions).');base64,([^"]+)"/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found - if (!empty($matches)) { + if (!empty($matches) && !empty($matches[1])) { if (empty($images_dir)) { // No temp directory provided, so we are not able to support convertion of data:image into physical images. $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index ab91cd8867b..216644876ba 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1408,6 +1408,12 @@ class FormTicket $ticketstat = new Ticket($this->db); $res = $ticketstat->fetch('', '', $this->track_id); + print '
    '; + $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); + print ' '; + print ''; + print '
    '; @@ -1418,12 +1424,6 @@ class FormTicket print '
    '; - $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); - print ' '; - print ''; - print '
    '; print '

    '; - print ''; + print ''; if ($this->withcancel) { print "     "; print ''; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 3e1415c3625..1696018db89 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -194,8 +194,7 @@ TicketAssigned=Ticket is now assigned TicketChangeType=Change type TicketChangeCategory=Change analytic code TicketChangeSeverity=Change severity -TicketAddMessage=Add a message -AddMessage=Add a message +TicketAddMessage=Add private message MessageSuccessfullyAdded=Ticket added TicketMessageSuccessfullyAdded=Message successfully added TicketMessagesList=Message list diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 3f137148a89..bab3c501ca3 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -371,7 +371,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { // New message - print ''; + print ''; // Close ticket if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 650735b7ec0..12944e4b5ef 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -444,11 +444,7 @@ if (empty($reshook)) { if ($ret > 0) { if (!empty($backtopage)) { - if (empty($id)) { - $url = $backtopage; - } else { - $url = 'card.php?track_id='.urlencode($object->track_id); - } + $url = $backtopage; } else { $url = 'card.php?track_id='.urlencode($object->track_id); } @@ -456,7 +452,7 @@ if (empty($reshook)) { header("Location: ".$url); exit; } else { - setEventMessages($object->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = 'presend'; } } @@ -690,6 +686,7 @@ if (empty($reshook)) { $permissiontoadd = $user->rights->ticket->write; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; //var_dump($action);exit; + // Actions to send emails $triggersendname = 'TICKET_SENTBYMAIL'; $paramname = 'id'; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 9a01c5cf7d2..133fb72e7f2 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -164,7 +164,7 @@ class ActionsTicket } elseif ($action == 'view') { return $langs->trans("TicketCard"); } elseif ($action == 'add_message') { - return $langs->trans("AddMessage"); + return $langs->trans("TicketAddMessage"); } else { return $langs->trans("TicketsManagement"); } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4acc9104454..4a03098b57c 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2792,7 +2792,7 @@ class Ticket extends CommonObject if ($result) { // update last_msg_sent date $this->date_last_msg_sent = dol_now(); - $this->update($user); + $this->update($user, 1); // disable trigger when updatin date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. } } } @@ -2800,8 +2800,8 @@ class Ticket extends CommonObject } } - // Set status to "answered" if not set yet, but only if internal user - if ($object->status < 3 && !$user->socid) { + // Set status to "answered" if not set yet, but only if internal user and not private message + if ($object->status < 3 && !$user->socid && !$private) { $object->setStatut(3); } return 1; From 81813225aa3473f174e70f770de56246812002c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 01:25:50 +0200 Subject: [PATCH 1132/1289] Look and feel v17 --- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/action/info.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/contact.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/comm/propal/info.php | 2 +- htdocs/comm/propal/note.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/contact.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/commande/info.php | 2 +- htdocs/commande/note.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/compta/facture/contact.php | 2 +- htdocs/compta/facture/document.php | 2 +- htdocs/compta/facture/info.php | 2 +- htdocs/compta/facture/note.php | 2 +- htdocs/compta/facture/prelevement.php | 2 +- htdocs/compta/sociales/note.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/delivery/card.php | 2 +- htdocs/expedition/card.php | 2 +- htdocs/expedition/contact.php | 2 +- htdocs/expedition/document.php | 2 +- htdocs/expedition/note.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/contact.php | 2 +- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/fourn/commande/document.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/fourn/commande/note.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/document.php | 2 +- htdocs/fourn/facture/info.php | 2 +- htdocs/fourn/facture/note.php | 2 +- htdocs/projet/class/project.class.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/reception/contact.php | 2 +- htdocs/reception/document.php | 2 +- htdocs/reception/note.php | 2 +- htdocs/resource/element_resource.php | 2 +- htdocs/supplier_proposal/contact.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/card.php | 12 ++++++------ htdocs/ticket/contact.php | 2 +- htdocs/ticket/document.php | 2 +- htdocs/ticket/messaging.php | 2 +- 54 files changed, 59 insertions(+), 59 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 53ac5846628..3aa6a16d3ef 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2169,7 +2169,7 @@ if ($id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index f80476c2f9a..b02b2850346 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -176,7 +176,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index e009c9fccf7..749ca6a0c62 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -104,7 +104,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9180be4f99b..648fc6e18c4 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2317,7 +2317,7 @@ if ($action == 'create') { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 835dcc70fd0..42f3f34f8d4 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -156,7 +156,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 799539d97b1..f1d1d7ef644 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -154,7 +154,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 26a65f9a66e..986601a91bc 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -101,7 +101,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 64fe59edea5..fe4895ad2f8 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -126,7 +126,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0bffd98e739..786fb1a2ad2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2346,7 +2346,7 @@ if ($action == 'create' && $usercancreate) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index aa61426e435..04c16e68aa0 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -150,7 +150,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index ef1e1ce1697..0c35c3489f7 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index e319cb95d36..0acc5b793aa 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -101,7 +101,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 946902e1a11..e84dd5ad6e1 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -120,7 +120,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a193383836b..10cf7b624fc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4383,7 +4383,7 @@ if ($action == 'create') { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 7b7dd41ef7e..b367301911d 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index c4b11cea186..5cec55e2439 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 340c40afa4a..1ea28b295c3 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -115,7 +115,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index f6c81bbf800..af08c6163e2 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 172ec0c1120..d475e83c55b 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -375,7 +375,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index c65b731109d..0f85b6ddf06 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= ' : '.$proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } else { $morehtmlref .= ''; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 9ddab3b6487..3a3c5440b30 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -188,7 +188,7 @@ if ($id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b2a89ab63ec..802305b6306 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1391,7 +1391,7 @@ if ($action == 'create') { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 3c3bb00baeb..e5557c28a5b 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -172,7 +172,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 477d8818c4b..652738f10b5 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -159,7 +159,7 @@ if ($object->id) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 1038fe83de3..f17cc11f748 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -128,7 +128,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 0b019bec92c..b98b75015ab 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -345,7 +345,7 @@ if ($action == 'create') { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 5e9dc8fb1a7..f002dc8fe27 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1759,7 +1759,7 @@ if ($action == 'create') { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 4ef381dfc9a..48822121fa3 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -165,7 +165,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 4aca218a611..517c1cea8d2 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -157,7 +157,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 2e98169f042..4401af0b20c 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index c1b4a04fcee..9394269a03a 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -303,7 +303,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ce85f581859..5dbe81ca4a4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2068,7 +2068,7 @@ if ($action == 'create') { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 3a8a5a5c49a..3ca1eca77bf 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 1f63c5a594b..41c15dabb68 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -561,7 +561,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index b7d8ba118a0..b3dfb8b9ece 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -147,7 +147,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 4129947282f..fc3918a32f3 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -160,7 +160,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 27e74006d85..33648dd9817 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a66f48fc2e0..1738dd69868 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2893,7 +2893,7 @@ if ($action == 'create') { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 1317fe2f0a7..542b37db092 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -156,7 +156,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 45189f5395e..03012acbcaf 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -132,7 +132,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 0dc58debba3..9223d47b791 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -98,7 +98,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 0136ee1d11d..1c61fdc8e07 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -128,7 +128,7 @@ if ($object->id > 0) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1495df77df7..c5dcf0d4bb4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1347,7 +1347,7 @@ class Project extends CommonObject } $result .= $linkend; if ($withpicto != 2) { - $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : ''); + $result .= (($addlabel && $this->title) ? ''.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'' : ''); } global $action; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d5106a3b5ea..9afa6ec57d8 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1395,7 +1395,7 @@ if ($action == 'create') { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 01ff7218f9e..a03460b1e49 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -179,7 +179,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index 6ef302f4143..980b5e50a33 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -170,7 +170,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 5b04e971702..d916099b872 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -150,7 +150,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($objectsrc->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 7e94465219f..c063e049f44 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -367,7 +367,7 @@ if (!$ret) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 6b01d2af35a..1fa344cbb5e 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index d14cff7a474..9111faedcb7 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -208,7 +208,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 12944e4b5ef..1290a9a9a9b 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -968,18 +968,18 @@ if ($action == 'create' || $action == 'presend') { $langs->load("projects"); $morehtmlref .= '
    '; if ($permissiontoedit) { - $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + $object->fetch_project(); + $morehtmlref .= img_picto($langs->trans("Project"), 'project'.((is_object($object->project) && $object->project->public) ? 'pub' : ''), '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); + $object->fetch_project(); + $morehtmlref .= $object->project->getNomUrl(1); + if ($object->project->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($object->project->title).''; } } } diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 5e7cadf07fe..7f5a36faf1b 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -242,7 +242,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 8a95623444f..8015cb32145 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -177,7 +177,7 @@ if ($object->id) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 6e5ee567805..f1fd631234b 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -204,7 +204,7 @@ if (isModEnabled('project')) { $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } } From b4218f4c53851e89c465d5ff9c791eb8b631ceaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 03:07:22 +0200 Subject: [PATCH 1133/1289] Responsive --- htdocs/compta/facture/list.php | 14 +++++++----- htdocs/core/class/html.form.class.php | 32 ++++++++++++++++++--------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2618e688698..9b92e9e018e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1420,13 +1420,13 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { print '
    '; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10, 1, '', 1); + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1); print ''; - print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1); + print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100'); print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + $s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1); + print ''; + print $s; print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); + $s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', -1, -1, 1); + print ''; + print $s; print '
    '; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth75'); print '
    '.$langs->trans("Categories").''; + print ''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); print '
    '.$langs->trans("ContactByDefaultFor").''; + print ''; print $formcompany->showRoles("roles", $object, 'view', $object->roles); print '
    '.$langs->trans("ContactForProposals").''; + print '
    '.$langs->trans("ContactForProposals").''; print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal"); print '
    '; + print '
    '; if (isModEnabled("expedition")) { print $langs->trans("ContactForOrdersOrShipments"); } else { print $langs->trans("ContactForOrders"); } - print ''; + print ''; $none = $langs->trans("NoContactForAnyOrder"); if (isModEnabled("expedition")) { $none = $langs->trans("NoContactForAnyOrderOrShipments"); @@ -1515,18 +1514,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (isModEnabled('contrat')) { - print '
    '.$langs->trans("ContactForContracts").''; + print '
    '.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print '
    '.$langs->trans("ContactForInvoices").''; + print '
    '.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print '
    '.$langs->trans("DolibarrLogin").''; + print '
    '.$langs->trans("DolibarrLogin").''; if ($object->user_id) { $dolibarr_user = new User($db); $result = $dolibarr_user->fetch($object->user_id); From 692be6889aff6a900724cb201b104aefeb791ed0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 11:04:40 +0200 Subject: [PATCH 1138/1289] Responsive --- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 9dfd94d5729..4def8dfbef6 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -725,7 +725,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; - print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 4593541e87a..3c4a9e7f46b 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -749,7 +749,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth150'); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth75'); print '
    '; // Ref - if (!empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { - print ''; - } else { + if (empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { print ''; + } else { + print ''; } From 4eeb73276a1f06300ab193deacaf29926b2aeefd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 19:38:38 +0200 Subject: [PATCH 1143/1289] Close #22650 --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index b10aa69767b..d98840379a9 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 @@ -197,6 +197,12 @@ ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) N ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; + +-- Rename const to hide public and private notes (fix allow notes const was used to hide) +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PUBLIC_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PUBLIC_NOTES'; +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PRIVATE_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PRIVATE_NOTES'; + + ALTER TABLE llx_projet ADD COLUMN date_start_event datetime; ALTER TABLE llx_projet ADD COLUMN date_end_event datetime; ALTER TABLE llx_projet ADD COLUMN location varchar(255); From e9b80fa65605931717219824f977873b992b4ea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 19:40:51 +0200 Subject: [PATCH 1144/1289] Fix phpcs --- htdocs/core/lib/admin.lib.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index a07f16c06cb..03bb5d6ba69 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1708,15 +1708,13 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print ''; - } - elseif ($const == 'ADHERENT_MAILMAN_UNSUB_URL') { + } elseif ($const == 'ADHERENT_MAILMAN_UNSUB_URL') { print '. '.$langs->trans("Example").': '.img_down().'
    '; print ''; //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; - } - elseif ($const == 'ADHERENT_MAILMAN_LISTS') { + } elseif ($const == 'ADHERENT_MAILMAN_LISTS') { print '. '.$langs->trans("Example").': '.img_down().'
    '; print ''; //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; - } - elseif ($const == 'ADHERENT_MAIL_FROM') { + } elseif ($const == 'ADHERENT_MAIL_FROM') { print ' '.img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); } From 2d7348aff861a851d111333c502c4f09d6a92113 Mon Sep 17 00:00:00 2001 From: emilisev Date: Mon, 24 Oct 2022 20:13:43 +0200 Subject: [PATCH 1145/1289] Fix Undefined variable $num --- htdocs/adherents/type.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index cc3c697e032..fcdb643a006 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -145,6 +145,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'"; $sql .= " WHERE entity IN (".getEntity('member_type').")"; $result = $db->query($sql); + $num = null; if ($result) { $num = $db->num_rows($result); } From 5a9901e484b09a980e714200556ae5571ecfe3df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 20:28:36 +0200 Subject: [PATCH 1146/1289] Clean code of module ticket --- htdocs/core/class/html.formticket.class.php | 4 +- htdocs/ticket/card.php | 3 +- htdocs/ticket/class/api_tickets.class.php | 30 ----- htdocs/ticket/class/ticket.class.php | 142 +------------------- 4 files changed, 7 insertions(+), 172 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 216644876ba..d5484f31829 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -670,7 +670,7 @@ class FormTicket /** * Return html list of tickets type * - * @param string|array $selected Id du type pre-selectionne + * @param string|array $selected Id of preselected field or array of Ids * @param string $htmlname Nom de la zone select * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code @@ -685,7 +685,7 @@ class FormTicket { global $langs, $user; - $selected = is_array($selected) ? $selected : (!empty($selected) ? implode(',', $selected) : array()); + $selected = is_array($selected) ? $selected : (!empty($selected) ? array($selected) : array()); $ticketstat = new Ticket($this->db); dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 1290a9a9a9b..c9ca9b6622f 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -126,6 +126,8 @@ $permissiontoadd = $user->rights->ticket->write; $actionobject = new ActionsTicket($db); +$upload_dir = $conf->ticket->dir_output; + $now = dol_now(); @@ -682,7 +684,6 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once // Actions to build doc - $upload_dir = $conf->ticket->dir_output; $permissiontoadd = $user->rights->ticket->write; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; //var_dump($action);exit; diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 35e01a74f0d..e7930569bdd 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -181,36 +181,6 @@ class Tickets extends DolibarrApi $this->ticket->messages = $messages; } - // History - $history = array(); - $this->ticket->loadCacheLogsTicket(); - if (is_array($this->ticket->cache_logs_ticket) && count($this->ticket->cache_logs_ticket) > 0) { - $num = count($this->ticket->cache_logs_ticket); - $i = 0; - $user_action = new User($this->db); - - while ($i < $num) { - $userstring = ''; - if ($this->ticket->cache_logs_ticket[$i]['fk_user_create'] > 0) { - $user_action->fetch($this->ticket->cache_logs_ticket[$i]['fk_user_create']); - - $userstring = dolGetFirstLastname($user_action->firstname, $user_action->lastname); - } - - // Now define messages - $history[] = array( - 'id' => $this->ticket->cache_logs_ticket[$i]['id'], - 'fk_user_author' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'], - 'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'], - 'fk_user_action_string' => $userstring, - 'message' => $this->ticket->cache_logs_ticket[$i]['message'], - 'datec' => $this->ticket->cache_logs_ticket[$i]['datec'], - ); - $i++; - } - $this->ticket->history = $history; - } - if (!DolibarrApi::_checkAccessToResource('ticket', $this->ticket->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4a03098b57c..276196bc035 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1580,144 +1580,6 @@ class Ticket extends CommonObject } } - - /** - * Send notification of changes by email - * - * @param User $user User that create - * @param string $message Log message - * @return int <0 if KO, >0 if OK (number of emails sent) - */ - private function sendLogByEmail($user, $message) - { - global $conf, $langs; - - $nb_sent = 0; - - $langs->load('ticket'); - - // Retrieve email of all contacts (internal and external) - $contacts = $this->listeContact(-1, 'internal'); - $contacts = array_merge($contacts, $this->listeContact(-1, 'external')); - - /* If origin_email and no socid, we add email to the list * */ - if (!empty($this->origin_email) && empty($this->fk_soc)) { - $array_ext = array(array('firstname' => '', 'lastname' => '', 'email' => $this->origin_email, 'libelle' => $langs->transnoentities('TicketEmailOriginIssuer'), 'socid' => "-1")); - $contacts = array_merge($contacts, $array_ext); - } - - if (!empty($this->fk_soc)) { - $this->fetch_thirdparty($this->fk_soc); - $array_company = array(array('firstname' => '', 'lastname' => $this->client->name, 'email' => $this->client->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $this->client->id)); - $contacts = array_merge($contacts, $array_company); - } - - // foreach contact send email with notification message - if (count($contacts) > 0) { - foreach ($contacts as $key => $info_sendto) { - $tmpmessage = ''; - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNotificationEmailSubject', $this->track_id); - $tmpmessage .= $langs->transnoentities('TicketNotificationEmailBody', $this->track_id)."\n\n"; - $tmpmessage .= $langs->transnoentities('Title').' : '.$this->subject."\n"; - - $recipient_name = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1'); - $recipient = (!empty($recipient_name) ? $recipient_name : $info_sendto['email']).' ('.strtolower($info_sendto['libelle']).')'; - $tmpmessage .= $langs->transnoentities('TicketNotificationRecipient').' : '.$recipient."\n"; - $tmpmessage .= "\n"; - $tmpmessage .= '* '.$langs->transnoentities('TicketNotificationLogMessage').' *'."\n"; - $tmpmessage .= dol_html_entity_decode($message, ENT_QUOTES | ENT_HTML5)."\n"; - - if ($info_sendto['source'] == 'internal') { - $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$this->track_id; - $tmpmessage .= "\n".$langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$this->track_id.''."\n"; - } else { - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; - $tmpmessage .= "\n".$langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$this->track_id.''."\n"; - } - - $tmpmessage .= "\n"; - $tmpmessage .= $langs->transnoentities('TicketEmailPleaseDoNotReplyToThisEmail')."\n"; - - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; - $replyto = $from; - - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); - - $tmpmessage = dol_nl2br($tmpmessage); - - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $sendtocc = ''; - $deliveryreceipt = 0; - $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $tmpmessage, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error || !empty($mailfile->errors)) { - setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } else { - $result = $mailfile->sendfile(); - if ($result > 0) { - $nb_sent++; - } - } - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - } - - setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs'); - } - - return $nb_sent; - } - - /** - * Charge la liste des actions sur le ticket - * - * @return int Number of lines loaded, 0 if already loaded, <0 if KO - */ - public function loadCacheLogsTicket() - { - global $langs; - - if (is_array($this->cache_logs_ticket) && count($this->cache_logs_ticket)) { - return 0; - } - // Cache deja charge - - // TODO Read the table llx_actioncomm - /* - $sql = "SELECT rowid, fk_user_create, datec, message"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs"; - $sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'"; - $sql .= " ORDER BY datec DESC"; - - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) { - $obj = $this->db->fetch_object($resql); - $this->cache_logs_ticket[$i]['id'] = $obj->rowid; - $this->cache_logs_ticket[$i]['fk_user_create'] = $obj->fk_user_create; - $this->cache_logs_ticket[$i]['datec'] = $this->db->jdate($obj->datec); - $this->cache_logs_ticket[$i]['message'] = $obj->message; - $i++; - } - return $num; - } else { - $this->error = "Error " . $this->db->lasterror(); - dol_syslog(get_class($this) . "::loadCacheLogsTicket " . $this->error, LOG_ERR); - return -1; - }*/ - - return 0; - } - /** * Add message into database * @@ -2869,9 +2731,11 @@ class Ticket extends CommonObject $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } + $upload_dir_tmp = $conf->user->dir_output."/".$user->id; + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $trackid = "tic".$this->id; - $mailfile = new CMailFile($subject, $receiver, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, '', 'ticket'); + $mailfile = new CMailFile($subject, $receiver, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, '', 'ticket', '', $upload_dir_tmp); if ($mailfile->error) { setEventMessages($mailfile->error, null, 'errors'); } else { From afc452b2742568de66c795e8b3aa127c56776ecd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 20:30:58 +0200 Subject: [PATCH 1147/1289] Fix tmp --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 276196bc035..3a6adeb6c20 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2731,7 +2731,7 @@ class Ticket extends CommonObject $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } - $upload_dir_tmp = $conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $trackid = "tic".$this->id; From dba982fcb96c205f239b79ee72ea83f5b5211037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milise=20Prim?= Date: Mon, 24 Oct 2022 21:13:04 +0200 Subject: [PATCH 1148/1289] FIX Undefined property: stdClass::$email --- htdocs/core/boxes/box_birthdays_members.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 6138664db2d..df8e51f348f 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -104,7 +104,6 @@ class box_birthdays_members extends ModeleBoxes $memberstatic->id = $objp->rowid; $memberstatic->firstname = $objp->firstname; $memberstatic->lastname = $objp->lastname; - $memberstatic->email = $objp->email; $dateb = $this->db->jdate($objp->birth); $age = date('Y', dol_now()) - date('Y', $dateb); From c4444e76c9009fc166a7e5508a941f3c19562247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milise=20Prim?= Date: Mon, 24 Oct 2022 21:53:10 +0200 Subject: [PATCH 1149/1289] FIX Undefined variable $backtopage --- htdocs/core/actions_linkedfiles.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index b89d5bf6cb0..93d1e8463ec 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -160,7 +160,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } if (is_object($object) && $object->id > 0) { - if ($backtopage) { + if (isset($backtopage)) { header('Location: '.$backtopage); exit; } else { From 68e1509834ae501c58d9af4646f5d10a7a526595 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Oct 2022 22:38:45 +0200 Subject: [PATCH 1150/1289] Fix ckeditor --- htdocs/admin/fckeditor.php | 10 ++++++++-- htdocs/langs/en_US/admin.lang | 3 ++- htdocs/langs/fr_FR/admin.lang | 3 ++- htdocs/theme/eldy/ckeditor/config.js | 1 + htdocs/theme/md/ckeditor/config.js | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index eeeb5035e16..94b210c627f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -166,7 +166,12 @@ if (empty($conf->use_javascript_ajax)) { print ''."\n"; print '
    '; print ''; - print ''; + print ''; print '\n"; - // Signature print ''; print ''; + // Note private + print '\n"; + + // Note private + print '\n"; print '
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.img_object("", $picto[$const]).''.$langs->trans($desc).''; + print $langs->trans($desc); + if ($const == 'DETAILS') { + print '
    '.$langs->trans("FCKeditorForProductDetails2").''; + } + print '
    '; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { @@ -185,6 +190,7 @@ if (empty($conf->use_javascript_ajax)) { print '
    '."\n"; print ''; + print ''; // Skins show_skin(null, 1); @@ -219,7 +225,7 @@ if (empty($conf->use_javascript_ajax)) { print $conf->global->FCKEDITOR_TEST; print ''; } - print $form->buttonsSaveCancel("Save", ''); + print $form->buttonsSaveCancel("Save", '', null, 0, 'reposition'); print '
    '; print '
    '."\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e8f8f5bac6d..1881ef9a459 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1748,7 +1748,8 @@ FCKeditorForNotePublic=WYSIWIG creation/edition of the field "public notes" of e FCKeditorForNotePrivate=WYSIWIG creation/edition of the field "private notes" of elements FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) FCKeditorForProduct=WYSIWIG creation/edition of the field description of products/services -FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. +FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). +FCKeditorForProductDetails2=Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3f45fc1643d..8edc331780b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1747,7 +1747,8 @@ FCKeditorForNotePublic=Création/édition WYSIWIG du champ notes publiques des FCKeditorForNotePrivate=Création/édition WYSIWIG du champ notes privées des éléments FCKeditorForCompany=Création/édition WYSIWIG de la description des éléments (autre que produits/services) FCKeditorForProduct=Création/édition WYSIWIG du champ description des produits/services -FCKeditorForProductDetails=Création/édition WYSIWYG des lignes de détails produits sur tous les éléments (commandes, propales, factures, etc...). Attention: L'utilisation pour ce cas est fortement déconseillée car peut créer des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. +FCKeditorForProductDetails=Création/édition WYSIWYG des lignes de détails produits sur tous les éléments (commandes, propales, factures, etc...). +FCKeditorForProductDetails2=Attention: L'utilisation pour ce cas est fortement déconseillée car peut créer des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings) FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs FCKeditorForMail=Création/édition WYSIWIG tous les emails (sauf Outils->Emailings) diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index d2a87a4a4d8..6dce53be431 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -100,6 +100,7 @@ CKEDITOR.editorConfig = function( config ) [ ['Maximize'], ['Find'], + ['Image'], ['Source'] ]; }; diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js index e463e6db9a3..c7e10f9a123 100644 --- a/htdocs/theme/md/ckeditor/config.js +++ b/htdocs/theme/md/ckeditor/config.js @@ -100,6 +100,7 @@ CKEDITOR.editorConfig = function( config ) [ ['Maximize'], ['Find'], + ['Image'], ['Source'] ]; }; From 1618bfc90293947c118768bfb0bd3700b4a2d344 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 10:53:19 +0200 Subject: [PATCH 1151/1289] Debug v17 --- htdocs/core/lib/usergroups.lib.php | 5 ++++- htdocs/core/tpl/notes.tpl.php | 5 ----- htdocs/user/card.php | 30 +++++++++++++++++++----------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 868a5af0d51..273e7285273 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -157,7 +157,10 @@ function user_prepare_head(User $object) if (empty($user->socid)) { // Notes $nbNote = 0; - if (!empty($object->note)) { + if (!empty($object->note_public)) { + $nbNote++; + } + if (!empty($object->note_private)) { $nbNote++; } $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 9a9c5866023..a81c95251f4 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -96,11 +96,6 @@ if ($module == 'propal') { } //else dol_print_error('','Bad value '.$module.' for param module'); -if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. -} else { - $typeofdata = 'textarea:12:95%'; -} if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a539dad3505..338a3bbd1e9 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -276,8 +276,8 @@ if (empty($reshook)) { $object->job = GETPOST("job", 'alphanohtml'); $object->signature = GETPOST("signature", 'restricthtml'); $object->accountancy_code = GETPOST("accountancy_code", 'alphanohtml'); - $object->note = GETPOST("note", 'restricthtml'); - $object->note_private = GETPOST("note", 'restricthtml'); + $object->note_public = GETPOST("note_public", 'restricthtml'); + $object->note_private = GETPOST("note_private", 'restricthtml'); $object->ldap_sid = GETPOST("ldap_sid", 'alphanohtml'); $object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", 'int') : 0; $object->fk_user_expense_validator = GETPOST("fk_user_expense_validator", 'int') > 0 ? GETPOST("fk_user_expense_validator", 'int') : 0; @@ -1205,15 +1205,6 @@ if ($action == 'create' || $action == 'adduserldap') { $parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - // Note - print '
    '; - print $langs->trans("Note"); - print ''; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); - $doleditor->Create(); - print "
    '.$langs->trans("Signature").''; @@ -1222,6 +1213,23 @@ if ($action == 'create' || $action == 'adduserldap') { print $doleditor->Create(1); print '
    '; + print $langs->trans("NotePublic"); + print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note_public', GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor->Create(); + print "
    '; + print $langs->trans("NotePrivate"); + print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note_private', GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor->Create(); + print "

    '; From 1f9424a4b314db7c0b9b4930e587170d19056e7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 11:13:34 +0200 Subject: [PATCH 1152/1289] Clean code/options --- htdocs/adherents/type_translation.php | 4 ++-- htdocs/admin/ticket_public.php | 4 ++-- htdocs/categories/card.php | 2 +- htdocs/categories/traduction.php | 4 ++-- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/product/card.php | 5 ++--- htdocs/projet/tasks.php | 18 ++++++--------- htdocs/projet/tasks/task.php | 25 ++++++++++----------- htdocs/user/card.php | 4 ++-- 10 files changed, 32 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 5e1db1233b8..33c93704b80 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -226,7 +226,7 @@ if ($action == 'edit') { print '
    '; print ''; print ''; print ''; @@ -289,7 +289,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) { print ''; print ''; print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 84186e4e226..05938e27d49 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -419,7 +419,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; print ''; print ''; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 8aecdde63ea..f0f40b4401b 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -267,7 +267,7 @@ if ($action == 'edit') { // Desc $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''; @@ -327,7 +327,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; print ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index edaf088e949..53a20d6dadd 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -60,7 +60,7 @@ class DolEditor * 'In' = each window has its own toolbar * 'Out:name' = share toolbar into the div called 'name' * @param boolean $toolbarstartexpanded Bar is visible or not at start - * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param boolean $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param boolean|string $okforextendededitor True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". * @param int $rows Size of rows for textarea tool diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index d5484f31829..0e5e6ff9e7c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1501,7 +1501,7 @@ class FormTicket print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 7c51da5d02a..fdc3b05a82a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1446,7 +1446,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '"; if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { @@ -1620,7 +1619,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '"; @@ -2198,7 +2197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { print '"; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 18a75449f24..951406b4275 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -774,18 +774,14 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 331b29acb96..8b19c8c0519 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -100,8 +100,11 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) { $object->ref = $taskref ? $taskref : GETPOST("ref", 'alpha', 2); $object->label = GETPOST("label", "alphanohtml"); - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $object->description = GETPOST('description', "alphanohtml"); - else $object->description = GETPOST('description', "restricthtml"); + if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { + $object->description = GETPOST('description', "alphanohtml"); + } else { + $object->description = GETPOST('description', "restricthtml"); + } $object->fk_task_parent = $task_parent; $object->planned_workload = $planned_workload; $object->date_start = dol_mktime(GETPOST('dateohour', 'int'), GETPOST('dateomin', 'int'), 0, GETPOST('dateomonth', 'int'), GETPOST('dateoday', 'int'), GETPOST('dateoyear', 'int')); @@ -491,18 +494,14 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 338a3bbd1e9..905be457810 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1218,7 +1218,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $langs->trans("NotePublic"); print '\n"; @@ -1227,7 +1227,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $langs->trans("NotePrivate"); print '\n"; From 7c892802eb748eb7472ab9eca862eca3f28ad018 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 12:22:43 +0200 Subject: [PATCH 1153/1289] Debug v17 --- htdocs/core/class/html.form.class.php | 3 ++- htdocs/core/modules/modFckeditor.class.php | 6 +++--- htdocs/core/tpl/objectline_create.tpl.php | 23 +++++++++++---------- htdocs/core/tpl/objectline_edit.tpl.php | 24 ++++++++++++++-------- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 6 files changed, 35 insertions(+), 23 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index daff55c7615..0a1f5f16d6d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6299,7 +6299,7 @@ class Form } if (!$options_only) { - $return .= ''; } $selectedfound = false; @@ -6346,6 +6346,7 @@ class Form if (!$options_only) { $return .= ''; + //$return .= ajax_combobox($htmlname); // This break for the moment dynamic autoselection of a value when selecting a product in object lines } } else { $return .= $this->error; diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 8c30d8a0a51..4bfe6c2dd39 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -71,9 +71,9 @@ class modFckeditor extends DolibarrModules $this->const = array(); $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for the fields descriptions of elements (except products/services)"); $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for the fields description of products/services"); - $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); - $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); - $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); + $this->const[2] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); + $this->const[3] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); + $this->const[4] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); $this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities"); $this->const[6] = array("FCKEDITOR_SKIN", "string", "moono-lisa", "Skin by default for fckeditor"); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 4ec5fcc02c6..381683cf62c 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -413,13 +413,14 @@ if ($nolinesbefore) { $coldisplay++; ?> - global->PRODUCT_USE_UNITS)) { @@ -434,11 +435,12 @@ if ($nolinesbefore) { } $coldisplay++; ?> - + + situation_cycle_ref) && $this->situation_cycle_ref) { $coldisplay++; - print ''; + print ''; $coldisplay++; print ''; } @@ -456,11 +458,11 @@ if ($nolinesbefore) { global->DISPLAY_MARGIN_RATES)) { - echo ''; + echo ''; $coldisplay++; } if (!empty($conf->global->DISPLAY_MARK_RATES)) { - echo ''; + echo ''; $coldisplay++; } } @@ -498,7 +500,6 @@ if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelecto } } - if (!empty($object->element) && $object->element == 'contrat') { print $langs->trans("DateStartPlanned").' '; print $form->selectDate($date_start, "date_start", $usehm, $usehm, 1, "addproduct"); @@ -521,8 +522,8 @@ if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelecto ?> function prefill_service_dates() { - $('#date_start').val("").trigger('change'); - $('#date_end').val("").trigger('change'); + $('#date_start').val("").trigger('change'); + $('#date_end').val("").trigger('change'); return false; // Prevent default link behaviour (which is go to href URL) } @@ -735,7 +736,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { // Get the HT price for the product and display it console.log("Load unit price without tax and set it into #price_ht for product id="+$(this).val()+" socid=socid; ?>"); $.post('/product/ajax/products.php?action=fetch', - { 'id': $(this).val(), 'socid': socid; ?> }, + { 'id': $(this).val(), 'socid': socid; ?>, 'token': '' }, function(data) { console.log("objectline_create.tpl Load unit price end, we got value ht="+data.price_ht+" ttc="+data.price_ttc+" pricebasetype="+data.pricebasetype); @@ -875,7 +876,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } options += ''; }); - options += ''; + options += ''; console.log("finally selected defaultkey="+defaultkey+" defaultprice for buying price="+defaultprice); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index c8188c82bb8..1a9f028c263 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -200,9 +200,12 @@ $coldisplay++; '.$form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : ($line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : '')), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1).''; + print ''; } else { print ''; } @@ -266,24 +269,29 @@ $coldisplay++; ?> + situation_cycle_ref) { $coldisplay++; print ''; $coldisplay++; print ''; } + if (!empty($usemargins)) { if (!empty($user->rights->margins->creer)) { $coldisplay++; @@ -303,9 +311,9 @@ $coldisplay++; $margin_rate = (GETPOSTISSET("np_marginRate") ? GETPOST("np_marginRate", "alpha", 2) : (($line->pa_ht == 0) ? '' : price($line->marge_tx))); // if credit note, dont allow to modify margin if ($line->subprice < 0) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } $coldisplay++; } @@ -313,9 +321,9 @@ $coldisplay++; $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } $coldisplay++; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 05f00488123..d2395cc6f02 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1583,6 +1583,7 @@ table[summary="list_of_modules"] .fa-cog { .widthauto { width: auto; } .width20 { width: 20px; } .width25 { width: 25px; } +.width40 { width: 40px; } .width50 { width: 50px; } .width75 { width: 75px; } .width100 { width: 100px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index df1bd11dc4f..da4b905e329 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1677,6 +1677,7 @@ tr.nobottom td { .widthauto { width: auto; } .width20 { width: 20px; } .width25 { width: 25px; } +.width40 { width: 40px; } .width50 { width: 50px; } .width75 { width: 75px; } .width100 { width: 100px; } From 1954e5a1aba0c651c56c35515184ffa2b45ff50d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 14:39:19 +0200 Subject: [PATCH 1154/1289] Update actions_linkedfiles.inc.php --- htdocs/core/actions_linkedfiles.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 93d1e8463ec..4e2cd2873b6 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -160,7 +160,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } if (is_object($object) && $object->id > 0) { - if (isset($backtopage)) { + if (!empty($backtopage)) { header('Location: '.$backtopage); exit; } else { From 3059bfdd6055d5392b9fef84c82b11f87bda4dce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 16:33:25 +0200 Subject: [PATCH 1155/1289] Better responsive --- htdocs/admin/fckeditor.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 +++- htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 94b210c627f..f43ddb281bd 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -51,7 +51,7 @@ $modules = array( 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', 'SOCIETE' => 'FCKeditorForCompany', - 'PRODUCTDESC' => 'FCKeditorForProduct', + //'PRODUCTDESC' => 'FCKeditorForProduct', 'DETAILS' => 'FCKeditorForProductDetails', 'USERSIGN' => 'FCKeditorForUserSignature', 'MAILING' => 'FCKeditorForMailing', diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d2395cc6f02..f2cea00230d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5618,7 +5618,9 @@ a.cke_dialog_ui_button .cke_dialog_ui_hbox_first { vertical-align: middle !important; } - +.cke_combo_text { + width: 40px !important; +} /* .cke_editable { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da4b905e329..002166968cd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5461,6 +5461,9 @@ a.cke_dialog_ui_button { vertical-align: bottom !important; } +.cke_combo_text { + width: 40px !important; +} /* .cke_editable { From 013d2429430d8aa35d7f2d91300c126b7ea00ec4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 17:16:14 +0200 Subject: [PATCH 1156/1289] Merge FCKEDITOR_ENABLE_DETAILS and FCKEDITOR_ENABLE_PRODUCTDESC. The 2 options has similar effect, only one in code is required. --- htdocs/core/modules/modFckeditor.class.php | 1 - htdocs/langs/en_US/admin.lang | 3 +-- htdocs/product/card.php | 4 ++-- htdocs/product/fournisseurs.php | 2 +- htdocs/product/traduction.php | 8 ++++---- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 4bfe6c2dd39..fa3a66c37cc 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -70,7 +70,6 @@ class modFckeditor extends DolibarrModules // Constants $this->const = array(); $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for the fields descriptions of elements (except products/services)"); - $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for the fields description of products/services"); $this->const[2] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); $this->const[3] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); $this->const[4] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1881ef9a459..90ca6c15362 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1747,8 +1747,7 @@ ActivateFCKeditor=Activate advanced editor for: FCKeditorForNotePublic=WYSIWIG creation/edition of the field "public notes" of elements FCKeditorForNotePrivate=WYSIWIG creation/edition of the field "private notes" of elements FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) -FCKeditorForProduct=WYSIWIG creation/edition of the field description of products/services -FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). +FCKeditorForProductDetails=WYSIWIG creation/edition of products description or lines for objects (lines of proposals, orders, invoices, etc...). FCKeditorForProductDetails2=Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature diff --git a/htdocs/product/card.php b/htdocs/product/card.php index fdc3b05a82a..c1be61741bb 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1444,7 +1444,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Description (used in invoice, propal...) print '"; @@ -2006,7 +2006,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '"; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 034fa97f86f..2ccdc7409f3 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -821,7 +821,7 @@ END; print ''; print ''; diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 3f536b6761a..ba4dc956d08 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -265,12 +265,12 @@ if ($action == 'edit') { print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); $doleditor->Create(); print ''; @@ -431,7 +431,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print '
    '.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); $doleditor->Create(); print ''; diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 7f04c6d1005..c94e464a762 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -247,7 +247,7 @@ if ($user->rights->categorie->creer) { // Description print '
    '.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_5, '90%'); + $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print '
    '; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); + $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); $doleditor->Create(); print '
    '.$langs->trans("Description").''; $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); $doleditor->Create(); - print "
    '.$langs->trans("NoteNotVisibleOnBill").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_8, '90%'); + $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_8, '90%'); $doleditor->Create(); print "
    '.$langs->trans("NoteNotVisibleOnBill").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_4, '90%'); $doleditor->Create(); print "
    '.$langs->trans("Description").''; - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - print ''; - } else { - // WYSIWYG editor - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { - $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; - } - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); - print $doleditor->Create(); + // WYSIWYG editor + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0); + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { + $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); + print $doleditor->Create(); print '
    '.$langs->trans("Description").''; - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - print ''; - } else { - // WYSIWYG editor - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { - $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; - } - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); - print $doleditor->Create(); + // WYSIWYG editor + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0); + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { + $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); + print $doleditor->Create(); print '
    '.$langs->trans("Budget").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note_public', GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC'), ROWS_3, '90%'); $doleditor->Create(); print "
    '; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note_private', GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_3, '90%'); $doleditor->Create(); print "
    - "> + "> "> + + "> ">%">% %% %%%%'; + print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : ($line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : '')), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1); + print '% - info_bits & 2) != 2) { - print '%'; + print '>%'; } else { ?>   %'.$margin_rate.'%'.$margin_rate.'%%%'.$mark_rate.'%'.$mark_rate.'%%%
    '.$langs->trans("Description").''; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); print "
    '.$langs->trans("Description").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); print "
    '.$langs->trans('ProductSupplierDescription').''; - $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); print '
    '; print ''; print ''; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { print ''; @@ -336,13 +336,13 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; print ''; // Other field (not used) if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { print ''; } From 06fcf5312fca7d9fdcb0cf76458407be422ee1c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 17:30:50 +0200 Subject: [PATCH 1157/1289] Close #22512 manually due to error in sticket (missing space after cast) --- .../install/mysql/tables/llx_emailcollector_emailcollector.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index f13fff71a6f..4119e7aac08 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -28,7 +28,7 @@ CREATE TABLE llx_emailcollector_emailcollector( acces_type integer DEFAULT 0, oauth_service varchar(128), password varchar(128), - source_directory varchar(255) NOT NULL, + source_directory varchar(255) DEFAULT 'Inbox' NOT NULL, target_directory varchar(255), maxemailpercollect integer DEFAULT 100, datelastresult datetime, From 1e8f5b475397be5a6102f4bdcc3c9cad4c4983d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 19:39:59 +0200 Subject: [PATCH 1158/1289] Rename page of agenda to follow same naming than other elements --- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/{info.php => agenda.php} | 2 +- htdocs/projet/messaging.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) rename htdocs/projet/{info.php => agenda.php} (99%) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 14f43f24034..46a61e60a61 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11470,6 +11470,7 @@ function getActionCommEcmList($object) } + /** * Show html area with actions in messaging format. * Note: Global parameter $param must be defined. @@ -11766,7 +11767,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n } } - // Set $out to sow events + // Set $out to show events $out = ''; if (!isModEnabled('agenda')) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a7cd6520abb..d427f87189a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -311,7 +311,7 @@ function project_prepare_head(Project $project, $moreparam = '') $h++; } - $head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id; + $head[$h][0] = DOL_URL_ROOT.'/projet/messaging.php?id='.$project->id; $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $head[$h][1] .= '/'; diff --git a/htdocs/projet/info.php b/htdocs/projet/agenda.php similarity index 99% rename from htdocs/projet/info.php rename to htdocs/projet/agenda.php index f8ac6301f99..a3c120d0a23 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/agenda.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/projet/info.php + * \file htdocs/projet/agenda.php * \ingroup project * \brief Page with events on project */ diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 9200d802794..7fe5b4a0b9d 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -132,7 +132,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; @@ -180,7 +180,7 @@ if (!empty($object->id)) { $morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2); // Show link to change view in agenda - $messagingUrl = DOL_URL_ROOT.'/projet/info.php?id='.$object->id; + $messagingUrl = DOL_URL_ROOT.'/projet/agenda.php?id='.$object->id; $morehtmlcenter .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); From f2993f7c0f096181eda79425e06007e11182b1be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 19:54:57 +0200 Subject: [PATCH 1159/1289] Better fix for #22589 --- htdocs/product/stock/class/mouvementstock.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index b1e184c3fe2..282f09e276e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -976,11 +976,10 @@ class MouvementStock extends CommonObject if ($origin_type) { // Separate originetype with "@" : left part is class name, right part is module name $origin_type_array = explode('@', $origin_type); - $classname = strtolower($origin_type_array[0]); - $modulename = empty($origin_type_array[1]) ? $classname : $origin_type_array[1]; + $classname = ucfirst($origin_type_array[0]); + $modulename = empty($origin_type_array[1]) ? strtolower($classname) : $origin_type_array[1]; $result = dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php'); if ($result) { - $classname = ucfirst($classname); $origin = new $classname($this->db); } } From 94800e2d0f3c720d043600dc9206ce4e4d2ecbbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 19:58:53 +0200 Subject: [PATCH 1160/1289] Update objectline_edit.tpl.php --- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 64404081e54..a92aaef85a2 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -186,7 +186,7 @@ $coldisplay++; ?>
    fk_fournprice.'">'); + print ''; } $coldisplay++; From 0e4a4b9e5893aed02c2b5f8d6545d8f92d9de20b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2022 21:16:29 +0200 Subject: [PATCH 1161/1289] Fix phpcs error --- htdocs/core/lib/ticket.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index f82c57a0418..5d0d691228e 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -268,4 +268,3 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
    '; } - From 791927723aaa2aaccb4d49f6dae5b606092ca9b6 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 26 Oct 2022 11:38:07 +0200 Subject: [PATCH 1162/1289] Fix #22671 : fix permissions notes.tpl.php --- htdocs/core/tpl/notes.tpl.php | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index e0f0c5d9142..0430ec16e0e 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -29,6 +29,9 @@ $module = $object->element; $note_public = 'note_public'; $note_private = 'note_private'; +if ($module == "product") { + $module = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); +} $colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ? '25' : '')); // Set $permission from the $permissionnote var defined on calling page $permission = (isset($permissionnote) ? $permissionnote : (isset($permission) ? $permission : (isset($user->rights->$module->create) ? $user->rights->$module->create : (isset($user->rights->$module->creer) ? $user->rights->$module->creer : 0)))); @@ -60,37 +63,39 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->hasRight("propale", "creer"); } elseif ($module == 'supplier_proposal') { - $permission = $user->rights->supplier_proposal->creer; + $permission = $user->hasRight("supplier_proposal", "creer"); } elseif ($module == 'fichinter') { - $permission = $user->rights->ficheinter->creer; + $permission = $user->hasRight("ficheinter", "creer"); } elseif ($module == 'project') { - $permission = $user->rights->projet->creer; + $permission = $user->hasRight("projet", "creer"); } elseif ($module == 'project_task') { - $permission = $user->rights->projet->creer; + $permission = $user->hasRight("projet", "creer"); } elseif ($module == 'invoice_supplier') { if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { - $permission = $user->rights->fournisseur->facture->creer; + $permission = $user->hasRight("fournisseur", "facture", "creer"); } else { - $permission = $user->rights->supplier_invoice->creer; + $permission = $user->hasRight("supplier_invoice", "creer"); } } elseif ($module == 'order_supplier') { if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { - $permission = $user->rights->fournisseur->commande->creer; + $permission = $user->hasRight("fournisseur", "commande", "creer"); } else { - $permission = $user->rights->supplier_order->creer; + $permission = $user->hasRight("supplier_order", "creer"); } } elseif ($module == 'societe') { - $permission = $user->rights->societe->creer; + $permission = $user->hasRight("societe", "creer"); } elseif ($module == 'contact') { - $permission = $user->rights->societe->creer; + $permission = $user->hasRight("societe", "creer"); } elseif ($module == 'shipping') { - $permission = $user->rights->expedition->creer; + $permission = $user->hasRight("expedition", "creer"); } elseif ($module == 'product') { - $permission = $user->rights->produit->creer; + $permission = $user->hasRight("produit", "creer"); +} elseif ($module == 'service') { + $permission = $user->hasRight("service", "creer"); } elseif ($module == 'ecmfiles') { - $permission = $user->rights->ecm->setup; + $permission = $user->hasRight("ecm", "setup"); } //else dol_print_error('','Bad value '.$module.' for param module'); From 2281b187b7a1ed714aa62f2c078457cefda2f739 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 26 Oct 2022 12:15:30 +0200 Subject: [PATCH 1163/1289] FIX just add integer --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 83de127f254..7a8e1004468 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1479,7 +1479,7 @@ class Societe extends CommonObject $sql .= ",fk_effectif = ".($this->effectif_id > 0 ? ((int) $this->effectif_id) : "null"); if (isset($this->stcomm_id)) { - $sql .= ",fk_stcomm=".(($this->stcomm_id > 0 || $this->stcomm_id = -1) ? ((int) $this->stcomm_id) : "0"); + $sql .= ",fk_stcomm=".(int) $this->stcomm_id; } if (isset($this->typent_id)) { $sql .= ",fk_typent = ".($this->typent_id > 0 ? ((int) $this->typent_id) : "0"); From 2ed2f74c8aca18745bf19e9ea6d7a3b013096dd4 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 26 Oct 2022 15:35:27 +0200 Subject: [PATCH 1164/1289] FIX - /td in if to MAIN_CHECKBOX_LEFT_COLUMN --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..7bb730b93c2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2565,8 +2565,8 @@ if ($resql) { } print ''; } + print ''; } - print ''; if (!$i) { $totalarray['nbfield']++; } From 12db216f1e0dd6e0e2629145b0763a480a270b7a Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 26 Oct 2022 16:05:10 +0200 Subject: [PATCH 1165/1289] FIX - $totalarray['nbfield']++; --- htdocs/commande/list.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 7bb730b93c2..1e26bd2ed9e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1950,6 +1950,10 @@ if ($resql) { } print ''; } + if (!$i) { + $totalarray['nbfield']++; + } + print ''; } // Ref @@ -2566,9 +2570,9 @@ if ($resql) { print ''; } print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print "
    \n"; From 04cba0307d6028922d489f27bcb41855fed29374 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 26 Oct 2022 19:15:55 +0200 Subject: [PATCH 1166/1289] Propal list and third --- htdocs/comm/propal/list.php | 10 +++++++--- htdocs/societe/list.php | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0d560d741ce..c7f901c2c25 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1661,6 +1661,9 @@ if ($resql) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['p.ref']['checked'])) { @@ -2205,10 +2208,11 @@ if ($resql) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } - if (!$i) { - $totalarray['nbfield']++; - } + print ''."\n"; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index f32317163ad..675a86410a5 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1478,6 +1478,9 @@ while ($i < min($num, $limit)) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['s.rowid']['checked'])) { print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print ''."\n"; From 3a97588d810998ad6a6f14cea0e8c01dea4b0a3c Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 26 Oct 2022 19:22:36 +0200 Subject: [PATCH 1167/1289] product list --- htdocs/product/list.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 26f6a3a410c..74b066490e3 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1381,6 +1381,9 @@ if ($resql) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Ref if (!empty($arrayfields['p.rowid']['checked'])) { @@ -1944,9 +1947,9 @@ if ($resql) { print ''; } print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print "\n"; From 36a9ac414d1fe9c71b2f5f6abbdd946370aa6046 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 00:38:32 +0200 Subject: [PATCH 1168/1289] FIX The break of option in setup page was not working correctly --- htdocs/admin/workflow.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 10f32eed97d..d18cf067a23 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -79,7 +79,7 @@ $workflowcodes = array( 'picto'=>'ticket' ), - 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>''), + 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('commande')) || (isModEnabled('commande') && isModEnabled('facture')) || (isModEnabled('ticket') && isModEnabled('ficheinter')))), // Automatic classification of proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( @@ -118,8 +118,6 @@ $workflowcodes = array( 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. - 'separator2'=>array('family'=>'separator', 'position'=>50), - // Automatic classification supplier proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array( 'family'=>'classify_supplier_proposal', @@ -170,17 +168,19 @@ $workflowcodes = array( 'picto' => 'shipment' ), + 'separator2'=>array('family'=>'separator', 'position'=>400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))), + // Automatic link ticket -> contract 'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'family' => 'link_ticket', - 'position' => 75, - 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), + 'position' => 500, + 'enabled' => (isModEnabled('ticket') && isModEnabled('contract')), 'picto' => 'ticket' ), 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'family' => 'link_ticket', - 'position' => 76, - 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), + 'position' => 501, + 'enabled' => (isModEnabled('ticket') && isModEnabled('contract')), 'picto' => 'ticket' ), ); From c7e4ca2437329fb226da9991b296e54c5216bb21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 00:40:41 +0200 Subject: [PATCH 1169/1289] Right alignement of button --- htdocs/admin/workflow.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index d18cf067a23..2e3473d4a99 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -235,6 +235,7 @@ foreach ($workflowcodes as $key => $params) { continue; } + $reg = array(); if ($oldfamily != $params['family']) { if ($params['family'] == 'create') { $header = $langs->trans("AutomaticCreation"); @@ -269,7 +270,7 @@ foreach ($workflowcodes as $key => $params) { print ''; print ''; - print ''; + print ''; print ''; $oldfamily = $params['family']; @@ -286,7 +287,7 @@ foreach ($workflowcodes as $key => $params) { print ''; - print ''; // Mode of payment print ''; // Bank Account From 9792d4e0aa4a369a539794a589362929ecbb0fb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 01:40:32 +0200 Subject: [PATCH 1176/1289] Fix missing picto in combo list --- htdocs/expedition/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index e697c0be6c3..81e0adb15aa 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -526,7 +526,7 @@ $param .= $hookmanager->resPrint; $arrayofmassactions = array( 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - 'classifyclose'=>$langs->trans("Close"), + 'classifyclose' => img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("Close"), 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if (in_array($massaction, array('presend'))) { From a0203af926ec8dd6f5b83d39e096780ca819fecd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 02:49:57 +0200 Subject: [PATCH 1177/1289] Code comment --- htdocs/core/modules/syslog/mod_syslog_file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index e99e16ef649..04d1de3fbbd 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -116,7 +116,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 1) { // file depend on session key name (Note that session name is same for all users and is not a per user value) $suffixinfilename .= '_'.session_name(); } - if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 2) { // file depend on session value sor per user + if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 2) { // file depend on session name + ip so nearly per user $suffixinfilename .= '_'.session_name().'_'.$_SERVER["REMOTE_ADDR"]; } } From b268f630a12d64b9989a882d3034e739cebcc8d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 02:53:41 +0200 Subject: [PATCH 1178/1289] NEW conf->global->SYSLOG_FILE_ONEPERSESSION accept a string --- htdocs/core/modules/syslog/mod_syslog_file.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index 04d1de3fbbd..265741f35c6 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -113,11 +113,15 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface } if (!empty($conf->global->SYSLOG_FILE_ONEPERSESSION)) { - if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 1) { // file depend on session key name (Note that session name is same for all users and is not a per user value) - $suffixinfilename .= '_'.session_name(); - } - if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 2) { // file depend on session name + ip so nearly per user - $suffixinfilename .= '_'.session_name().'_'.$_SERVER["REMOTE_ADDR"]; + if (is_numeric($conf->global->SYSLOG_FILE_ONEPERSESSION)) { + if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 1) { // file depend on instance session key name (Note that session name is same for the instance so for all users and is not a per user value) + $suffixinfilename .= '_'.session_name(); + } + if ($conf->global->SYSLOG_FILE_ONEPERSESSION == 2) { // file depend on instance session key name + ip so nearly per user + $suffixinfilename .= '_'.session_name().'_'.$_SERVER["REMOTE_ADDR"]; + } + } else { + $suffixinfilename .= '_'.$conf->global->SYSLOG_FILE_ONEPERSESSION; } } From f682edb4f2e6225d9dc566e9761be08139d85c34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 03:37:01 +0200 Subject: [PATCH 1179/1289] Missing some info in log file --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index ed2bcef8034..8327addc260 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -212,7 +212,7 @@ class CMailFile // On defini alternative_boundary $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) - dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, replyto=$replyto trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, replyto=$replyto trackid=$trackid sendcontext=$sendcontext upload_dir_tmp=$upload_dir_tmp", LOG_DEBUG); dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG); if (empty($subject)) { From d1cd43c9d8564e059d72b3f4483509cb0ddc2e4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 04:02:42 +0200 Subject: [PATCH 1180/1289] Fix same file content = same hash --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8327addc260..49269b47f2c 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1783,7 +1783,7 @@ class CMailFile foreach ($matches[1] as $key => $ext) { // We save the image to send in disk $filecontent = $matches[2][$key]; - $cid = dol_hash(uniqid(time()), 3); + $cid = dol_hash($this->html, 'md5'); $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; $fhandle = @fopen($destfiletmp, 'w'); From c9f43dc7a6232ab25327ac92c2f28dc366a4320b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 04:20:54 +0200 Subject: [PATCH 1181/1289] Fix error too large regex in memory --- htdocs/core/class/CMailFile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 49269b47f2c..e21a288e53e 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1761,7 +1761,7 @@ class CMailFile /* global $dolibarr_main_data_root; $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; - $fp = fopen($outputfile, "w"); + $fp = fopen($outputfile, "w+"); fwrite($fp, $this->html); fclose($fp); */ @@ -1808,7 +1808,7 @@ class CMailFile // type $this->html_images[$i]["type"] = 'cidfromdata'; - $this->html = preg_replace('/src="data:image\/'.$ext.';base64,'.preg_quote($filecontent, '/').'"/', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); + $this->html = str_replace('src="data:image/'.$ext.';base64,'.$filecontent.'"', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); } $i++; } From f45f3740e2aa1517938bb62bb4e472ff45dfaf23 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 28 Oct 2022 08:10:39 +0200 Subject: [PATCH 1182/1289] FIX Accountancy - Review of Winfic - eWinfic - Winsis compta export format --- .../accountancy/class/accountancyexport.class.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index ec24af642fd..db58cb2ccbc 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -657,9 +657,12 @@ class AccountancyExport /** * Export format : WinFic - eWinfic - WinSis Compta + * Last review for this format : 2022-10-28 Alexandre Spangaro (aspangaro@open-dsi.fr) * + * Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf * * @param array $TData data + * * @return void */ public function exportWinfic(&$TData) @@ -679,7 +682,7 @@ class AccountancyExport $Tab = array(); //$Tab['type_ligne'] = 'M'; - $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); + $Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2), 2); //We use invoice date $data->doc_date not $date_ecriture which is the transfert date //maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? @@ -688,11 +691,11 @@ class AccountancyExport $Tab['folio'] = ' 1'; - $Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT); + $Tab['num_ecriture'] = str_pad(dol_trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT); $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); - $Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0'); + $Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6), 6, '0'); if ($data->sens == 'D') { $Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); @@ -704,9 +707,9 @@ class AccountancyExport $Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); } - $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30); + $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30); - $Tab['lettrage'] = str_repeat(' ', 2); + $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left'), 2); $Tab['code_piece'] = str_repeat(' ', 5); From b3c7d64cb2b184c245f682851ad4035e4b249f4d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 28 Oct 2022 10:40:43 +0200 Subject: [PATCH 1183/1289] NEW: Allow download link in module configuration (propal,invoice,supplier proposal, order) --- htdocs/admin/commande.php | 44 ++++++++++++++++++++++-- htdocs/admin/contract.php | 45 ++++++++++++++++++------- htdocs/admin/facture.php | 54 ++++++++++++++++++++++-------- htdocs/admin/propal.php | 9 +++++ htdocs/admin/supplier_proposal.php | 48 +++++++++++++++++++++----- htdocs/langs/en_US/contracts.lang | 1 - htdocs/langs/es_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/contracts.lang | 1 - 9 files changed, 165 insertions(+), 39 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index e9ad4a5c53b..34a5e281fac 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -182,7 +182,39 @@ if ($action == 'updateMask') { } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { +} elseif (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $value = (GETPOST($code) ? GETPOST($code) : 1); + + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} elseif (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + $res = dolibarr_del_const($db, $code, $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} +/*elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { // Activate ask for payment bank $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); @@ -208,7 +240,8 @@ if ($action == 'updateMask') { } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} +} */ + /* @@ -636,6 +669,13 @@ print ''; print ''; print "\n"; + +// Allow external download +print ''; +print ''; +print ''; print ''; /* diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index eb6ff17e411..55271091db1 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -55,6 +55,8 @@ if (empty($conf->global->CONTRACT_ADDON)) { include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +$error=0; + if ($action == 'updateMask') { $maskconst = GETPOST('maskconstcontract', 'alpha'); $maskvalue = GETPOST('maskcontract', 'alpha'); @@ -158,10 +160,37 @@ if ($action == 'updateMask') { if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 0, 'int', $conf->entity)) { $error++; } -} elseif ($action == "allowexternaldownload") { - if (!dolibarr_set_const($db, "CONTRACT_ALLOW_EXTERNAL_DOWNLOAD", $value, 0, 'int', $conf->entity)) { +} elseif (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $value = (GETPOST($code) ? GETPOST($code) : 1); + + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { $error++; } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} elseif (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + $res = dolibarr_del_const($db, $code, $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } } @@ -504,16 +533,8 @@ print ''; // Allow external download print ''; print ''; -print ''; print ''; print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Other').' ('.$langs->trans("NotUsed").')'; - $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); } print '
    '.$langs->trans('Label').'
    '.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Other').' ('.$langs->trans("NotUsed").''; - $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '; @@ -1795,9 +1798,9 @@ while ($i < min($num, $limit)) { print ''; } print '
    '.$header.''.$langs->trans("Status").''.$langs->trans("Status").'
    '; + print ''; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff($key); From fde8d2865fe96fe29374a8fba4bb74bb36736521 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 02:06:02 +0200 Subject: [PATCH 1170/1289] Add a line into log --- htdocs/public/payment/newpayment.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 0941446b4fc..1c74e3836be 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -342,9 +342,9 @@ $creditor = $mysoc->name; $paramcreditor = 'ONLINE_PAYMENT_CREDITOR'; $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix; if (!empty($conf->global->$paramcreditorlong)) { - $creditor = $conf->global->$paramcreditorlong; + $creditor = $conf->global->$paramcreditorlong; // use label long of the seller to show } elseif (!empty($conf->global->$paramcreditor)) { - $creditor = $conf->global->$paramcreditor; + $creditor = $conf->global->$paramcreditor; // use label short of the seller to show } $mesg = ''; @@ -356,6 +356,8 @@ $mesg = ''; // Action dopayment is called after clicking/choosing the payment mode if ($action == 'dopayment') { + dol_syslog("--- newpayment.php Execute action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_stripe'); + if ($paymentmethod == 'paypal') { $PAYPAL_API_PRICE = price2num(GETPOST("newamount", 'alpha'), 'MT'); $PAYPAL_PAYMENT_TYPE = 'Sale'; From 4b7655b784c155ead43b0a754eb0175156ccd929 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 02:21:04 +0200 Subject: [PATCH 1171/1289] Fix log --- htdocs/public/payment/newpayment.php | 64 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1c74e3836be..0a70c6c5204 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -356,7 +356,7 @@ $mesg = ''; // Action dopayment is called after clicking/choosing the payment mode if ($action == 'dopayment') { - dol_syslog("--- newpayment.php Execute action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_stripe'); + dol_syslog("--- newpayment.php Execute action = ".$action." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment'); if ($paymentmethod == 'paypal') { $PAYPAL_API_PRICE = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -493,9 +493,9 @@ if ($action == 'charge' && isModEnabled('stripe')) { $amountstripe = $amountstripe * 100; } - dol_syslog("--- newpayment.php Execute action = ".$action." STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=".getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION'), LOG_DEBUG, 0, '_stripe'); - dol_syslog("GET=".var_export($_GET, true), LOG_DEBUG, 0, '_stripe'); - dol_syslog("POST=".var_export($_POST, true), LOG_DEBUG, 0, '_stripe'); + dol_syslog("--- newpayment.php Execute action = ".$action." STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=".getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION'), LOG_DEBUG, 0, '_payment'); + dol_syslog("GET=".var_export($_GET, true), LOG_DEBUG, 0, '_payment'); + dol_syslog("POST=".var_export($_POST, true), LOG_DEBUG, 0, '_payment'); $stripeToken = GETPOST("stripeToken", 'alpha'); $email = GETPOST("email", 'alpha'); @@ -505,10 +505,10 @@ if ($action == 'charge' && isModEnabled('stripe')) { $vatnumber = GETPOST('vatnumber', 'alpha'); $savesource = GETPOSTISSET('savesource') ? GETPOST('savesource', 'int') : 1; - dol_syslog("POST stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe'); - dol_syslog("POST email = ".$email, LOG_DEBUG, 0, '_stripe'); - dol_syslog("POST thirdparty_id = ".$thirdparty_id, LOG_DEBUG, 0, '_stripe'); - dol_syslog("POST vatnumber = ".$vatnumber, LOG_DEBUG, 0, '_stripe'); + dol_syslog("POST stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_payment'); + dol_syslog("POST email = ".$email, LOG_DEBUG, 0, '_payment'); + dol_syslog("POST thirdparty_id = ".$thirdparty_id, LOG_DEBUG, 0, '_payment'); + dol_syslog("POST vatnumber = ".$vatnumber, LOG_DEBUG, 0, '_payment'); $error = 0; $errormessage = ''; @@ -529,7 +529,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { } if ($thirdparty_id > 0) { - dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe'); + dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_payment'); $service = 'StripeTest'; $servicestatus = 0; @@ -548,7 +548,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); if (empty($customer)) { $error++; - dol_syslog('Failed to get/create stripe customer for thirdparty id = '.$thirdparty_id.' and servicestatus = '.$servicestatus.': '.$stripe->error, LOG_ERR, 0, '_stripe'); + dol_syslog('Failed to get/create stripe customer for thirdparty id = '.$thirdparty_id.' and servicestatus = '.$servicestatus.': '.$stripe->error, LOG_ERR, 0, '_payment'); setEventMessages('Failed to get/create stripe customer for thirdparty id = '.$thirdparty_id.' and servicestatus = '.$servicestatus.': '.$stripe->error, null, 'errors'); $action = ''; } @@ -563,7 +563,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { if (empty($card)) { $error++; - dol_syslog('Failed to create card record', LOG_WARNING, 0, '_stripe'); + dol_syslog('Failed to create card record', LOG_WARNING, 0, '_payment'); setEventMessages('Failed to create card record', null, 'errors'); $action = ''; } else { @@ -577,7 +577,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { $metadata["dol_type"] = $dol_type; } - dol_syslog("Create charge on card ".$card->id, LOG_DEBUG, 0, '_stripe'); + dol_syslog("Create charge on card ".$card->id, LOG_DEBUG, 0, '_payment'); $charge = \Stripe\Charge::create(array( 'amount' => price2num($amountstripe, 'MU'), 'currency' => $currency, @@ -591,7 +591,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) if (empty($charge)) { $error++; - dol_syslog('Failed to charge card', LOG_WARNING, 0, '_stripe'); + dol_syslog('Failed to charge card', LOG_WARNING, 0, '_payment'); setEventMessages('Failed to charge card', null, 'errors'); $action = ''; } @@ -609,7 +609,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { if (empty($vatcleaned)) $taxinfo=null; */ - dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_stripe'); + dol_syslog("Create anonymous customer card profile", LOG_DEBUG, 0, '_payment'); $customer = \Stripe\Customer::create(array( 'email' => $email, @@ -646,7 +646,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { // The customer was just created with a source, so we can make a charge // with no card defined, the source just used for customer creation will be used. - dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); + dol_syslog("Create charge", LOG_DEBUG, 0, '_payment'); $charge = \Stripe\Charge::create(array( 'customer' => $customer->id, 'amount' => price2num($amountstripe, 'MU'), @@ -659,7 +659,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) if (empty($charge)) { $error++; - dol_syslog('Failed to charge card', LOG_WARNING, 0, '_stripe'); + dol_syslog('Failed to charge card', LOG_WARNING, 0, '_payment'); setEventMessages('Failed to charge card', null, 'errors'); $action = ''; } @@ -678,21 +678,21 @@ if ($action == 'charge' && isModEnabled('stripe')) { $error++; $errormessage = "ErrorCard ".$e->getMessage()." err=".var_export($err, true); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (\Stripe\Error\RateLimit $e) { // Too many requests made to the API too quickly $error++; $errormessage = "ErrorRateLimit ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (\Stripe\Error\InvalidRequest $e) { // Invalid parameters were supplied to Stripe's API $error++; $errormessage = "ErrorInvalidRequest ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (\Stripe\Error\Authentication $e) { @@ -700,14 +700,14 @@ if ($action == 'charge' && isModEnabled('stripe')) { // (maybe you changed API keys recently) $error++; $errormessage = "ErrorAuthentication ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (\Stripe\Error\ApiConnection $e) { // Network communication with Stripe failed $error++; $errormessage = "ErrorApiConnection ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (\Stripe\Error\Base $e) { @@ -715,14 +715,14 @@ if ($action == 'charge' && isModEnabled('stripe')) { // yourself an email $error++; $errormessage = "ErrorBase ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } catch (Exception $e) { // Something else happened, completely unrelated to Stripe $error++; $errormessage = "ErrorException ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } @@ -757,7 +757,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { } catch (Exception $e) { $error++; $errormessage = "CantRetrievePaymentIntent ".$e->getMessage(); - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; } @@ -765,13 +765,13 @@ if ($action == 'charge' && isModEnabled('stripe')) { if ($paymentintent->status != 'succeeded') { $error++; $errormessage = "StatusOfRetrievedIntent is not succeeded: ".$paymentintent->status; - dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); + dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($paymentintent->status, null, 'errors'); $action = ''; } else { // TODO We can also record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here. - //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe'); + //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_payment'); // Get here amount and currency used for payment and force value into $amount and $currency so the real amount is saved into session instead // of the amount and currency retreived from the POST. @@ -801,11 +801,11 @@ if ($action == 'charge' && isModEnabled('stripe')) { $_SESSION['TRANSACTIONID'] = (is_object($charge) ? $charge->id : (is_object($paymentintent) ? $paymentintent->id : '')); $_SESSION['errormessage'] = $errormessage; - dol_syslog("Action charge stripe STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=".getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')." ip=".$remoteip, LOG_DEBUG, 0, '_stripe'); - dol_syslog("onlinetoken=".$_SESSION["onlinetoken"]." FinalPaymentAmt=".$_SESSION["FinalPaymentAmt"]." currencyCodeType=".$_SESSION["currencyCodeType"]." payerID=".$_SESSION['payerID']." TRANSACTIONID=".$_SESSION['TRANSACTIONID'], LOG_DEBUG, 0, '_stripe'); - dol_syslog("FULLTAG=".$FULLTAG, LOG_DEBUG, 0, '_stripe'); - dol_syslog("error=".$error." errormessage=".$errormessage, LOG_DEBUG, 0, '_stripe'); - dol_syslog("Now call the redirect to paymentok or paymentko, URL = ".($error ? $urlko : $urlok), LOG_DEBUG, 0, '_stripe'); + dol_syslog("Action charge stripe STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=".getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')." ip=".$remoteip, LOG_DEBUG, 0, '_payment'); + dol_syslog("onlinetoken=".$_SESSION["onlinetoken"]." FinalPaymentAmt=".$_SESSION["FinalPaymentAmt"]." currencyCodeType=".$_SESSION["currencyCodeType"]." payerID=".$_SESSION['payerID']." TRANSACTIONID=".$_SESSION['TRANSACTIONID'], LOG_DEBUG, 0, '_payment'); + dol_syslog("FULLTAG=".$FULLTAG, LOG_DEBUG, 0, '_payment'); + dol_syslog("error=".$error." errormessage=".$errormessage, LOG_DEBUG, 0, '_payment'); + dol_syslog("Now call the redirect to paymentok or paymentko, URL = ".($error ? $urlko : $urlok), LOG_DEBUG, 0, '_payment'); if ($error) { header("Location: ".$urlko); @@ -834,6 +834,8 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +dol_syslog("newpayment.php show page paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment'); + // Check link validity if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) { $langs->load("errors"); From fb9ec11ffb3e1fbafd4364cdd2f17af42ea57382 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 02:37:08 +0200 Subject: [PATCH 1172/1289] Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead. --- ChangeLog | 1 + htdocs/admin/workflow.php | 16 ++++++++-------- htdocs/expedition/class/expedition.class.php | 15 --------------- htdocs/reception/class/reception.class.php | 15 --------------- 4 files changed, 9 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2376592a12f..9432bdea4d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Following changes may create regressions for some external modules, but were nec * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. * All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead * Code standardization: $user->rights->propale is now $user->rights->propal everywhere. +* Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead. ***** ChangeLog for 16.0.1 compared to 16.0.0 ***** diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 2e3473d4a99..675815f1dbb 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -152,14 +152,6 @@ $workflowcodes = array( 'warning'=>'' ), - // Automatic classification reception - 'WORKFLOW_BILL_ON_RECEPTION'=>array( - 'family'=>'classify_reception', - 'position'=>80, - 'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), - 'picto'=>'reception' - ), - // Automatic classification shipping 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', @@ -168,6 +160,14 @@ $workflowcodes = array( 'picto' => 'shipment' ), + // Automatic classification reception + 'WORKFLOW_BILL_ON_RECEPTION'=>array( + 'family'=>'classify_reception', + 'position'=>95, + 'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), + 'picto'=>'reception' + ), + 'separator2'=>array('family'=>'separator', 'position'=>400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))), // Automatic link ticket -> contract diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 82ba1d36040..d3981dcf264 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2243,21 +2243,6 @@ class Expedition extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on) - * - * @deprecated - * @see setBilled() - * @return int <0 if ko, >0 if ok - */ - public function set_billed() - { - // phpcs:enable - dol_syslog(get_class($this)."::set_billed is deprecated, use setBilled instead", LOG_NOTICE); - return $this->setBilled(); - } - /** * Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on) * diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 47b4bcdeb0d..912f2cae93f 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1641,21 +1641,6 @@ class Reception extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on) - * - * @deprecated - * @see setBilled() - * @return int <0 if ko, >0 if ok - */ - public function set_billed() - { - // phpcs:enable - dol_syslog(get_class($this)."::set_billed is deprecated, use setBilled instead", LOG_NOTICE); - return $this->setBilled(); - } - /** * Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on) * From 035c08536c9cdbca5af4055728081a2aadd6f317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Oct 2022 03:32:03 +0200 Subject: [PATCH 1173/1289] Standardization of the name of some constant (customer match supplier) --- htdocs/admin/workflow.php | 2 +- htdocs/core/modules/modWorkflow.class.php | 1 - ...e_20_modWorkflow_WorkflowManager.class.php | 25 +++++++++++++------ htdocs/langs/en_US/workflow.lang | 4 +-- htdocs/reception/class/reception.class.php | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 675815f1dbb..cf55c7b9127 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -161,7 +161,7 @@ $workflowcodes = array( ), // Automatic classification reception - 'WORKFLOW_BILL_ON_RECEPTION'=>array( + 'WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE'=>array( 'family'=>'classify_reception', 'position'=>95, 'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index cc7e478e379..58da4876d32 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -93,7 +93,6 @@ class modWorkflow extends DolibarrModules 6=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 0, 'current', 0), 7=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 0, 'current', 0), 8=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0), - 9=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0), 10=>array('WORKFLOW_TICKET_LINK_CONTRACT', 'chaine', '0', 'Automatically link a ticket to available contracts', 0, 'current', 0), 11=>array('WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS', 'chaine', '0', 'Search among parent companies contracts when automatically linking a ticket to available contracts', 0, 'current', 0), 11=>array('WORKFLOW_TICKET_CREATE_INTERVENTION', 'chaine', '1', 'WORKFLOW_TICKET_CREATE_INTERVENTION', 0, 'current', 0) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 119a0122cb6..abaadfc85a8 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -181,14 +181,23 @@ class InterfaceWorkflowManager extends DolibarrTriggers } if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { - /** @var Facture $object */ $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); - if (!empty($object->linkedObjects)) { - /** @var Expedition $shipment */ - $shipment = array_shift($object->linkedObjects['shipping']); - - $ret = $shipment->setClosed(); + $totalonlinkedelements = 0; + foreach ($object->linkedObjects['shipping'] as $element) { + if ($element->statut == Expedition::STATUS_VALIDATED) { + $totalonlinkedelements += $element->total_ht; + } + } + dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + if ($totalonlinkedelements == $object->total_ht) { + foreach ($object->linkedObjects['shipping'] as $element) { + $ret = $element->setClosed(); + if ($ret < 0) { + return $ret; + } + } + } } } @@ -244,8 +253,8 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - // Then set reception to "Billed" if WORKFLOW_BILL_ON_RECEPTION is set - if (isModEnabled("reception") && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { + // Then set reception to "Billed" if WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE is set + if (isModEnabled("reception") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE)) { $object->fetchObjectLinked('', 'reception', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index 803a31c9646..a2b6b4c1f95 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -22,7 +22,7 @@ descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked sourc descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION=Classify linked source purchase order as received when a reception is validated (and if the quantity received by all receptions is the same as in the purchase order to update) descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED=Classify linked source purchase order as received when a reception is closed (and if the quantity received by all rceptions is the same as in the purchase order to update) # Autoclassify purchase invoice -descWORKFLOW_BILL_ON_RECEPTION=Classify receptions to "billed" when a linked supplier order is validated +descWORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE=Classify receptions to "billed" when a linked purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) # Automatically link ticket to contract descWORKFLOW_TICKET_LINK_CONTRACT=When creating a ticket, link available contracts of matching thirdparty descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS=When linking contracts, search among those of parents companies @@ -31,6 +31,6 @@ descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the tic AutomaticCreation=Automatic creation AutomaticClassification=Automatic classification # Autoclassify shipment -descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated +descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked shipments) AutomaticClosing=Automatic closing AutomaticLinking=Automatic linking diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 912f2cae93f..1abfb49fb4c 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1642,7 +1642,7 @@ class Reception extends CommonObject } /** - * Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on) + * Classify the reception as invoiced (used when WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE is on) * * @return int <0 if ko, >0 if ok */ From 2f60b5f847b16650c5206a7c59af459f6899b34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Oct 2022 10:29:18 +0200 Subject: [PATCH 1174/1289] add ceil in evalmath --- htdocs/core/class/evalmath.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index 5c659344465..f2dfb80960e 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -113,7 +113,8 @@ class EvalMath // constants public $fb = array( // built-in functions - 'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval'); + 'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval', 'ceil', + ); /** * Constructor From 02942e844e5e94b4289caf96c29397244e7683a8 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 27 Oct 2022 15:26:40 +0200 Subject: [PATCH 1175/1289] Fix propal page reload : use thirdparty values --- htdocs/comm/propal/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c737ea63ebe..64f58e4d705 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1635,13 +1635,13 @@ if ($action == 'create') { // Terms of payment print '
    '.$langs->trans('PaymentConditionsShort').''; print img_picto('', 'paiment'); - $form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1); + $form->select_conditions_paiements((GETPOST('cond_reglement_id', 'int') > 0 ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1); print '
    '.$langs->trans('PaymentMode').''; print img_picto('', 'bank').' '; - $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); + $form->select_types_paiements((GETPOST('mode_reglement_id', 'int') > 0 ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); print '
    '.$langs->trans("AllowExternalDownload").''; +print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print '
    '.$langs->trans("AllowExternalDownload").''; -if ($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD) { - print ''; - print img_picto($langs->trans("Activited"), 'switch_on'); - print ''; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; -} +print ''; +print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); print '
    '; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index cdb7794c4d2..d2e1ec4ea25 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -232,6 +232,37 @@ if ($action == 'updateMask') { if (!($res > 0)) { $error++; } +} elseif (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $value = (GETPOST($code) ? GETPOST($code) : 1); + + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} elseif (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + $res = dolibarr_del_const($db, $code, $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } } @@ -771,20 +802,15 @@ print ''; print '
    '.$langs->trans("InvoiceCheckPosteriorDate"). ' ' ; print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help') . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); -} else { - print '
    '; - print ''; - print ''; - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_CHECK_POSTERIOR_DATE", $arrval, $conf->global->INVOICE_CHECK_POSTERIOR_DATE); - print '
    '; - print ''; - print ''; -} +print ''; +print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); +print '
    '.$langs->trans("AllowExternalDownload").''; +print ajax_constantonoff('INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); print '
    '; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index c24446fb1bd..7883cc7da20 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -625,6 +625,15 @@ print ''; +print ''.$langs->trans("AllowExternalDownload").''; +print ''; +print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print ''; + + + // default update prices on cloning a proposal /* print '
    '; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index fa3702d36b7..993e19fc796 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -178,6 +178,37 @@ if ($action == 'set') { // par appel methode canBeActivated dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON", $value, 'chaine', 0, '', $conf->entity); +} elseif (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $value = (GETPOST($code) ? GETPOST($code) : 1); + + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} elseif (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + $res = dolibarr_del_const($db, $code, $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } } @@ -502,21 +533,20 @@ print '
    '; if (isModEnabled('banque')) { print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; - if (!empty($conf->use_javascript_ajax)) { - print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); - } else { - if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; - } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; - } - } + print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); print ''; } else { print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').''; } +// Allow external download +print ''; +print ''.$langs->trans("AllowExternalDownload").' '; +print ''; +print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print ''; + print ''; diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index f0db53f3ddd..a485f97a553 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -102,7 +102,6 @@ TypeContact_contrat_external_CUSTOMER=Follow-up customer contact TypeContact_contrat_external_SALESREPSIGN=Signing contract customer contact HideClosedServiceByDefault=Hide closed services by default AllowOnlineSign=Allow online signing -AllowExternalDownload=Allow external download ShowClosedServices=Show Closed Services HideClosedServices=Hide Closed Services UserStartingService=User starting service diff --git a/htdocs/langs/es_US/admin.lang b/htdocs/langs/es_US/admin.lang index c5ab56cb8d8..f59ee2569c5 100644 --- a/htdocs/langs/es_US/admin.lang +++ b/htdocs/langs/es_US/admin.lang @@ -3,3 +3,4 @@ OperationParamDesc=Define the rules to use to extract or set values.
    Example EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it.
    For example, if you want to create a thirdparty with a name extracted from a string 'Name: name to find' present into the body, use the sender email as email, you can set the parameter field like this:
    'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'
    IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +AllowExternalDownload=Allow external download diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3f45fc1643d..8ba3c5802ca 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -2329,3 +2329,4 @@ HelpCssOnViewDesc=Le CSS utilisé lors de l'affichage du champ. HelpCssOnListDesc=Le CSS utilisé lorsque le champ est à l'intérieur du tableau d'une liste.
    Exemple : "tdoverflowmax200" RECEPTION_PDF_HIDE_ORDERED=Masquer la quantité commandée sur les documents générés pour les réceptions MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Afficher le prix sur les documents générés pour les réceptions +AllowExternalDownload=Autoriser le téléchargement externe diff --git a/htdocs/langs/fr_FR/contracts.lang b/htdocs/langs/fr_FR/contracts.lang index 3c3d5620d1a..7d6bfc6f2e0 100644 --- a/htdocs/langs/fr_FR/contracts.lang +++ b/htdocs/langs/fr_FR/contracts.lang @@ -102,7 +102,6 @@ TypeContact_contrat_external_CUSTOMER=Contact client suivi contrat TypeContact_contrat_external_SALESREPSIGN=Contact client signataire contrat HideClosedServiceByDefault=Masquer les services fermés par défaut AllowOnlineSign=Autoriser la signature en ligne -AllowExternalDownload=Autoriser le téléchargement externe ShowClosedServices=Afficher les services fermés HideClosedServices=Masquer les services fermés UserStartingService=Utilisateur démarrant le service From 7c1a7a03af9c61faaace857be729813f7e9cc82d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 12:18:21 +0200 Subject: [PATCH 1184/1289] FIX Regression page nb was broken on bottom of PDF --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3899af425bc..f71a6ed6d3c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1282,8 +1282,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Show page nb only on iso languages (so default Helvetica font) if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') { $pdf->SetXY($dims['wk'] - $dims['rm'] - 18, -$posy); - //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; - $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0); + //$pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0); + $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); } // Show Draft Watermark From 6645693b450b296e07a9499f28c96bc20c5549db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 12:34:49 +0200 Subject: [PATCH 1185/1289] Remove useless html colspan --- htdocs/admin/system/dolibarr.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 7fa1ef252cb..144580b83af 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -149,25 +149,26 @@ print '
    '; // Session print '
    '; print ''; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print '\n"; -print ''."\n"; -print ''."\n"; +print ''."\n"; -print ''."\n"; -print ''."\n"; print ''."\n"; -print ''; + print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).''; print ''; diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 0e59adfc166..de9eb46631c 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -106,7 +106,7 @@ if ($id > 0 || $ref) { print ''; + print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).''; print ''; diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 8d88d761956..3b15676792e 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -100,7 +100,7 @@ if ($id > 0 || $ref) { print ''; + print '   '.$langs->trans("By").' '.$muser->getNomUrl(-1).''; print ''; @@ -135,7 +135,7 @@ if ($id > 0 || $ref) { print ''; print ''; - print ''; } - // End date + // Date validation if (!empty($arrayfields['cp.date_valid']['checked'])) { print ''; } + // Date appoval + if (!empty($arrayfields['cp.date_approval']['checked'])) { + print ''; + } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook @@ -705,6 +713,9 @@ if ($resql) { if (!empty($arrayfields['cp.date_valid']['checked'])) { print_liste_field_titre($arrayfields['cp.date_valid']['label'], $_SERVER["PHP_SELF"], "cp.date_valid", "", $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($arrayfields['cp.date_approval']['checked'])) { + print_liste_field_titre($arrayfields['cp.date_approval']['label'], $_SERVER["PHP_SELF"], "cp.date_approval", "", $param, '', $sortfield, $sortorder, 'center '); + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -839,18 +850,20 @@ if ($resql) { $totalarray['nbfield']++; } } + // Date validation if (!empty($arrayfields['cp.date_valid']['checked'])) { // date_valid is both date_valid but also date_approval - print ''; if (!$i) $totalarray['nbfield']++; } - /*if (!empty($arrayfields['cp.date_approve']['checked'])) { - print ''; - if (!$i) $totalarray['nbfield']++; - }*/ + // Date approval + if (!empty($arrayfields['cp.date_approval']['checked'])) { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; From 40d18331542e8bfab73006cf5ae3ef6be49cc90e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Oct 2022 12:19:41 +0200 Subject: [PATCH 1209/1289] Prepare support of --force option on crons --- scripts/cron/cron_run_jobs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index ee866203665..1d95a745e1c 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -164,6 +164,10 @@ $user->getrights(); if (isset($argv[3]) && $argv[3]) { $id = $argv[3]; } +$forcequalified = 0; +if (isset($argv[4]) && $argv[4] == '--force') { + $forcequalified = 1; +} // create a jobs object $object = new Cronjob($db); @@ -313,7 +317,7 @@ exit(0); */ function usage($path, $script_file) { - print "Usage: ".$script_file." securitykey userlogin|'firstadmin' [cronjobid]\n"; + print "Usage: ".$script_file." securitykey userlogin|'firstadmin' [cronjobid] [--force]\n"; print "The script return 0 when everything worked successfully.\n"; print "\n"; print "On Linux system, you can have cron jobs ran automatically by adding an entry into cron.\n"; From 41175b73ee05c9c49b27132b02dafa866d483382 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Oct 2022 12:57:14 +0200 Subject: [PATCH 1210/1289] NEW add option --force on CLI cron_run_jobs.php This allow to execute cron even if date is not yeat reached --- scripts/cron/cron_run_jobs.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 1d95a745e1c..630ae8c9948 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -92,7 +92,7 @@ $hookmanager->initHooks(array('cli')); $now = dol_now(); @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=".$userlogin." ***** ".dol_print_date($now, 'dayhourrfc')." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." - userlogin=".$userlogin." - ".dol_print_date($now, 'dayhourrfc')." *****\n"; // Check module cron is activated if (empty($conf->cron->enabled)) { @@ -250,7 +250,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { } //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database - if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) { + if ($forcequalified || (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now))) { echo " - qualified"; dol_syslog("cron_run_jobs.php line->datenextrun:".dol_print_date($line->datenextrun, 'dayhourrfc')." line->datestart:".dol_print_date($line->datestart, 'dayhourrfc')." line->dateend:".dol_print_date($line->dateend, 'dayhourrfc')." now:".dol_print_date($now, 'dayhourrfc')); @@ -325,4 +325,6 @@ function usage($path, $script_file) print "30 3 * * * ".$path.$script_file." securitykey userlogin > ".DOL_DATA_ROOT."/".$script_file.".log\n"; print "For example, to run pending tasks every 5mn, you can add this line:\n"; print "*/5 * * * * ".$path.$script_file." securitykey userlogin > ".DOL_DATA_ROOT."/".$script_file.".log\n"; + print "\n"; + print "The option --force allow to bypass the check on date of execution so job will be executed even if date is not yet reached.\n"; } From d5ad0090a0bb5a204078948e6d11350401d6ddd9 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 29 Oct 2022 17:56:03 +0200 Subject: [PATCH 1211/1289] sql var not quoted --- htdocs/partnership/partnership_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 0aba38fd7e3..36a0fd39218 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -335,7 +335,7 @@ if ($object->ismultientitymanaged == 1) { } if ($managedfor == 'member') { if ($memberid > 0) { - $sql .= " AND t.fk_member = ".$memberid; + $sql .= " AND t.fk_member = ".((int) $memberid); } else { $sql .= " AND fk_member > 0"; } From 8efaf03ec9526bf3eb84ab1dd6d742e7752fef12 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:49:03 +0200 Subject: [PATCH 1212/1289] FIX - php 8 totalarray --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..4114f5f4129 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,6 +1887,8 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; + $totalarray['val']['c.total_tva'] = 0; + $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From 1d08d2c8ab3a32f557a40fd540d6e9762143d18e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:50:06 +0200 Subject: [PATCH 1213/1289] erreur --- htdocs/commande/list.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4114f5f4129..455420ce90a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,8 +1887,6 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; - $totalarray['val']['c.total_tva'] = 0; - $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From df2f3b046928de3db14eecbf5d4754146fe59a6e Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:50:23 +0200 Subject: [PATCH 1214/1289] FIX - php 8 totalarray --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..4114f5f4129 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,6 +1887,8 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; + $totalarray['val']['c.total_tva'] = 0; + $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); From 1c0dd84d6f11de6d9195f9d389e54244bfdda46f Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 29 Oct 2022 21:57:58 +0200 Subject: [PATCH 1215/1289] OK --- htdocs/commande/list.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4114f5f4129..53e95ff649f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1887,8 +1887,6 @@ if ($resql) { $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; - $totalarray['val']['c.total_tva'] = 0; - $totalarray['val']['c.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); @@ -2194,7 +2192,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva'; } - $totalarray['val']['c.total_tva'] += $obj->total_tva; + if (isset($totalarray['val']['c.total_tva'])) { + $totalarray['val']['c.total_tva'] += $obj->total_tva; + } else { + $totalarray['val']['c.total_tva'] = $obj->total_tva; + } } // Amount TTC / gross @@ -2206,7 +2208,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc'; } - $totalarray['val']['c.total_ttc'] += $obj->total_ttc; + if (isset($totalarray['val']['c.total_ttc'])) { + $totalarray['val']['c.total_ttc'] += $obj->total_ttc; + } else { + $totalarray['val']['c.total_ttc'] = $obj->total_ttc; + } } // Currency From d15493e50dbfc8040a6f6cd18aa9413176ced637 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 30 Oct 2022 02:59:11 +0200 Subject: [PATCH 1216/1289] massacrtion for updating product prices --- htdocs/core/actions_massactions.inc.php | 44 +++++++++++++++++++++++++ htdocs/core/tpl/massactions_pre.tpl.php | 18 ++++++++++ htdocs/langs/en_US/main.lang | 3 ++ htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/main.lang | 5 ++- htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/list.php | 4 +-- 7 files changed, 73 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 49cc6fa873c..7539bb028a4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1240,6 +1240,50 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } } +if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) { + $db->begin(); + if (GETPOSTISSET('pricevariation')) { + $pricepercentage=GETPOST('pricevariation', 'int'); + if ($pricepercentage == 0) { + setEventMessages($langs->trans("RecordsModified", 0), null); + } else { + foreach ($toselect as $toselectid) { + $result = $object->fetch($toselectid); + //var_dump($contcats);exit; + if ($result > 0) { + if ($obj->price_base_type == 'TTC') { + $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; + $minprice = $object->price_min_ttc; + } else { + $newprice = $object->price * (100 + $pricepercentage) / 100; + $minprice = $object->price_min; + } + $res = $object->updatePrice($newprice, $obj->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } + } + } + } + + if (!$error) { + if ($nbok > 0) { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } + $db->commit(); + $toselect=array(); + } else { + $db->rollback(); + } +} + if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) { $db->begin(); $supervisortoset=GETPOST('supervisortoset'); diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index f09d7defeb1..74ae317d938 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -78,6 +78,23 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } } +if ($massaction == 'preupdateprice' && isModEnabled('category')) { + $formquestion = array(); + + $valuefield = '
    '; + $valuefield .= '%'; + $valuefield .= '
    '; + + $formquestion[] = array( + 'type' => 'other', + 'name' => 'pricevariation', + 'label' => $langs->trans("PriceVariation"), + 'value' => $valuefield + ); + + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)), "updateprice", $formquestion, 1, 0, 200, 500, 1); +} + if ($massaction == 'presetsupervisor') { $formquestion = array(); @@ -96,6 +113,7 @@ if ($massaction == 'presetsupervisor') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1); } + if ($massaction == 'presend') { $langs->load("mails"); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 325e27b6606..a21d6633718 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1150,9 +1150,12 @@ SetSupervisor=Set Supervisor CreateExternalUser=Create external user ConfirmAffectTag=Bulk Tag Affect ConfirmSetSupervisor=Bulk Supervisor Set +ConfirmUpdatePrice=Choose a price update percentage ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)? +ConfirmUpdatePriceQuestion=Are you sure you want to update the price of the %s selected record(s)? CategTypeNotFound=No tag type found for type of records +PriceVariation=Price variation SupervisorNotFound=Supervisor not found CopiedToClipboard=Copied to clipboard InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index fa2ed9669d9..39f09917d99 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -416,6 +416,7 @@ ProductsMergeSuccess=Products have been merged ErrorsProductsMerge=Errors in products merge SwitchOnSaleStatus=Switch on sale status SwitchOnPurchaseStatus=Switch on purchase status +UpdatePrice=Update price StockMouvementExtraFields= Extra Fields (stock mouvement) InventoryExtraFields= Extra Fields (inventory) ScanOrTypeOrCopyPasteYourBarCodes=Scan or type or copy/paste your barcodes diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 2c376c887bf..c51ee2b09fa 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -566,7 +566,7 @@ None=Aucun NoneF=Aucune NoneOrSeveral=Aucun ou plusieurs Late=Retard -LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes +LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes NoItemLate=Aucun élément en retard Photo=Photo Photos=Photos @@ -1150,9 +1150,12 @@ SetSupervisor=Choisir un superviseur CreateExternalUser=Créer utilisateur externe ConfirmAffectTag=Affecter les tags en masse ConfirmSetSupervisor=Choisir un superviseur en masse +ConfirmUpdatePrice=Choisir un pourcentage de hausse/baisse des prix ConfirmAffectTagQuestion=Êtes-vous sur de vouloir affecter ces catégories aux %s lignes sélectionnées ? ConfirmSetSupervisorQuestion=Êtes-vous sur de vouloir affecter ce superviseur aux %s lignes sélectionnées ? +ConfirmUpdatePriceQuestion=Êtes-vous sur de vouloir mettre à jour les prix des %s lignes sélectionnées ? CategTypeNotFound=Aucun type de tag trouvé pour ce type d'enregistrements +PriceVariation=Variation de prix SupervisorNotFound=Supervisuer non trouvé CopiedToClipboard=Copié dans le presse-papier InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération. diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 9061f0498fc..4a679dc4bd6 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -416,6 +416,7 @@ ProductsMergeSuccess=Produits fusionnés ErrorsProductsMerge=Erreur lors de la fusion des produits SwitchOnSaleStatus=Basculer le statut En vente SwitchOnPurchaseStatus=Basculer le statut En achat +UpdatePrice=Mettre à jour le prix StockMouvementExtraFields= Champs supplémentaires (mouvement de stock) InventoryExtraFields= Attributs supplémentaires (inventaire) ScanOrTypeOrCopyPasteYourBarCodes=Scannez ou tapez ou copiez/collez vos codes-barres diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 26f6a3a410c..76fba05b5a7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -310,7 +310,6 @@ if (GETPOST('cancel', 'alpha')) { if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } - $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -737,11 +736,12 @@ if ($resql) { if ($user->rights->{$rightskey}->creer) { $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); + $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); } if (isModEnabled('category') && $user->rights->{$rightskey}->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } - if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields'))) { + if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields', 'preupdateprice'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From 71e55ab7097dcc3df3ab4f5a1724a3497b02442d Mon Sep 17 00:00:00 2001 From: Faustin Date: Sun, 30 Oct 2022 02:37:56 +0100 Subject: [PATCH 1217/1289] Translation update --- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/tpl/massactions_pre.tpl.php | 6 +++--- htdocs/langs/en_US/main.lang | 4 ++-- htdocs/langs/en_US/products.lang | 2 +- htdocs/langs/fr_FR/main.lang | 2 +- htdocs/langs/fr_FR/products.lang | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 7539bb028a4..02d4215b963 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1242,8 +1242,8 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) { $db->begin(); - if (GETPOSTISSET('pricevariation')) { - $pricepercentage=GETPOST('pricevariation', 'int'); + if (GETPOSTISSET('pricerate')) { + $pricepercentage=GETPOST('pricerate', 'int'); if ($pricepercentage == 0) { setEventMessages($langs->trans("RecordsModified", 0), null); } else { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 74ae317d938..1e48fc4d5a0 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -82,13 +82,13 @@ if ($massaction == 'preupdateprice' && isModEnabled('category')) { $formquestion = array(); $valuefield = '
    '; - $valuefield .= '%'; + $valuefield .= '%'; $valuefield .= '
    '; $formquestion[] = array( 'type' => 'other', - 'name' => 'pricevariation', - 'label' => $langs->trans("PriceVariation"), + 'name' => 'pricerate', + 'label' => $langs->trans("Rate"), 'value' => $valuefield ); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a21d6633718..6f849e39be1 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1150,12 +1150,12 @@ SetSupervisor=Set Supervisor CreateExternalUser=Create external user ConfirmAffectTag=Bulk Tag Affect ConfirmSetSupervisor=Bulk Supervisor Set -ConfirmUpdatePrice=Choose a price update percentage +ConfirmUpdatePrice=Choose a increase/decrease price rate ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)? ConfirmUpdatePriceQuestion=Are you sure you want to update the price of the %s selected record(s)? CategTypeNotFound=No tag type found for type of records -PriceVariation=Price variation +Rate=Rate SupervisorNotFound=Supervisor not found CopiedToClipboard=Copied to clipboard InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 39f09917d99..3d5048d99a9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -416,7 +416,7 @@ ProductsMergeSuccess=Products have been merged ErrorsProductsMerge=Errors in products merge SwitchOnSaleStatus=Switch on sale status SwitchOnPurchaseStatus=Switch on purchase status -UpdatePrice=Update price +UpdatePrice=Increase/decrease customer price StockMouvementExtraFields= Extra Fields (stock mouvement) InventoryExtraFields= Extra Fields (inventory) ScanOrTypeOrCopyPasteYourBarCodes=Scan or type or copy/paste your barcodes diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index c51ee2b09fa..39d857ae0e8 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -1155,7 +1155,7 @@ ConfirmAffectTagQuestion=Êtes-vous sur de vouloir affecter ces catégories aux ConfirmSetSupervisorQuestion=Êtes-vous sur de vouloir affecter ce superviseur aux %s lignes sélectionnées ? ConfirmUpdatePriceQuestion=Êtes-vous sur de vouloir mettre à jour les prix des %s lignes sélectionnées ? CategTypeNotFound=Aucun type de tag trouvé pour ce type d'enregistrements -PriceVariation=Variation de prix +Rate=Taux SupervisorNotFound=Supervisuer non trouvé CopiedToClipboard=Copié dans le presse-papier InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération. diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 4a679dc4bd6..2592548059c 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -416,7 +416,7 @@ ProductsMergeSuccess=Produits fusionnés ErrorsProductsMerge=Erreur lors de la fusion des produits SwitchOnSaleStatus=Basculer le statut En vente SwitchOnPurchaseStatus=Basculer le statut En achat -UpdatePrice=Mettre à jour le prix +UpdatePrice=Augmenter/baisser le prix de vente StockMouvementExtraFields= Champs supplémentaires (mouvement de stock) InventoryExtraFields= Attributs supplémentaires (inventaire) ScanOrTypeOrCopyPasteYourBarCodes=Scannez ou tapez ou copiez/collez vos codes-barres From ebcaa34134ca5d73f957a156f504cdc0b3f9a2fd Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 30 Oct 2022 16:42:54 +0100 Subject: [PATCH 1218/1289] NEw translation for shipping method API cf https://github.com/Dolibarr/dolibarr/pull/22699 --- htdocs/api/class/api_setup.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..54f08cb1df3 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1188,6 +1188,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number {@min 0} * @param int $active Shipping methodsm is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the method must be translated to * @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')" * * @url GET dictionary/shipping_methods @@ -1196,7 +1197,7 @@ class Setup extends DolibarrApi * * @throws RestException 400 */ - public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '') + public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') { $list = array(); @@ -1232,7 +1233,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $method = $this->db->fetch_object($result); + $this->translateLabel($method, $lang, '', array('dict')); + $list[] = $method; } } else { throw new RestException(400, $this->db->lasterror()); From 55d233e2da43880acfe3806938c56601676e80a2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 30 Oct 2022 17:19:32 +0100 Subject: [PATCH 1219/1289] NEW translate for contact type API cf #22699 --- htdocs/api/class/api_setup.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..aa05b5fc588 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -779,6 +779,7 @@ class Setup extends DolibarrApi * @param string $type To filter on type of contact * @param string $module To filter on module contacts * @param int $active Contact's type is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the civility must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of Contacts types * @@ -786,7 +787,7 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '') + public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang ='', $sqlfilters = '') { $list = array(); @@ -827,7 +828,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $contact_type = $this->db->fetch_object($result); + $this->translateLabel($contact_type, $lang, 'TypeContact_'.$contact_type->type.'_'.$contact_type->source.'_', array("eventorganization", "resource", "projects", "contracts", "bills", "orders", "agenda", "propal", "stocks", "supplier_proposal", "interventions", "sendings", "ticket")); + $list[] = $contact_type; } } else { throw new RestException(503, 'Error when retrieving list of contacts types : '.$this->db->lasterror()); From 82da70841fe8b293a4ee9734aafd6cd2200d33b5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 30 Oct 2022 16:20:15 +0000 Subject: [PATCH 1220/1289] Fixing style errors. --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index aa05b5fc588..c671053f84f 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -787,7 +787,7 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang ='', $sqlfilters = '') + public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang = '', $sqlfilters = '') { $list = array(); From 39f7b8399d575855ce40b407ce6270d6496f30c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Oct 2022 19:06:26 +0100 Subject: [PATCH 1221/1289] css --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index c70416fec6e..e361941b704 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -68,9 +68,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } print ''; print '
    '; - print ''; + print ''; print ''; - print ' - + '; $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $nowyearmonth = strftime("%Y-%m", dol_now()); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 53446163183..88e04e89303 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -310,7 +310,7 @@ print ''; $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $nowyearmonth = strftime("%Y-%m", dol_now()); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 4dbdd9f5be8..7d4483de6cf 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -304,7 +304,7 @@ function getDefaultDatesForTransfer() $date_end = dol_get_last_day($year_end, $month_end); } } elseif ($periodbydefaultontransfer == 1) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()); $pastmonthyear = $year_current; if ($pastmonth == 0) { @@ -312,7 +312,7 @@ function getDefaultDatesForTransfer() $pastmonthyear--; } } else { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 4109c30d335..e9c2b82ae22 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -41,7 +41,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index b4d11320411..e9fdd03a2be 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -54,7 +54,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'expensereport', $id, ''); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index f1ab4b08fec..162afb68077 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -43,7 +43,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php index b4277e559b1..0e3f9367e16 100644 --- a/htdocs/product/stock/fiche-valo.php +++ b/htdocs/product/stock/fiche-valo.php @@ -106,7 +106,7 @@ if ($id > 0) { /* ************************************************************************** */ print "
    \n"; - $year = strftime("%Y", time()); + $year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $file = $conf->stock->dir_temp.'/entrepot-'.$entrepot->id.'-'.($year).'.png'; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 6bf59ebeb0e..af98ee98540 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -52,7 +52,7 @@ if ($page < 0) { $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $offset = $limit * $page; -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); /* diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index ba293dea744..32498121045 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -41,7 +41,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year', 'int') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index dd807b7bb93..07b0199d480 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -44,7 +44,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index b1f5dbdc7f9..1e26bf5871a 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -36,7 +36,7 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 9ee2e52a226..5ba1b818137 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -459,7 +459,7 @@ if ($id > 0) { // Create if ($action == 'create') { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 4dfd0c84e0c..ba5d254f22b 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -51,7 +51,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'salaries', '', '', ''); -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 52965da8182..7e94af1a431 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -45,7 +45,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index a8a4363ba5c..d7793c3ced1 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -45,7 +45,7 @@ if (!$user->admin) { // Date range $year = GETPOST("year"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = strftime("%m", dol_now()); $year_start = $year_current; } else { From 88152eccda95c3c8f2ad9941e1e389c116399b03 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 31 Oct 2022 12:30:01 +0100 Subject: [PATCH 1226/1289] NEW add constant PROPAL_BYPASS_VALIDATED_STATUS --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0d560d741ce..07a950c5d5e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -462,7 +462,7 @@ if ($action == "nosign" && $permissiontoclose) { $error = 0; foreach ($toselect as $checked) { if ($tmpproposal->fetch($checked) > 0) { - if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) { + if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || !empty($conf->global->PROPAL_BYPASS_VALIDATED_STATUS)) { $tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED; if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) { setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs'); From 1e76422a500075a84aadcf159300bd8c966e3bd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2022 13:00:41 +0100 Subject: [PATCH 1227/1289] NEW Show picto and color into combo for selection of tags --- htdocs/categories/class/categorie.class.php | 1 + htdocs/comm/propal/list.php | 13 +++--- htdocs/core/class/html.form.class.php | 41 +++++++++++++------ htdocs/core/class/html.formcategory.class.php | 38 ++++++++++++----- htdocs/product/list.php | 2 +- 5 files changed, 66 insertions(+), 29 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d9a7eb4b1c7..b5719d388f3 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1152,6 +1152,7 @@ class Categorie extends CommonObject $this->cats[$obj->rowid]['color'] = $obj->color; $this->cats[$obj->rowid]['visible'] = $obj->visible; $this->cats[$obj->rowid]['ref_ext'] = $obj->ref_ext; + $this->cats[$obj->rowid]['picto'] = 'category'; $i++; } } else { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0d560d741ce..8b057a6c702 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -50,6 +50,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (isModEnabled('categorie')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); @@ -1080,13 +1084,12 @@ if ($resql) { $moreforfilter .= '
    '; } // If the user can view products - if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->hasRight('categorie', 'read') && ($user->rights->produit->lire || $user->rights->service->lire)) { + $searchCategoryProductOperator = -1; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
    '; $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1); - $moreforfilter .= '
    '; + $formcategory = new FormCategory($db); + $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle); } if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b104509a0c8..32f2fb9cde4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4859,7 +4859,7 @@ class Form * - int (id of category) * - string (categories ids seprated by comma) * - array (list of categories ids) - * @param int $outputmode 0=HTML select string, 1=Array + * @param int $outputmode 0=HTML select string, 1=Array, 2=Array extended * @param int $include [=0] Removed or 1=Keep only * @param string $morecss More CSS * @return string|array @@ -4892,7 +4892,7 @@ class Form while ($i < $num) { $objp = $this->db->fetch_object($result); if ($objp) { - $cate_arbo[$objp->rowid] = array('id'=>$objp->rowid, 'fulllabel'=>$objp->label); + $cate_arbo[$objp->rowid] = array('id'=>$objp->rowid, 'fulllabel'=>$objp->label, 'color'=>'', 'picto'=>'category'); } $i++; } @@ -4905,8 +4905,9 @@ class Form $cate_arbo = $cat->get_full_arbo($type, $markafterid, $include); } - $output = ''; if (is_array($cate_arbo)) { if (!count($cate_arbo)) { $output .= ''; @@ -4918,7 +4919,11 @@ class Form } else { $add = ''; } - $output .= ''; + $output .= '
    '.$langs->trans("Session").''.$langs->trans("Value").'
    '.$langs->trans("SessionSavePath").''.session_save_path().'
    '.$langs->trans("SessionName").''.session_name().'
    '.$langs->trans("SessionId").''.session_id().'
    '.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime)'.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); -print ''; +print '
    '.$langs->trans("Session").''.$langs->trans("Value").'
    '.$langs->trans("SessionSavePath").''.session_save_path().'
    '.$langs->trans("SessionName").''.session_name().'
    '.$langs->trans("SessionId").''.session_id().'
    '.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime)'; +print ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); print ''."\n"; print ''."\n"; print ''."\n"; print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"))); print "
    '.$langs->trans("CurrentTheme").''.$conf->theme.'
    '.$langs->trans("CurrentMenuHandler").''; +print '
    '.$langs->trans("CurrentTheme").''.$conf->theme.'
    '.$langs->trans("CurrentMenuHandler").''; print $conf->standard_menu; print '
    '.$langs->trans("Screen").''; +print '
    '.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
    '.$langs->trans("Session").''; +print '
    '.$langs->trans("Session").''; $i = 0; foreach ($_SESSION as $key => $val) { if ($i > 0) { From db1de27be669f1d64fccbabf8851a110dc0597f7 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 28 Oct 2022 12:36:48 +0200 Subject: [PATCH 1186/1289] Header Scroll index.php --- htdocs/takepos/index.php | 69 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8be5a97e465..05e910790fc 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -939,6 +939,65 @@ $( document ).ready(function() { } } ?> + + /* For Header Scroll */ + var elem1 = $("#topnav-left")[0]; + var elem2 = $("#topnav-right")[0]; + var checkOverflow = function() { + if (scrollBars().horizontal) $("#topnav").addClass("overflow"); + else $("#topnav").removeClass("overflow"); + } + + var scrollBars = function(){ + var container= $('#topnav')[0]; + return { + vertical:container.scrollHeight > container.clientHeight, + horizontal:container.scrollWidth > container.clientWidth + }; + } + + $(window).resize(function(){ + checkOverflow(); + }); + + let resizeObserver = new ResizeObserver(() => { + checkOverflow(); + }); + resizeObserver.observe(elem1); + resizeObserver.observe(elem2); + checkOverflow(); + + var pressTimer = []; + var direction = 1; + var step = 200; + + $(".indicator").mousedown(function(){ + direction = $(this).hasClass("left") ? -1 : 1; + scrollTo(); + pressTimer.push(setInterval(scrollTo, 100)); + }); + + $(".indicator").mouseup(function(){ + pressTimer.forEach(clearInterval); + }); + + $("body").mouseup(function(){ + pressTimer.forEach(clearInterval); + console.log("body"); + }); + + function scrollTo(){ + console.log("here"); + var pos = $("#topnav").scrollLeft(); + document.getElementById("topnav").scrollTo({ left: $("#topnav").scrollLeft() + direction * step, behavior: 'smooth' }) + } + + $("#topnav").scroll(function(){ + if (($("#topnav").offsetWidth + $("#topnav").scrollLeft >= $("#topnav").scrollWidth)) { + console.log("end"); + } + }); + /* End Header Scroll */ }); @@ -951,8 +1010,8 @@ $keyCodeForEnter = getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { ?>
    -
    -
    +
    +
    -
    +
    +
    + + +
    Date: Fri, 28 Oct 2022 12:37:35 +0200 Subject: [PATCH 1187/1289] CSS Header Scroll --- htdocs/takepos/css/pos.css.php | 103 +++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index f4a130dc5f1..c72ae215289 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -929,4 +929,107 @@ div#moreinfo, div#infowarehouse { div.wrapper2{ height:10%; } +} + +.arrows { + display: none; + position: absolute; + justify-content: space-between; + width: 100%; +} + +.indicator { + background: #00000042; + padding: 15px 5px; + cursor: pointer; +} + +.indicator:hover { + background: #000000; +} + +.indicator i { + color: white; +} + +.topnav-left { + margin-left: 20px; +} + +.topnav-right { + margin-right: 20px; +} + +/* For Header Scroll */ +html { + scroll-behavior: smooth; +} + +.topnav { + scroll-behavior: smooth; +} + +.header { + height: unset; +} + +.topnav { + width: 100%; + white-space: nowrap; + overflow-x: scroll; + display: inline-flex; +} + +.topnav-left { + white-space: nowrap; + float: none; + margin-right: auto; + align-items: center; +} + +.topnav-right { + display: flex; + white-space: nowrap; + float: none; + align-items: center; +} + +.topnav-left #shoppingcart { + display:inline-flex; +} + +.topnav-right .login_block_other { + display: flex; + white-space: nowrap; +} + +::-webkit-scrollbar { + width: 8px; +} + + +::-webkit-scrollbar-track { + background: #f1f1f1; +} + + +::-webkit-scrollbar-thumb { + background: #888; +} + +.topnav::-webkit-scrollbar-track{ + background: #eeeeee; +} + +.topnav::-webkit-scrollbar{ + width: 1px; + background: #F5F5F5; +} + +.topnav::-webkit-scrollbar-thumb{ + background: #f9171700; +} + +.topnav.overflow .arrows { + display: flex; } \ No newline at end of file From d8c74eff5ff49cc6698e31c9e27c4aef8740903c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 12:39:37 +0200 Subject: [PATCH 1188/1289] css --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 144580b83af..4a55c1a1160 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -168,7 +168,7 @@ print '
    '.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
    '.$langs->trans("Session").''; +print '
    '.$langs->trans("Session").''; $i = 0; foreach ($_SESSION as $key => $val) { if ($i > 0) { From 764ddd4636a18ae86308fe7264669d60b5fea13a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 28 Oct 2022 10:44:04 +0000 Subject: [PATCH 1189/1289] Fixing style errors. --- htdocs/takepos/css/pos.css.php | 28 ++++++++++++++-------------- htdocs/takepos/index.php | 10 +++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index c72ae215289..d39b3fb0b37 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -933,9 +933,9 @@ div#moreinfo, div#infowarehouse { .arrows { display: none; - position: absolute; - justify-content: space-between; - width: 100%; + position: absolute; + justify-content: space-between; + width: 100%; } .indicator { @@ -970,28 +970,28 @@ html { } .header { - height: unset; + height: unset; } .topnav { width: 100%; - white-space: nowrap; - overflow-x: scroll; + white-space: nowrap; + overflow-x: scroll; display: inline-flex; } .topnav-left { - white-space: nowrap; - float: none; + white-space: nowrap; + float: none; margin-right: auto; - align-items: center; + align-items: center; } .topnav-right { - display: flex; - white-space: nowrap; - float: none; - align-items: center; + display: flex; + white-space: nowrap; + float: none; + align-items: center; } .topnav-left #shoppingcart { @@ -1000,7 +1000,7 @@ html { .topnav-right .login_block_other { display: flex; - white-space: nowrap; + white-space: nowrap; } ::-webkit-scrollbar { diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 05e910790fc..a128a0d66fd 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -960,11 +960,11 @@ $( document ).ready(function() { checkOverflow(); }); - let resizeObserver = new ResizeObserver(() => { - checkOverflow(); - }); - resizeObserver.observe(elem1); - resizeObserver.observe(elem2); + let resizeObserver = new ResizeObserver(() => { + checkOverflow(); + }); + resizeObserver.observe(elem1); + resizeObserver.observe(elem2); checkOverflow(); var pressTimer = []; From 95b3913910670ca42be28e7200ae8f7305e2a0df Mon Sep 17 00:00:00 2001 From: hector Date: Fri, 28 Oct 2022 13:52:22 +0200 Subject: [PATCH 1190/1289] Add hooks --- htdocs/comm/action/card.php | 9 +++++++++ htdocs/comm/action/document.php | 12 ++++++++++++ htdocs/comm/action/info.php | 12 ++++++++++++ htdocs/resource/element_resource.php | 12 ++++++++++++ 4 files changed, 45 insertions(+) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 3aa6a16d3ef..271b6eb463c 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2148,6 +2148,15 @@ if ($id > 0) { $linkback .= ''.$langs->trans("ViewPerUser").''; $linkback .= ''; + // Add more views from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); + if (empty($reshook)) { + $linkback .= $hookmanager->resPrint; + } elseif ($reshook > 1) { + $linkback = $hookmanager->resPrint; + } + //$linkback.=$out; $morehtmlref = '
    '; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index b02b2850346..82cc7584c07 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -63,6 +63,9 @@ if ($id > 0) { $object->fetch_thirdparty(); } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('actioncard', 'globalcard')); + // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -155,6 +158,15 @@ if ($object->id > 0) { $out .= '
  • '.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewDay").''; + // Add more views from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); + if (empty($reshook)) { + $out .= $hookmanager->resPrint; + } elseif ($reshook > 1) { + $out = $hookmanager->resPrint; + } + $linkback .= $out; $morehtmlref = '
    '; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 749ca6a0c62..d4588223b26 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -39,6 +39,9 @@ $langs->load("commercial"); $id = GETPOST('id', 'int'); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('actioncard', 'globalcard')); + // Security check if ($user->socid > 0) { $action = ''; @@ -83,6 +86,15 @@ $out .= ''.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewDay").''; +// Add more views from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); +if (empty($reshook)) { + $out .= $hookmanager->resPrint; +} elseif ($reshook > 1) { + $out = $hookmanager->resPrint; +} + $linkback .= $out; $morehtmlref = '
    '; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index c063e049f44..eedfcc06245 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -324,6 +324,9 @@ if (!$ret) { if (($element_id || $element_ref) && $element == 'action') { require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('actioncard', 'globalcard')); + $act = fetchObjectByElement($element_id, $element, $element_ref); if (is_object($act)) { $head = actions_prepare_head($act); @@ -344,6 +347,15 @@ if (!$ret) { $out .= '
  • '.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewDay").''; + // Add more views from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); + if (empty($reshook)) { + $out .= $hookmanager->resPrint; + } elseif ($reshook > 1) { + $out = $hookmanager->resPrint; + } + $linkback .= $out; $morehtmlref = '
    '; From bbebdbb840ff74e775f78639831d4bbbc759301d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 Oct 2022 15:48:46 +0200 Subject: [PATCH 1191/1289] Fix php 8.1 warnings --- htdocs/bom/bom_card.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/project.lib.php | 12 +++++++----- htdocs/mrp/mo_card.php | 7 ++++--- htdocs/mrp/mo_movements.php | 3 ++- htdocs/product/class/html.formproduct.class.php | 1 + htdocs/product/index.php | 4 ++-- htdocs/product/list.php | 4 ++-- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/projet/class/project.class.php | 2 +- .../class/recruitmentjobposition.class.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 3 ++- htdocs/recruitment/recruitmentcandidature_card.php | 4 ++-- htdocs/recruitment/recruitmentcandidature_list.php | 3 ++- htdocs/recruitment/recruitmentcandidature_note.php | 2 +- htdocs/recruitment/recruitmentjobposition_card.php | 7 ++++--- .../recruitment/recruitmentjobposition_document.php | 2 +- htdocs/recruitment/recruitmentjobposition_note.php | 4 ++-- 21 files changed, 40 insertions(+), 32 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 926797d1f07..89705c25ec5 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -704,7 +704,7 @@ if (empty($reshook)) { // Clone if ($permissiontoadd) { - print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd); + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=bom', 'clone', $permissiontoadd); } // Close / Cancel diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 6401437ac15..49f3b2fa302 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -435,7 +435,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; + $newlang = !empty($object->thirdparty->default_lang) ? $object->thirdparty->default_lang : ""; } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0a1f5f16d6d..67cae4a652e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5060,7 +5060,7 @@ class Form $more .= $input['label'].'
    '; } if ($input['type'] == 'select') { - $more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); + $more .= $this->selectarray($input['name'], $input['values'], !empty($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); } else { $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d427f87189a..6028a8d4bea 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1610,7 +1610,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Duration print '
  • '; - $dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id]; + $dayWorkLoad = !empty($projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id] : 0; + if (!isset($totalforeachday[$preselectedday])) $totalforeachday[$preselectedday] = 0; $totalforeachday[$preselectedday] += $dayWorkLoad; $alreadyspent = ''; @@ -1990,7 +1991,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $modeinput = 'hours'; for ($idw = 0; $idw < 7; $idw++) { $tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); - + if (!isset($totalforeachday[$tmpday])) $totalforeachday[$tmpday] = 0; $cssonholiday = ''; if (!$isavailable[$tmpday]['morning'] && !$isavailable[$tmpday]['afternoon']) { $cssonholiday .= 'onholidayallday '; @@ -2001,14 +2002,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } $tmparray = dol_getdate($tmpday); - $dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id]; + $dayWorkLoad = (!empty($projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id] : 0); $totalforeachday[$tmpday] += $dayWorkLoad; $alreadyspent = ''; if ($dayWorkLoad > 0) { $alreadyspent = convertSecondToTime($dayWorkLoad, 'allhourmin'); } - $alttitle = $langs->trans("AddHereTimeSpentForDay", $tmparray['day'], $tmparray['mon']); + $alttitle = $langs->trans("AddHereTimeSpentForDay", !empty($tmparray['day']) ? $tmparray['day'] : 0, $tmparray['mon']); global $numstartworkingday, $numendworkingday; $cssweekend = ''; @@ -2288,7 +2289,8 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $year = $firstdaytoshowarray['year']; $month = $firstdaytoshowarray['mon']; foreach ($TWeek as $weekIndex => $weekNb) { - $weekWorkLoad = $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]; + $weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ; + if (!isset($totalforeachweek[$weekNb])) $totalforeachweek[$weekNb] = 0; $totalforeachweek[$weekNb] += $weekWorkLoad; $alreadyspent = ''; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 4142693b172..32571252ebf 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -49,7 +49,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'moc $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $TBomLineId = GETPOST('bomlineid', 'array'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST("socid", 'int'); // Initialize technical objects $object = new Mo($db); @@ -678,7 +679,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=mo', 'clone', $permissiontoadd); + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=mo', 'clone', $permissiontoadd); } // Cancel - Reopen @@ -725,7 +726,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $filedir = $conf->mrp->dir_output.'/'.$objref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $user->rights->mrp->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->mrp->create; // If you can create/edit, you can remove a file on card + $delallowed = $user->hasRight("mrp", "creer"); // If you can create/edit, you can remove a file on card print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang); // Show links to link elements diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 761a17f016d..2f3ed1f2d2b 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -47,7 +47,8 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mostockmovement'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$massaction = GETPOST('massaction', 'aZ09'); +$lineid = GETPOST('lineid', 'int'); $msid = GETPOST('msid', 'int'); $year = GETPOST("year", 'int'); diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index a21ff6348e6..75a929f53e5 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -403,6 +403,7 @@ class FormProduct dol_syslog(get_class($this)."::selectWorkstations $selected, $htmlname, $empty, $disabled, $fk_product, $empty_label, $forcecombo, $morecss", LOG_DEBUG); + $filterstatus=''; $out = ''; if (!empty($fk_product) && $fk_product > 0) { $this->cache_workstations = array(); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 845c2e1012d..c2704111094 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -126,7 +126,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be /* * Number of products and/or services */ -if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) { +if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { $prodser = array(); $prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0; $prodser[0]['sell'] = 0; @@ -284,7 +284,7 @@ print '
    '; /* * Latest modified products */ -if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) { +if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { $max = 15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,"; $sql .= " p.entity,"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 26f6a3a410c..50aa776eceb 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1909,7 +1909,7 @@ if ($resql) { // Status (to sell) if (!empty($arrayfields['p.tosell']['checked'])) { print '
    '; - if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product_static->LibStatut($obj->tosell, 5, 0); @@ -1922,7 +1922,7 @@ if ($resql) { // Status (to buy) if (!empty($arrayfields['p.tobuy']['checked'])) { print ''; - if (!empty($conf->use_javascript_ajax) && $user->rights->produit->creer && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $product_static->LibStatut($obj->tobuy, 5, 1); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 0854dceee67..018aeb85965 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -709,7 +709,7 @@ if (count($tasksarray) > 0) { // Calculate total for all tasks $listofdistinctprojectid = array(); // List of all distinct projects - if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { + if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { foreach ($tasksarraywithoutfilter as $tmptask) { $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project; } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 380b4891376..273affc3563 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -524,7 +524,7 @@ if (count($tasksarray) > 0) { // Calculate total for all tasks $listofdistinctprojectid = array(); // List of all distinct projects - if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { + if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { foreach ($tasksarraywithoutfilter as $tmptask) { $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index e7bc897db5a..7177f35e71c 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -747,7 +747,7 @@ if (count($tasksarray) > 0) { // Calculate total for all tasks $listofdistinctprojectid = array(); // List of all distinct projects - if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { + if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) { foreach ($tasksarraywithoutfilter as $tmptask) { $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c5dcf0d4bb4..81f767d2d7d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2046,7 +2046,7 @@ class Project extends CommonObject $sql .= " AND pt.fk_projet = ".((int) $this->id); $sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')"; - if ($task_id) { + if ($taskid) { $sql .= " AND ptt.fk_task=".((int) $taskid); } if (is_numeric($userid)) { diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index d5c109a5516..dda796c243e 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -254,7 +254,7 @@ class RecruitmentJobPosition extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); - unset($object->import_key); + $object->import_key = null; // Clear fields if (property_exists($object, 'ref')) { diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 9988140393d..01d3e8a27c2 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -40,6 +40,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$socid = GETPOST('socid', 'int'); if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -79,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id; + $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 4226e016e73..2452c9e530b 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -43,7 +43,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'recruitmentcandidaturecard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); // Initialize technical objects $object = new RecruitmentCandidature($db); @@ -565,7 +565,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentcandidature', 'clone', $permissiontoadd); + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&object=recruitmentcandidature', 'clone', $permissiontoadd); } // Button to convert into a user diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 0489d68bffb..9b860ac54d5 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -47,6 +47,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : ((e $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); +$lineid = GETPOST('lineid', 'int'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -437,7 +438,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index 543d7a66c10..1649ab5ee5e 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -48,7 +48,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id; + $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } $permissionnote = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 88424f1b06d..be1b9eec084 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -42,7 +42,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'recruitmentjobpositioncard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOST('lineid', 'int'); // Initialize technical objects $object = new RecruitmentJobPosition($db); @@ -279,6 +279,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } if ($action == 'closeas') { + $text = ""; //Form to close proposal (signed or not) $formquestion = array( array('type' => 'select', 'name' => 'status', 'label' => ''.$langs->trans("CloseAs").'', 'values' => array(3=>$object->LibStatut($object::STATUS_RECRUITED), 9=>$object->LibStatut($object::STATUS_CANCELED))), @@ -340,7 +341,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { @@ -435,7 +436,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Clone if ($permissiontoadd) { - print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=recruitmentjobposition', 'clone', $permissiontoadd); + print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=recruitmentjobposition', 'clone', $permissiontoadd); } /* diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index ca9907976be..a162f4c3af7 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -148,7 +148,7 @@ if ($object->id) { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index dcda5b53109..5dc4004a361 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -53,7 +53,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id; + $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } $permissionnote = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_setnotes.inc.php @@ -125,7 +125,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { From ba20087ceb95ff35294b5220378fbfef0c03362b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 15:52:59 +0200 Subject: [PATCH 1192/1289] FIX better compatibility for translation of label in setup API --- htdocs/api/class/api_setup.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..41715cff0ba 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -612,10 +612,11 @@ class Setup extends DolibarrApi * @param object $object Object with label to translate * @param string $lang Code of the language the name of the object must be translated to * @param string $prefix Prefix for translation key + * @param string $dict Dictionnary for translation * * @return void */ - private function translateLabel($object, $lang, $prefix = 'Country') + private function translateLabel($object, $lang, $prefix = 'Country', $dict = 'dict') { if (!empty($lang)) { // Load the translations if this is a new language. @@ -623,7 +624,7 @@ class Setup extends DolibarrApi global $conf; $this->translations = new Translate('', $conf); $this->translations->setDefaultLang($lang); - $this->translations->load('dict'); + $this->translations->load($dict); } if ($object->code) { $key = $prefix.$object->code; @@ -636,7 +637,6 @@ class Setup extends DolibarrApi } } - /** * Get the list of events types. * From b0c6b59eb2cad3b1b31aecefb6de278fa40a0ae1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 15:56:15 +0200 Subject: [PATCH 1193/1289] NEW translate setup/ticket API link to https://github.com/Dolibarr/dolibarr/pull/22699 & fix for multicompany --- htdocs/api/class/api_setup.class.php | 33 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..7c43b751082 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1496,6 +1496,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number (starting from zero) * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the severity must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of ticket categories * @@ -1503,13 +1504,14 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') { $list = array(); $sql = "SELECT rowid, code, pos, label, use_default, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t"; - $sql .= " WHERE t.active = ".((int) $active); + $sql .= " WHERE t.entity IN (".getEntity('c_ticket_category').")"; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { $errormessage = ''; @@ -1538,7 +1540,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $category = $this->db->fetch_object($result); + $this->translateLabel($category, $lang, 'TicketCategoryShort', 'ticket'); + $list[] = $category; } } else { throw new RestException(503, 'Error when retrieving list of ticket categories : '.$this->db->lasterror()); @@ -1555,6 +1559,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number (starting from zero) * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the severity must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of ticket severities * @@ -1562,13 +1567,14 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') { $list = array(); $sql = "SELECT rowid, code, pos, label, use_default, color, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t"; - $sql .= " WHERE t.active = ".((int) $active); + $sql .= " WHERE t.entity IN (".getEntity('c_ticket_severity').")"; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { $errormessage = ''; @@ -1597,7 +1603,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $severity = $this->db->fetch_object($result); + $this->translateLabel($severity, $lang, 'TicketSeverityShort', 'ticket'); + $list[] = $severity; } } else { throw new RestException(503, 'Error when retrieving list of ticket severities : '.$this->db->lasterror()); @@ -1614,6 +1622,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number (starting from zero) * @param int $active Payment term is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the severity must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of ticket types * @@ -1621,15 +1630,15 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '') { $list = array(); $sql = "SELECT rowid, code, pos, label, use_default, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t"; - $sql .= " WHERE t.active = ".(int) $active; - // if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'"; - // if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'"; + $sql .= " WHERE t.entity IN (".getEntity('c_ticket_type').")"; + $sql .= " AND t.active = ".((int) $active); + // Add sql filters if ($sqlfilters) { $errormessage = ''; @@ -1658,7 +1667,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $type =$this->db->fetch_object($result); + $this->translateLabel($type, $lang, 'TicketTypeShort', 'ticket'); + $list[] = $type; } } else { throw new RestException(503, 'Error when retrieving list of ticket types : '.$this->db->lasterror()); From 8d604e3b2d4fe8416b761d7ed63c0c473a17b29f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 16:16:11 +0200 Subject: [PATCH 1194/1289] NEW support lang in Civilities API --- htdocs/api/class/api_setup.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..342eedf483d 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -845,6 +845,7 @@ class Setup extends DolibarrApi * @param int $page Page number (starting from zero) * @param string $module To filter on module events * @param int $active Civility is active or not {@min 0} {@max 1} + * @param string $lang Code of the language the label of the civility must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of civility types * @@ -852,7 +853,7 @@ class Setup extends DolibarrApi * * @throws RestException */ - public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '') + public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $lang = '', $sqlfilters = '') { $list = array(); @@ -890,7 +891,9 @@ class Setup extends DolibarrApi $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { - $list[] = $this->db->fetch_object($result); + $civility = $this->db->fetch_object($result); + $this->translateLabel($civility, $lang, 'Civility', 'dict'); + $list[] = $civility; } } else { throw new RestException(503, 'Error when retrieving list of civility : '.$this->db->lasterror()); From 81bec045865eeac4f549298e581e6f31f970d0f1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 16:17:14 +0200 Subject: [PATCH 1195/1289] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 7c43b751082..28c693ed87c 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1496,7 +1496,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number (starting from zero) * @param int $active Payment term is active or not {@min 0} {@max 1} - * @param string $lang Code of the language the label of the severity must be translated to + * @param string $lang Code of the language the label of the category must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of ticket categories * @@ -1622,7 +1622,7 @@ class Setup extends DolibarrApi * @param int $limit Number of items per page * @param int $page Page number (starting from zero) * @param int $active Payment term is active or not {@min 0} {@max 1} - * @param string $lang Code of the language the label of the severity must be translated to + * @param string $lang Code of the language the label of the type must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" * @return array List of ticket types * From c4543eff73244ee05c7d5e502c24a6fac956acc6 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Fri, 28 Oct 2022 16:31:01 +0200 Subject: [PATCH 1196/1289] FIX: Fix the request SQL for transversal user, the join on usergroup table must be with getEntity('usergroup') and not other element --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/user/class/user.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a3a72d4894a..27b00377411 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2072,7 +2072,7 @@ abstract class CommonObject $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { $sql .= " AND ug.fk_user = te.rowid"; - $sql .= " AND ug.entity IN (".getEntity($this->element).")"; + $sql .= " AND ug.entity IN (".getEntity('usergroup').")"; } } else { $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; @@ -2142,7 +2142,7 @@ abstract class CommonObject $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { $sql .= " AND ug.fk_user = te.rowid"; - $sql .= " AND ug.entity IN (".getEntity($this->element).")"; + $sql .= " AND ug.entity IN (".getEntity('usergroup').")"; } } else { $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 04eebd6b6c9..1543d579839 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3490,7 +3490,7 @@ class User extends CommonObject } else { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ((ug.fk_user = t.rowid"; - $sql .= " AND ug.entity IN (".getEntity('user')."))"; + $sql .= " AND ug.entity IN (".getEntity('usergroup')."))"; $sql .= " OR t.entity = 0)"; // Show always superadmin } } else { From 72870ec95c224f27ffce9bddc60750ef69502fb8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 Oct 2022 16:35:11 +0200 Subject: [PATCH 1197/1289] Fix : wrong backtopage in recruitmentcandidature_agenda.php --- htdocs/recruitment/recruitmentcandidature_agenda.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 9988140393d..56cc1abb24c 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -209,7 +209,8 @@ if ($object->id > 0) { if (get_class($objthirdparty) == 'Societe') { $out .= '&socid='.$objthirdparty->id; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1'; + $backtopageurl = urlencode($_SERVER['PHP_SELF'].'?id='.$objthirdparty->id); + $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$backtopageurl.'&percentage=-1'; //$out.=$langs->trans("AddAnAction").' '; //$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=""; From eb54ae1d22eae1e22814dfad87ddbca76c7bb147 Mon Sep 17 00:00:00 2001 From: Faustin Date: Fri, 28 Oct 2022 17:41:09 +0200 Subject: [PATCH 1198/1289] Added checking when thirdparty is created/updated --- htdocs/societe/class/societe.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c01f83401cf..d0012e78e3a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1171,7 +1171,7 @@ class Societe extends CommonObject } // Check for duplicate or mandatory fields defined into setup - $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL'); + $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'TVA_INTRA'); foreach ($array_to_check as $key) { $keymin = strtolower($key); $i = (int) preg_replace('/[^0-9]/', '', $key); @@ -1216,6 +1216,14 @@ class Societe extends CommonObject $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } + } elseif ($key == 'TVA_INTRA') { + // Check for unicity + if ($vallabel && !empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { + $langs->load("errors"); + $error++; $this->errors[] = $langs->trans('VATIntra')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } } } } From 18c9685051f637de78fe6576214ac76769bdbd41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 17:51:25 +0200 Subject: [PATCH 1199/1289] Rename table to prepare need of direct debit for non invoices --- htdocs/compta/facture/list.php | 2 +- htdocs/compta/facture/prelevement.php | 8 +++--- htdocs/compta/paiement.php | 2 +- htdocs/compta/paymentbybanktransfer/index.php | 2 +- .../class/bonprelevement.class.php | 26 +++++++++---------- .../class/rejetprelevement.class.php | 4 +-- htdocs/compta/prelevement/create.php | 2 +- htdocs/compta/prelevement/demandes.php | 2 +- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/compta/prelevement/line.php | 2 +- htdocs/compta/prelevement/list.php | 2 +- htdocs/core/class/commoninvoice.class.php | 10 +++---- htdocs/core/lib/fourn.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/facture/paiement.php | 2 +- .../install/mysql/migration/16.0.0-17.0.0.sql | 5 ++++ ...acture.key.sql => llx_prelevement.key.sql} | 4 +-- ...vement_facture.sql => llx_prelevement.sql} | 2 +- ...ey.sql => llx_prelevement_demande.key.sql} | 4 +-- ...emande.sql => llx_prelevement_demande.sql} | 2 +- htdocs/stripe/class/stripe.class.php | 14 +++++----- 23 files changed, 55 insertions(+), 50 deletions(-) rename htdocs/install/mysql/tables/{llx_prelevement_facture.key.sql => llx_prelevement.key.sql} (76%) rename htdocs/install/mysql/tables/{llx_prelevement_facture.sql => llx_prelevement.sql} (96%) rename htdocs/install/mysql/tables/{llx_prelevement_facture_demande.key.sql => llx_prelevement_demande.key.sql} (78%) rename htdocs/install/mysql/tables/{llx_prelevement_facture_demande.sql => llx_prelevement_demande.sql} (97%) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b5b9687686b..11fdb6ac982 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -493,7 +493,7 @@ if ($action == 'makepayment_confirm' && !empty($user->rights->facture->paiement) $rsql .= " , pfd.date_traite as date_traite"; $rsql .= " , pfd.amount"; $rsql .= " , u.rowid as user_id, u.lastname, u.firstname, u.login"; - $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $rsql .= " , ".MAIN_DB_PREFIX."user as u"; $rsql .= " WHERE fk_facture = ".((int) $objecttmp->id); $rsql .= " AND pfd.fk_user_demande = u.rowid"; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index d475e83c55b..9809554c37f 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -311,7 +311,7 @@ if ($object->id > 0) { $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; $sql .= " , pfd.date_traite as date_traite"; $sql .= " , pfd.amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; if ($type == 'bank-transfer') { $sql .= " WHERE fk_facture_fourn = ".((int) $object->id); } else { @@ -686,7 +686,7 @@ if ($object->id > 0) { // For which amount ? $sql = "SELECT SUM(pfd.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; if ($type == 'bank-transfer') { $sql .= " WHERE fk_facture_fourn = ".((int) $object->id); } else { @@ -812,7 +812,7 @@ if ($object->id > 0) { $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande,"; $sql .= " pfd.date_traite as date_traite, pfd.amount,"; $sql .= " u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons"; if ($type == 'bank-transfer') { @@ -889,7 +889,7 @@ if ($object->id > 0) { $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande, pfd.date_traite, pfd.fk_prelevement_bons, pfd.amount,"; $sql .= " pb.ref,"; $sql .= " u.rowid as user_id, u.email, u.lastname, u.firstname, u.login, u.statut as user_status"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on pfd.fk_user_demande = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_bons as pb ON pb.rowid = pfd.fk_prelevement_bons"; if ($type == 'bank-transfer') { diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index c51cb19ef1a..f2cd1fe18f9 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -750,7 +750,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $numdirectdebitopen = 0; $totaldirectdebit = 0; $sql = "SELECT COUNT(pfd.rowid) as nb, SUM(pfd.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE fk_facture = ".((int) $objp->facid); $sql .= " AND pfd.traite = 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 9e79cd98939..ba37fde1ba5 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -109,7 +109,7 @@ $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } -$sql .= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; $sql .= " AND f.total_ttc > 0"; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 8aaf8010dd2..344229dc0a8 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -151,7 +151,7 @@ class BonPrelevement extends CommonObject if ($result == 0) { if ($line_id > 0) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement ("; if ($type != 'bank-transfer') { $sql .= "fk_facture"; } else { @@ -577,7 +577,7 @@ class BonPrelevement extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; - $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql .= " , ".MAIN_DB_PREFIX."prelevement as pf"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND p.rowid = ".((int) $this->id); @@ -635,7 +635,7 @@ class BonPrelevement extends CommonObject } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; } - $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; @@ -695,7 +695,7 @@ class BonPrelevement extends CommonObject } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; } - $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; @@ -788,7 +788,7 @@ class BonPrelevement extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; } $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE f.entity IN (".getEntity('invoice').')'; if ($type != 'bank-transfer') { $sql .= " AND f.rowid = pfd.fk_facture"; @@ -1014,7 +1014,7 @@ class BonPrelevement extends CommonObject } // Update invoice requests as done - $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande"; + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande"; $sql .= " SET traite = 1"; $sql .= ", date_traite = '".$this->db->idate($now)."'"; $sql .= ", fk_prelevement_bons = ".((int) $this->id); @@ -1147,7 +1147,7 @@ class BonPrelevement extends CommonObject } if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id).")"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id).")"; $resql1 = $this->db->query($sql); if (!$resql1) { dol_print_error($this->db); @@ -1171,7 +1171,7 @@ class BonPrelevement extends CommonObject } if (!$error) { - $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".((int) $this->id); + $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".((int) $this->id); $resql4 = $this->db->query($sql); if (!$resql4) { dol_print_error($this->db); @@ -1425,7 +1425,7 @@ class BonPrelevement extends CommonObject $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql .= " ".MAIN_DB_PREFIX."facture as f,"; - $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; + $sql .= " ".MAIN_DB_PREFIX."prelevement as pf,"; $sql .= " ".MAIN_DB_PREFIX."societe as soc,"; $sql .= " ".MAIN_DB_PREFIX."c_country as c,"; $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; @@ -1541,7 +1541,7 @@ class BonPrelevement extends CommonObject $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; - $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; + $sql .= " ".MAIN_DB_PREFIX."prelevement as pf,"; $sql .= " ".MAIN_DB_PREFIX."societe as soc,"; $sql .= " ".MAIN_DB_PREFIX."c_country as c,"; $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; @@ -1634,7 +1634,7 @@ class BonPrelevement extends CommonObject $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql .= " ".MAIN_DB_PREFIX."facture as f,"; - $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql .= " ".MAIN_DB_PREFIX."prelevement as pf"; $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); $sql .= " AND pl.rowid = pf.fk_prelevement_lignes"; $sql .= " AND pf.fk_facture = f.rowid"; @@ -1660,7 +1660,7 @@ class BonPrelevement extends CommonObject $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; - $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql .= " ".MAIN_DB_PREFIX."prelevement as pf"; $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id); $sql .= " AND pl.rowid = pf.fk_prelevement_lignes"; $sql .= " AND pf.fk_facture_fourn = f.rowid"; @@ -1691,7 +1691,7 @@ class BonPrelevement extends CommonObject fclose($this->file); if (!empty($conf->global->MAIN_UMASK)) { - @chmod($this->file, octdec($conf->global->MAIN_UMASK)); + @chmod($this->filename, octdec($conf->global->MAIN_UMASK)); } return $result; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index f88ff5201f3..27e27fe60bd 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -221,7 +221,7 @@ class RejetPrelevement $userid = 0; $sql = "SELECT fk_user_demande"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE pfd.fk_prelevement_bons = ".((int) $this->bon_id); $sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn' : '').' = '.((int) $fac->id); @@ -289,7 +289,7 @@ class RejetPrelevement //Returns all invoices of a withdrawal $sql = "SELECT f.rowid as facid, pl.amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement as pf"; if ($this->type == 'bank-transfer') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON (pf.fk_facture_fourn = f.rowid)"; } else { diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5d6a58b9215..c5b0dda6cf2 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -348,7 +348,7 @@ if ($type == 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s,"; -$sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 585c601da56..905c8f36415 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -137,7 +137,7 @@ if ($type != 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s,"; -$sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pfd"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index d6009631ac2..dcb91710bd6 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -177,7 +177,7 @@ $sql .= " f.rowid as facid, f.ref as ref, f.total_ttc,"; $sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql .= ", ".MAIN_DB_PREFIX."prelevement_facture as pf"; +$sql .= ", ".MAIN_DB_PREFIX."prelevement as pf"; if ($object->type != 'bank-transfer') { $sql .= ", ".MAIN_DB_PREFIX."facture as f"; } else { diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 830bd101d0a..d71314a08e2 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -109,7 +109,7 @@ $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } -$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.total_ttc > 0"; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 1fccef050d1..186546b74a9 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -262,7 +262,7 @@ if ($id) { $sql .= " , s.rowid as socid, s.nom as name"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; - $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql .= " , ".MAIN_DB_PREFIX."prelevement as pf"; if ($type == 'bank-transfer') { $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; } else { diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index b84bc7f3d2d..571c78358e0 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -114,7 +114,7 @@ $sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, $sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement as pf"; if ($type == 'bank-transfer') { $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; } else { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 2d63347c029..2a185b362be 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -756,7 +756,7 @@ abstract class CommonInvoice extends CommonObject $bac->fetch(0, $this->socid); $sql = "SELECT count(*)"; - $sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande"; + $sql .= " FROM ".$this->db->prefix()."prelevement_demande"; if ($type == 'bank-transfer') { $sql .= " WHERE fk_facture_fourn = ".((int) $this->id); } else { @@ -786,7 +786,7 @@ abstract class CommonInvoice extends CommonObject } if (is_numeric($amount) && $amount != 0) { - $sql = 'INSERT INTO '.$this->db->prefix().'prelevement_facture_demande('; + $sql = 'INSERT INTO '.$this->db->prefix().'prelevement_demande('; if ($type == 'bank-transfer') { $sql .= 'fk_facture_fourn, '; } else { @@ -883,7 +883,7 @@ abstract class CommonInvoice extends CommonObject } $sql = "SELECT rowid, date_demande, amount, fk_facture, fk_facture_fourn"; - $sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande"; + $sql .= " FROM ".$this->db->prefix()."prelevement_demande"; $sql .= " WHERE rowid = ".((int) $did); dol_syslog(get_class($this)."::makeStripeSepaRequest 1", LOG_DEBUG); @@ -1572,7 +1572,7 @@ abstract class CommonInvoice extends CommonObject $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; } - $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande("; + $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_demande("; $sql .= "fk_facture, "; $sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)"; $sql .= " VALUES (".$this->id; @@ -1633,7 +1633,7 @@ abstract class CommonInvoice extends CommonObject public function demande_prelevement_delete($fuser, $did) { // phpcs:enable - $sql = 'DELETE FROM '.$this->db->prefix().'prelevement_facture_demande'; + $sql = 'DELETE FROM '.$this->db->prefix().'prelevement_demande'; $sql .= ' WHERE rowid = '.((int) $did); $sql .= ' AND traite = 0'; if ($this->db->query($sql)) { diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index c65013722d4..8ba05557220 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -58,7 +58,7 @@ function facturefourn_prepare_head($object) if (!empty($conf->paymentbybanktransfer->enabled)) { $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE pfd.fk_facture_fourn = ".((int) $object->id); $sql .= " AND pfd.ext_payment_id IS NULL"; $resql = $db->query($sql); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index bd02d7cca53..0d14b322953 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -59,7 +59,7 @@ function facture_prepare_head($object) if (!empty($conf->prelevement->enabled)) { $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE pfd.fk_facture = ".((int) $object->id); $sql .= " AND pfd.ext_payment_id IS NULL"; $resql = $db->query($sql); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 1d7149cdb10..ddc4036e91b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -345,7 +345,7 @@ if (empty($reshook)) { $rsql .= " , pfd.date_traite as date_traite"; $rsql .= " , pfd.amount"; $rsql .= " , u.rowid as user_id, u.lastname, u.firstname, u.login"; - $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $rsql .= " , ".MAIN_DB_PREFIX."user as u"; $rsql .= " WHERE fk_facture_fourn = ".((int) $objecttmp->id); $rsql .= " AND pfd.fk_user_demande = u.rowid"; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index b421496153d..bad8d19bd28 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -718,7 +718,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $numdirectdebitopen = 0; $totaldirectdebit = 0; $sql = "SELECT COUNT(pfd.rowid) as nb, SUM(pfd.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " WHERE fk_facture_fourn = ".((int) $objp->facid); $sql .= " AND pfd.traite = 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; 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 24ac0e37ff5..ce81740b50d 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 @@ -361,3 +361,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903); + + +ALTER TABLE llx_prelevement_facture RENAME TO llx_prelevement; +ALTER TABLE llx_prelevement_facture_demande RENAME TO llx_prelevement_demande; + diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture.key.sql b/htdocs/install/mysql/tables/llx_prelevement.key.sql similarity index 76% rename from htdocs/install/mysql/tables/llx_prelevement_facture.key.sql rename to htdocs/install/mysql/tables/llx_prelevement.key.sql index bc8b1bd8386..c3234b7756a 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture.key.sql +++ b/htdocs/install/mysql/tables/llx_prelevement.key.sql @@ -18,8 +18,8 @@ -- ============================================================================ -ALTER TABLE llx_prelevement_facture ADD INDEX idx_prelevement_facture_fk_prelevement_lignes (fk_prelevement_lignes); +ALTER TABLE llx_prelevement ADD INDEX idx_prelevement_fk_prelevement_lignes (fk_prelevement_lignes); -ALTER TABLE llx_prelevement_facture ADD CONSTRAINT fk_prelevement_facture_fk_prelevement_lignes FOREIGN KEY (fk_prelevement_lignes) REFERENCES llx_prelevement_lignes (rowid); +ALTER TABLE llx_prelevement ADD CONSTRAINT fk_prelevement_facture_fk_prelevement_lignes FOREIGN KEY (fk_prelevement_lignes) REFERENCES llx_prelevement_lignes (rowid); diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture.sql b/htdocs/install/mysql/tables/llx_prelevement.sql similarity index 96% rename from htdocs/install/mysql/tables/llx_prelevement_facture.sql rename to htdocs/install/mysql/tables/llx_prelevement.sql index 53a329f4376..b1fd80ef78b 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture.sql +++ b/htdocs/install/mysql/tables/llx_prelevement.sql @@ -16,7 +16,7 @@ -- -- =================================================================== -create table llx_prelevement_facture +create table llx_prelevement ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NULL, diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.key.sql b/htdocs/install/mysql/tables/llx_prelevement_demande.key.sql similarity index 78% rename from htdocs/install/mysql/tables/llx_prelevement_facture_demande.key.sql rename to htdocs/install/mysql/tables/llx_prelevement_demande.key.sql index 4f9aedb9cdf..cd4ed476635 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.key.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_demande.key.sql @@ -17,6 +17,6 @@ -- =================================================================== -ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture); -ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn); +ALTER TABLE llx_prelevement_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture); +ALTER TABLE llx_prelevement_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn); diff --git a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_demande.sql similarity index 97% rename from htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql rename to htdocs/install/mysql/tables/llx_prelevement_demande.sql index 9837f709777..bfad4d7fa6a 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_facture_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_demande.sql @@ -17,7 +17,7 @@ -- =================================================================== -create table llx_prelevement_facture_demande +create table llx_prelevement_demande ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 25a4edb6123..43f940acdee 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -386,7 +386,7 @@ class Stripe extends CommonObject // That's why we can comment the part of code to retrieve a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used) $sql = "SELECT pi.ext_payment_id, pi.entity, pi.fk_facture, pi.sourcetype, pi.ext_payment_site"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pi"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pi"; $sql .= " WHERE pi.fk_facture = ".((int) $object->id); $sql .= " AND pi.sourcetype = '".$this->db->escape($object->element)."'"; $sql .= " AND pi.entity IN (".getEntity('societe').")"; @@ -530,12 +530,12 @@ class Stripe extends CommonObject $paymentintentalreadyexists = 0; // Check that payment intent $paymentintent->id is not already recorded. $sql = "SELECT pi.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pi"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pi"; $sql .= " WHERE pi.entity IN (".getEntity('societe').")"; $sql .= " AND pi.ext_payment_site = '".$this->db->escape($service)."'"; $sql .= " AND pi.ext_payment_id = '".$this->db->escape($paymentintent->id)."'"; - dol_syslog(get_class($this)."::getPaymentIntent search if payment intent already in prelevement_facture_demande", LOG_DEBUG); + dol_syslog(get_class($this)."::getPaymentIntent search if payment intent already in prelevement_demande", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -552,7 +552,7 @@ class Stripe extends CommonObject // If not, we create it. if (!$paymentintentalreadyexists) { $now = dol_now(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site, amount)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site, amount)"; $sql .= " VALUES ('".$this->db->idate($now)."', ".((int) $user->id).", '".$this->db->escape($paymentintent->id)."', ".((int) $object->id).", '".$this->db->escape($object->element)."', ".((int) $conf->entity).", '".$this->db->escape($service)."', ".((float) $amount).")"; $resql = $this->db->query($sql); if (!$resql) { @@ -696,12 +696,12 @@ class Stripe extends CommonObject $setupintentalreadyexists = 0; // Check that payment intent $setupintent->id is not already recorded. $sql = "SELECT pi.rowid"; - $sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_facture_demande as pi"; + $sql.= " FROM " . MAIN_DB_PREFIX . "prelevement_demande as pi"; $sql.= " WHERE pi.entity IN (".getEntity('societe').")"; $sql.= " AND pi.ext_payment_site = '" . $this->db->escape($service) . "'"; $sql.= " AND pi.ext_payment_id = '".$this->db->escape($setupintent->id)."'"; - dol_syslog(get_class($this) . "::getPaymentIntent search if payment intent already in prelevement_facture_demande", LOG_DEBUG); + dol_syslog(get_class($this) . "::getPaymentIntent search if payment intent already in prelevement_demande", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -717,7 +717,7 @@ class Stripe extends CommonObject if (! $setupintentalreadyexists) { $now=dol_now(); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_demande (date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; $sql .= " VALUES ('".$this->db->idate($now)."', ".((int) $user->id).", '".$this->db->escape($setupintent->id)."', ".((int) $object->id).", '".$this->db->escape($object->element)."', " . ((int) $conf->entity) . ", '" . $this->db->escape($service) . "', ".((float) $amount).")"; $resql = $this->db->query($sql); if (! $resql) From 65cbd2c663f48b9646b3551a0e61482608c58e61 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 17:59:34 +0200 Subject: [PATCH 1200/1289] Update api_setup.class.php some values needs more dictionaries --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 41715cff0ba..345a8e60799 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -624,7 +624,7 @@ class Setup extends DolibarrApi global $conf; $this->translations = new Translate('', $conf); $this->translations->setDefaultLang($lang); - $this->translations->load($dict); + $this->translations->loadLangs(array($dict)); } if ($object->code) { $key = $prefix.$object->code; From 4596a16cdb3c4fc4b02e52d8da59f1cb3d06350b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 18:02:40 +0200 Subject: [PATCH 1201/1289] css --- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/fiche-rejet.php | 2 +- htdocs/compta/prelevement/fiche-stat.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index dcb91710bd6..0ed75b5c3b8 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -111,7 +111,7 @@ if ($id > 0 || $ref) { print '
    '.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getNomUrl(-1).'
    '.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print '
    '.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getNomUrl(-1).'
    '.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print '
    '.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getNomUrl(-1).'
    '.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print '
    '; + print '
    '; $labelfororderfield = 'WithdrawalFile'; if ($object->type == 'bank-transfer') { $labelfororderfield = 'CreditTransferFile'; From 29d819be5eeb281f9358f1eedbb53d4517d5b076 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Oct 2022 18:11:54 +0200 Subject: [PATCH 1202/1289] Rename cid so we can retreive it easily on file --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e21a288e53e..2651df8b2e5 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1783,7 +1783,7 @@ class CMailFile foreach ($matches[1] as $key => $ext) { // We save the image to send in disk $filecontent = $matches[2][$key]; - $cid = dol_hash($this->html, 'md5'); + $cid = 'cid000'.dol_hash($this->html, 'md5'); $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; $fhandle = @fopen($destfiletmp, 'w'); From e450b950d14819077cd422b223b913f06731f7ad Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 21:24:30 +0200 Subject: [PATCH 1203/1289] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 345a8e60799..c35c75cd154 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -616,7 +616,7 @@ class Setup extends DolibarrApi * * @return void */ - private function translateLabel($object, $lang, $prefix = 'Country', $dict = 'dict') + private function translateLabel($object, $lang, $prefix = 'Country', $dict = array('dict')) { if (!empty($lang)) { // Load the translations if this is a new language. @@ -624,7 +624,7 @@ class Setup extends DolibarrApi global $conf; $this->translations = new Translate('', $conf); $this->translations->setDefaultLang($lang); - $this->translations->loadLangs(array($dict)); + $this->translations->loadLangs($dict); } if ($object->code) { $key = $prefix.$object->code; From 0277c07c31fc9d44d634d9ac1025b4f1571f099d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 21:25:42 +0200 Subject: [PATCH 1204/1289] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 342eedf483d..a604aa46432 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -892,7 +892,7 @@ class Setup extends DolibarrApi $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { $civility = $this->db->fetch_object($result); - $this->translateLabel($civility, $lang, 'Civility', 'dict'); + $this->translateLabel($civility, $lang, 'Civility', array('dict')); $list[] = $civility; } } else { From 6dd07121937293c8d362ad20a164a588ec691ab0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 28 Oct 2022 21:26:45 +0200 Subject: [PATCH 1205/1289] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 28c693ed87c..ef1d7e4c512 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1541,7 +1541,7 @@ class Setup extends DolibarrApi $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { $category = $this->db->fetch_object($result); - $this->translateLabel($category, $lang, 'TicketCategoryShort', 'ticket'); + $this->translateLabel($category, $lang, 'TicketCategoryShort', array('ticket')); $list[] = $category; } } else { @@ -1604,7 +1604,7 @@ class Setup extends DolibarrApi $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { $severity = $this->db->fetch_object($result); - $this->translateLabel($severity, $lang, 'TicketSeverityShort', 'ticket'); + $this->translateLabel($severity, $lang, 'TicketSeverityShort', array('ticket')); $list[] = $severity; } } else { @@ -1668,7 +1668,7 @@ class Setup extends DolibarrApi $min = min($num, ($limit <= 0 ? $num : $limit)); for ($i = 0; $i < $min; $i++) { $type =$this->db->fetch_object($result); - $this->translateLabel($type, $lang, 'TicketTypeShort', 'ticket'); + $this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket')); $list[] = $type; } } else { From 27ee846562edb0a3c029257e34db8ae2993efde3 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Fri, 28 Oct 2022 16:14:50 -0500 Subject: [PATCH 1206/1289] New constant warhouse internal not sell To no show stock of products in internal warehouse --- htdocs/core/tpl/objectline_create.tpl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 381683cf62c..1bfc9587b89 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -258,9 +258,11 @@ if ($nolinesbefore) { } if (empty($senderissupplier)) { $statustoshow = 1; + $statuswarehouse = 'warehouseopen,warehouseinternal'; + if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen'; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array')); } else { $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } From bc4b9c4b18ab9eddc5b365e3a102f818035e0ca5 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 29 Oct 2022 09:39:12 +0200 Subject: [PATCH 1207/1289] NEW #22622: all partneships displayed on tab partnership of thirdparty and member --- htdocs/core/lib/company.lib.php | 20 +- htdocs/core/lib/member.lib.php | 20 +- htdocs/langs/en_US/partnership.lang | 5 +- htdocs/langs/fr_FR/partnership.lang | 1 + htdocs/partnership/partnership_list.php | 149 ++++++++++++- htdocs/societe/partnership.php | 274 ------------------------ 6 files changed, 180 insertions(+), 289 deletions(-) delete mode 100644 htdocs/societe/partnership.php diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 70589dfb120..43264ac3d98 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -267,9 +267,23 @@ function societe_prepare_head(Societe $object) if (!empty($user->rights->partnership->read)) { $langs->load("partnership"); $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; - $head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Partnership"); - $head[$h][2] = 'partnership'; + $head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Partnerships"); + $nbNote = 0; + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."partnership as n"; + $sql .= " WHERE fk_soc = ".((int) $object->id); + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + $nbNote = $obj->nb; + } else { + dol_print_error($db); + } + if ($nbNote > 0) { + $head[$h][1] .= ''.$nbNote.''; + } + $head[$h][2] = 'partnerships'; if ($nbPartnership > 0) { $head[$h][1] .= ''.$nbPartnership.''; } diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 6e0dcb3b83a..71a9849dc16 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -66,9 +66,23 @@ function member_prepare_head(Adherent $object) if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') { if (!empty($user->rights->partnership->read)) { $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; - $head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id; - $head[$h][1] = $langs->trans("Partnership"); - $head[$h][2] = 'partnership'; + $head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?rowid='.$object->id; + $head[$h][1] = $langs->trans("Partnerships"); + $nbNote = 0; + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."partnership as n"; + $sql .= " WHERE fk_member = ".((int) $object->id); + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + $nbNote = $obj->nb; + } else { + dol_print_error($db); + } + if ($nbNote > 0) { + $head[$h][1] .= ''.$nbNote.''; + } + $head[$h][2] = 'partnerships'; if ($nbPartnership > 0) { $head[$h][1] .= ''.$nbPartnership.''; } diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 6490bf23d8b..89a1bfa742d 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -20,6 +20,7 @@ ModulePartnershipName=Partnership management PartnershipDescription=Module Partnership management PartnershipDescriptionLong= Module Partnership management Partnership=Partnership +Partnerships=Partnerships AddPartnership=Add partnership CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions PartnershipCheckBacklink=Partnership: Check referring backlink @@ -49,8 +50,8 @@ PublicFormRegistrationPartnerDesc=Dolibarr can provide you a public URL/website # Object # DeletePartnership=Delete a partnership -PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party -PartnershipDedicatedToThisMember=Partnership dedicated to this member +PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party +PartnershipDedicatedToThisMember=Partnership dedicated to this member DatePartnershipStart=Start date DatePartnershipEnd=End date ReasonDecline=Decline reason diff --git a/htdocs/langs/fr_FR/partnership.lang b/htdocs/langs/fr_FR/partnership.lang index 41849e2812e..20c3fc0d801 100644 --- a/htdocs/langs/fr_FR/partnership.lang +++ b/htdocs/langs/fr_FR/partnership.lang @@ -20,6 +20,7 @@ ModulePartnershipName=Gestion des partenariats PartnershipDescription=Module de gestion des partenariats PartnershipDescriptionLong= Module de gestion des partenariats Partnership=Partenariat +Partnerships=Partenariats AddPartnership=Ajouter un partenariat CancelPartnershipForExpiredMembers=Partenariat : annuler le partenariat des adhérents dont les cotisations ont expirés PartnershipCheckBacklink=Partenariat : Vérifiez le backlink référent diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 838969e745e..0aba38fd7e3 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -28,7 +28,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; // for other modules @@ -49,7 +51,8 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); - +$socid = GETPOST('socid', 'int'); +$memberid = GETPOST('rowid', 'int'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -68,7 +71,13 @@ $object = new Partnership($db); $extrafields = new ExtraFields($db); $adherent = new Adherent($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array +if ($socid > 0) { + $hookmanager->initHooks(array('thirdpartypartnership')); +} elseif ($memberid > 0) { + $hookmanager->initHooks(array('memberpartnership')); +} else { + $hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array +} // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -144,7 +153,6 @@ $permissiontodelete = $user->rights->partnership->delete; if (empty($conf->partnership->enabled)) { accessforbidden('Module not enabled'); } -$socid = 0; if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); @@ -325,9 +333,19 @@ if ($object->ismultientitymanaged == 1) { } else { $sql .= " WHERE 1 = 1"; } -if ($managedfor == 'member') - $sql .= " AND fk_member > 0"; -else $sql .= " AND fk_soc > 0"; +if ($managedfor == 'member') { + if ($memberid > 0) { + $sql .= " AND t.fk_member = ".$memberid; + } else { + $sql .= " AND fk_member > 0"; + } +} else { + if ($socid > 0) { + $sql .= " AND t.fk_soc = ".((int) $socid); + } else { + $sql .= " AND fk_soc > 0"; + } +} foreach ($search as $key => $val) { if (array_key_exists($key, $object->fields)) { if ($key == 'status' && $search[$key] == -1) { @@ -449,6 +467,113 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); +if ($managedfor == "member") { + if ($memberid > 0 && $user->hasRight('adherent', 'lire')) { + $langs->load("members"); + + $adhstat = new Adherent($db); + $adht = new AdherentType($db); + $result = $adhstat->fetch($memberid); + + if (isModEnabled('notification')) { + $langs->load("mails"); + } + + $adht->fetch($adhstat->typeid); + + $head = member_prepare_head($adhstat); + + print dol_get_fiche_head($head, 'partnerships', $langs->trans("ThirdParty"), -1, 'user'); + + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
    '; + + print '
    '; + print ''; + + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''; + } + + // Type + print '\n"; + + // Morphy + print ''; + print ''; + + // Company + print ''; + + // Civility + print ''; + print ''; + + print '
    '.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
    '.$langs->trans("Type").''.$adht->getNomUrl(1)."
    '.$langs->trans("MemberNature").''.$adhstat->getmorphylib().'
    '.$langs->trans("Company").''.$adhstat->company.'
    '.$langs->trans("UserTitle").''.$adhstat->getCivilityLabel().' 
    '; + + print '
    '; + + print dol_get_fiche_end(); + } +} elseif ($managedfor == "thirdparty") { + if ($socid && $user->hasRight('societe', 'lire')) { + $socstat = new Societe($db); + $res = $socstat->fetch($socid); + if ($res > 0) { + $tmpobject = $object; + $object = $socstat; // $object must be of type Societe when calling societe_prepare_head + $head = societe_prepare_head($socstat); + $object = $tmpobject; + + print dol_get_fiche_head($head, 'partnerships', $langs->trans("ThirdParty"), -1, 'company'); + + dol_banner_tab($socstat, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); + + print '
    '; + + print '
    '; + print ''; + + // Type Prospect/Customer/Supplier + print ''; + + // Customer code + if ($socstat->client && !empty($socstat->code_client)) { + print ''; + print ''; + } + // Supplier code + if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) { + print ''; + print ''; + } + + print '
    '.$langs->trans('NatureOfThirdParty').''; + print $socstat->getTypeUrl(1); + print '
    '; + print $langs->trans('CustomerCode').''; + print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_client)); + $tmpcheck = $socstat->check_codeclient(); + if ($tmpcheck != 0 && $tmpcheck != -5) { + print ' ('.$langs->trans("WrongCustomerCode").')'; + } + print '
    '; + print $langs->trans('SupplierCode').''; + print showValueWithClipboardCPButton(dol_escape_htmltag($socstat->code_fournisseur)); + $tmpcheck = $socstat->check_codefournisseur(); + if ($tmpcheck != 0 && $tmpcheck != -5) { + print ' ('.$langs->trans("WrongSupplierCode").')'; + } + print '
    '; + print '
    '; + print dol_get_fiche_end(); + } + } +} $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -459,6 +584,12 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } +if ($socid) { + $param .= '&socid='.urlencode($socid); +} +if ($memberid) { + $param .= '&rowid='.urlencode($memberid); +} foreach ($search as $key => $val) { if (is_array($search[$key]) && count($search[$key])) { foreach ($search[$key] as $skey) { @@ -512,7 +643,11 @@ print ''; print ''; print ''; print ''; - +if ($socid) { + print ''; +} elseif ($memberid) { + print ''; +} $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php deleted file mode 100644 index b7bcd153092..00000000000 --- a/htdocs/societe/partnership.php +++ /dev/null @@ -1,274 +0,0 @@ - - * Copyright (C) 2021 NextGestion - * Copyright (C) 2022 Charlene Benke - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file partnership_card.php - * \ingroup partnership - * \brief Page to create/edit/view partnership - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; -require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; - -// Load translation files required by the page -$langs->loadLangs(array("companies", "partnership", "other")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'partnershipcard'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -//$lineid = GETPOST('lineid', 'int'); - -// Security check -$socid = GETPOST('socid', 'int'); -if (!empty($user->socid)) { - $socid = $user->socid; -} - -if (empty($id) && $socid && (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') == 'thirdparty')) { - $id = $socid; -} - -$object = new Societe($db); -if ($id > 0) { - $object->fetch($id); -} - -// Initialize technical objects -$object = new Partnership($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('thirdpartypartnership', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); - -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); - -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - -// Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - -$permissiontoread = $user->rights->partnership->read; -$permissiontoadd = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->partnership->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$permissionnote = $user->rights->partnership->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->partnership->write; // Used by the include of actions_dellink.inc.php -$usercanclose = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $object->entity : 1]; - - -if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty') != 'thirdparty') { - accessforbidden('Partnership is not activated for thirdparties'); -} -if (empty($conf->partnership->enabled)) { - accessforbidden(); -} -if (empty($permissiontoread)) { - accessforbidden(); -} -if ($action == 'edit' && empty($permissiontoadd)) { - accessforbidden(); -} - -if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT && !empty($user->socid)) { - accessforbidden(); -} - - -// Security check -$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); - - -/* - * Actions - */ - -$parameters = array('socid' => $id); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -$date_start = dol_mktime(0, 0, 0, GETPOST('date_partnership_startmonth', 'int'), GETPOST('date_partnership_startday', 'int'), GETPOST('date_partnership_startyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GETPOST('date_partnership_endday', 'int'), GETPOST('date_partnership_endyear', 'int')); - -if (empty($reshook)) { - $error = 0; - - $backtopage = DOL_URL_ROOT.'/partnership/partnership.php?id='.($id > 0 ? $id : '__ID__'); - - // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; -} - -$object->fields['fk_soc']['visible'] = 0; -if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) { - $object->fields['reason_decline_or_cancel']['visible'] = 1; -} -$object->fields['note_public']['visible'] = 1; - - -/* - * View - */ - -$form = new Form($db); -$formfile = new FormFile($db); - -$title = $langs->trans("Partnership"); -llxHeader('', $title); - -$form = new Form($db); - -if ($id > 0) { - $langs->load("companies"); - - $object = new Societe($db); - $result = $object->fetch($id); - - if (isModEnabled('notification')) { - $langs->load("mails"); - } - $head = societe_prepare_head($object); - - print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'company'); - - $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); - - print '
    '; - - print '
    '; - print ''; - - if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field - print ''; - } - - if ($object->client) { - print ''; - } - - if ($object->fournisseur) { - print ''; - print ''; - } - - print '
    '.$langs->trans('Prefix').''.$object->prefix_comm.'
    '; - print $langs->trans('CustomerCode').''; - print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); - $tmpcheck = $object->check_codeclient(); - if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongCustomerCode").')'; - } - print '
    '; - print $langs->trans('SupplierCode').''; - print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur)); - $tmpcheck = $object->check_codefournisseur(); - if ($tmpcheck != 0 && $tmpcheck != -5) { - print ' ('.$langs->trans("WrongSupplierCode").')'; - } - print '
    '; - - print '
    '; - - print dol_get_fiche_end(); -} else { - dol_print_error('', 'Parameter id not defined'); -} - -// Part to show record -if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - // Buttons for actions - - if ($action != 'presend') { - print '
    '."\n"; - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } - - if (empty($reshook)) { - // Show - if ($permissiontoadd) { - print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/societe/partnership.php?id='.$object->id), '', $permissiontoadd); - } - } - print '
    '."\n"; - } - - - //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php'; - $morehtmlright = ''; - - print load_fiche_titre($langs->trans("PartnershipDedicatedToThisThirdParty", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, ''); - - $socid = $object->id; - - - // TODO Replace this card with a table of list of all partnerships. - - $object = new Partnership($db); - $partnershipid = $object->fetch(0, '', 0, $socid); - - if ($partnershipid > 0) { - print '
    '; - print '
    '; - print '
    '; - print ''."\n"; - - // Common attributes - unset($object->fields['fk_soc']); // Hide field already shown in banner - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - $forcefieldid = 'socid'; - $forceobjectid = $object->fk_soc; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
    '; - print '
    '; - } -} - -// End of page -llxFooter(); -$db->close(); From 3a78777c9fb529181c6877dd9f7e902e34ab65de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Oct 2022 12:07:26 +0200 Subject: [PATCH 1208/1289] Fix separation of date validation and approval as 2 different dates --- htdocs/holiday/list.php | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8f16676f9ce..ddbafbcbd3c 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -126,7 +126,7 @@ $arrayfields = array( 'cp.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>40), 'cp.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>42), 'cp.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'position'=>60), - 'cp.date_approve'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1, 'position'=>70), + 'cp.date_approval'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1, 'position'=>70), 'cp.date_create'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'cp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>501), 'cp.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), @@ -271,6 +271,8 @@ $sql .= " cp.statut as status,"; $sql .= " cp.fk_validator,"; $sql .= " cp.date_valid,"; $sql .= " cp.fk_user_valid,"; +$sql .= " cp.date_approval,"; +$sql .= " cp.fk_user_approve,"; $sql .= " cp.date_refuse,"; $sql .= " cp.fk_user_refuse,"; $sql .= " cp.date_cancel,"; @@ -636,12 +638,18 @@ if ($resql) { print '
    '; print ''; + print ''; + print ''; print dol_print_date($db->jdate($obj->date_valid), 'day'); print ''; - print dol_print_date($db->jdate($obj->date_approve), 'day'); - print ''; + print dol_print_date($db->jdate($obj->date_approval), 'day'); + print ''.$objectlink->getNomUrl(1).''.$objectlink->ref_client.''.dol_escape_htmltag($objectlink->ref_client).''.dol_print_date($objectlink->date, 'day').''; + print ''; if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) { $sign = 1; if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) { From b616a1eccbee06594c6a81827d81406340cb6320 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Oct 2022 19:08:54 +0100 Subject: [PATCH 1222/1289] css --- htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index d7e68e274fa..1bca663e1ef 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { ?>
    trans("RepeatableInvoice"); ?>getNomUrl(1); ?>getNomUrl(1); ?> date_when, 'day'); ?> Date: Mon, 31 Oct 2022 08:13:11 +0100 Subject: [PATCH 1223/1289] Debug v17 - use of 'mode' for user list and filter on categories --- ChangeLog | 6 +- htdocs/adherents/list.php | 6 +- htdocs/compta/bank/list.php | 6 +- htdocs/compta/facture/list.php | 12 +++- htdocs/contact/list.php | 18 +++++- htdocs/core/class/html.formcategory.class.php | 16 +++-- htdocs/core/class/html.formother.class.php | 4 +- htdocs/core/menus/init_menu_auguria.sql | 4 +- htdocs/core/menus/standard/eldy.lib.php | 4 +- htdocs/fourn/facture/list.php | 14 ++++- .../knowledgerecord_list.php | 6 +- htdocs/product/inventory/list.php | 55 ++++++---------- htdocs/product/list.php | 19 +++--- htdocs/product/stock/list.php | 6 +- htdocs/projet/list.php | 6 +- htdocs/projet/tasks/list.php | 6 +- htdocs/societe/list.php | 12 +++- htdocs/user/hierarchy.php | 34 +++++++--- htdocs/user/list.php | 62 +++++++++++-------- 19 files changed, 187 insertions(+), 109 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9432bdea4d7..18e2b1cdc72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + ***** ChangeLog for 17.0.0 compared to 16.0.0 ***** For users: @@ -25,9 +26,10 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. -* All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead -* Code standardization: $user->rights->propale is now $user->rights->propal everywhere. +* All functions fetch_all() have been set to deprecated for naming consitency, use fetchAll() instead. +* Code standardization: '$user->rights->propale' is now '$user->rights->propal' everywhere. * Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead. +* Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande. ***** ChangeLog for 16.0.1 compared to 16.0.0 ***** diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 4b3a5cdb82c..394a650d7ee 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -370,7 +370,11 @@ if (!empty($searchCategoryContactList)) { if (intval($searchCategoryContact) == -2) { $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member)"; } elseif (intval($searchCategoryContact) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + if ($searchCategoryContactOperator == 0) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = ".((int) $searchCategoryContact).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } } } if ($listofcategoryid) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 1f4fc60397e..54cd0f2b58c 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -222,7 +222,11 @@ if (!empty($searchCategoryBankList)) { if (intval($searchCategoryBank) == -2) { $searchCategoryBankSqlList[] = "NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account)"; } elseif (intval($searchCategoryBank) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank); + if ($searchCategoryBankOperator == 0) { + $searchCategoryBankSqlList[] = " EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie = ".((int) $searchCategoryBank).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank); + } } } if ($listofcategoryid) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 11fdb6ac982..fb7616e8ab3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -813,7 +813,11 @@ if (!empty($searchCategoryProductList)) { if (intval($searchCategoryProduct) == -2) { $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } } } if ($listofcategoryid) { @@ -839,7 +843,11 @@ if (!empty($searchCategoryCustomerList)) { if (intval($searchCategoryCustomer) == -2) { $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategoryCustomer) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + if ($searchCategoryCustomerOperator == 0) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } } } if ($listofcategoryid) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e8396a4299c..ae5deba98f1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -438,7 +438,11 @@ if (!empty($searchCategoryContactList)) { if (intval($searchCategoryContact) == -2) { $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople)"; } elseif (intval($searchCategoryContact) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + if ($searchCategoryContactOperator == 0) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } } } if ($listofcategoryid) { @@ -464,7 +468,11 @@ if (!empty($searchCategoryCustomerList)) { if (intval($searchCategoryCustomer) == -2) { $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategoryCustomer) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + if ($searchCategoryCustomerOperator == 0) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } } } if ($listofcategoryid) { @@ -490,7 +498,11 @@ if (!empty($searchCategorySupplierList)) { if (intval($searchCategorySupplier) == -2) { $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategorySupplier) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + if ($searchCategorySupplierOperator == 0) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } } } if ($listofcategoryid) { diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index c0e07b6bb7a..bd2315645db 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -32,11 +32,13 @@ class FormCategory extends Form /** * Return a HTML filter box for a list filter view * - * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) - * @param Array $preSelected A list with the elements that should pre-selected - * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) + * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) + * @param array $preSelected A list with the elements that should pre-selected + * @param string $morecss More CSS + * @param int $searchCategoryProductOperator 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected) + * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) */ - public function getFilterBox($type, array $preSelected) + public function getFilterBox($type, array $preSelected, $morecss = "minwidth300 widthcentpercentminusx", $searchCategoryProductOperator = -1) { global $langs; @@ -45,6 +47,7 @@ class FormCategory extends Form } $htmlName = "search_category_".$type."_list"; + $htmlName2 = "search_category_".$type."_operator"; $categoryArray = $this->select_all_categories($type, "", "", 64, 0, 1); $categoryArray[-2] = "- ".$langs->trans('NotCategorized')." -"; @@ -55,7 +58,10 @@ class FormCategory extends Form $filter .= '
    '; $filter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); //$filter .= $langs->trans('Categories').": "; - $filter .= Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0, "minwidth300 widthcentpercentminusx", 0, 0, '', '', $tmptitle); + $filter .= Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0, $morecss, 0, 0, '', '', $tmptitle); + if ($searchCategoryProductOperator >= 0) { + $filter .= ' '; + } $filter .= "
    "; return $filter; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 103b370dcb0..7e14474bc96 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -429,8 +429,7 @@ class FormOther if (!is_numeric($showempty)) { $textforempty = $showempty; } - $moreforfilter .= ''."\n"; - //$moreforfilter .= ''; // Should use -1 to say nothing + $moreforfilter .= ''."\n"; } if (is_array($tab_categs)) { @@ -439,6 +438,7 @@ class FormOther if ($categ['id'] == $selected) { $moreforfilter .= ' selected'; } + $moreforfilter .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$categ['color'].'"').dol_trunc($categ['fulllabel'], 50, 'middle')).'"'; $moreforfilter .= '>'.dol_trunc($categ['fulllabel'], 50, 'middle').''; } } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 10c50ca99ee..d6945d26fd5 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -473,9 +473,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- HRM - Employee -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__); -- HRM - Holiday insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4a6636942c4..22613a331b7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2251,9 +2251,9 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = if (isModEnabled('hrm')) { $langs->load("hrm"); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->hasRight('user', 'user', 'write')); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'read')); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'read')); $newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"')); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index ddc4036e91b..709204793e9 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -594,7 +594,11 @@ if (!empty($searchCategorySupplierList)) { if (intval($searchCategorySupplier) == -2) { $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategorySupplier) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + if ($searchCategorySupplierOperator == 0) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } } } if ($listofcategoryid) { @@ -612,7 +616,7 @@ if (!empty($searchCategorySupplierList)) { } // Search for tag/category ($searchCategoryProductList is an array of ID) $searchCategoryProductList = $search_product_category ? array($search_product_category) : array(); -$searchCategorySupplierOperator = 0; +$searchCategoryProductOperator = 0; if (!empty($searchCategoryProductList)) { $searchCategoryProductSqlList = array(); $listofcategoryid = ''; @@ -620,7 +624,11 @@ if (!empty($searchCategoryProductList)) { if (intval($searchCategoryProduct) == -2) { $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } } } if ($listofcategoryid) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 217c7c71468..c8df2018ae7 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -293,7 +293,11 @@ if (!empty($searchCategoryKnowledgemanagementList)) { if (intval($searchCategoryKnowledgemanagement) == -2) { $searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)"; } elseif (intval($searchCategoryKnowledgemanagement) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement); + if ($searchCategoryKnowledgemanagementOperator == 0) { + $searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement); + } } } if ($listofcategoryid) { diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index d9ed8a37c5e..18104118068 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -270,49 +270,32 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } -// Search for tag/category -$searchCategoryProductSqlList = array(); -if ($searchCategoryProductOperator == 1) { - $existsCategoryProductList = array(); +// Search for tag/category ($searchCategoryProductList is an array of ID) +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $sqlCategoryProductNotExists = " NOT EXISTS ("; - $sqlCategoryProductNotExists .= " SELECT cp.fk_product"; - $sqlCategoryProductNotExists .= " FROM ".$db->prefix()."categorie_product AS cp"; - $sqlCategoryProductNotExists .= " WHERE cp.fk_product = t.fk_product"; - $sqlCategoryProductNotExists .= " )"; - $searchCategoryProductSqlList[] = $sqlCategoryProductNotExists; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $existsCategoryProductList[] = $db->escape($searchCategoryProduct); + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } } } - if (!empty($existsCategoryProductList)) { - $sqlCategoryProductExists = " EXISTS ("; - $sqlCategoryProductExists .= " SELECT cp.fk_product"; - $sqlCategoryProductExists .= " FROM ".$db->prefix()."categorie_product AS cp"; - $sqlCategoryProductExists .= " WHERE cp.fk_product = t.fk_product"; - $sqlCategoryProductExists .= " AND cp.fk_categorie IN (".$db->sanitize(implode(',', $existsCategoryProductList)).")"; - $sqlCategoryProductExists .= " )"; - $searchCategoryProductSqlList[] = $sqlCategoryProductExists; + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; - } -} else { - foreach ($searchCategoryProductList as $searchCategoryProduct) { - if (intval($searchCategoryProduct) == -2) { - $sqlCategoryProductNotExists = " NOT EXISTS ("; - $sqlCategoryProductNotExists .= " SELECT cp.fk_product"; - $sqlCategoryProductNotExists .= " FROM ".$db->prefix()."categorie_product AS cp"; - $sqlCategoryProductNotExists .= " WHERE cp.fk_product = t.fk_product"; - $sqlCategoryProductNotExists .= " )"; - $searchCategoryProductSqlList[] = $sqlCategoryProductNotExists; - } elseif (intval($searchCategoryProduct) > 0) { - $searchCategoryProductSqlList[] = "t.fk_product IN (SELECT fk_product FROM ".$db->prefix()."categorie_product WHERE fk_categorie = ".((int) $searchCategoryProduct).")"; + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } - } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } } // Add where from extra fields diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 26f6a3a410c..55c5dc396b2 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -45,6 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; } // Load translation files required by the page @@ -72,7 +73,7 @@ $search_type = GETPOST("search_type", 'int'); $search_vatrate = GETPOST("search_vatrate", 'alpha'); $searchCategoryProductOperator = 0; if (GETPOSTISSET('formfilteraction')) { - $searchCategoryProductOperator = GETPOST('search_category_product_operator', 'int'); + $searchCategoryProductOperator = GETPOSTINT('search_category_product_operator'); } elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) { $searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT; } @@ -508,7 +509,11 @@ if (!empty($searchCategoryProductList)) { if (intval($searchCategoryProduct) == -2) { $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } } } if ($listofcategoryid) { @@ -554,7 +559,6 @@ if ($search_accountancy_code_buy_intra) { if ($search_accountancy_code_buy_export) { $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', $search_accountancy_code_buy_export); } - // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -820,13 +824,8 @@ if ($resql) { // Filter on categories $moreforfilter = ''; if (isModEnabled('categorie') && $user->rights->categorie->lire) { - $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); - $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); - $categoriesProductArr[-2] = '- '.$langs->trans('NotCategorized').' -'; - $moreforfilter .= Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300'); - $moreforfilter .= ' '; - $moreforfilter .= '
    '; + $formcategory = new FormCategory($db); + $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductOperator ? $searchCategoryProductOperator : 0); } //Show/hide child products. Hidden by default diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index af2bb49b05e..b0c33e61484 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -270,7 +270,11 @@ if (!empty($searchCategoryWarehouseList)) { if (intval($searchCategoryWarehouse) == -2) { $searchCategoryWarehouseSqlList[] = "NOT EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse)"; } elseif (intval($searchCategoryWarehouse) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryWarehouse); + if ($searchCategoryWarehouseOperator == 0) { + $searchCategoryWarehouseSqlList[] = " EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse AND ck.fk_categorie = ".((int) $searchCategoryWarehouse).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryWarehouse); + } } } if ($listofcategoryid) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 696888a75dd..9ef64174325 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -570,7 +570,11 @@ if (!empty($searchCategoryProjectList)) { if (intval($searchCategoryProject) == -2) { $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; } elseif (intval($searchCategoryProject) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + if ($searchCategoryProjectOperator == 0) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } } } if ($listofcategoryid) { diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 76261480ffe..fdec5c6a958 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -444,7 +444,11 @@ if (!empty($searchCategoryProjectList)) { if (intval($searchCategoryProject) == -2) { $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; } elseif (intval($searchCategoryProject) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + if ($searchCategoryProjectOperator == 0) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } } } if ($listofcategoryid) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index f32317163ad..c0f50a5e7b0 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -536,7 +536,11 @@ if (!empty($searchCategoryCustomerList)) { if (intval($searchCategoryCustomer) == -2) { $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategoryCustomer) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + if ($searchCategoryCustomerOperator == 0) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } } } if ($listofcategoryid) { @@ -562,7 +566,11 @@ if (!empty($searchCategorySupplierList)) { if (intval($searchCategorySupplier) == -2) { $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; } elseif (intval($searchCategorySupplier) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + if ($searchCategorySupplierOperator == 0) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } } } if ($listofcategoryid) { diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index c48eda2312e..44ab46193d9 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2021 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 @@ -31,7 +31,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; // Load translation files required by page -$langs->loadLangs(array('users', 'companies')); +$langs->loadLangs(array('users', 'companies', 'hrm', 'salaries')); // Security check (for external users) $socid = 0; @@ -40,16 +40,15 @@ if ($user->socid > 0) { } $optioncss = GETPOST('optioncss', 'alpha'); -$contextpage = GETPOST('optioncss', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'userlist'; // To manage different context of search +$mode = GETPOST("mode", 'alpha'); + $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -// Load mode employee -$mode = GETPOST("mode", 'alpha'); $search_statut = GETPOST('search_statut', 'int'); - if ($search_statut == '' || $search_statut == '0') { $search_statut = '1'; } @@ -58,18 +57,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_statut = ""; } +if ($contextpage == 'employeelist') { + $search_employee = 1; +} + $userstatic = new User($db); // Define value to know what current user can do on users $canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); -if (!$user->hasRight("user", "user", "read") && !$user->admin) { - accessforbidden(); +// Permission to list +if ($contextpage == 'employeelist' && $search_employee == 1) { + if (!$user->hasRight("salaries", "read")) { + accessforbidden(); + } +} else { + if (!$user->hasRight("user", "user", "read") && empty($user->admin)) { + accessforbidden(); + } } $childids = $user->getAllChildIds(1); + /* * View */ @@ -77,7 +88,11 @@ $childids = $user->getAllChildIds(1); $form = new Form($db); $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer'; -$title = $langs->trans("Users"); +if ($contextpage == 'employeelist' && $search_employee == 1) { + $title = $langs->trans("Employees"); +} else { + $title = $langs->trans("Users"); +} $arrayofjs = array( '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', @@ -152,6 +167,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) { //var_dump($data); $param = "&search_statut=".urlencode($search_statut); + $param = "&contextpage=".urlencode($contextpage); $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 05d2f88c035..dacf572d175 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -41,9 +41,10 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'userlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST("mode", 'alpha'); // Security check (for external users) $socid = 0; @@ -51,9 +52,6 @@ if ($user->socid > 0) { $socid = $user->socid; } -// Load mode employee -$mode = GETPOST("mode", 'alpha'); - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -125,7 +123,7 @@ $arrayfields = array( 'u.firstname'=>array('label'=>"Firstname", 'checked'=>1, 'position'=>20), 'u.entity'=>array('label'=>"Entity", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), 'u.gender'=>array('label'=>"Gender", 'checked'=>0, 'position'=>22), - 'u.employee'=>array('label'=>"Employee", 'checked'=>($mode == 'employee' ? 1 : 0), 'position'=>25), + 'u.employee'=>array('label'=>"Employee", 'checked'=>($contextpage == 'employeelist' ? 1 : 0), 'position'=>25), 'u.fk_user'=>array('label'=>"HierarchicalResponsible", 'checked'=>1, 'position'=>27), 'u.accountancy_code'=>array('label'=>"AccountancyCode", 'checked'=>0, 'position'=>30), 'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31), @@ -164,6 +162,17 @@ $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_supervisor = GETPOST('search_supervisor', 'intcomma'); $search_categ = GETPOST("search_categ", 'int'); +$searchCategoryUserOperator = 0; +if (GETPOSTISSET('formfilteraction')) { + $searchCategoryUserOperator = GETPOSTINT('search_category_user_operator'); +} elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) { + $searchCategoryUserOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT; +} +$searchCategoryUserList = GETPOST('search_category_user_list', 'array'); +$catid = GETPOST('catid', 'int'); +if (!empty($catid) && empty($searchCategoryUserList)) { + $searchCategoryUserList = array($catid); +} $catid = GETPOST('catid', 'int'); if (!empty($catid) && empty($search_categ)) { $search_categ = $catid; @@ -173,7 +182,7 @@ if (!empty($catid) && empty($search_categ)) { if ($search_statut == '') { $search_statut = '1'; } -if ($mode == 'employee' && !GETPOSTISSET('search_employee')) { +if ($contextpage == 'employeelist' && !GETPOSTISSET('search_employee')) { $search_employee = 1; } @@ -192,7 +201,7 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $error = 0; // Permission to list -if ($mode == 'employee') { +if ($contextpage == 'employeelist' && $search_employee == 1) { if (!$user->hasRight("salaries", "read")) { accessforbidden(); } @@ -428,35 +437,39 @@ if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } -// Search for tag/category ($searchCategoryProductList is an array of ID) -$searchCategoryProductList = array($search_categ); -if (!empty($searchCategoryProductList)) { - $searchCategoryProductSqlList = array(); +// Search for tag/category ($searchCategoryUserList is an array of ID) +$searchCategoryUserList = array($search_categ); +if (!empty($searchCategoryUserList)) { + $searchCategoryUserSqlList = array(); $listofcategoryid = ''; - foreach ($searchCategoryProductList as $searchCategoryProduct) { - if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user)"; - } elseif (intval($searchCategoryProduct) > 0) { - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + foreach ($searchCategoryUserList as $searchCategoryUser) { + if (intval($searchCategoryUser) == -2) { + $searchCategoryUserSqlList[] = "NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user)"; + } elseif (intval($searchCategoryUser) > 0) { + if ($searchCategoryUserOperator == 0) { + $searchCategoryUserSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryUser); + } } } if ($listofcategoryid) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + $searchCategoryUserSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } - if ($searchCategoryProductOperator == 1) { - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + if ($searchCategoryUserOperator == 1) { + if (!empty($searchCategoryUserSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryUserSqlList).")"; } } else { - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + if (!empty($searchCategoryUserSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryUserSqlList).")"; } } } if ($search_warehouse > 0) { $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); } -if ($mode == 'employee' && !$user->hasRight("salaries", "readall")) { +if ($contextpage == 'employeelist' && !$user->hasRight("salaries", "readall")) { $sql .= " AND u.rowid IN (".$db->sanitize(join(',', $childids)).")"; } // Add where from extra fields @@ -523,7 +536,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -$title = $langs->trans("ListOfUsers"); llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); @@ -626,7 +638,7 @@ print ''; print ''; print ''; -$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; +$url = DOL_URL_ROOT.'/user/card.php?action=create'.($contextpage == 'employeelist' ? '&search_employee=1' : '').'&leftmenu='; if (!empty($socid)) { $url .= '&socid='.urlencode($socid); } From 840428200c77dde31a98c79d5c503428b520d906 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2022 08:27:25 +0100 Subject: [PATCH 1224/1289] Add fields to allow SEPA payments of salaries --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_prelevement.sql | 4 ++-- htdocs/install/mysql/tables/llx_prelevement_demande.sql | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index ce81740b50d..119dda91a2e 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 @@ -366,3 +366,5 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value ALTER TABLE llx_prelevement_facture RENAME TO llx_prelevement; ALTER TABLE llx_prelevement_facture_demande RENAME TO llx_prelevement_demande; +ALTER TABLE llx_prelevement ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn; +ALTER TABLE llx_prelevement_demande ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn; diff --git a/htdocs/install/mysql/tables/llx_prelevement.sql b/htdocs/install/mysql/tables/llx_prelevement.sql index b1fd80ef78b..597cdb4a79f 100644 --- a/htdocs/install/mysql/tables/llx_prelevement.sql +++ b/htdocs/install/mysql/tables/llx_prelevement.sql @@ -20,7 +20,7 @@ create table llx_prelevement ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NULL, - fk_facture_fourn integer NULL, + fk_facture_fourn integer NULL, + fk_salary integer NULL, fk_prelevement_lignes integer NOT NULL - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_prelevement_demande.sql b/htdocs/install/mysql/tables/llx_prelevement_demande.sql index bfad4d7fa6a..b0b1b87f77f 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_demande.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_demande.sql @@ -23,6 +23,7 @@ create table llx_prelevement_demande entity integer DEFAULT 1 NOT NULL, fk_facture integer NULL, fk_facture_fourn integer NULL, + fk_salary integer NULL, sourcetype varchar(32), amount double(24,8) NOT NULL, date_demande datetime NOT NULL, From 754881a6efe9f3e29a4f6b3fca5c8c24de0e7554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 31 Oct 2022 10:42:40 +0100 Subject: [PATCH 1225/1289] strftime is deprecated in php 8.1 --- htdocs/adherents/stats/byproperties.php | 2 +- htdocs/adherents/stats/geo.php | 2 +- htdocs/adherents/stats/index.php | 2 +- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/deplacement/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/compta/journal/purchasesjournal.php | 2 +- htdocs/compta/journal/sellsjournal.php | 2 +- htdocs/compta/localtax/clients.php | 2 +- htdocs/compta/localtax/index.php | 2 +- htdocs/compta/localtax/quadri_detail.php | 2 +- htdocs/compta/resultat/result.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/compta/stats/supplier_turnover.php | 2 +- htdocs/core/lib/accounting.lib.php | 4 ++-- htdocs/don/stats/index.php | 2 +- htdocs/expensereport/stats/index.php | 2 +- htdocs/fichinter/stats/index.php | 2 +- htdocs/product/stock/fiche-valo.php | 2 +- htdocs/product/stock/valo.php | 2 +- htdocs/projet/stats/index.php | 2 +- htdocs/projet/tasks/stats/index.php | 2 +- htdocs/reception/stats/index.php | 2 +- htdocs/salaries/card.php | 2 +- htdocs/salaries/stats/index.php | 2 +- htdocs/ticket/stats/index.php | 2 +- scripts/accountancy/export-thirdpartyaccount.php | 2 +- 28 files changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index f632a1ea9c7..1d0f0d92c16 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -40,7 +40,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index bb65a1047a8..e7195d4ee30 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -42,7 +42,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 11447dcd8bb..30b79f4bd76 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -47,7 +47,7 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); -$year = strftime("%Y", time()); +$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 9e2e485c92a..db85490e1bb 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -52,7 +52,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 15642da2d39..9052ed7ab27 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -65,7 +65,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 50848654a71..1bf7706bf87 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -62,7 +62,7 @@ if ($userid > 0) { } } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7bb430489b2..760a0eca4c8 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -64,7 +64,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; $startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 28eee624db2..e71a85004d1 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -74,7 +74,7 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer $form = new Form($db); -$year_current = strftime("%Y", dol_now()); +$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index d704e09ad68..0fc5a192271 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -77,7 +77,7 @@ $morequery = '&date_startyear='.$date_startyear.'&date_startmonth='.$date_startm llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery); -$year_current = strftime("%Y", dol_now()); +$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 7f8e181f121..d5aef47c285 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -39,7 +39,7 @@ $local = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index e9aab173337..ad0b86a161d 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -38,7 +38,7 @@ $localTaxType = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 9e03f156848..66c58580df6 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -49,7 +49,7 @@ $local = GETPOST('localTaxType', 'int'); // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 15c369b7a52..3f3e14e2d61 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -59,7 +59,7 @@ $nbofyear = 1; // Date range $year = GETPOST('year', 'int'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = strftime("%m", dol_now()); $year_start = $year_current - ($nbofyear - 1); } else { diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 8e20f5b0afd..4d65c201ffd 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -371,7 +371,7 @@ print '
    '; + print '
    '; // Member $adh->ref = $adh->getFullName($langs); @@ -320,7 +320,7 @@ if ($rowid && $action != 'edit') { print ''; // Amount - print ''; + print ''; // Label print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 648fc6e18c4..e99c4a29663 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -131,7 +131,6 @@ $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown // Security check if (!empty($user->socid)) { $socid = $user->socid; - $object->id = $user->socid; } restrictedArea($user, 'propal', $object->id); @@ -2004,8 +2003,8 @@ if ($action == 'create') { $i = 0; while ($i < $num) { $row = $db->fetch_row($resql); - $propalRefAndSocName = $row [1]." - ".$row [2]; - $liste_propal [$row [0]] = $propalRefAndSocName; + $propalRefAndSocName = $row[1]." - ".$row[2]; + $liste_propal[$row[0]] = $propalRefAndSocName; $i++; } print $form->selectarray("copie_propal", $liste_propal, 0); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 8b057a6c702..f1b5c29bae2 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -552,7 +552,7 @@ $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos' llxHeader('', $title, $help_url); $sql = 'SELECT'; -if ($sall || $search_product_category > 0 || $search_user > 0) { +if ($sall || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, '; @@ -596,12 +596,9 @@ $sql .= ', '.MAIN_DB_PREFIX.'propal as p'; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)"; @@ -714,10 +711,6 @@ if ($search_fk_input_reason > 0) { if ($search_fk_mode_reglement > 0) { $sql .= " AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement); } - -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -754,6 +747,36 @@ if ($search_date_signature_start) { if ($search_date_signature_end) { $sql .= " AND p.date_signature <= '".$db->idate($search_date_signature_end)."'"; } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 455420ce90a..79bbf69e31c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -793,7 +793,7 @@ $title = $langs->trans("Orders"); $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; $sql = 'SELECT'; -if ($sall || $search_product_category > 0 || $search_user > 0) { +if ($sall || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client,'; @@ -837,12 +837,9 @@ $sql .= ', '.MAIN_DB_PREFIX.'commande as c'; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)"; } -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid'; @@ -862,9 +859,6 @@ $sql .= $hookmanager->resPrint; $sql .= ' WHERE c.fk_soc = s.rowid'; $sql .= ' AND c.entity IN ('.getEntity('commande').')'; -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -1007,7 +1001,36 @@ if ($search_fk_mode_reglement > 0) { if ($search_fk_input_reason > 0) { $sql .= " AND c.fk_input_reason = ".((int) $search_fk_input_reason); } - +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index fb7616e8ab3..46cf6b73ac4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -559,7 +559,7 @@ $companyparent = new Societe($db); $company_url_list = array(); $sql = 'SELECT'; -if ($sall || $search_product_category > 0 || $search_user > 0) { +if ($sall || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= ' f.rowid as id, f.ref, f.ref_client, f.fk_soc, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total_ht, f.total_tva, f.total_ttc,'; @@ -616,7 +616,7 @@ if (!$sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; } */ -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture'; } if (!empty($search_fac_rec_source_title)) { @@ -811,17 +811,17 @@ if (!empty($searchCategoryProductList)) { $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { if ($searchCategoryProductOperator == 0) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; } else { $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); } } } if ($listofcategoryid) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } if ($searchCategoryProductOperator == 1) { if (!empty($searchCategoryProductSqlList)) { @@ -918,7 +918,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $db->num_rows($result); */ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - if ($sall || $search_product_category > 0 || $search_user > 0) { + if ($sall || $search_user > 0) { $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql); } else { $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index c1b97e65e98..65bb4fa8b08 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -265,9 +265,6 @@ if (!empty($extrafields->attributes[$object->table_element]['label']) && is_arra $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; -} if ($search_user > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; @@ -277,9 +274,6 @@ $sql .= ' AND c.entity IN ('.getEntity('contract').')'; if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')'; } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } @@ -325,6 +319,36 @@ if ($sall) { if ($search_user > 0) { $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user); } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -378,8 +402,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } else { $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'contratdet as cd ON c.rowid = cd.fk_contrat/', '', $sqlforcount); - $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product/', '', $sqlforcount); - $sqlforcount = preg_replace('/AND cp.fk_categorie = '.((int) $search_product_category).'/', '', $sqlforcount); $sqlforcount = preg_replace('/GROUP BY.*$/', '', $sqlforcount); $resql = $db->query($sqlforcount); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 81e0adb15aa..3b06f005787 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -258,7 +258,7 @@ $helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Ex llxHeader('', $langs->trans('ListOfSendings'), $helpurl); $sql = 'SELECT'; -if ($sall || $search_product_category > 0 || $search_user > 0) { +if ($sall || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,"; @@ -288,13 +288,10 @@ $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (e.rowid = ef.fk_object)"; } -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'expeditiondet as ed ON e.rowid=ed.fk_expedition'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON pd.rowid=ed.fk_origin_line'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ @@ -326,9 +323,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object $sql .= $hookmanager->resPrint; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} + if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } @@ -408,7 +403,36 @@ if ($search_categ_cus > 0) { if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; } - +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -593,7 +617,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->right $moreforfilter .= img_picto($tmptitle, 'category'); //$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); //$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); - $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'parent', 1, $tmptitle); + $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'search_product_category', 1, $tmptitle); $moreforfilter .= ''; } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index e0434378573..8eac9943c3a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -752,7 +752,7 @@ if ($search_billed > 0) { $help_url = ''; $sql = 'SELECT'; -if ($sall || $search_product_category > 0) { +if ($sall) { $sql = 'SELECT DISTINCT'; } $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.email,'; @@ -782,12 +782,9 @@ $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (cf.rowid = ef.fk_object)"; } -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseurdet as pd ON cf.rowid=pd.fk_commande'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cf.fk_projet"; // We'll need this table joined to the select in order to filter by sale @@ -826,9 +823,6 @@ if ($search_request_author) { if ($search_billed != '' && $search_billed >= 0) { $sql .= " AND cf.billed = ".((int) $search_billed); } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') { $sql .= " AND cf.fk_statut IN (".$db->sanitize($db->escape($db->escape(GETPOST('statut', 'intcomma')))).")"; @@ -920,6 +914,36 @@ if ($search_multicurrency_montant_ttc != '') { if ($search_project_ref != '') { $sql .= natural_search("p.ref", $search_project_ref); } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 709204793e9..9f06c56b9e1 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -405,7 +405,7 @@ $formcompany = new FormCompany($db); $thirdparty = new Societe($db); $sql = "SELECT"; -if ($search_all || $search_product_category > 0) { +if ($search_all) { $sql = 'SELECT DISTINCT'; } $sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement, f.fk_cond_reglement,"; @@ -446,7 +446,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array if (!$search_all) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; } -if ($search_all || $search_product_category > 0) { +if ($search_all) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; } $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; @@ -622,17 +622,17 @@ if (!empty($searchCategoryProductList)) { $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { if ($searchCategoryProductOperator == 0) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; } else { $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); } } } if ($listofcategoryid) { - $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } if ($searchCategoryProductOperator == 1) { if (!empty($searchCategoryProductSqlList)) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 37853d1488a..66f69a25ff9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -52,7 +52,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'supplier_proposal', 'compta', 'bills', 'propal', 'orders', 'products', 'deliveries', 'sendings')); -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $langs->load('margins'); } @@ -62,13 +62,13 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel'); +$cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOST('originid', 'int'); $confirm = GETPOST('confirm', 'alpha'); -$projectid = GETPOST('projectid', 'int'); $lineid = GETPOST('lineid', 'int'); $contactid = GETPOST('contactid', 'int'); +$projectid = GETPOST('projectid', 'int'); $rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; // PDF @@ -79,12 +79,6 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($con // Nombre de ligne pour choix de produit/service predefinis $NBLINES = 4; -// Security check -if (!empty($user->socid)) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'supplier_proposal', $id); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('supplier_proposalcard', 'globalcard')); @@ -100,8 +94,9 @@ if ($id > 0 || !empty($ref)) { if ($ret > 0) { $ret = $object->fetch_thirdparty(); } - if ($ret < 0) { - dol_print_error('', $object->error); + if ($ret <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; } } @@ -124,6 +119,12 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php $permissiontoadd = $usercancreate; +// Security check +if (!empty($user->socid)) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'supplier_proposal', $object->id); + /* * Actions @@ -166,7 +167,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once // Action clone object - if ($action == 'confirm_clone' && $confirm == 'yes') { + if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } else { @@ -195,8 +196,11 @@ if (empty($reshook)) { // Remove line $result = $object->deleteline($lineid); // reorder lines - if ($result) { + if ($result > 0) { $object->line_order(true); + } else { + $langs->load("errors"); + setEventMessages($object->error, $object->errors, 'errors'); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -208,6 +212,9 @@ if (empty($reshook)) { $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) { + $object->fetch_thirdparty(); + } $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } @@ -218,25 +225,25 @@ if (empty($reshook)) { $result = $object->valid($user); if ($result >= 0) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $outputlangs = $langs; - $newlang = ''; - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { - $newlang = GETPOST('lang_id', 'aZ09'); - } - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { - $newlang = $object->thirdparty->default_lang; - } - if (!empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model = $object->model_pdf; - $ret = $object->fetch($id); // Reload to get new records - - $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + $outputlangs = $langs; + $newlang = ''; + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); } + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { + $newlang = $object->thirdparty->default_lang; + } + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model = $object->model_pdf; + $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) { + $object->fetch_thirdparty(); + } + + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } else { $langs->load("errors"); @@ -322,6 +329,7 @@ if (empty($reshook)) { if (!$error) { if ($origin && $originid) { + // Parse element/subelement (ex: project_task) $element = $subelement = $origin; if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { $element = $regs[1]; @@ -336,6 +344,15 @@ if (empty($reshook)) { $element = 'comm/propal'; $subelement = 'propal'; } + if ($element == 'contract') { + $element = $subelement = 'contrat'; + } + if ($element == 'inter') { + $element = $subelement = 'ficheinter'; + } + if ($element == 'shipping') { + $element = $subelement = 'expedition'; + } $object->origin = $origin; $object->origin_id = $originid; @@ -533,6 +550,9 @@ if (empty($reshook)) { $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) { + $object->fetch_thirdparty(); + } $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } elseif ($action == "setabsolutediscount" && $usercancreate) { @@ -568,11 +588,13 @@ if (empty($reshook)) { $ref_supplier = GETPOST('fourn_ref', 'alpha'); - $prod_entry_mode = GETPOST('prod_entry_mode'); - if ($prod_entry_mode == 'free') { + $prod_entry_mode = GETPOST('prod_entry_mode', 'aZ09'); + if ($prod_entry_mode == 'free') { $idprod = 0; + $tva_tx = (GETPOST('tva_tx', 'alpha') ? price2num(preg_replace('/\s*\(.*\)/', '', GETPOST('tva_tx', 'alpha'))) : 0); } else { $idprod = GETPOST('idprod', 'int'); + $tva_tx = ''; } $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)' @@ -581,7 +603,8 @@ if (empty($reshook)) { $price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2); $price_ttc = price2num(GETPOST('price_ttc'), 'MU', 2); $price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2); - $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); + + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0); if (empty($remise_percent)) { @@ -864,6 +887,9 @@ if (empty($reshook)) { } $model = $object->model_pdf; $ret = $object->fetch($id); // Reload to get new records + if ($ret > 0) { + $object->fetch_thirdparty(); + } $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { @@ -917,7 +943,7 @@ if (empty($reshook)) { } } } elseif ($action == 'updateline' && $usercancreate && GETPOST('save') == $langs->trans("Save")) { - // Mise a jour d'une ligne dans la demande de prix + // Update a line within proposal $vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0); // Define info_bits @@ -1403,7 +1429,7 @@ if ($action == 'create') { /* - * Combobox pour la fonction de copie + * Combobox for copy function */ if (empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE)) { @@ -1425,7 +1451,7 @@ if ($action == 'create') { $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal p"; $sql .= ", ".MAIN_DB_PREFIX."societe s"; $sql .= " WHERE s.rowid = p.fk_soc"; - $sql .= " AND p.entity = ".$conf->entity; + $sql .= " AND p.entityy IN (".getEntity('supplier_proposal').")"; $sql .= " AND p.fk_statut <> ".SupplierProposal::STATUS_DRAFT; $sql .= " ORDER BY Id"; @@ -1435,8 +1461,8 @@ if ($action == 'create') { $i = 0; while ($i < $num) { $row = $db->fetch_row($resql); - $askPriceSupplierRefAndSocName = $row [1]." - ".$row [2]; - $liste_ask [$row [0]] = $askPriceSupplierRefAndSocName; + $askPriceSupplierRefAndSocName = $row[1]." - ".$row[2]; + $liste_ask[$row[0]] = $askPriceSupplierRefAndSocName; $i++; } print $form->selectarray("copie_supplier_proposal", $liste_ask, 0); @@ -1564,39 +1590,28 @@ if ($action == 'create') { //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'supplier'); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($usercancreate) { + $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->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -1610,7 +1625,7 @@ if ($action == 'create') { print '
    '; print '
    '; - print '
    '.$langs->trans("Amount").''.price($object->amount).'
    '.$langs->trans("Amount").''.price($object->amount).'
    '.$langs->trans("Label").''.$object->note.'
    '; + print '
    '; // Relative and absolute discounts if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 1fa344cbb5e..8db19cfb2a7 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -132,15 +132,15 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; // Ref supplier - $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); + //$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); + //$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '; - if ($permissiontoedit) { + if (0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 7aacfb8f8b2..c1829fd61d6 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -77,6 +77,7 @@ if ($object->id > 0) { } $permissiontoadd = $user->rights->supplier_proposal->creer; +$usercancreate = $permissiontoadd; /* * Actions @@ -120,37 +121,25 @@ if ($object->id > 0) { //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->supplier_proposal->creer) { + $morehtmlref .= '
    '; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index d1f0daad639..0b2af861163 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -72,32 +72,22 @@ $morehtmlref = '
    '; //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= $object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->supplier_proposal->creer) { + $morehtmlref .= '
    '; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5cb7cf69ef8..fd71dc26204 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -94,6 +94,7 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_status = GETPOST('search_status', 'int'); +$search_product_category = GETPOST('search_product_category', 'int'); $object_statut = $db->escape(GETPOST('supplier_proposal_statut')); $search_btn = GETPOST('button_search', 'alpha'); @@ -216,8 +217,6 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -$search_product_category = 0; - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? @@ -295,7 +294,7 @@ $help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'; llxHeader('', $title, $help_url); $sql = 'SELECT'; -if ($sall || $search_product_category > 0 || $search_user > 0) { +if ($sall || $search_user > 0) { $sql = 'SELECT DISTINCT'; } $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; @@ -327,12 +326,9 @@ $sql .= ', '.MAIN_DB_PREFIX.'supplier_proposal as sp'; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (sp.rowid = ef.fk_object)"; } -if ($sall || $search_product_category > 0) { +if ($sall) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'supplier_proposaldet as pd ON sp.rowid=pd.fk_supplier_proposal'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sp.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = sp.fk_projet"; // We'll need this table joined to the select in order to filter by sale @@ -426,6 +422,36 @@ if ($search_sale > 0) { if ($search_user > 0) { $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".((int) $search_user); } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductOperator = -1; +$searchCategoryProductList = array($search_product_category); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + if ($searchCategoryProductOperator == 0) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; + } else { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -1121,7 +1147,7 @@ if ($resql) { $userstatic->id = $obj->fk_user_author; $userstatic->login = $obj->login; - $userstatic->status = $obj->status; + $userstatic->status = $obj->ustatus; $userstatic->lastname = $obj->name; $userstatic->firstname = $obj->firstname; $userstatic->photo = $obj->photo; @@ -1201,6 +1227,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print '
    '; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 118855cecf3..aa0ccc5276a 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/comm/propal/note.php + * \file htdocs/supplier_proposal/note.php * \ingroup propal - * \brief Fiche d'information sur une proposition commerciale + * \brief Page to show notes of a supplier proposal request */ // Load Dolibarr environment @@ -53,6 +53,8 @@ $result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal'); $object = new SupplierProposal($db); +$usercancreate = $user->hasRight("supplier_propal", "write"); + /* @@ -104,37 +106,25 @@ if ($id > 0 || !empty($ref)) { //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= $object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->supplier_proposal->creer) { + $morehtmlref .= '
    '; + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); 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); + $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); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index dacf572d175..c5681326817 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -436,7 +436,6 @@ if ($search_statut != '' && $search_statut >= 0) { if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } - // Search for tag/category ($searchCategoryUserList is an array of ID) $searchCategoryUserList = array($search_categ); if (!empty($searchCategoryUserList)) { From fdc5cc6d6e3d54f39412f3f91ac769759639eb21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2022 17:47:21 +0100 Subject: [PATCH 1231/1289] Add more log in payment process --- htdocs/public/payment/newpayment.php | 6 ++++-- htdocs/public/payment/paymentok.php | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 018d233ade2..207775a3d54 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -805,6 +805,8 @@ if ($action == 'charge' && isModEnabled('stripe')) { dol_syslog("onlinetoken=".$_SESSION["onlinetoken"]." FinalPaymentAmt=".$_SESSION["FinalPaymentAmt"]." currencyCodeType=".$_SESSION["currencyCodeType"]." payerID=".$_SESSION['payerID']." TRANSACTIONID=".$_SESSION['TRANSACTIONID'], LOG_DEBUG, 0, '_payment'); dol_syslog("FULLTAG=".$FULLTAG, LOG_DEBUG, 0, '_payment'); dol_syslog("error=".$error." errormessage=".$errormessage, LOG_DEBUG, 0, '_payment'); + dol_syslog("_SERVER[SERVER_NAME] = ".(empty($_SERVER["SERVER_NAME"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_NAME"])), LOG_DEBUG, 0, '_payment'); + dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_ADDR"])), LOG_DEBUG, 0, '_payment'); dol_syslog("Now call the redirect to paymentok or paymentko, URL = ".($error ? $urlko : $urlok), LOG_DEBUG, 0, '_payment'); if ($error) { @@ -834,7 +836,7 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -dol_syslog("newpayment.php show page paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha'), LOG_DEBUG, 0, '_payment'); +dol_syslog("newpayment.php show page source=".$source." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha')." ref=".$ref, LOG_DEBUG, 0, '_payment'); // Check link validity if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) { @@ -2411,7 +2413,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme } elseif (!empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { ?> // Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set to 1 or 2 - + // Create a Stripe client. $v) { $tracepost .= "{$k} - {$v}\n"; } dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); +$tracesession = ""; +foreach ($_SESSION as $k => $v) { + $tracesession .= "{$k} - {$v}\n"; +} +dol_syslog("SESSION=".$tracesession, LOG_DEBUG, 0, '_payment'); $head = ''; if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { From 194df584b994510cab41d43c4327a7a675a00c8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2022 18:15:33 +0100 Subject: [PATCH 1232/1289] Fix log --- htdocs/public/payment/newpayment.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 207775a3d54..79104817e77 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -836,7 +836,10 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +dol_syslog("--- newpayment.php action = ".$action, LOG_DEBUG, 0, '_payment'); dol_syslog("newpayment.php show page source=".$source." paymentmethod=".$paymentmethod.' amount='.$amount.' newamount='.GETPOST("newamount", 'alpha')." ref=".$ref, LOG_DEBUG, 0, '_payment'); +dol_syslog("_SERVER[SERVER_NAME] = ".(empty($_SERVER["SERVER_NAME"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_NAME"])), LOG_DEBUG, 0, '_payment'); +dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_escape_htmltag($_SERVER["SERVER_ADDR"])), LOG_DEBUG, 0, '_payment'); // Check link validity if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) { From 28a6a879cb613db9021d7830519501e4fd516371 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Oct 2022 19:51:04 +0100 Subject: [PATCH 1233/1289] Code comment --- htdocs/filefunc.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 54c7885e080..3a7eebbffac 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -253,7 +253,7 @@ if (empty($dolibarr_main_data_root)) { // Define some constants define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter) define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents) -// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT. +// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT when root is not directly the main domain. // Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works. $tmp = ''; $found = 0; @@ -283,7 +283,8 @@ foreach ($paths as $tmppath) { // We check to find (B+start of C)=A } //print "found=".$found." dolibarr_main_url_root=".$dolibarr_main_url_root."\n"; if (!$found) { - $tmp = $dolibarr_main_url_root; // If autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT). + // There is no subdir that compose the main url root or autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT). + $tmp = $dolibarr_main_url_root; } else { $tmp = 'http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : ''); } From 4bd9bdaccd509172cf7b483e6eefde78acf42338 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Nov 2022 07:56:24 +0100 Subject: [PATCH 1234/1289] FIX Accountancy - Review of Winfic - eWinfic - Winsis compta export format --- .../class/accountancyexport.class.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index db58cb2ccbc..022a8ecd3c0 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -657,7 +657,7 @@ class AccountancyExport /** * Export format : WinFic - eWinfic - WinSis Compta - * Last review for this format : 2022-10-28 Alexandre Spangaro (aspangaro@open-dsi.fr) + * Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr) * * Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf * @@ -670,10 +670,14 @@ class AccountancyExport global $conf; $end_line = "\r\n"; + $index = 1; //We should use dol_now function not time however this is wrong date to transfert in accounting //$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy //$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy + + // Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (!empty($data->subledger_account)) { @@ -691,11 +695,11 @@ class AccountancyExport $Tab['folio'] = ' 1'; - $Tab['num_ecriture'] = str_pad(dol_trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT); + $Tab['num_ecriture'] = str_pad(dol_trunc($index, 6), 6, ' ', STR_PAD_LEFT); $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); - $Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6), 6, '0'); + $Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0'); if ($data->sens == 'D') { $Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); @@ -707,11 +711,11 @@ class AccountancyExport $Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); } - $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30); + $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30); $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left'), 2); - $Tab['code_piece'] = str_repeat(' ', 5); + $Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5), 5, ' ', STR_PAD_LEFT); $Tab['code_stat'] = str_repeat(' ', 4); @@ -735,6 +739,8 @@ class AccountancyExport $Tab['end_line'] = $end_line; print implode('|', $Tab); + + $index++; } } From d3d55240f911cbf98878e935dd107b02ea8952da Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Nov 2022 08:00:37 +0100 Subject: [PATCH 1235/1289] FIX Accountancy - Review of Winfic - eWinfic - Winsis compta export format --- htdocs/accountancy/class/accountancyexport.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 022a8ecd3c0..73035c55d5d 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -686,7 +686,7 @@ class AccountancyExport $Tab = array(); //$Tab['type_ligne'] = 'M'; - $Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2), 2); + $Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2); //We use invoice date $data->doc_date not $date_ecriture which is the transfert date //maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? @@ -695,7 +695,7 @@ class AccountancyExport $Tab['folio'] = ' 1'; - $Tab['num_ecriture'] = str_pad(dol_trunc($index, 6), 6, ' ', STR_PAD_LEFT); + $Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); @@ -713,9 +713,9 @@ class AccountancyExport $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30); - $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left'), 2); + $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2); - $Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5), 5, ' ', STR_PAD_LEFT); + $Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT); $Tab['code_stat'] = str_repeat(' ', 4); From 9aeb1b0f8671d5b06605a372ee5b8efd37c88757 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 11:46:21 +0100 Subject: [PATCH 1236/1289] Remove no more used option MODULEBUILDER_FOREVERYONE Add menu entry in main menu Tools for Modulebuilder and API explorer --- htdocs/core/modules/modApi.class.php | 45 ++++++------------- .../core/modules/modModuleBuilder.class.php | 14 +++--- htdocs/langs/en_US/modulebuilder.lang | 2 +- htdocs/modulebuilder/index.php | 6 +-- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 5eaae25a67c..30751fc5222 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -152,37 +152,20 @@ class modApi extends DolibarrModules $this->menu = array(); // List of menus to add $r = 0; - // Add here entries to declare new menus - // - // Example to declare a new Top Menu entry and its Left menu entry: - // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu - // 'type'=>'top', // This is a Top menu entry - // 'titre'=>'Api top menu', - // 'mainmenu'=>'api', - // 'leftmenu'=>'api', - // 'url'=>'/api/pagetop.php', - // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - // 'position'=>100, - // 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled. - // 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules - // 'target'=>'', - // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - // $r++; - // - // Example to declare a Left Menu entry into an existing Top menu entry: - // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - // 'type'=>'left', // This is a Left menu entry - // 'titre'=>'Api left menu', - // 'mainmenu'=>'xxx', - // 'leftmenu'=>'api', - // 'url'=>'/api/pagelevel2.php', - // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - // 'position'=>100, - // 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - // 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules - // 'target'=>'', - // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - // $r++; + $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools', + 'type'=>'left', + 'titre'=>'ApiExplorer', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'mainmenu'=>'tools', + 'leftmenu'=>'devtools_api', + 'url'=>'/api/index.php/explorer', + 'langs'=>'modulebuilder', + 'position'=>100, + 'perms'=>'1', + //'enabled'=>'isModEnabled("api") && preg_match(\'/^(devtools)/\',$leftmenu)', + 'enabled'=>'isModEnabled("api")', + 'target'=>'_apiexplorer', + 'user'=>0); // Exports diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index 99c32e48bbd..2d6cafa9c2e 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -102,16 +102,18 @@ class modModuleBuilder extends DolibarrModules //------------------ $this->menu = array(); - $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', + $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools', 'type'=>'left', 'titre'=>'ModuleBuilder', - 'mainmenu'=>'home', - 'leftmenu'=>'admintools_modulebuilder', - 'url'=>'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'mainmenu'=>'tools', + 'leftmenu'=>'devtools_modulebuilder', + 'url'=>'/modulebuilder/index.php?mainmenu=tools&leftmenu=devtools', 'langs'=>'modulebuilder', 'position'=>100, - 'perms'=>'1', - 'enabled'=>'$conf->modulebuilder->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu) && ($user->admin || $conf->global->MODULEBUILDER_FOREVERYONE)', + 'perms'=>'$user->hasRight("modulebuilder", "run")', + //'enabled'=>'isModEnabled("modulebuilder") && preg_match(\'/^(devtools|all)/\',$leftmenu)', + 'enabled'=>'isModEnabled("modulebuilder")', 'target'=>'_modulebuilder', 'user'=>0); } diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 6de9ada7e4d..cefdfaa1b41 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -86,7 +86,7 @@ IsAMeasure=Is a measure DirScanned=Directory scanned NoTrigger=No trigger NoWidget=No widget -GoToApiExplorer=API explorer +ApiExplorer=API explorer ListOfMenusEntries=List of menu entries ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 705dc202932..eadef4684a4 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -84,7 +84,7 @@ $idmodule= GETPOST('idmodule', 'alpha'); if (!isModEnabled('modulebuilder')) { accessforbidden('Module ModuleBuilder not enabled'); } -if (!$user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) { +if (!$user->hasRight("modulebuilder", "run")) { accessforbidden('ModuleBuilderNotAllowed'); } @@ -2836,9 +2836,9 @@ if ($module == 'initmodule') { print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; if (empty($conf->global->$const_name)) { // If module is not activated - print ''.$langs->trans("GoToApiExplorer").''; + print ''.$langs->trans("ApiExplorer").''; } else { - print ''.$langs->trans("GoToApiExplorer").''; + print ''.$langs->trans("ApiExplorer").''; } } else { print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; From 39ef32326fe92707cb00fffc87454f0dd1a66e83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 12:05:52 +0100 Subject: [PATCH 1237/1289] Better responsive behaviour --- htdocs/user/list.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 8642c569752..e92fbf33280 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1072,14 +1072,15 @@ while ($i < $imaxinloop) { } } + // Phone if (!empty($arrayfields['u.office_phone']['checked'])) { - print '
    \n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.user_mobile']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1091,10 +1092,10 @@ while ($i < $imaxinloop) { } } if (!empty($arrayfields['u.api_key']['checked'])) { - print '\n"; // D'ont display category diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 671ef27ba96..db6b224466c 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -84,7 +84,10 @@ if ($action == 'getProducts') { } unset($prod->fields); unset($prod->db); - $prod->price_formated=price(price2num($prod->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency); + + $prod->price_formated = price(price2num($prod->price, 'MT'), 1, $langs, 1, -1, -1, $conf->currency); + $prod->price_ttc_formated = price(price2num($prod->price_ttc, 'MT'), 1, $langs, 1, -1, -1, $conf->currency); + $res[] = $prod; } } @@ -158,7 +161,7 @@ if ($action == 'getProducts') { if (isset($barcode_value_list['ref'])) { // search product from reference - $sql = "SELECT rowid, ref, label, tosell, tobuy, barcode, price"; + $sql = "SELECT rowid, ref, label, tosell, tobuy, barcode, price, price_ttc"; $sql .= " FROM " . $db->prefix() . "product as p"; $sql .= " WHERE entity IN (" . getEntity('product') . ")"; $sql .= " AND ref = '" . $db->escape($barcode_value_list['ref']) . "'"; @@ -207,6 +210,7 @@ if ($action == 'getProducts') { 'tobuy' => $obj->tobuy, 'barcode' => $obj->barcode, 'price' => $obj->price, + 'price_ttc' => $obj->price_ttc, 'object' => 'product', 'img' => $ig, 'qty' => $qty, @@ -223,7 +227,7 @@ if ($action == 'getProducts') { } } - $sql = 'SELECT p.rowid, p.ref, p.label, p.tosell, p.tobuy, p.barcode, p.price' ; + $sql = 'SELECT p.rowid, p.ref, p.label, p.tosell, p.tobuy, p.barcode, p.price, p.price_ttc' ; if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) { $sql .= ', ps.reel'; } @@ -299,10 +303,12 @@ if ($action == 'getProducts') { 'tobuy' => $obj->tobuy, 'barcode' => $obj->barcode, 'price' => $obj->price, + 'price_ttc' => $obj->price_ttc, 'object' => 'product', 'img' => $ig, 'qty' => 1, - 'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) + 'price_formated' => price(price2num($obj->price, 'MT'), 1, $langs, 1, -1, -1, $conf->currency), + 'price_ttc_formated' => price(price2num($obj->price_ttc, 'MT'), 1, $langs, 1, -1, -1, $conf->currency) ); // Add entries to row from hooks $parameters=array(); diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index d39b3fb0b37..ec21eea2d60 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -477,7 +477,7 @@ p.description_content{ div.description_content { display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: global->TAKEPOS_LINES_TO_SHOW; ?>; + -webkit-line-clamp: ; overflow: hidden; padding-left: 2px; padding-right: 2px; @@ -587,11 +587,11 @@ div#moreinfo, div#infowarehouse { background: var(--colorbackhmenu1); color: var(--colortextbackhmenu); font-size: 2em; - padding: 5px; + padding: 4px; border-radius: 2px; opacity: 0.9; - padding-left: 8px; - padding-right: 8px; + padding-left: 6px; + padding-right: 6px; } @@ -841,11 +841,11 @@ div#moreinfo, div#infowarehouse { padding-bottom: 2px; margin-left: 2px; } - + .div4 .wrapper.divempty, .div4 img, .div4 .wrapper:nth-last-child(1), .div4 .wrapper:nth-last-child(2), #prodiv22, #prodiv23, .catwatermark { display: none!important; } - + .tab-category { float: left; position: relative; @@ -858,7 +858,7 @@ div#moreinfo, div#infowarehouse { box-sizing: border-box; background-color: #fff; } - + .div4 .wrapper, .tab-category { width: auto; height: auto; @@ -868,7 +868,7 @@ div#moreinfo, div#infowarehouse { border: 1px solid #FFF!important; border-top: 3px solid #FFF!important; } - + .div4 .tab-category.active { border-right: 1px solid #CCC !important; border-left: 1px solid #CCC !important; @@ -890,42 +890,42 @@ div#moreinfo, div#infowarehouse { padding-top: 0px; background: -webkit-linear-gradient(top, rgba(250,250,250,0), rgba(250,250,250,0.5), rgba(250,250,250,0.95), rgba(250,250,250,1)); } - + .div5 .description .description_content { font-weight: bold; font-size: 14px; padding-left: 10px; } - + .div5 .wrapper2 { width: 100%; display: inline-flex; align-items: center; padding: 10px; } - + .div5 .wrapper2.divempty { display: none; } - + div.wrapper2 { float: none; } - + .div5 .arrow { width: auto; height: auto; display: none!important; } - + .div5 .arrow .centerinmiddle { transform: translate(0, 0); } - + .div5 .imgadd { display: flex; } - + div.wrapper2{ height:10%; } @@ -1009,12 +1009,12 @@ html { ::-webkit-scrollbar-track { - background: #f1f1f1; + background: #f1f1f1; } - + ::-webkit-scrollbar-thumb { - background: #888; + background: #888; } .topnav::-webkit-scrollbar-track{ diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index a128a0d66fd..17c4f14060c 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -367,7 +367,7 @@ function LoadProducts(position, issubcat) { ?> if (data[parseInt(idata)]['price_formated']) { $("#proprice"+ishow).attr("class", "productprice"); - $("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']); + $("#proprice"+ishow).html(data[parseInt(idata)]['price_ttc_formated']); } console.log("#prodiv"+ishow+".data(rowid)="+data[idata]['id']); console.log($("#prodiv"+ishow)); @@ -449,7 +449,7 @@ function MoreProducts(moreorless) { $("#probutton"+ishow).show(); if (data[parseInt(idata)]['price_formated']) { $("#proprice"+ishow).attr("class", "productprice"); - $("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']); + $("#proprice"+ishow).html(data[parseInt(idata)]['price_ttc_formated']); } $("#proimg"+ishow).attr("src","genimg/index.php?query=pro&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); @@ -657,7 +657,7 @@ function Search2(keyCodeForEnter, moreorless) { $("#probutton" + i).show(); if (data[i]['price_formated']) { $("#proprice" + i).attr("class", "productprice"); - $("#proprice" + i).html(data[i]['price_formated']); + $("#proprice" + i).html(data[i]['price_ttc_formated']); } $("#proimg" + i).attr("title", titlestring); if( undefined !== data[i]['img']) { @@ -939,15 +939,15 @@ $( document ).ready(function() { } } ?> - + /* For Header Scroll */ var elem1 = $("#topnav-left")[0]; var elem2 = $("#topnav-right")[0]; var checkOverflow = function() { if (scrollBars().horizontal) $("#topnav").addClass("overflow"); - else $("#topnav").removeClass("overflow"); + else $("#topnav").removeClass("overflow"); } - + var scrollBars = function(){ var container= $('#topnav')[0]; return { @@ -955,43 +955,43 @@ $( document ).ready(function() { horizontal:container.scrollWidth > container.clientWidth }; } - + $(window).resize(function(){ checkOverflow(); }); - + let resizeObserver = new ResizeObserver(() => { checkOverflow(); }); resizeObserver.observe(elem1); resizeObserver.observe(elem2); checkOverflow(); - + var pressTimer = []; var direction = 1; var step = 200; - + $(".indicator").mousedown(function(){ direction = $(this).hasClass("left") ? -1 : 1; scrollTo(); pressTimer.push(setInterval(scrollTo, 100)); }); - + $(".indicator").mouseup(function(){ pressTimer.forEach(clearInterval); }); - + $("body").mouseup(function(){ pressTimer.forEach(clearInterval); console.log("body"); }); - + function scrollTo(){ console.log("here"); var pos = $("#topnav").scrollLeft(); document.getElementById("topnav").scrollTo({ left: $("#topnav").scrollLeft() + direction * step, behavior: 'smooth' }) } - + $("#topnav").scroll(function(){ if (($("#topnav").offsetWidth + $("#topnav").scrollLeft >= $("#topnav").scrollWidth)) { console.log("end"); From 8e9be8f40fbf541b2abdcc519a975e617d53878e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 23:33:08 +0100 Subject: [PATCH 1241/1289] Update card.php --- htdocs/comm/propal/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 64f58e4d705..da4c756705f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1635,13 +1635,13 @@ if ($action == 'create') { // Terms of payment print ''; // Mode of payment print ''; // Bank Account From ff16d74bd2975d207ed45fca66fc1caaff3065ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 00:00:02 +0100 Subject: [PATCH 1242/1289] FIX install wizard error management --- htdocs/install/step5.php | 82 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index b841edb12ac..27bce2d8e57 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -220,9 +220,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."
    "; $success = 1; } else { - if ($newuser->error == 'ErrorLoginAlreadyExists') { + if ($result == -6) { //login or email already exists dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING); - print '
    '.$langs->trans("AdminLoginAlreadyExists", $login)."

    "; + print '
    '.$newuser->error."

    "; $success = 1; } else { dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR); @@ -357,48 +357,50 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { // Create lock file // If first install -if ($action == "set" && $success) { - if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { - // Install is finished - print $langs->trans("SystemIsInstalled")."
    "; +if ($action == "set") { + if ($success) { + if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { + // Install is finished + print $langs->trans("SystemIsInstalled")."
    "; - $createlock = 0; + $createlock = 0; - if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { - // Install is finished, we create the lock file - $lockfile = DOL_DATA_ROOT.'/install.lock'; - $fp = @fopen($lockfile, "w"); - if ($fp) { - if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) { - $force_install_lockinstall = 444; // For backward compatibility + if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { + // Install is finished, we create the lock file + $lockfile = DOL_DATA_ROOT.'/install.lock'; + $fp = @fopen($lockfile, "w"); + if ($fp) { + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) { + $force_install_lockinstall = 444; // For backward compatibility + } + fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); + fclose($fp); + @chmod($lockfile, octdec($force_install_lockinstall)); + $createlock = 1; } - fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); - fclose($fp); - @chmod($lockfile, octdec($force_install_lockinstall)); - $createlock = 1; } + if (empty($createlock)) { + print '
    '.$langs->trans("WarningRemoveInstallDir")."
    "; + } + + print "
    "; + + print $langs->trans("YouNeedToPersonalizeSetup")."


    "; + + print ''; + } else { + // If here MAIN_VERSION_LAST_UPGRADE is not empty + print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
    '; + print $langs->trans("VersionProgram").': '.DOL_VERSION.'
    '; + print $langs->trans("MigrationNotFinished").'
    '; + print "
    "; + + print ''; } - if (empty($createlock)) { - print '
    '.$langs->trans("WarningRemoveInstallDir")."
    "; - } - - print "
    "; - - print $langs->trans("YouNeedToPersonalizeSetup")."


    "; - - print ''; - } else { - // If here MAIN_VERSION_LAST_UPGRADE is not empty - print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
    '; - print $langs->trans("VersionProgram").': '.DOL_VERSION.'
    '; - print $langs->trans("MigrationNotFinished").'
    '; - print "
    "; - - print ''; } } elseif (empty($action) || preg_match('/upgrade/i', $action)) { // If upgrade @@ -443,7 +445,7 @@ if ($action == "set" && $success) { $morehtml .= ''; } } else { - dol_print_error('', 'step5.php: unknown choice of action'); + dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction'); } // Clear cache files From 74f350daa47b42ba41ac2b65b50eb1b162f3cd00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 00:36:08 +0100 Subject: [PATCH 1243/1289] Fix error message not complete --- htdocs/takepos/invoice.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e22f6e6d226..47af7d16260 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -703,7 +703,9 @@ if (empty($reshook)) { $pu_ht = price2num($number / (1 + ($line->tva_tx / 100)), 'MU'); //Check min price if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min)))) { - echo $langs->trans("CantBeLessThanMinPrice"); + $langs->load("products"); + dol_htmloutput_errors($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency))); + //echo $langs->trans("CantBeLessThanMinPrice"); } else { if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) { dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); @@ -739,7 +741,8 @@ if (empty($reshook)) { // Check min price if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) { - echo $langs->trans("CantBeLessThanMinPrice"); + $langs->load("products"); + dol_htmloutput_errors($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency))); } else { if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) { dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); From 59809eb50a5b8ce7b8c719d8526eced57aaa335e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 00:49:28 +0100 Subject: [PATCH 1244/1289] Fix trans --- htdocs/langs/en_US/admin.lang | 4 +++- htdocs/langs/en_US/contracts.lang | 1 - htdocs/langs/en_US/interventions.lang | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0555906768c..e963f8206be 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2333,4 +2333,6 @@ MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents f WarningDisabled=Warning disabled LimitsAndMitigation=Access limits and mitigation DesktopsOnly=Desktops only -DesktopsAndSmartphones=Desktops et smartphones \ No newline at end of file +DesktopsAndSmartphones=Desktops et smartphones +AllowOnlineSign=Allow online signing +AllowExternalDownload=Allow external download (without login, using a shared link) \ No newline at end of file diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index a485f97a553..ab94a63bcc3 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -101,7 +101,6 @@ TypeContact_contrat_external_BILLING=Billing customer contact TypeContact_contrat_external_CUSTOMER=Follow-up customer contact TypeContact_contrat_external_SALESREPSIGN=Signing contract customer contact HideClosedServiceByDefault=Hide closed services by default -AllowOnlineSign=Allow online signing ShowClosedServices=Show Closed Services HideClosedServices=Hide Closed Services UserStartingService=User starting service diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 7524439f3ec..c93a5c4db09 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -68,6 +68,4 @@ ConfirmReopenIntervention=Are you sure you want to open back the intervention Date: Wed, 2 Nov 2022 02:19:26 +0100 Subject: [PATCH 1245/1289] Add column for birth place --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_user.sql | 1 + htdocs/user/card.php | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 119dda91a2e..d29fdd1cce8 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 @@ -368,3 +368,6 @@ ALTER TABLE llx_prelevement_facture_demande RENAME TO llx_prelevement_demande; ALTER TABLE llx_prelevement ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn; ALTER TABLE llx_prelevement_demande ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn; + + +ALTER TABLE llx_user ADD COLUMN birth_place varchar(64); diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index e70716d90c4..ca0c7bc818d 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -50,6 +50,7 @@ create table llx_user fk_state integer DEFAULT 0, fk_country integer DEFAULT 0, birth date, -- birthday + birth_place varchar(64), -- birth place (town) job varchar(128), office_phone varchar(20), office_fax varchar(20), diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 905be457810..8a93a57cb96 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1290,7 +1290,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "\n"; // Date employment - print '
    '; + print ''; print ''; From 95ca1f66c9b4e6453abc0782a7445165c6ad0e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 02:42:14 +0100 Subject: [PATCH 1246/1289] css --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1b684fdc236..c6b6c3b4c20 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -841,7 +841,7 @@ class FormFile $out .= ''; if (!$i) { @@ -1493,7 +1493,7 @@ if ($num > 0) { } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; if (!$i) { @@ -1639,7 +1639,7 @@ if ($num > 0) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -1559,8 +1560,9 @@ if ($num > 0) { } // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; From ca77beeff6c77aa2c10e51da891feeef33c2133d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 2 Nov 2022 14:32:14 +0100 Subject: [PATCH 1251/1289] add same translation in many entities --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_overwrite_trans.key.sql | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 119dda91a2e..efb9ff96dbb 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 @@ -211,6 +211,9 @@ ALTER TABLE llx_projet ADD COLUMN location varchar(255); ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(128); +ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans; +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey); + -- -- List of all managed triggered events (used for trigger agenda automatic events and for notification) -- diff --git a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql index 617036e66ee..7dd3156d2e5 100644 --- a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql +++ b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql @@ -17,5 +17,4 @@ -- =========================================================================== -ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey); - +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey); From d4165f380021ca5d40d29922b739cf35dc851096 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 16:21:20 +0100 Subject: [PATCH 1252/1289] FIX #22732 --- htdocs/fourn/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 00a3ba55caa..2c929aa40ba 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -848,7 +848,7 @@ if ($object->id > 0) { if ($object->status == 1) { print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, ''); } else { - print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposalGR'), 'default', $_SERVER['PHP_SELF'].'#', '', false); + print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposal'), 'default', $_SERVER['PHP_SELF'].'#', '', false); } } @@ -865,7 +865,7 @@ if ($object->id > 0) { if (!empty($orders2invoice) && $orders2invoice > 0) { if ($object->status == 1) { // Company is open - print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplierGR'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', ''); + print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplier'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', ''); } else { print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false); } From 946624fd671cb7862408c4dba9f5d4f03f9ee2ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 16:50:45 +0100 Subject: [PATCH 1253/1289] Debug v17 --- htdocs/core/class/html.formprojet.class.php | 8 ++++---- htdocs/langs/en_US/categories.lang | 2 +- htdocs/projet/list.php | 16 +++++++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index d4c3b1aa21f..9c8928de718 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -689,10 +689,10 @@ class FormProjets $sellist .= ''; } if ($showallnone) { - $sellist .= ''; - $sellist .= ''; - $sellist .= ''; - $sellist .= ''; + $sellist .= ''; + $sellist .= ''; + $sellist .= ''; + $sellist .= ''; } while ($i < $num) { $obj = $this->db->fetch_object($resql); diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index ae3d31b6f12..0493968798e 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -88,7 +88,7 @@ DeleteFromCat=Remove from tags/category ExtraFieldsCategories=Complementary attributes CategoriesSetup=Tags/categories setup CategorieRecursiv=Link with parent tag/category automatically -CategorieRecursivHelp=If option is on, when you add a product into a subcategory, product will also be added into the parent category. +CategorieRecursivHelp=If option is on, when you add an object into a subcategory, the object will also be added into the parent categories. AddProductServiceIntoCategory=Add the following product/service AddCustomerIntoCategory=Assign category to customer AddSupplierIntoCategory=Assign category to supplier diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 9ef64174325..d3a5a203487 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1008,7 +1008,7 @@ if (!empty($arrayfields['c.assigned']['checked'])) { // Opp status if (!empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; } if (!empty($arrayfields['p.opp_amount']['checked'])) { @@ -1267,6 +1267,9 @@ while ($i < $imaxinloop) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Project url if (!empty($arrayfields['p.ref']['checked'])) { @@ -1428,6 +1431,9 @@ while ($i < $imaxinloop) { } } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Opp Status if (!empty($arrayfields['p.fk_opp_status']['checked'])) { @@ -1612,7 +1618,7 @@ while ($i < $imaxinloop) { $userstatic->gender = $obj->gender; if (!empty($arrayfields['u.login']['checked'])) { - print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print "\n"; From f3279c5f3d0691c927dbd34ab67762c6c513bf2e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 2 Nov 2022 16:58:15 +0100 Subject: [PATCH 1254/1289] FIX passing null in "$options" parameter is deprecated --- htdocs/core/lib/security.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 0ef7a568f18..8e1ed6cebd1 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -146,7 +146,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR") } $ivseed = dolGetRandomBytes($ivlen); - $newchain = openssl_encrypt($chain, $ciphering, $key, null, $ivseed); + $newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed); return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain; } else { return $chain; @@ -180,9 +180,9 @@ function dolDecrypt($chain, $key = '') if (function_exists('openssl_decrypt')) { $tmpexplode = explode(':', $reg[2]); if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) { - $newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, null, $tmpexplode[0]); + $newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]); } else { - $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, null, null); + $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null); } } else { $newchain = 'Error function openssl_decrypt() not available'; From b4ecccfd9de093a771a2372d8756d2fcf17c8e31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 17:08:27 +0100 Subject: [PATCH 1255/1289] Fix alias --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8ffe95731de..37cf4746d82 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3604,14 +3604,14 @@ class Societe extends CommonObject } //Verify duplicate entries - $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$this->db->escape($value)."' AND entity IN (".getEntity('societe').")"; + $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$this->db->escape($value)."' AND entity IN (".getEntity('societe').")"; if ($socid) { $sql .= " AND rowid <> ".$socid; } $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - $count = $obj->idprof; + $count = $obj->nb; } else { $count = 0; print $this->db->error(); From 8981020fa197bf67c47d3035da4d8ca49c482195 Mon Sep 17 00:00:00 2001 From: bomuux Date: Wed, 2 Nov 2022 18:18:53 +0100 Subject: [PATCH 1256/1289] BUG: can't update product_price_by_qty a typo in update query. --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 2171ef4aab3..d7005fa439a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -556,7 +556,7 @@ if (empty($reshook)) { // Ajout / mise à jour if ($rowid > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."product_price_by_qty SET"; - $sql .= " price=".((float) $price)."',"; + $sql .= " price=".((float) $price).","; $sql .= " unitprice=".((float) $unitPrice).","; $sql .= " quantity=".((float) $quantity).","; $sql .= " remise_percent=".((float) $remise_percent).","; From 47dea03ecc4be594e0769688cb19f16ffa2603fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Nov 2022 10:02:17 +0100 Subject: [PATCH 1257/1289] fetch last_main_doc in societe class --- htdocs/societe/class/societe.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 550f2280c59..8da7e20e4e5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019-2021 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2020 Open-Dsi * Copyright (C) 2022 ButterflyOfFire * @@ -1710,13 +1710,13 @@ class Societe extends CommonObject $sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif'; $sql .= ', s.phone, s.fax, s.email'; $sql .= ', s.socialnetworks'; - $sql .= ', s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur'; + $sql .= ', s.url, s.zip, s.town, s.note_private, s.note_public, s.client, s.fournisseur'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_forme_juridique as forme_juridique_code'; - $sql .= ', s.webservices_url, s.webservices_key, s.model_pdf'; + $sql .= ', s.webservices_url, s.webservices_key, s.model_pdf, s.last_main_doc'; if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= ', s.code_compta, s.code_compta_fournisseur, s.accountancy_code_buy, s.accountancy_code_sell'; } else { @@ -1947,7 +1947,10 @@ class Societe extends CommonObject // multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; $this->multicurrency_code = $obj->multicurrency_code; + + // pdf $this->model_pdf = $obj->model_pdf; + $this->last_main_doc = $obj->last_main_doc; $result = 1; From d0a824c5e9fb9d5c3ec38b619c4f40697b00fec2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Nov 2022 16:13:35 +0100 Subject: [PATCH 1258/1289] Debug v17 --- htdocs/bookmarks/card.php | 7 +- htdocs/bookmarks/list.php | 110 ++++++++++-------- htdocs/core/lib/functions.lib.php | 4 +- htdocs/core/lib/project.lib.php | 5 +- htdocs/core/menus/standard/eldy.lib.php | 1 + htdocs/core/tpl/objectline_create.tpl.php | 5 +- htdocs/langs/en_US/members.lang | 4 +- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/projet/card.php | 4 +- htdocs/projet/index.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 + htdocs/theme/md/style.css.php | 9 +- htdocs/user/card.php | 37 +++--- 13 files changed, 114 insertions(+), 80 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 60d615192d0..5b22b8918d9 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2015 Laurent Destailleur + * Copyright (C) 2005-2022 Laurent Destailleur * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -186,7 +186,7 @@ if ($action == 'create') { print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print ''; - // Owner + // Visibility / Owner print ''; @@ -279,9 +279,10 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { } print ''; + // Visibility / owner print '
    '.$langs->trans("NoRecordFound").'
    '.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'; + print ''; if ($obj->api_key) { if ($canreadsecretapi) { - print $obj->api_key; + print dol_escape_htmltag($obj->api_key); } else { print ''.$langs->trans("Hidden").''; } From e0a4070da3f3d13c5afd5b676ace1e1357437eea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 14:00:08 +0100 Subject: [PATCH 1238/1289] Try to fix phpunit --- htdocs/core/modules/DolibarrModules.class.php | 5 +++-- test/phpunit/AdminLibTest.php | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 763973ac031..f6ee9da7d60 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1881,7 +1881,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $i = 0; while ($i < $num) { $obj2 = $this->db->fetch_object($resqlseladmin); - dol_syslog(get_class($this)."::insert_permissions Add permission id '.$r_id.' to user id=".$obj2->rowid); + dol_syslog(get_class($this)."::insert_permissions Add permission id ".$r_id." to user id=".$obj2->rowid); $tmpuser = new User($this->db); $result = $tmpuser->fetch($obj2->rowid); @@ -1968,13 +1968,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->menu_handler = 'all'; //$menu->module=strtolower($this->name); TODO When right_class will be same than module name - $menu->module = empty($this->rights_class) ?strtolower($this->name) : $this->rights_class; + $menu->module = (empty($this->rights_class) ? strtolower($this->name) : $this->rights_class); if (!$this->menu[$key]['fk_menu']) { $menu->fk_menu = 0; } else { $foundparent = 0; $fk_parent = $this->menu[$key]['fk_menu']; + $reg = array(); if (preg_match('/^r=/', $fk_parent)) { // old deprecated method $fk_parent = str_replace('r=', '', $fk_parent); if (isset($this->menu[$fk_parent]['rowid'])) { diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 317d486434e..6649aa19798 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -165,6 +165,9 @@ class AdminLibTest extends PHPUnit\Framework\TestCase require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php'; print "Enable module modExpenseReport"; $moduledescriptor=new modExpenseReport($db); + + $result = $moduledescriptor->remove(); + $result = $moduledescriptor->init(); print __METHOD__." result=".$result."\n"; $this->assertEquals(1, $result); @@ -173,6 +176,9 @@ class AdminLibTest extends PHPUnit\Framework\TestCase require_once dirname(__FILE__).'/../../htdocs/core/modules/modApi.class.php'; print "Enable module modAPI"; $moduledescriptor=new modApi($db); + + $result = $moduledescriptor->remove(); + $result = $moduledescriptor->init(); print __METHOD__." result=".$result."\n"; $this->assertEquals(1, $result); From dca945f1ab7f94bd0b43c2bf8a0b5302799e1483 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 20:25:58 +0100 Subject: [PATCH 1239/1289] Doc --- htdocs/api/class/api_setup.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 406172590d7..79fe00187d9 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -612,7 +612,6 @@ class Setup extends DolibarrApi * @param object $object Object with label to translate * @param string $lang Code of the language the name of the object must be translated to * @param string $prefix Prefix for translation key - * * @return void */ private function translateLabel($object, $lang, $prefix = 'Country') From 75d784a6eb52bb298c3db637331ebbfc6563cd50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Nov 2022 23:23:42 +0100 Subject: [PATCH 1240/1289] Fix price on takepos thumb must include vat --- htdocs/product/class/product.class.php | 10 +++++-- htdocs/takepos/admin/appearance.php | 2 +- htdocs/takepos/ajax/ajax.php | 14 +++++++--- htdocs/takepos/css/pos.css.php | 38 +++++++++++++------------- htdocs/takepos/index.php | 28 +++++++++---------- 5 files changed, 51 insertions(+), 41 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index aba48b939be..ffb72bfca78 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -127,19 +127,23 @@ class Product extends CommonObject public $type = self::TYPE_PRODUCT; /** - * Selling price + * Selling price without tax * * @var float */ - public $price; // Price net + public $price; + + public $price_formated; // used by takepos/ajax/ajax.php /** - * Price with tax + * Selling price with tax * * @var float */ public $price_ttc; + public $price_ttc_formated; // used by takepos/ajax/ajax.php + /** * Minimum price net * diff --git a/htdocs/takepos/admin/appearance.php b/htdocs/takepos/admin/appearance.php index 250606703af..54ed2f642a2 100644 --- a/htdocs/takepos/admin/appearance.php +++ b/htdocs/takepos/admin/appearance.php @@ -115,7 +115,7 @@ print '
    '; print $langs->trans("NumberOfLinesToShow"); print ''; $array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6"); -print $form->selectarray('TAKEPOS_LINES_TO_SHOW', $array, (empty($conf->global->TAKEPOS_LINES_TO_SHOW) ? '2' : $conf->global->TAKEPOS_LINES_TO_SHOW), 0); +print $form->selectarray('TAKEPOS_LINES_TO_SHOW', $array, getDolGlobalInt('TAKEPOS_LINES_TO_SHOW', 2), 0); print "
    '.$langs->trans('PaymentConditionsShort').''; print img_picto('', 'paiment'); - $form->select_conditions_paiements((GETPOST('cond_reglement_id', 'int') > 0 ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1); + $form->select_conditions_paiements(((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') > 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1); print '
    '.$langs->trans('PaymentMode').''; print img_picto('', 'bank').' '; - $form->select_types_paiements((GETPOST('mode_reglement_id', 'int') > 0 ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); + $form->select_types_paiements(((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') > 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); print '
    '.$langs->trans("DateEmployment").'
    '.$langs->trans("DateOfEmployment").''; print $form->selectDate($dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 1); @@ -2307,25 +2307,25 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->socid > 0 && !($object->contact_id > 0)) { // external user but no link to a contact print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); - print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, '', false, 1); + print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } elseif ($object->socid > 0 && $object->contact_id > 0) { // external user with a link to a contact print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); // We keep thirdparty empty, contact is already set - print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, '', false, 1); + print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } elseif (!($object->socid > 0) && $object->contact_id > 0) { // internal user with a link to a contact print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set - print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, '', false, 1); + print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } else { // $object->socid is not > 0 here print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set - print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, '', false, 1); + print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); } } print '
    '; if ($imgpreview) { - $out .= ''; + $out .= ''; } else { $out .= ''; } From 1f594f5ae953ed88ccf5983ce5cc9f85ba7890ad Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 2 Nov 2022 07:26:58 +0100 Subject: [PATCH 1247/1289] receipt.php Receipt preview --- htdocs/takepos/receipt.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 3542aa44014..400d05415aa 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -330,7 +330,9 @@ if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeTe ?> From c11f89d18a24429bdf255df996f1f1bbe72c5cb8 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 2 Nov 2022 07:28:14 +0100 Subject: [PATCH 1248/1289] admin/receipt.php Receipt preview --- htdocs/takepos/admin/receipt.php | 76 +++----------------------------- 1 file changed, 7 insertions(+), 69 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index bcf0a853705..1cfe141478d 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -93,75 +93,6 @@ print '
    '; print ''; -print load_fiche_titre($langs->trans("PrintMethod"), '', ''); - -print '
    '; -print ''; -print ''; -print ''; -print "\n"; - -// Browser method -print '\n"; - -// Receipt printer module -print '\n"; - -// TakePOS Connector -print '\n"; -print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").'
    '; -print $langs->trans('Browser'); -print ''; -print $langs->trans('BrowserMethodDescription'); -print ''; -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser") { - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; -} -print "
    '; -print $langs->trans('DolibarrReceiptPrinter'); -print ''; -print $langs->trans('ReceiptPrinterMethodDescription'); -if (isModEnabled('receiptprinter')) { - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { - print '
    '; - print img_picto('', 'printer', 'class="paddingright"').''.$langs->trans("Setup").''; - } -} -print '
    '; -if (isModEnabled('receiptprinter')) { - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; - } -} else { - print ''; - print $langs->trans("ModuleReceiptPrinterMustBeEnabled"); - print ''; -} -print "
    '; -print "TakePOS Connector"; -print ''; -print $langs->trans('TakeposConnectorMethodDescription'); - -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - print '
    '; - print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; - print ' '; -} - -print '
    '; -if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - print img_picto($langs->trans("Activated"), 'switch_on'); -} else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; -} -print "
    '; -print '
    '; - - print load_fiche_titre($langs->trans("Receipt"), '', ''); print '
    '; @@ -285,6 +216,13 @@ print $form->buttonsSaveCancel("Save", ''); print "\n"; +print load_fiche_titre($langs->trans("Preview"), '', ''); +print '
    '; +print '
    '; +print ''; +print '
    '; +print '
    '; + print '
    '; llxFooter(); From 95b27d39a3e4e560d34239936857527332a3c87e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 12:52:26 +0100 Subject: [PATCH 1249/1289] css --- htdocs/fourn/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9f06c56b9e1..22b9767d13c 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1484,7 +1484,7 @@ if ($num > 0) { // Third party if (!empty($arrayfields['s.nom']['checked'])) { - print '
    '; + print ''; print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); print ''; + print ''; print $thirdparty->name_alias; print ''; + print ''; if ($userstatic->id) { print $userstatic->getLoginUrl(-1); } else { From 1dfa3e9e9857ab8ebad74257719f1e5d1ec198fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 12:59:29 +0100 Subject: [PATCH 1250/1289] Look and feel v17 --- htdocs/fourn/facture/list.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 22b9767d13c..0d8945436e2 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1550,8 +1550,9 @@ if ($num > 0) { // Payment condition if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); + $s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1, '', -1, -1, 1); + print ''; + print dol_escape_htmltag($s); print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + $s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1); + print ''; + print dol_escape_htmltag($s); print ''; - print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 0, 1, 0, 'maxwidth100 nowrapoption', 1, 0); + print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth125 nowrapoption', 1, 1); print ''; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } else { @@ -1672,9 +1678,9 @@ while ($i < $imaxinloop) { print ''; } print '
    '.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
    '.$langs->trans("Visibility").''; print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); print '
    '.$langs->trans("Visibility").''; if ($action == 'edit' && $user->admin) { - print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); } else { if ($object->fk_user > 0) { $fuser = new User($db); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 4f5d73a2404..5f8eb93af96 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2022 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,13 +39,14 @@ $id = GETPOST("id", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -72,6 +73,14 @@ $permissiontodelete = !empty($user->rights->bookmark->supprimer); * Actions */ +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + if ($action == 'delete') { $res = $object->remove($id); if ($res > 0) { @@ -103,34 +112,41 @@ if (!$user->admin) { $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)"; } -$sql .= $db->order($sortfield.", position", $sortorder); - // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); - $nbtotalofrecords = $db->num_rows($resql); + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 $page = 0; $offset = 0; } + $db->free($resql); } -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { - $num = $nbtotalofrecords; -} else { + +// Complete request and execute it with limit +$sql .= $db->order($sortfield.", position", $sortorder); +if ($limit) { $sql .= $db->plimit($limit + 1, $offset); - - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); } -$param = ""; +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + +$param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -138,7 +154,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($optioncss != '') { - $param = '&optioncss='.urlencode($optioncss); + $param .= '&optioncss='.urlencode($optioncss); } $moreforfilter = ''; @@ -150,7 +166,7 @@ $arrayofmassactions = array( //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { @@ -158,7 +174,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print '
    '; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -167,7 +183,9 @@ print ''; print ''; print ''; +print ''; print ''; +print ''; $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer)); @@ -179,13 +197,13 @@ print ''; //print ""; -print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder); -print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder); -print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder); -print_liste_field_titre("Target", '', '', '', '', 'align="center"'); -print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder); +print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder); +print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder); +print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre(''); print "\n"; @@ -205,33 +223,31 @@ while ($i < min($num, $limit)) { print $object->getNomUrl(1); print ''; - $linkintern = 0; + $linkintern = 1; + if (preg_match('/^http/i', $obj->url)) { + $linkintern = 0; + } $title = $obj->title; $link = $obj->url; $canedit = $user->rights->bookmark->supprimer; $candelete = $user->rights->bookmark->creer; // Title - print "\n"; // Url print '\n"; // Target @@ -264,7 +280,7 @@ while ($i < min($num, $limit)) { print "\n"; // Date creation - print '"; + print '"; // Position print '"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 46a61e60a61..09c9d3e9943 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4072,7 +4072,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss', 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', - 'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', + 'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'conferenceorbooth', 'eventorganization' ))) { $fakey = $pictowithouttext; @@ -4121,7 +4121,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'supplier'=>'building', 'technic'=>'cogs', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', - 'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card', + 'uncheck'=>'times', 'uparrow'=>'share', 'url'=>'external-link-alt', 'vat'=>'money-check-alt', 'vcard'=>'address-card', 'jabber'=>'comment-o', 'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock', 'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram' diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f418fcf7de2..062c3f711af 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2451,6 +2451,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $arrayidtypeofcontact = array(); + print ''; print '
    '; print '
     
    "; - $linkintern = 1; - if ($linkintern) { - print ''; - } - print $title; - if ($linkintern) { - print ""; - } + print ''; + print dol_escape_htmltag($title); print "'; - if (!$linkintern) { - print 'target ? ' target="newlink" rel="noopener"' : '').'>'; + if (empty($linkintern)) { + print img_picto('', 'url', 'class="pictofixedwidth"'); + print 'target ? ' target="newlink" rel="noopener"' : '').'>'; + } else { + //print img_picto('', 'rightarrow', 'class="pictofixedwidth"'); + print ''; } print $link; - if (!$linkintern) { - print ''; - } + print ''; print "'.dol_print_date($db->jdate($obj->dateb), 'day')."'.dol_print_date($db->jdate($obj->dateb), 'day')."'.$obj->position."
    '; @@ -2650,12 +2651,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $plannedworkload = $objp->planned_workload; $total_plannedworkload += $plannedworkload; if (!in_array('plannedworkload', $hiddenfields)) { - print ''; + print ''; } if (!in_array('declaredprogress', $hiddenfields)) { $declaredprogressworkload = $objp->declared_progess_workload; $total_declaredprogressworkload += $declaredprogressworkload; - print ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 22613a331b7..8f91e4bb122 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2409,6 +2409,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 1bfc9587b89..bd961b5bf17 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -107,7 +107,7 @@ if ($nolinesbefore) { global->MAIN_VIEW_LINE_NUMBER)) { ?> - - '; // Label diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 56ce446f4e2..2698a4b1a21 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f2cea00230d..a73eb67fccb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5163,6 +5163,10 @@ tr.visible { /* Module website */ /* ============================================================================== */ +.previewnotyetavailable { + opacity: 0.5; +} + .websiteformtoolbar { position: sticky; top: ; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 002166968cd..50fff15b8f0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5018,6 +5018,11 @@ tr.visible { /* Module website */ /* ============================================================================== */ + +.previewnotyetavailable { + opacity: 0.5; +} + .websiteformtoolbar { position: sticky; top: ; @@ -5754,7 +5759,7 @@ ul.ecmjqft > a { width: calc(100% - 100px); overflow: hidden; white-space: break-spaces; - word-break: break-all; + word-break: break-all; } ul.ecmjqft a:active { font-weight: bold !important; @@ -6216,7 +6221,7 @@ ul.select2-results__options li { .select2-container.select2-container--open .select2-dropdown--below { min-width: 220px !important; } - + .select2-container--open .select2-dropdown--below { border-top: 1px solid var(--inputbordercolor); /* border-top: 1px solid #aaaaaa; */ diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8a93a57cb96..238724f7ae0 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2021 Regis Houssin * Copyright (C) 2005 Lionel Cousteix @@ -1434,7 +1434,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
    '; print '
    '; - print '
    '.($plannedworkload ?convertSecondToTime($plannedworkload) : '').''.($plannedworkload ?convertSecondToTime($plannedworkload) : '').''; + print ''; //print $objp->planned_workload.'-'.$objp->declared_progess_workload."
    "; print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : ''); print '
    +
    trans('AddNewLine'); ?>
    - + global->MAIN_DISABLE_FREE_LINES)) { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index d774a8e7434..dfb4ed1d0bd 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -35,8 +35,8 @@ DateSubscription=Date of membership DateEndSubscription=End date of membership EndSubscription=End of membership SubscriptionId=Contribution ID -WithoutSubscription=Without contribution -WaitingSubscription=Waiting contribution +WithoutSubscription=Without membership +WaitingSubscription=Membership pending MemberId=Member Id MemberRef=Member Ref NewMember=New member diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 30ccdd22e44..f26afd1a503 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -87,7 +87,7 @@ require_once __DIR__.'/class/myobject.class.php'; // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule", "other")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 718aeecec82..1bdcccbaecf 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -561,7 +561,9 @@ if ($action == 'create' && $user->rights->projet->creer) { // Ref $suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref); print '
    '.$langs->trans("Ref").''; - print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); + if ($suggestedref) { + print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); + } print '
    '; + print '
    '; // Login print ''; @@ -1739,9 +1739,11 @@ if ($action == 'create' || $action == 'adduserldap') { print "
    '.$langs->trans("Login").'
    \n"; + // Credentials + print '
    '; print '
    '; - print ''; + print '
    '; print ''; @@ -1749,7 +1751,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; // Date login validity - print ''; + print ''; print '\n"; // Password - print ''; - - print '"; - print ''."\n"; + if (dol_string_nohtmltag($valuetoshow)) { // If there is a real visible content to show + print ''; + print '"; + print ''."\n"; + } // API key if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) { - print ''; + print ''; print ''; } - print ''; + print ''; print ''; print "\n"; - print '
    '; print img_picto('', 'security', 'class="paddingleft pictofixedwidth"').$langs->trans("Credentials"); print '
    '.$langs->trans("RangeOfLoginValidity").'
    '.$langs->trans("RangeOfLoginValidity").''; if ($object->datestartvalidity) { print ''.$langs->trans("FromDate").' '; @@ -1763,9 +1765,6 @@ if ($action == 'create' || $action == 'adduserldap') { print "
    '.$langs->trans("Password").''; $valuetoshow = ''; if (preg_match('/ldap/', $dolibarr_main_authentication)) { if (!empty($object->ldap_sid)) { @@ -1785,6 +1784,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (preg_match('/http/', $dolibarr_main_authentication)) { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("HTTPBasicPassword"); } + /* if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($object->pass) { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : ''); @@ -1792,15 +1792,15 @@ if ($action == 'create' || $action == 'adduserldap') { } else { if ($user->admin && $user->id == $object->id) { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : ''); - //$valuetoshow .= ''.$langs->trans("Crypted").' - '; $valuetoshow .= ''.$langs->trans("Hidden").''; - // TODO Add a feature to reveal the hash $valuetoshow .= ''; } else { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : ''); + $valuetoshow .= ''.$langs->trans("Hidden").''; } } } + */ // Other form for user password $parameters = array('valuetoshow' => $valuetoshow); @@ -1811,13 +1811,17 @@ if ($action == 'create' || $action == 'adduserldap') { $valuetoshow .= $hookmanager->resPrint; // to add } - print $valuetoshow; - print "
    '.$langs->trans("Password").''; + print $valuetoshow; + print "
    '.$langs->trans("ApiKey").'
    '.$langs->trans("ApiKey").''; if (!empty($object->api_key)) { print ''; @@ -1827,7 +1831,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
    '.$langs->trans("LastConnexion").'
    '.$langs->trans("LastConnexion").''; if ($object->datepreviouslogin) { print dol_print_date($object->datepreviouslogin, "dayhour").' ('.$langs->trans("Previous").'), '; @@ -1838,7 +1842,8 @@ if ($action == 'create' || $action == 'adduserldap') { print '
    '; + print '
    '; + print '
    '; print '
    '; From 4890a2ada3a1a035a944edb8aa39ead2972514bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Nov 2022 00:13:52 +0100 Subject: [PATCH 1259/1289] Debug v17 --- htdocs/adherents/card.php | 6 ++++-- htdocs/adherents/class/adherent.class.php | 24 ++++++++++++++--------- htdocs/adherents/document.php | 9 ++++----- htdocs/adherents/note.php | 9 ++++----- htdocs/adherents/subscription.php | 6 ++++-- htdocs/core/lib/files.lib.php | 6 ++++++ htdocs/core/lib/functions.lib.php | 20 +++++++++++++++++++ htdocs/theme/eldy/info-box.inc.php | 15 +++++++++++++- htdocs/theme/md/info-box.inc.php | 15 +++++++++++++- htdocs/website/class/website.class.php | 8 ++++++-- 10 files changed, 91 insertions(+), 27 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 35829b5dcbf..c47321dbf7c 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1725,10 +1725,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Type - print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + print ''.$langs->trans("Type").''; + print ''.$adht->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$object->getmorphylib('', 1).''; + print ''.$langs->trans("MemberNature").''; + print ''.$object->getmorphylib('', 1).''; print ''; // Company diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index dd9d58eb7d3..130f5580e3a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -520,7 +520,7 @@ class Adherent extends CommonObject * Return translated label by the nature of a adherent (physical or moral) * * @param string $morphy Nature of the adherent (physical or moral) - * @param int $addbadge Add badge (1=Full label, 2=First letter only) + * @param int $addbadge Add badge (1=Full label, 2=First letters only) * @return string Label */ public function getmorphylib($morphy = '', $addbadge = 0) @@ -534,21 +534,27 @@ class Adherent extends CommonObject if ($addbadge) { $s = ''; + $labeltoshowm = $langs->trans("Moral"); + $labeltoshowp = $langs->trans("Physical"); if ($morphy == 'phy') { + $labeltoshow = $labeltoshowp; if ($addbadge == 2) { - $labeltoshow = dol_substr($langs->trans("Physical"), 0, 1); - } else { - $labeltoshow = $langs->trans("Physical"); + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowp)); + if ($labeltoshow == dol_strtoupper(dolGetFirstLetters($labeltoshowm))) { + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowp, 2)); + } } - $s .= ''.$labeltoshow.''; + $s .= ''.$labeltoshow.''; } if ($morphy == 'mor') { + $labeltoshow = $labeltoshowm; if ($addbadge == 2) { - $labeltoshow = dol_substr($langs->trans("Moral"), 0, 1); - } else { - $labeltoshow = $langs->trans("Moral"); + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowm)); + if ($labeltoshow == dol_strtoupper(dolGetFirstLetters($labeltoshowp))) { + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowm, 2)); + } } - $s .= ''.$labeltoshow.''; + $s .= ''.$labeltoshow.''; } } else { if ($morphy == 'phy') { diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index bce8227ab57..37d6e72a97e 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -158,13 +158,12 @@ if ($id > 0) { } // Type - print ''.$langs->trans("Type").''.$membert->getNomUrl(1)."\n"; + print ''.$langs->trans("Type").''; + print ''.$membert->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; - /*print ''; - print $form->showphoto('memberphoto',$object); - print '';*/ + print ''.$langs->trans("MemberNature").''; + print ''.$object->getmorphylib('', 1).''; print ''; // Company diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index ea5e22fe153..938ab368ae1 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -133,13 +133,12 @@ if ($id) { } // Type - print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + print ''.$langs->trans("Type").''; + print ''.$adht->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; - /*print ''; - print $form->showphoto('memberphoto',$member); - print '';*/ + print ''.$langs->trans("MemberNature").''; + print ''.$object->getmorphylib('', 1).''; print ''; // Company diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index db40a8ad465..cc5b600b2a4 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -506,10 +506,12 @@ if ($rowid > 0) { } // Type - print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; + print ''.$langs->trans("Type").''; + print ''.$adht->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; + print ''.$langs->trans("MemberNature").''; + print ''.$object->getmorphylib('', 1).''; print ''; // Company diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c3eede90efd..cb7e1a8883e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -641,6 +641,12 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask return 0; } + $srcexists = dol_is_file($srcfile); + if (!$srcexists) { + dol_syslog("files.lib.php::dolReplaceInFile failed to read src file", LOG_WARNING); + return -3; + } + $tmpdestfile = $destfile.'.tmp'; $newpathofsrcfile = dol_osencode($srcfile); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 09c9d3e9943..6d2841a08b2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3830,6 +3830,26 @@ function isValidPhone($phone) } +/** + * Return first letters of a strings. + * Example with nbofchar=1: 'ghi' will return 'g' but 'abc def' will return 'ad' + * Example with nbofchar=2: 'ghi' will return 'gh' but 'abc def' will return 'abde' + * + * @param string $s String to truncate + * @param int $nbofchar Nb of characters to keep + * @return string Return first chars. + */ +function dolGetFirstLetters($s, $nbofchar = 1) { + $ret = ''; + $tmparray = explode(' ', $s); + foreach($tmparray as $tmps) { + $ret .= dol_substr($tmps, 0, $nbofchar); + } + + return $ret; +} + + /** * Make a strlen call. Works even if mbstring module not enabled * diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 29f1a229054..daa3ff1da21 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -295,7 +295,20 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { margin: 2px; border-radius: 3px; } - +.member-company-back { + padding: 2px 7px 2px 7px; + background-color: #e4e4e4; + color: #666; + border-radius: 10px; + white-space: nowrap; +} +.member-individual-back { + padding: 2px 7px 2px 7px; + background-color: #e4e4e4; + color: #666; + border-radius: 10px; + white-space: nowrap; +} .bg-infobox-project{ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index daf3c409397..e2733acc2bc 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -48,7 +48,20 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { margin: 2px; border-radius: 3px; } - +.member-company-back { + padding: 2px 7px 2px 7px; + background-color: #e4e4e4; + color: #666; + border-radius: 10px; + white-space: nowrap; +} +.member-individual-back { + padding: 2px 7px 2px 7px; + background-color: #e4e4e4; + color: #666; + border-radius: 10px; + white-space: nowrap; +} .bg-infobox-project{ color: #6c6aa8 !important; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index a8a85423da3..d532f7f475c 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1003,10 +1003,14 @@ class Website extends CommonObject // Make some replacement into some files $cssindestdir = $conf->website->dir_temp.'/'.$website->ref.'/containers/styles.css.php'; - dolReplaceInFile($cssindestdir, $arrayreplacementincss); + if (dol_is_file($cssindestdir)) { + dolReplaceInFile($cssindestdir, $arrayreplacementincss); + } $htmldeaderindestdir = $conf->website->dir_temp.'/'.$website->ref.'/containers/htmlheader.html'; - dolReplaceInFile($htmldeaderindestdir, $arrayreplacementincss); + if (dol_is_file($htmldeaderindestdir)) { + dolReplaceInFile($htmldeaderindestdir, $arrayreplacementincss); + } // Build sql file $filesql = $conf->website->dir_temp.'/'.$website->ref.'/website_pages.sql'; From a355f4fc8bb1746d87aa4d6dbee3d27f517d6701 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Fri, 4 Nov 2022 17:46:32 +0100 Subject: [PATCH 1260/1289] NEW: Add new hooks for actioncomm --- htdocs/comm/action/class/actioncomm.class.php | 13 ++++++++++++ htdocs/core/lib/company.lib.php | 20 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 228ff397607..aa14ba6e696 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1306,8 +1306,17 @@ class ActionComm extends CommonObject dol_syslog(get_class()."::getActions", LOG_DEBUG); + require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('agendadao')); + $sql = "SELECT a.id"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; + // Fields from hook + $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); + $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; if (!empty($socid)) { $sql .= " AND a.fk_soc = ".((int) $socid); @@ -1326,6 +1335,10 @@ class ActionComm extends CommonObject if (!empty($filter)) { $sql .= $filter; } + // Fields where hook + $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); + $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; if ($sortorder && $sortfield) { $sql .= $this->db->order($sortfield, $sortorder); } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 43264ac3d98..3d0cb72e7c9 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1489,6 +1489,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql = ''; if (isModEnabled('agenda')) { + require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('agendadao')); + // Recherche histo sur actioncomm if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; @@ -1528,6 +1533,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } } + // Fields from hook + $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); + $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; @@ -1539,6 +1549,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); } + // Fields from hook + $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); + $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; + if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; } elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { @@ -1639,6 +1654,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin addOtherFilterSQL($sql, $donetodo, $now, $filters); + // Fields from hook + $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module); + $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; + if (is_array($actioncode)) { foreach ($actioncode as $code) { $sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj); From 43e153715f97d1153153c951ce815873abedef3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Nov 2022 20:49:25 +0100 Subject: [PATCH 1261/1289] Remove non used code for module webhook --- htdocs/core/lib/functions.lib.php | 22 ++- ...ce_95_modWebhook_WebhookTriggers.class.php | 12 +- htdocs/webhook/class/target.class.php | 6 +- htdocs/webhook/lib/webhook_target.lib.php | 43 ----- htdocs/webhook/target_card.php | 80 +------- htdocs/webhook/target_list.php | 4 +- htdocs/webhook/target_note.php | 174 ------------------ test/phpunit/FunctionsLibTest.php | 2 + 8 files changed, 46 insertions(+), 297 deletions(-) delete mode 100644 htdocs/webhook/target_note.php diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 46a61e60a61..6989d57de99 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1159,29 +1159,43 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) } /** - * Create a clone of instance of object (new instance with same value for properties) - * With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid. + * Create a clone of instance of object (new instance with same value for each properties) + * With native = 0: Property that are reference are different memory area in the new object (full isolation clone). This means $this->db of new object may not be valid. * With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object. + * With native = 2: Property that are reference are different memory area in the new object (full isolation clone). Only scalar and array values are cloned. This means $this->db of new object is not valid. * * @param object $object Object to clone - * @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended) + * @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended) * @return object Clone object * @see https://php.net/manual/language.oop5.cloning.php */ function dol_clone($object, $native = 0) { if ($native == 0) { + // deprecated method, use the method with native = 2 instead $tmpsavdb = null; if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { $tmpsavdb = $object->db; unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection') } - $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields + $myclone = unserialize(serialize($object)); // serialize then unserialize is a hack to be sure to have a new object for all fields if (!empty($tmpsavdb)) { $object->db = $tmpsavdb; } + } elseif ($native == 2) { + // recommended method to have a full isolated cloned object + $myclone = new stdClass(); + $tmparray = get_object_vars($object); // return only public properties + + if (is_array($tmparray)) { + foreach ($tmparray as $propertykey => $propertyval) { + if (is_scalar($propertyval) || is_array($propertyval)) { + $myclone->$propertykey = $propertyval; + } + } + } } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 94b4b861e86..d53b74bcd2e 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -103,7 +103,17 @@ class InterfaceWebhookTriggers extends DolibarrTriggers foreach ($target_url as $key => $tmpobject) { $actionarray = explode(",", $tmpobject->trigger_codes); if (is_array($actionarray) && in_array($action, $actionarray)) { - $jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}'; + // Build the answer object + $resobject = new stdClass(); + $resobject->triggercode = $action; + $resobject->object = dol_clone($object, 2); + + unset($resobject->object['fields']); + unset($resobject->object['error']); + unset($resobject->object['errors']); + + $jsonstr = json_encode($resobject); + $response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, array(), array('http', 'https'), 0, -1); if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) { $nbPosts ++; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 30d541f33af..ba33f2b8995 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -105,6 +105,8 @@ class Target extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'index'=>1, 'searchall'=>1, 'validate'=>'1', 'comment'=>"Reference of object"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), + 'url' => array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>1,), + 'trigger_codes' => array('type'=>'text', 'label'=>'TriggerCodes', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'help'=>"TriggerCodeInfo",), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',), @@ -113,9 +115,7 @@ class Target extends CommonObject 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>3, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'), 'validate'=>'1',), - 'url' => array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>1,), - 'trigger_codes' => array('type'=>'text', 'label'=>'TriggerCodes', 'enabled'=>'1', 'position'=>50, 'notnull'=>1, 'visible'=>1, 'help'=>"TriggerCodeInfo",), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'), 'validate'=>'1',), ); public $rowid; public $ref; diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index 894e3134c0c..da342da0065 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.php @@ -38,49 +38,6 @@ function targetPrepareHead($object) $head[$h][2] = 'card'; $h++; - if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { - $nbNote = 0; - if (!empty($object->note_private)) { - $nbNote++; - } - if (!empty($object->note_public)) { - $nbNote++; - } - $head[$h][0] = dol_buildpath('/webhook/target_note.php', 1).'?id='.$object->id; - $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) { - $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); - } - $head[$h][2] = 'note'; - $h++; - } - - /*require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->webhook->dir_output."/target/".dol_sanitizeFileName($object->ref); - $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); - $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/webhook/target_document.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles + $nbLinks) > 0) { - $head[$h][1] .= ''.($nbFiles + $nbLinks).''; - } - $head[$h][2] = 'document'; - $h++;*/ - - /*$head[$h][0] = dol_buildpath("/webhook/target_agenda.php", 1).'?id='.$object->id; - $head[$h][1] = $langs->trans("Events"); - $head[$h][2] = 'agenda'; - $h++;*/ - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - //$this->tabs = array( - // 'entity:+tabname:Title:@webhook:/webhook/mypage.php?id=__ID__' - //); // to add new tab - //$this->tabs = array( - // 'entity:-tabname:Title:@webhook:/webhook/mypage.php?id=__ID__' - //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'target@webhook'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'target@webhook', 'remove'); diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 35e18a9cdbc..83f2008703f 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -160,8 +160,6 @@ if (empty($reshook)) { /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -459,25 +457,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - if (empty($user->socid)) { + /*if (empty($user->socid)) { print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); - } - - // Back to draft - if ($object->status == $object::STATUS_VALIDATED) { - print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); - } + }*/ print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - // Validate + // Disable + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + } + + // Enable if ($object->status == $object::STATUS_DRAFT) { - if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); - } else { - $langs->load("errors"); - print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); - } + print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } // Clone @@ -505,61 +498,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
    '."\n"; } - - - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } - - if ($action != 'presend') { - print '
    '; - print ''; // ancre - - $includedocgeneration = 0; - - // Documents - if ($includedocgeneration) { - $objref = dol_sanitizeFileName($object->ref); - $relativepath = $objref.'/'.$objref.'.pdf'; - $filedir = $conf->webhook->dir_output.'/'.$object->element.'/'.$objref; - $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content - $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('webhook:Target', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); - } - - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('target')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - - - print '
    '; - - $MAXEVENT = 10; - - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/webhook/target_agenda.php', 1).'?id='.$object->id); - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); - - print '
    '; - } - - //Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } - - // Presend form - $modelmail = 'target'; - $defaulttopic = 'InformationMessage'; - $diroutput = $conf->webhook->dir_output; - $trackid = 'target'.$object->id; - - include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } // End of page diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 5d81bec967f..1db73639103 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -48,10 +48,12 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ta $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); +if (empty($mode)) { + $mode = 'modulesetup'; +} $id = GETPOST('id', 'int'); - // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php deleted file mode 100644 index e09ace533a9..00000000000 --- a/htdocs/webhook/target_note.php +++ /dev/null @@ -1,174 +0,0 @@ - - * Copyright (C) 2022 Frédéric France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/webhook/target_note.php - * \ingroup webhook - * \brief Tab for notes on Target - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; -require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; - -// Load translation files required by the page -$langs->loadLangs(array('companies')); - -// Get parameters -$action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); - -// Initialize technical objects -$object = new Target($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('targetnote', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; -} - -// Permissions -// There is several ways to check permission. -// Set $enablepermissioncheck to 1 to enable a minimum low level of checks -$enablepermissioncheck = 0; -if ($enablepermissioncheck) { - $permissiontoread = $user->rights->webhook->target->read; - $permissiontoadd = $user->rights->webhook->target->write; - $permissionnote = $user->rights->webhook->target->write; // Used by the include of actions_setnotes.inc.php -} else { - $permissiontoread = 1; - $permissiontoadd = 1; - $permissionnote = 1; -} - -// Security check (enable the most restrictive one) -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); -//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (!isModEnabled('webhook') || !$permissiontoread) { - accessforbidden(); -} - - -/* - * Actions - */ - -$parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} -if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once -} - - -/* - * View - */ - -$form = new Form($db); - -//$help_url='EN:Webhooks|FR:Webhooks_FR|ES:Webhooks_ES'; -$help_url = ''; -$title = $langs->trans('Target').' - '.$langs->trans("Notes"); -llxHeader('', $title, $help_url); - -if ($id > 0 || !empty($ref)) { - $object->fetch_thirdparty(); - - $head = targetPrepareHead($object); - - print dol_get_fiche_head($head, 'note', $langs->trans("Target"), -1, $object->picto); - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $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 (isModEnabled('projet')) - { - $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 .= ''; - } - } - }*/ - $morehtmlref .= '
    '; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - - print '
    '; - print '
    '; - - - $cssclass = "titlefield"; - include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - - print '
    '; - - print dol_get_fiche_end(); -} - -// End of page -llxFooter(); -$db->close(); diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 5357f7c8061..12c8683bb8f 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -188,6 +188,8 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase $this->assertEquals($this->savdb->connected, 1, 'Savdb is connected'); $this->assertNotNull($newproduct1->db->db, 'newproduct1->db is not null'); + $newproductcloned2 = dol_clone($newproduct1, 2); + var_dump($newproductcloned2); //print __METHOD__." newproductcloned1->db must be null\n"; //$this->assertNull($newproductcloned1->db, 'newproductcloned1->db is null'); } From df3580687c387ba0ab0805fcf3f81b6d37e964d8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Nov 2022 04:38:12 +0100 Subject: [PATCH 1262/1289] NEW Accountancy - Added an option during export to export or not the lettering --- htdocs/accountancy/bookkeeping/list.php | 30 ++++++++++++++++++++++--- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e9836c4efbf..642dca887b2 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -700,6 +700,17 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements // Export files then exit $accountancyexport = new AccountancyExport($db); + $notexportlettering = GETPOST('notexportlettering', 'alpha'); + + if (!empty($notexportlettering)) { + if (is_array($object->lines)) { + foreach ($object->lines as $k => $movement) { + unset($object->lines[$k]->lettering_code); + unset($object->lines[$k]->date_lettering); + } + } + } + $mimetype = $accountancyexport->getMimeType($formatexportset); top_httphead($mimetype, 1); @@ -802,6 +813,19 @@ $formconfirm = ''; if ($action == 'export_file') { $form_question = array(); + if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { + // If 1, we check by default. + $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; + $form_question['notexportlettering'] = array( + 'name' => 'notexportlettering', + 'type' => 'checkbox', + 'label' => $langs->trans('NotExportLettering'), + 'value' => $checked, + ); + + $form_question['separator'] = array('name'=>'separator', 'type'=>'separator'); + } + // If 1 or not set, we check by default. $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); $form_question['notifiedexportdate'] = array( @@ -811,7 +835,7 @@ if ($action == 'export_file') { 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), ); - $form_question['separator'] = array('name'=>'separator', 'type'=>'separator'); + $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { // If 0 or not set, we NOT check by default. @@ -823,10 +847,10 @@ if ($action == 'export_file') { 'value' => $checked, ); - $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); + $form_question['separator3'] = array('name'=>'separator3', 'type'=>'separator'); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 350, 600); } //if ($action == 'delbookkeepingyear') { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 40482298e63..5d115fe3e16 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -337,6 +337,7 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) ## Export +NotExportLettering=Do not export the lettering when generating the file NotifiedExportDate=Flag exported lines as Exported (to modify a line, you will need to delete the whole transaction and re-transfert it into accounting) NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) DateValidationAndLock=Date validation and lock From b9fd2302b528dbb3959cd2f13a8c479e770d9bf3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 12:39:42 +0100 Subject: [PATCH 1263/1289] Trans --- htdocs/cron/card.php | 2 +- htdocs/langs/en_US/cron.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 5de627a9a9a..b7ca2c55555 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -787,7 +787,7 @@ if (($action == "create") || ($action == "edit")) { print dol_get_fiche_end(); - print "\n\n
    \n"; + print "\n\n".'
    '."\n"; if (!$user->rights->cron->create) { print ''.$langs->trans("Edit").''; } else { diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 5e4da60f0f2..46a1b834c23 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -58,7 +58,7 @@ CronNote=Comment CronFieldMandatory=Fields %s is mandatory CronErrEndDateStartDt=End date cannot be before start date StatusAtInstall=Status at module installation -CronStatusActiveBtn=Schedule +CronStatusActiveBtn=Enable scheduling CronStatusInactiveBtn=Disable CronTaskInactive=This job is disabled (not scheduled) CronId=Id From e48af2bfbba8fd8e910d37e22a19d0f9747a8960 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 12:48:16 +0100 Subject: [PATCH 1264/1289] Debug v17 --- htdocs/core/class/html.formcron.class.php | 3 ++ htdocs/cron/card.php | 14 ++++---- htdocs/cron/list.php | 43 ++++++++++++----------- htdocs/langs/en_US/cron.lang | 2 +- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index b6a9140cf58..609458ce839 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -96,6 +96,9 @@ class FormCron extends Form $out .= ''; } + if (empty($readonly)) { + $out .= ajax_combobox($htmlname); + } return $out; } diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index b7ca2c55555..9900db2c9d6 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -493,7 +493,7 @@ if (($action == "create") || ($action == "edit")) { if (!empty($object->datestart)) { print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform"); } else { - print $form->selectDate(-1, 'datestart', 1, 1, '', "cronform"); + print $form->selectDate(-1, 'datestart', 1, 1, 1, "cronform"); } print ""; print ""; @@ -505,7 +505,7 @@ if (($action == "create") || ($action == "edit")) { if (!empty($object->dateend)) { print $form->selectDate($object->dateend, 'dateend', 1, 1, '', "cronform"); } else { - print $form->selectDate(-1, 'dateend', 1, 1, '', "cronform"); + print $form->selectDate(-1, 'dateend', 1, 1, 1, "cronform"); } print ""; print ""; @@ -518,7 +518,7 @@ if (($action == "create") || ($action == "edit")) { if (!empty($object->priority)) { $priority = $object->priority; } - print " "; + print ' '; print ""; print ""; print ""; @@ -530,7 +530,7 @@ if (($action == "create") || ($action == "edit")) { $maxrun = $object->maxrun; } print $langs->trans('CronMaxRun').""; - print " "; + print ' '; print ""; print ""; print ""; @@ -538,12 +538,12 @@ if (($action == "create") || ($action == "edit")) { print ''; print $langs->trans('CronDtNextLaunch'); - print ' ('.$langs->trans('CronFrom').')'; + //print ' ('.$langs->trans('CronFrom').')'; print ""; if (!empty($object->datenextrun)) { print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform"); } else { - print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform"); + print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform", 1, 1); } print ""; print ""; @@ -774,7 +774,7 @@ if (($action == "create") || ($action == "edit")) { print ''; print $langs->trans('CronLastOutput').""; - print nl2br($object->lastoutput); + print ''.nl2br($object->lastoutput).''; print ""; print ''; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index a2c3b1d4807..ae53242d836 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -420,7 +420,7 @@ if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) { $text .= $langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS); } print info_admin($text); -print '
    '; +//print '
    '; //$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ''; @@ -447,7 +447,7 @@ print ' '; print ''; print ' '; print ' '; -print ''; +print ''; print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Scheduled")), $search_status, 1); print ''; $searchpicto = $form->showFilterButtons(); @@ -460,18 +460,18 @@ print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '', print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Prority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder); -print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder); +print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax100 '); print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder); //print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50'); +print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder); -print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, 'align="center"', $sortfield, $sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); +print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, '', $sortfield, $sortorder, 'center '); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -560,19 +560,20 @@ if ($num > 0) { print $form->textwithpicto($text, $texttoshow, 1); print ''; - print ''; + $s = ''; if ($obj->unitfrequency == "60") { - print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Minutes'); - } - if ($obj->unitfrequency == "3600") { - print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Hours'); - } - if ($obj->unitfrequency == "86400") { - print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Days'); - } - if ($obj->unitfrequency == "604800") { - print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Weeks'); + $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Minutes') : $langs->trans('Minute')); + } elseif ($obj->unitfrequency == "3600") { + $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Hours') : $langs->trans('Hour')); + } elseif ($obj->unitfrequency == "86400") { + $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Days') : $langs->trans('Day')); + } elseif ($obj->unitfrequency == "604800") { + $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Weeks') : $langs->trans('Week')); + } elseif ($obj->unitfrequency == "2678400") { + $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Months') : $langs->trans('Month')); } + print ''; + print $s; print ''; /* diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 46a1b834c23..19572c361ad 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -26,7 +26,7 @@ CronCommand=Command CronList=Scheduled jobs CronDelete=Delete scheduled jobs CronConfirmDelete=Are you sure you want to delete these scheduled jobs? -CronExecute=Launch scheduled job +CronExecute=Launch now CronConfirmExecute=Are you sure you want to execute these scheduled jobs now? CronInfo=Scheduled job module allows to schedule jobs to execute them automatically. Jobs can also be started manually. CronTask=Job From 1069fb0555a75ce6623befb65ce4b3121874bc32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 13:32:05 +0100 Subject: [PATCH 1265/1289] forcerounding can accept MU or MT in price function --- htdocs/core/lib/functions.lib.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 775f534bda8..1671ecfaad1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5651,8 +5651,8 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0, * @param integer $form Type of format, HTML or not (not by default) * @param Translate|string $outlangs Object langs for output. '' use default lang. 'none' use international separators. * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless. - * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) - * @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force) + * @param int $rounding MINIMUM number of decimal to show. 0=no change, -1=we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) + * @param int|string $forcerounding Force the MAXIMUM of decimal to forcerounding decimal (-1=no change, 'MU' or 'MT' or numeric to round to MU or MT or to a given number of decimal) * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) * @return string String with formated amount * @@ -5723,8 +5723,14 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ } // If force rounding - if ($forcerounding >= 0) { - $nbdecimal = $forcerounding; + if ((string) $forcerounding != '-1') { + if ($forcerounding == 'MU') { + $nbdecimal = $conf->global->MAIN_MAX_DECIMALS_UNIT; + } else if ($forcerounding == 'MT') { + $nbdecimal = $conf->global->MAIN_MAX_DECIMALS_TOT; + } elseif ($forcerounding >= 0) { + $nbdecimal = $forcerounding; + } } // Format number From 35c64333165d38e4a3054ad93f150674d0ae8ee7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 13:53:04 +0100 Subject: [PATCH 1266/1289] Prepare setnewpassword mode --- htdocs/core/tpl/login.tpl.php | 16 +- htdocs/core/tpl/passwordforgotten.tpl.php | 23 +- htdocs/core/tpl/passwordreset.tpl.php | 367 ++++++++++++++++++++++ htdocs/langs/en_US/other.lang | 1 + htdocs/user/passwordforgotten.php | 15 +- 5 files changed, 405 insertions(+), 17 deletions(-) create mode 100644 htdocs/core/tpl/passwordreset.tpl.php diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index b7e6fd15dcb..eaf2d602571 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -372,9 +372,19 @@ if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->fil // Show error message if defined if (!empty($_SESSION['dol_loginmesg'])) { ?> - +