From ea8759e627cef4cc15b50c9a2d7d9128e5c5f911 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 21 May 2022 07:02:15 +0200 Subject: [PATCH 001/476] 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 002/476] 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 005/476] 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 006/476] 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 007/476] 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 008/476] 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 009/476] 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 010/476] 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 011/476] 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 012/476] =?UTF-8?q?M=C3=A0j=20column=20fk=5Ffedault=5Fwork?= =?UTF-8?q?statio=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 013/476] 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 014/476] 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 7f1a17bcc97a14b47c48ddfcf4677614b34332f7 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 20 Jul 2022 15:38:37 +0200 Subject: [PATCH 017/476] 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 018/476] 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 e4ec999b455457098403cd19b2ca16d3fed88ac0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Jul 2022 14:33:50 +0200 Subject: [PATCH 019/476] 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 420b2c1651283811f7665e4577ad5794c5adb6d2 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 17 Aug 2022 09:44:20 +0200 Subject: [PATCH 020/476] 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 021/476] 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 1a15582c49f790e75460d04e74aee241aa61f388 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 24 Aug 2022 09:43:48 +0000 Subject: [PATCH 022/476] 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 023/476] 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 024/476] 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 025/476] 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 026/476] 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 027/476] 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 88b5594af31f54bed54d0c89e61930f78c48404e Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 31 Aug 2022 09:59:24 +0200 Subject: [PATCH 028/476] FIX: Preview button position on documents list (case when the file is too long) --- htdocs/core/class/html.formfile.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 349b05416aa..6fe10788c54 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -850,6 +850,7 @@ class FormFile // Show file name with link to download $out .= ''; // Show file size @@ -1307,6 +1307,11 @@ class FormFile // File name print ''; if (!$i) { $totalarray['nbfield']++; @@ -1924,7 +1924,7 @@ if ($resql) { // Note private if (!empty($arrayfields['p.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2033b5626b2..07db0c6077c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1762,7 +1762,7 @@ if ($resql) { // Note public if (!empty($arrayfields['c.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1772,7 +1772,7 @@ if ($resql) { // Note private if (!empty($arrayfields['c.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f2cc5943e7a..f847d633ba0 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2103,7 +2103,7 @@ if ($resql) { // Note public if (!empty($arrayfields['f.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2112,7 +2112,7 @@ if ($resql) { // Note private if (!empty($arrayfields['f.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 508eb984307..c1e01db6a79 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -698,7 +698,7 @@ if ($resql) { // Note public if (!empty($arrayfields['f.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -707,7 +707,7 @@ if ($resql) { // Note private if (!empty($arrayfields['f.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; From 4490f0615e22d74fed64e1dbbf4e9d022fa63be8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2022 02:47:43 +0200 Subject: [PATCH 037/476] doc --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 891e445ab39..49a782e1264 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,8 +10,8 @@ For users: --------------- NEW: PHP 8.1 compatibility: - Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending - on the PHP setup). Removal of all PHP warnings on server side is planned for v17. + Warning!! Application works correctly with PHP8 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 NEW: Can show ZATCA QRCode on PDFs From 5b2b5e6a583aeac6c22752341383c5aaac8ac532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2022 08:33:36 +0200 Subject: [PATCH 038/476] Fix picto multicompany --- htdocs/user/group/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1acfa858663..3e6e6eb1231 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -443,7 +443,7 @@ if ($action == 'create') { print ''; print ''."\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 044/476] 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 045/476] 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 046/476] 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 047/476] 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 048/476] 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 f6d2033a242feb7c30be12bdb3fe03087901e540 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 15:00:34 +0200 Subject: [PATCH 049/476] 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 050/476] 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 051/476] 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 4ec58d76544989c6f3cc77e7139cc4ec529a70dc Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 15:20:31 +0200 Subject: [PATCH 052/476] 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 7a97fc8989d366e5be5493de080174fb7c817e0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2022 16:44:32 +0200 Subject: [PATCH 053/476] Fix missing trans --- htdocs/langs/en_US/install.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index dd451200c11..27e1792edac 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -211,3 +211,5 @@ ClickHereToGoToApp=Click here to go to your application ClickOnLinkOrRemoveManualy=If an upgrade is in progress, please wait. If not, click on the following link. If you always see this same page, you must remove/rename the file install.lock in the documents directory. Loaded=Loaded FunctionTest=Function test +NodoUpgradeAfterDB=No action requested by external modules after upgrade of database +NodoUpgradeAfterFiles=No action requested by external modules after upgrade of files or directories From 0b944e62ee86b77b292abc78667bb1bccd093ebf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 10 Sep 2022 17:01:21 +0200 Subject: [PATCH 054/476] 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 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 055/476] 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 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 056/476] 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 057/476] 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 058/476] 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 059/476] 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 060/476] 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 061/476] 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 062/476] 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 063/476] 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 064/476] 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 065/476] 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 066/476] 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 067/476] 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 068/476] 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 069/476] 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 070/476] 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 071/476] 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 072/476] 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 073/476] 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 074/476] 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 075/476] 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 076/476] 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 077/476] 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 078/476] 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 079/476] 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 080/476] 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 081/476] 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 082/476] 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 083/476] 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 084/476] 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 085/476] 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 086/476] 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 087/476] 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 088/476] 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 089/476] 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 090/476] 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 091/476] 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 9c2d4fa2d3032b9246d1c3bffeeb3a0800359b6e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 11 Sep 2022 11:53:37 +0200 Subject: [PATCH 092/476] Update evaluation.class.php --- htdocs/hrm/class/evaluation.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 4915d44fb6f..879acff61fa 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -20,9 +20,9 @@ */ /** - * \file class/evaluation.class.php - * \ingroup hrm - * \brief This file is a CRUD class file for Evaluation (Create/Read/Update/Delete) + * \file htdocs/hrm/class/evaluation.class.php + * \ingroup hrm + * \brief This file is a CRUD class file for Evaluation (Create/Read/Update/Delete) */ // Put here all includes required by your class file From 994603f009a00c6e0eff782e98b30e2a0a7a9dae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 12:17:49 +0200 Subject: [PATCH 093/476] FIX Missing token --- htdocs/admin/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 795a0557f16..a1281351176 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -356,7 +356,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { print ' }'; print ' function generatelink(){'; - print ' return "security.php?action=updatepattern&pattern="+getStringArg();'; + print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();'; print ' }'; print ' function valuePatternChange(){'; From 2293d826078416ef86f3b19e513808aaf975abbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 12:18:43 +0200 Subject: [PATCH 094/476] NEW Add picto property on sub-module for paswword generation --- htdocs/admin/security.php | 16 ++++--- htdocs/admin/security_file.php | 2 +- htdocs/admin/system/security.php | 44 +++++++++++++++++-- .../generate/modGeneratePassNone.class.php | 2 + .../generate/modGeneratePassPerso.class.php | 2 + .../modGeneratePassStandard.class.php | 2 + .../security/generate/modules_genpassword.php | 2 + htdocs/langs/en_US/admin.lang | 3 +- 8 files changed, 62 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 14975f8c68a..de404916fb4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -216,6 +216,8 @@ print '
'; print ''; print ''; +$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN')); + foreach ($arrayhandler as $key => $module) { // Show modules according to features level if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { @@ -226,15 +228,16 @@ foreach ($arrayhandler as $key => $module) { } if ($module->isEnabled()) { - print ''; // Show example of numbering module - print ''."\n"; - 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.'
'; + $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param, 'paddingright')."\n"; $out .= 'trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); - $out .= ''."\n"; - $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); + $out .= ''; $out .= ''; + // 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"; @@ -2097,9 +2098,10 @@ 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 = '') + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '', $moreclass = '') { global $langs, $conf; @@ -2107,7 +2109,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 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 029/476] 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 444ba4bf46e2225bbe6952a30fea6b2a548f3fb1 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 8 Sep 2022 11:40:40 +0200 Subject: [PATCH 030/476] 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 031/476] 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 032/476] 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 033/476] 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 034/476] 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 ca8c650feb12668abcd6a67fbc8147e577e68299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 9 Sep 2022 12:20:47 +0200 Subject: [PATCH 035/476] Fix: status of product suplier price was not recovered --- htdocs/fourn/class/fournisseur.product.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 0ae975a1cbf..ea5dc639a5e 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -578,7 +578,7 @@ class ProductFournisseur extends Product $sql .= " pfp.supplier_reputation, pfp.fk_user, pfp.datec,"; $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,"; $sql .= " pfp.barcode, pfp.fk_barcode_type, pfp.packaging,"; - $sql .= " p.ref as product_ref"; + $sql .= " p.ref as product_ref, p.tosell as status, p.tobuy as status_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE pfp.rowid = ".(int) $rowid; $sql .= " AND pfp.fk_product = p.rowid"; @@ -594,7 +594,8 @@ class ProductFournisseur extends Product $this->fk_product = $obj->fk_product; $this->product_id = $obj->fk_product; $this->product_ref = $obj->product_ref; - + $this->status = $obj->status; + $this->status_buy = $obj->status_buy; $this->fourn_id = $obj->fk_soc; $this->fourn_ref = $obj->ref_fourn; // deprecated $this->ref_supplier = $obj->ref_fourn; @@ -670,7 +671,7 @@ class ProductFournisseur extends Product // phpcs:enable global $conf; - $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id, p.ref as product_ref,"; + $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id, p.ref as product_ref, p.tosell as status, p.tobuy as status_buy, "; $sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; $sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,"; $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,"; @@ -699,6 +700,8 @@ class ProductFournisseur extends Product $prodfourn->product_ref = $record["product_ref"]; $prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"]; + $prodfourn->status = $record["status"]; + $prodfourn->status_buy = $record["status_buy"]; $prodfourn->product_fourn_id = $record["product_fourn_id"]; $prodfourn->product_fourn_entity = $record["entity"]; $prodfourn->ref_supplier = $record["ref_fourn"]; From 6b4bd6c09eef238300a87ba418c9b21a6ac34f9c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 9 Sep 2022 15:56:17 +0200 Subject: [PATCH 036/476] FIX #21859 - Don't show html balise on list for private/public note --- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/list.php | 4 ++-- htdocs/compta/facture/list.php | 4 ++-- htdocs/fichinter/list.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7a8fe187570..037ce5f26f8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1915,7 +1915,7 @@ if ($resql) { // Note public if (!empty($arrayfields['p.note_public']['checked'])) { print '
'; - print dol_escape_htmltag($obj->note_public); + print dol_string_nohtmltag($obj->note_public); print ''; - print dol_escape_htmltag($obj->note_private); + print dol_string_nohtmltag($obj->note_private); print ''; - print dol_escape_htmltag($obj->note_public); + print dol_string_nohtmltag($obj->note_public); print ''; - print dol_escape_htmltag($obj->note_private); + print dol_string_nohtmltag($obj->note_private); print ''; - print dol_escape_htmltag($obj->note_public); + print dol_string_nohtmltag($obj->note_public); print ''; - print dol_escape_htmltag($obj->note_private); + print dol_string_nohtmltag($obj->note_private); print ''; - print dol_escape_htmltag($obj->note_public); + print dol_string_nohtmltag($obj->note_public); print ''; - print dol_escape_htmltag($obj->note_private); + print dol_string_nohtmltag($obj->note_private); print '
'; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); - if ($useringroup->admin && !$useringroup->entity) { + if (isModEnabled('multicompany') && $useringroup->admin && empty($useringroup->entity)) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); } elseif ($useringroup->admin) { print img_picto($langs->trans("Administrator"), 'star'); From 857646ed364b9fc252343aa4d3fa78eec18d2fba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:00:38 +0200 Subject: [PATCH 039/476] 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 040/476] 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 041/476] 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 e73b8983bf4f1c0b95614cd43e2fb8725e820010 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 10 Sep 2022 11:07:00 +0200 Subject: [PATCH 042/476] 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 043/476] 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 .= '
'.$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("Example").''.$langs->trans("Activated").'
'; + print '
'; + print img_picto('', $module->picto, 'class="width25 size15x opacitymedium"').' '; print ucfirst($key); print "\n"; print $module->getDescription().'
'; - print $langs->trans("MinLength").': '.$module->length; + print $langs->trans("MinLength").': '.$module->length.''; print '
'; + print ''; $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); @@ -246,7 +249,7 @@ foreach ($arrayhandler as $key => $module) { } print ''; + print ''; if ($conf->global->USER_PASSWORD_GENERATED == $key) { //print img_picto('', 'tick'); print img_picto($langs->trans("Enabled"), 'switch_on'); @@ -267,7 +270,6 @@ print ''; //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) // Patter for Password Perso if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { - $tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN); print '
'; print '
'; @@ -346,7 +348,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { print ' }'; print ' function generatelink(){'; - print ' return "security.php?action=updatepattern&pattern="+getStringArg();'; + print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();'; print ' }'; print ' function valuePatternChange(){'; @@ -470,7 +472,9 @@ print '
'; + print ''; + print '
'; if (GETPOST('info', 'int') > 0) { diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index b20287ce19b..ff0d5780ad4 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -113,7 +113,7 @@ print '
'; // Upload options print '
'; -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 4ba5bec5b11..7ee7c93a97d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-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 @@ -312,11 +312,48 @@ print yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1); print '
'; print '
'; +print ''.$langs->trans("DoNotStoreClearPassword").': '; +print empty($conf->global->DATABASE_PWD_ENCRYPTED) ? '' : img_picto('', 'tick').' '; +print yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1); +if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; + +/* Already into section conf file */ +/* +$usepassinconfencrypted = 0; +global $dolibarr_main_db_pass, $dolibarr_main_db_encrypted_pass; +if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { + $usepassinconfencrypted = 1; +} +print ''.$langs->trans("MainDbPasswordFileConfEncrypted").': '; +print $usepassinconfencrypted ? img_picto('', 'tick').' ' : img_warning().' '; +print yn($usepassinconfencrypted); +if (empty($usepassinconfencrypted)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; +*/ + +print ''.$langs->trans("PasswordLength").': '; +print empty($conf->global->DATABASE_PWD_ENCRYPTED) ? '' : img_picto('', 'tick').' '; +print yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1); +if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; + print ''.$langs->trans("AntivirusEnabledOnUpload").': '; -print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; +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)) { +if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { + print ' - '.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transcountrynoentities("Setup")." - ".$langs->transnoentitiesnoconv("Security")).''; +} else { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { print ' - '.$langs->trans("ValueIsForcedBySystem").''; @@ -325,6 +362,7 @@ if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '
'; print '
'; + $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index c6cfb733f73..3ec764c6ab2 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -35,6 +35,8 @@ class modGeneratePassNone extends ModeleGenPassword */ public $id; + public $picto = 'fa-keyboard'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 02b970ee2aa..e0dd2046020 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -37,6 +37,8 @@ class modGeneratePassPerso extends ModeleGenPassword */ public $id; + public $picto = 'fa-shield-alt'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index f0e6fcf2a7f..b2d0b260ccb 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -35,6 +35,8 @@ class modGeneratePassStandard extends ModeleGenPassword */ public $id; + public $picto = 'fa-shield-alt'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php index 4d397605240..bb1e02774c6 100644 --- a/htdocs/core/modules/security/generate/modules_genpassword.php +++ b/htdocs/core/modules/security/generate/modules_genpassword.php @@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; */ abstract class ModeleGenPassword { + public $picto = 'generic'; + /** * Flag to 1 if we must clean ambiguous charaters for the autogeneration of password (List of ambiguous char is in $this->Ambi) * diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a24dd69cc71..d3b2f251a6c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2309,4 +2309,5 @@ UseOauth=Use a OAUTH token 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) \ No newline at end of file +ShowHideTheNRequests=Show/hide the %s SQL request(s) +DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s \ No newline at end of file From a0dda0ed7794dc1ed6ad9b1dd7e421e7ca56457a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 12:35:40 +0200 Subject: [PATCH 095/476] NEW Add more advices into the Setup security page --- htdocs/admin/security.php | 2 +- htdocs/admin/system/security.php | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index de404916fb4..02cddbd5d70 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -229,7 +229,7 @@ foreach ($arrayhandler as $key => $module) { if ($module->isEnabled()) { 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 286/476] 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 '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print img_picto('', $module->picto, 'class="width25 size15x opacitymedium"').' '; + print img_picto('', $module->picto, 'class="width25 size15x"').' '; print ucfirst($key); print "\n"; print $module->getDescription().'
'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 7ee7c93a97d..c2e486fc940 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -297,7 +297,7 @@ if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) { -// Menu security +// Menu Home - Setup - Security print '
'; print '
'; @@ -338,6 +338,11 @@ print '
'; print '
'; */ +/* Password length + +// Stored into $tabconf[0] if module generator is "Perso" or specific to the module generator. +$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN')); + print ''.$langs->trans("PasswordLength").': '; print empty($conf->global->DATABASE_PWD_ENCRYPTED) ? '' : img_picto('', 'tick').' '; print yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1); @@ -346,7 +351,7 @@ if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) { } print '
'; print '
'; - +*/ print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? img_warning().' ' : img_picto('', 'tick').' '; @@ -362,6 +367,19 @@ if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '
'; print '
'; +$umask = getDolGlobalString('MAIN_UMASK'); + +print ''.$langs->trans("UMask").': '; +if (! in_array($umask, array('600', '660', '0600', '0660'))) { + print img_warning().' '; +} +print $umask; +if (! in_array($umask, array('600', '660', '0600', '0660'))) { + print '   ('.$langs->trans("Recommended").': 0600 | 0660'.')'; +} +print '
'; +print '
'; + $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; @@ -527,10 +545,10 @@ print '
'; print 'MAIN_SECURITY_FORCECSP = '.(empty($conf->global->MAIN_SECURITY_FORCECSP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_FORCECSP).'   ('.$langs->trans("Example").": \"default-src 'self'; img-src *;\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCECSP = '.(empty($conf->global->WEBSITE_MAIN_SECURITY_FORCECSP) ? ''.$langs->trans("Undefined").'' : $conf->global->WEBSITE_MAIN_SECURITY_FORCECSP).'   ('.$langs->trans("Example").": \"default-src 'self'; style-src: https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src: https://cdn.transifex.com https://www.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src: *;\")
"; +print 'MAIN_SECURITY_FORCERP = '.(empty($conf->global->MAIN_SECURITY_FORCERP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_FORCERP).'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"same-origin\")
"; print '
'; -print 'MAIN_SECURITY_FORCERP = '.(empty($conf->global->MAIN_SECURITY_FORCERP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_FORCERP).'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"same-origin\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCECSP = '.(empty($conf->global->WEBSITE_MAIN_SECURITY_FORCECSP) ? ''.$langs->trans("Undefined").'' : $conf->global->WEBSITE_MAIN_SECURITY_FORCECSP).'   ('.$langs->trans("Example").": \"default-src 'self'; style-src: https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src: https://cdn.transifex.com https://www.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src: *;\")
"; print '
'; print 'WEBSITE_MAIN_SECURITY_FORCERP = '.(empty($conf->global->WEBSITE_MAIN_SECURITY_FORCERP) ? ''.$langs->trans("Undefined").'' : $conf->global->WEBSITE_MAIN_SECURITY_FORCERP).'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")
"; From 60c39933d4d306f807ebba3bd7019b288b9727b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 13:26:24 +0200 Subject: [PATCH 096/476] Clean code --- htdocs/admin/dav.php | 14 +++++++------- htdocs/admin/system/security.php | 2 +- htdocs/dav/fileserver.php | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index d70356650d9..d0fd21c80a0 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -77,14 +77,14 @@ print ''; $head = dav_admin_prepare_head(); -print dol_get_fiche_head($head, 'webdav', '', -1, 'action'); +print dol_get_fiche_head($head, 'webdav', '', -1, ''); if ($action == 'edit') { print '
'; print ''; print ''; - print ''; + print '
'; print ''; foreach ($arrayofparameters as $key => $val) { @@ -97,7 +97,7 @@ if ($action == 'edit') { $label = $langs->trans($key); if ($key == 'DAV_RESTICT_ON_IP') { $label = $langs->trans("RESTRICT_ON_IP"); - $label .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample"); + $tooltiphelp .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample"); } print $form->textwithpicto($label, $tooltiphelp); print ' - @@ -503,7 +507,10 @@ if (!empty($force_install_noedit)) { > - @@ -613,30 +621,13 @@ jQuery(document).ready(function() { }); - function init_needroot() - { - console.log("init_needroot force_install_noedit="); - /*alert(jQuery("#db_create_database").prop("checked")); */ - if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) - { - jQuery(".hideroot").show(); - - jQuery(".needroot").removeAttr('disabled'); - - } - else - { - jQuery(".hideroot").hide(); - jQuery(".needroot").prop('disabled', true); - } - } - init_needroot(); jQuery("#db_create_database").click(function() { + console.log("click on db_create_database"); init_needroot(); }); jQuery("#db_create_user").click(function() { + console.log("click on db_create_user"); init_needroot(); }); @@ -644,6 +635,27 @@ jQuery(document).ready(function() { }); +function init_needroot() +{ + console.log("init_needroot force_install_noedit="); + /*alert(jQuery("#db_create_database").prop("checked")); */ + if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) + { + console.log("init_needroot show root section"); + jQuery(".hideroot").show(); + + jQuery(".needroot").removeAttr('disabled'); + + } + else + { + console.log("init_needroot hide root section"); + jQuery(".hideroot").hide(); + jQuery(".needroot").prop('disabled', true); + } +} + function checkDatabaseName(databasename) { if (databasename.match(/[;\.]/)) { return false; } return true; @@ -651,6 +663,8 @@ function checkDatabaseName(databasename) { function jscheckparam() { + console.log("Click on jscheckparam"); + ok=true; if (document.forminstall.main_dir.value == '') @@ -688,12 +702,14 @@ function jscheckparam() { ok=false; alert('transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>'); + init_needroot(); } // If create user asked else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == '')) { ok=false; alert('transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>'); + init_needroot(); } return ok; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index a20c3489866..657e9841100 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -530,7 +530,7 @@ function pFooter($nonext = 0, $setuplang = '', $jscheckfunction = '', $withpleas print ''; } - print ''."\n"; + print '
'."\n"; // If there is some logs in buffer to show if (isset($conf->logbuffer) && count($conf->logbuffer)) { 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 120/476] 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 121/476] 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 122/476] 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 123/476] 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 124/476] 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 125/476] 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 8ac625f03bbccb4925032894270e8b0a95ca2e3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 10:26:20 +0200 Subject: [PATCH 126/476] FIX reading of trackid in emailcollector (when on recipient suffix) --- htdocs/comm/mailing/card.php | 2 +- htdocs/core/class/notify.class.php | 2 +- .../class/emailcollector.class.php | 44 ++++++++++++++----- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 748c5fabf10..63e79685311 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -475,7 +475,7 @@ if (empty($reshook)) { } } - $trackid = 'emailingtest'; + $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'); $result = $mailfile->sendfile(); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 3f26a98c728..5e12a30ba0e 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -456,7 +456,7 @@ class Notify $notifcodedefid = $obj->adid; $trackid = ''; if ($obj->type_target == 'tocontactid') { - $trackid = 'con'.$obj->cid; + $trackid = 'ctc'.$obj->cid; } if ($obj->type_target == 'touserid') { $trackid = 'use'.$obj->cid; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 47e3c1303da..1c8c0b8698f 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1236,22 +1236,38 @@ class EmailCollector extends CommonObject $headers['Subject'] = $this->decodeSMTPSubject($headers['Subject']); + $emailto = $this->decodeSMTPSubject($overview[0]->to); + dol_syslog("** Process email ".$iforemailloop." References: ".$headers['References']." Subject: ".$headers['Subject']); //print "Process mail ".$iforemailloop." Subject: ".dol_escape_htmltag($headers['Subject'])." References: ".dol_escape_htmltag($headers['References'])." In-Reply-To: ".dol_escape_htmltag($headers['In-Reply-To'])."
\n"; + $trackidfoundintorecipienttype = ''; + $trackidfoundintorecipientid = 0; + $reg = array(); + // See also later list of all supported tags... + if (preg_match('/\+(thi|ctc|use|mem|sub|proj|tas|con|tic|job|pro|ord|inv|spro|sor|sin|leav|stockinv|job|surv|salary)([0-9]+)@/', $emailto, $reg)) { + $trackidfoundintorecipienttype = $reg[1]; + $trackidfoundintorecipientid = $reg[2]; + } elseif (preg_match('/\+emailing-(\w+)@/', $emailto, $reg)) { // Can be 'emailing-test' or 'emailing-IdMailing-IdRecipient' + $trackidfoundintorecipienttype = 'emailing'; + $trackidfoundintorecipientid = $reg[1]; + } + // If there is a filter on trackid if ($searchfilterdoltrackid > 0) { - if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { - $nbemailprocessed++; - dol_syslog(" Discarded - No header References found"); - continue; // Exclude email + if (empty($trackidfoundintorecipienttype)) { + if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { + $nbemailprocessed++; + dol_syslog(" Discarded - No suffix in email recipient and no Header References found matching signature of application so with a trackid"); + continue; // Exclude email + } } } if ($searchfilternodoltrackid > 0) { - if (!empty($headers['References']) && preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { + if (!empty($trackidfoundintorecipienttype) || (!empty($headers['References']) && preg_match('/@'.preg_quote($host, '/').'/', $headers['References']))) { $nbemailprocessed++; - dol_syslog(" Discarded - Header References found and matching signature of application"); + dol_syslog(" Discarded - Suffix found into email or Header References found and matching signature of application so with a trackid"); continue; // Exclude email } } @@ -1431,13 +1447,19 @@ class EmailCollector extends CommonObject foreach ($arrayofreferences as $reference) { //print "Process mail ".$iforemailloop." email_msgid ".$msgid.", date ".dol_print_date($date, 'dayhour').", subject ".$subject.", reference ".dol_escape_htmltag($reference)."
\n"; - $resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote($host, '/').'/', $reference, $reg); - if (empty($resultsearchtrackid) && getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE')) { - $resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote(getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE'), '/').'/', $reference, $reg); + if (!empty($trackidfoundintorecipienttype)) { + $resultsearchtrackid = -1; + $reg[1] = $trackidfoundintorecipienttype; + $reg[2] = $trackidfoundintorecipientid; + } else { + $resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote($host, '/').'/', $reference, $reg); + if (empty($resultsearchtrackid) && getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE')) { + $resultsearchtrackid = preg_match('/dolibarr-([a-z]+)([0-9]+)@'.preg_quote(getDolGlobalString('EMAIL_ALTERNATIVE_HOST_SIGNATURE'), '/').'/', $reference, $reg); + } } - if ($resultsearchtrackid) { - // This is a Dolibarr reference of the server + if (!empty($resultsearchtrackid)) { + // We found a tracker (in recipient email or into a Reference matching the Dolibarr server) $trackid = $reg[1].$reg[2]; $objectid = $reg[2]; From 9dd96b2a03dcec22bc814581416daab41ab2aea9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 12 Sep 2022 10:50:59 +0200 Subject: [PATCH 127/476] 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 404bfd8b7b36a31e469c37afd79aabf828be626c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 11:06:55 +0200 Subject: [PATCH 128/476] Fix var not defined --- htdocs/admin/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 3218f673fd5..87b49c95468 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -28,6 +28,8 @@ require '../main.inc.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'companies')); +$action = ''; + if (!$user->admin) { accessforbidden(); } @@ -120,11 +122,12 @@ print '
'; // Add hook to add information $parameters = array(); +$object = new stdClass(); $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; if (empty($reshook)) { // Show into other - print ''.$langs->trans("SetupDescription5")."
"; + //print ''.$langs->trans("SetupDescription5")."
"; print '
'; // Show logo From dde3b71cadee16baa42c98656b29dde6b147b92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 11:33:43 +0200 Subject: [PATCH 129/476] 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 4566342d59f8b3d57a75e3468f85e4e04dca5c2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 11:47:06 +0200 Subject: [PATCH 130/476] FIX #yogosha12439 Remove define('NOCSRFCHECK', '1') --- htdocs/compta/ajaxpayment.php | 3 --- htdocs/expensereport/ajax/ajaxik.php | 3 --- htdocs/modulebuilder/template/css/mymodule.css.php | 10 ++++------ htdocs/mrp/ajax/ajax_bom.php | 3 --- htdocs/product/ajax/products.php | 3 --- htdocs/product/inventory/ajax/searchfrombarcode.php | 3 --- htdocs/salaries/ajax/ajaxsalaries.php | 3 --- htdocs/societe/ajax/ajaxcompanies.php | 3 --- htdocs/societe/ajax/company.php | 3 --- htdocs/stripe/ajax/ajax.php | 3 --- htdocs/takepos/ajax/ajax.php | 3 --- htdocs/takepos/css/pos.css.php | 3 --- htdocs/takepos/floors.php | 3 --- htdocs/takepos/freezone.php | 3 --- htdocs/takepos/genimg/index.php | 3 --- htdocs/takepos/genimg/qr.php | 3 --- htdocs/takepos/index.php | 3 --- htdocs/takepos/invoice.php | 3 --- htdocs/takepos/pay.php | 3 --- htdocs/takepos/phone.php | 3 --- htdocs/takepos/printbox.php | 3 --- htdocs/takepos/reduction.php | 3 --- htdocs/takepos/send.php | 3 --- htdocs/takepos/smpcb.php | 3 --- htdocs/takepos/split.php | 3 --- 25 files changed, 4 insertions(+), 78 deletions(-) diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index f9dec6d0f19..aeb8d164928 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -23,9 +23,6 @@ if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/expensereport/ajax/ajaxik.php b/htdocs/expensereport/ajax/ajaxik.php index 9abd767e1f9..209eb3cdde7 100644 --- a/htdocs/expensereport/ajax/ajaxik.php +++ b/htdocs/expensereport/ajax/ajaxik.php @@ -37,9 +37,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} $res = 0; require '../../main.inc.php'; diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index 6d38c782184..260868a10bf 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -21,15 +21,13 @@ * \brief CSS file for module MyModule. */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled. Language code is found on url. +//if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language +//if (!defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled. Language code is found on url. if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', 1); -} +//if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations +//if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); // Should be disable only for special situation if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', 1); } diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index a46563e02c8..050385246b5 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -26,9 +26,6 @@ if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 8fb1ce8f060..1896c801c50 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -38,9 +38,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (empty($_GET['keysearch']) && !defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } diff --git a/htdocs/product/inventory/ajax/searchfrombarcode.php b/htdocs/product/inventory/ajax/searchfrombarcode.php index d8f4ecf2ed2..efe4d65f2d3 100644 --- a/htdocs/product/inventory/ajax/searchfrombarcode.php +++ b/htdocs/product/inventory/ajax/searchfrombarcode.php @@ -34,9 +34,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php"; $warehouse = new Entrepot($db); diff --git a/htdocs/salaries/ajax/ajaxsalaries.php b/htdocs/salaries/ajax/ajaxsalaries.php index e8641f3a39a..1cbecf840d2 100644 --- a/htdocs/salaries/ajax/ajaxsalaries.php +++ b/htdocs/salaries/ajax/ajaxsalaries.php @@ -38,9 +38,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index 6aff1842d0f..08d914d562a 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -38,9 +38,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index a2e3e793fae..7bdfe6e0e34 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -37,9 +37,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/stripe/ajax/ajax.php b/htdocs/stripe/ajax/ajax.php index 33927aa291d..5fa4da88ae7 100644 --- a/htdocs/stripe/ajax/ajax.php +++ b/htdocs/stripe/ajax/ajax.php @@ -20,9 +20,6 @@ * \brief Ajax action for Stipe ie: Terminal */ -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 857e8249f21..1ee27c51f8b 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -21,9 +21,6 @@ * \brief Ajax search component for TakePos. It search products of a category. */ -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index acb195af15c..1ffe5c63db3 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -31,9 +31,6 @@ if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', 1); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', 1); } diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 46fe0f3529d..01f022a94cd 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -25,9 +25,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 952c867ae47..2402c24acca 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -26,9 +26,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index dcb8c1fe487..84ce27868ae 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -23,9 +23,6 @@ if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index eb33a08e370..b289814f9e1 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -26,9 +26,6 @@ if (!defined('NOIPCHECK')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index dd7eb27178f..e612d4cd8ee 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -28,9 +28,6 @@ // if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f383b630275..6ec6f11ffc7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -28,9 +28,6 @@ // if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 9cea11073ba..e9188aabfdc 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -27,9 +27,6 @@ // if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index fa12487763e..4d89ce23f66 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -25,9 +25,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/printbox.php b/htdocs/takepos/printbox.php index 176805662a5..dfceab9bbc4 100644 --- a/htdocs/takepos/printbox.php +++ b/htdocs/takepos/printbox.php @@ -26,9 +26,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index e02884d810c..67829003954 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -25,9 +25,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 2003abaf1f1..31929a9c732 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -26,9 +26,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/smpcb.php b/htdocs/takepos/smpcb.php index 26d058838e0..505ec27c1b0 100644 --- a/htdocs/takepos/smpcb.php +++ b/htdocs/takepos/smpcb.php @@ -21,9 +21,6 @@ * \brief Page with the content for smpcb payment */ -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php index 68e2995f192..b39f9d1d215 100644 --- a/htdocs/takepos/split.php +++ b/htdocs/takepos/split.php @@ -25,9 +25,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } From cad8b1ee7e84f704b3f66f3bda54940ee31e6cec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 12:25:15 +0200 Subject: [PATCH 131/476] 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 45c9e6064eb5ec0e818180f58a19adaa10082748 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Sep 2022 12:22:00 +0200 Subject: [PATCH 132/476] FIX #yogosha12439 Remove define('NOCSRFCHECK', '1') --- htdocs/asterisk/wrapper.php | 4 -- htdocs/core/ajax/ajaxcompanies.php | 1 - htdocs/core/ajax/check_notifications.php | 3 - htdocs/core/ajax/fetchKnowledgeRecord.php | 3 - htdocs/core/ajax/fileupload.php | 3 - htdocs/core/ajax/locationincoterms.php | 3 - htdocs/core/ajax/onlineSign.php | 3 - htdocs/core/ajax/selectobject.php | 3 - htdocs/core/ajax/ziptown.php | 3 - .../conferenceorboothattendee_note.php | 1 - htdocs/hrm/position.php | 1 - .../modulebuilder/template/ajax/myobject.php | 68 +++++++++++++++++++ .../template/myobject_agenda.php | 1 - .../modulebuilder/template/myobject_card.php | 1 - .../template/myobject_document.php | 1 - .../modulebuilder/template/myobject_list.php | 1 - .../modulebuilder/template/myobject_note.php | 1 - .../template/scripts/mymodule.php | 1 - htdocs/projet/ajax/projects.php | 5 +- htdocs/public/demo/index.php | 3 - htdocs/public/donations/donateurs_code.php | 3 - htdocs/public/test/test_arrays.php | 6 -- htdocs/public/test/test_csrf.php | 6 -- htdocs/public/test/test_exec.php | 6 -- htdocs/public/test/test_sessionlock.php | 6 -- htdocs/public/ticket/ajax/ajax.php | 3 - htdocs/takepos/admin/orderprinters.php | 3 + htdocs/takepos/admin/other.php | 1 - htdocs/takepos/floors.php | 5 +- htdocs/takepos/freezone.php | 2 +- htdocs/takepos/index.php | 33 ++++----- htdocs/takepos/invoice.php | 6 +- htdocs/takepos/pay.php | 22 +++--- htdocs/takepos/phone.php | 20 +++--- htdocs/takepos/printbox.php | 2 +- htdocs/takepos/reduction.php | 4 +- htdocs/takepos/send.php | 2 +- htdocs/takepos/split.php | 2 +- htdocs/theme/eldy/manifest.json.php | 3 - htdocs/theme/md/manifest.json.php | 3 - 40 files changed, 121 insertions(+), 127 deletions(-) create mode 100644 htdocs/modulebuilder/template/ajax/myobject.php diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 7313fdfd2d5..2f5096f6436 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -34,9 +34,6 @@ if (!defined('NOREQUIRESOC')) { if (!defined('NOREQUIRETRAN')) { define('NOREQUIRETRAN', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } @@ -75,7 +72,6 @@ function llxFooter() print "\n".''."\n"; } - require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/core/ajax/ajaxcompanies.php b/htdocs/core/ajax/ajaxcompanies.php index 9f135d8cb42..ef0d7303715 100644 --- a/htdocs/core/ajax/ajaxcompanies.php +++ b/htdocs/core/ajax/ajaxcompanies.php @@ -28,7 +28,6 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index df2db07d0ab..f48cb9bffe5 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -17,9 +17,6 @@ * along with this program. If not, see . */ -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) } diff --git a/htdocs/core/ajax/fetchKnowledgeRecord.php b/htdocs/core/ajax/fetchKnowledgeRecord.php index 179d8169465..1816217cdef 100644 --- a/htdocs/core/ajax/fetchKnowledgeRecord.php +++ b/htdocs/core/ajax/fetchKnowledgeRecord.php @@ -31,9 +31,6 @@ 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'); diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 0f6fac32338..67f95700976 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -21,9 +21,6 @@ * \brief File to return Ajax response on file upload */ -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', '1'); } diff --git a/htdocs/core/ajax/locationincoterms.php b/htdocs/core/ajax/locationincoterms.php index 34a7459c972..057322ec5fb 100644 --- a/htdocs/core/ajax/locationincoterms.php +++ b/htdocs/core/ajax/locationincoterms.php @@ -38,9 +38,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index f3a82783a2b..53eaf69aea1 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -31,9 +31,6 @@ 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'); diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index 1028ad69db4..31bc791dc10 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -35,9 +35,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 6452bcec884..f6869e9ffcf 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -37,9 +37,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index adc4a1683b8..ea186041602 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 24ce9ec3b51..7a1114ac4a0 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -31,7 +31,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/ajax/myobject.php b/htdocs/modulebuilder/template/ajax/myobject.php new file mode 100644 index 00000000000..3e22eb25f22 --- /dev/null +++ b/htdocs/modulebuilder/template/ajax/myobject.php @@ -0,0 +1,68 @@ + + * + * 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/mymodule/ajax/myobject.php + * \brief File to return Ajax response on product list request + */ + +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); // Disables token renewal +} +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', '1'); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} + +// Load Dolibarr environment +require '../../main.inc.php'; + +$mode = GETPOST('mode', 'aZ09'); + +// Security check +restrictedArea($user, 'mymodule', 0, 'myobject'); + + +/* + * View + */ + +dol_syslog("Call ajax mymodule/ajax/myobject.php"); + +top_httphead('application/json'); + +$arrayresult = array(); + +// .... + +$db->close(); + +print json_encode($arrayresult); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 0a397dceaa6..f0d7ffa1439 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index aa2680ea568..4bc0b797b47 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 4a4b68391bc..6aed7382b7d 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 789a5d2312d..276e709019d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index e97d131551a..f7859cfb217 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -28,7 +28,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/modulebuilder/template/scripts/mymodule.php b/htdocs/modulebuilder/template/scripts/mymodule.php index 2d9b3aac79c..e335eb0ea46 100644 --- a/htdocs/modulebuilder/template/scripts/mymodule.php +++ b/htdocs/modulebuilder/template/scripts/mymodule.php @@ -29,7 +29,6 @@ //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index e9e8f85ddf3..03d118dc9b9 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -38,9 +38,6 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } @@ -65,7 +62,7 @@ dol_syslog("Call ajax projet/ajax/projects.php"); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -top_httphead(); +top_httphead('application/json'); if (empty($htmlname) && !GETPOST('mode', 'aZ09')) { return; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 2762a57eced..f7274d5b06b 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -27,9 +27,6 @@ if (!defined('NOLOGIN')) { define('NOLOGIN', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', 1); } diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 5fb3798f428..4acbaa5a256 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -25,9 +25,6 @@ if (!defined('NOLOGIN')) { define('NOLOGIN', '1'); } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 15f54b646a5..693b7eed59d 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -9,12 +9,6 @@ if (!defined('NOREQUIRESOC')) { if (!defined('NOSTYLECHECK')) { define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test -} -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test -} //if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu //if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php //if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library diff --git a/htdocs/public/test/test_csrf.php b/htdocs/public/test/test_csrf.php index eb2527bb62d..6bb9679d404 100644 --- a/htdocs/public/test/test_csrf.php +++ b/htdocs/public/test/test_csrf.php @@ -9,12 +9,6 @@ if (!defined('NOREQUIRESOC')) { if (!defined('NOSTYLECHECK')) { define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test -} -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test -} //if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu //if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php //if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library diff --git a/htdocs/public/test/test_exec.php b/htdocs/public/test/test_exec.php index 59259d0ac49..1c477c31295 100644 --- a/htdocs/public/test/test_exec.php +++ b/htdocs/public/test/test_exec.php @@ -14,12 +14,6 @@ if (!defined('NOREQUIRETRAN')) { if (!defined('NOSTYLECHECK')) { define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test -} -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu } diff --git a/htdocs/public/test/test_sessionlock.php b/htdocs/public/test/test_sessionlock.php index ce764d5daed..6e022358ba2 100644 --- a/htdocs/public/test/test_sessionlock.php +++ b/htdocs/public/test/test_sessionlock.php @@ -14,12 +14,6 @@ if (!defined('NOREQUIRETRAN')) { if (!defined('NOSTYLECHECK')) { define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data } -if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test -} -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not check anti POST attack test -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu } diff --git a/htdocs/public/ticket/ajax/ajax.php b/htdocs/public/ticket/ajax/ajax.php index a75c796539c..2b637ce3647 100644 --- a/htdocs/public/ticket/ajax/ajax.php +++ b/htdocs/public/ticket/ajax/ajax.php @@ -33,9 +33,6 @@ 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'); diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index f01f3d4de66..2b4ac9e594c 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -175,6 +175,7 @@ print '
< print ''; $nbofentries = (count($data) - 1); print ''; +print ''; if ($nbofentries > 0) { print '< print ''; $nbofentries = (count($data) - 1); print ''; +print ''; if ($nbofentries > 0) { print '< print ''; $nbofentries = (count($data) - 1); print ''; +print ''; if ($nbofentries > 0) { print ''; - print ''; - print ''; - } else { - 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 ''; } } 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 268/476] 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 269/476] 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 270/476] 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 271/476] 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 272/476] 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 '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; @@ -120,19 +120,19 @@ if ($action == 'edit') { print ''; print '
'; } else { - print ''; + print '
'; print ''; foreach ($arrayofparameters as $key => $val) { - print '\n"; if (!$i) { $totalarray['nbfield']++; @@ -1107,7 +1107,7 @@ while ($i < min($num, $limit)) { } // Name if (!empty($arrayfields['p.lastname']['checked'])) { - print ''; if (!$i) { @@ -1116,35 +1116,35 @@ while ($i < min($num, $limit)) { } // Firstname if (!empty($arrayfields['p.firstname']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Job position if (!empty($arrayfields['p.poste']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Address if (!empty($arrayfields['p.address']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Zip if (!empty($arrayfields['p.zip']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Town if (!empty($arrayfields['p.town']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -1165,7 +1165,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -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 ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -1291,7 +1291,7 @@ while ($i < min($num, $limit)) { print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['p.datec']['checked'])) { - print ''; if (!$i) { @@ -1300,7 +1300,7 @@ while ($i < min($num, $limit)) { } // Date modification if (!empty($arrayfields['p.tms']['checked'])) { - print ''; if (!$i) { From 271150e1e64c2e4638c5d0c828642918cdcf2bd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 14:26:35 +0200 Subject: [PATCH 098/476] FIX CSS --- htdocs/contact/list.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 0bb902f7ca1..d41b6829bb2 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1072,7 +1072,7 @@ while ($i < min($num, $limit)) { // ID if (!empty($arrayfields['p.rowid']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; @@ -1080,7 +1080,7 @@ while ($i < min($num, $limit)) { } // Name if (!empty($arrayfields['p.lastname']['checked'])) { - print ''; if (!$i) { @@ -1089,35 +1089,35 @@ while ($i < min($num, $limit)) { } // Firstname if (!empty($arrayfields['p.firstname']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Job position if (!empty($arrayfields['p.poste']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Address if (!empty($arrayfields['p.address']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Zip if (!empty($arrayfields['p.zip']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Town if (!empty($arrayfields['p.town']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -1138,7 +1138,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1195,7 +1195,7 @@ while ($i < min($num, $limit)) { if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -1264,7 +1264,7 @@ while ($i < min($num, $limit)) { print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['p.datec']['checked'])) { - print ''; if (!$i) { @@ -1273,7 +1273,7 @@ while ($i < min($num, $limit)) { } // Date modification if (!empty($arrayfields['p.tms']['checked'])) { - print ''; if (!$i) { From c22db758324f2fbafe66019fc0ec12dab0dbb635 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2022 16:05:33 +0200 Subject: [PATCH 099/476] FIX Missing reposition --- 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 58a694726bc..f9fe30ef6d7 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1242,7 +1242,7 @@ if ($num) { // Status / Active print ''; } if (!empty($arrayfields['p.import_key']['checked'])) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 42fa3a1a6b6..ea2d941be3d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7859,7 +7859,7 @@ class Form * @return string HTML select string. * @see multiselectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 1, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) + public static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = 'minwidth75', $addjscombo = 1, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) { global $conf, $langs; From d8b6a670644c42884ebe7c95887edf887ddcc9b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 15:05:28 +0200 Subject: [PATCH 102/476] Fix picto --- .../triggers/interface_99_modWebhook_WebhookTriggers.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php index 335024554fc..a8932934bd1 100644 --- a/htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php @@ -52,7 +52,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers $this->description = "Webhook triggers."; // 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; - $this->picto = 'webhook@webhook'; + $this->picto = 'webhook'; } /** From 62cc9c2482e4553c1a9a8214fce590b2fca762c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 15:11:56 +0200 Subject: [PATCH 103/476] No trigger with a number higher than 95 --- ...ss.php => interface_95_modWebhook_WebhookTriggers.class.php} | 0 ...lass.php => interface_95_modZapier_ZapierTriggers.class.php} | 0 htdocs/install/upgrade2.php | 2 ++ 3 files changed, 2 insertions(+) rename htdocs/core/triggers/{interface_99_modWebhook_WebhookTriggers.class.php => interface_95_modWebhook_WebhookTriggers.class.php} (100%) rename htdocs/core/triggers/{interface_99_modZapier_ZapierTriggers.class.php => interface_95_modZapier_ZapierTriggers.class.php} (100%) diff --git a/htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php similarity index 100% rename from htdocs/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php rename to htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php similarity index 100% rename from htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php rename to htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 01e89bf51ff..94eeb6d6243 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4094,6 +4094,8 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/triggers/interface_modCommande_Ecotax.class.php', '/core/triggers/interface_modCommande_fraisport.class.php', '/core/triggers/interface_modPropale_PropalWorkflow.class.php', + '/core/triggers/interface_99_modWebhook_WebhookTriggers.class.php', + '/core/triggers/interface_99_modZapier_ZapierTriggers.class.php', '/core/menus/smartphone/iphone.lib.php', '/core/menus/smartphone/iphone_backoffice.php', '/core/menus/smartphone/iphone_frontoffice.php', From 3ac93040552394395f5cb5a8e01718e3a4587f0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 15:17:10 +0200 Subject: [PATCH 104/476] css --- htdocs/admin/system/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 9a0a1e4d850..8cd1ad3d597 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -65,7 +65,7 @@ print '
'; print '
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : ''); $label = $langs->trans($key); if ($key == 'DAV_RESTICT_ON_IP') { $label = $langs->trans("RESTRICT_ON_IP"); - $label .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample").''; + $tooltiphelp .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample").''; } print $form->textwithpicto($label, $tooltiphelp); - print ''; + print ''; if ($key == 'DAV_ALLOW_PRIVATE_DIR') { print $langs->trans("AlwaysActive"); } elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') { diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index c2e486fc940..5b3b8c9f280 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -375,7 +375,7 @@ if (! in_array($umask, array('600', '660', '0600', '0660'))) { } print $umask; if (! in_array($umask, array('600', '660', '0600', '0660'))) { - print '   ('.$langs->trans("Recommended").': 0600 | 0660'.')'; + print '   ('.$langs->trans("Recommended").': 0600 | 0660)'; } print '
'; print '
'; diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index c77d4d02226..dd46992d211 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -66,7 +66,6 @@ if (empty($conf->dav->enabled)) { accessforbidden(); } - // Restrict API to some IPs if (!empty($conf->global->DAV_RESTRICT_ON_IP)) { $allowedip = explode(' ', $conf->global->DAV_RESTRICT_ON_IP); @@ -136,7 +135,7 @@ $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $p return true; }); -$authBackend->setRealm(constant('DOL_APPLICATION_TITLE')); +$authBackend->setRealm(constant('DOL_APPLICATION_TITLE').' - WebDAV'); @@ -200,7 +199,7 @@ $lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir.'/.locksdb'); $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend); $server->addPlugin($lockPlugin); -// Support for html frontend +// Support for the html browser if (empty($conf->global->DAV_DISABLE_BROWSER)) { $browser = new \Sabre\DAV\Browser\Plugin(); $server->addPlugin($browser); From 85605408fa6ac5b181a815713f0280adaec6262b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 14:26:35 +0200 Subject: [PATCH 097/476] FIX CSS --- htdocs/contact/list.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1070c9e0b9d..59e57d03a60 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1099,7 +1099,7 @@ while ($i < min($num, $limit)) { // ID if (!empty($arrayfields['p.rowid']['checked'])) { print '
'; - print $obj->rowid; + print dol_escape_htmltag($obj->rowid); print "'; + print ''; print $contactstatic->getNomUrl(1); print ''.$obj->firstname.''.dol_escape_htmltag($obj->firstname).''.$obj->poste.''.dol_escape_htmltag($obj->poste).''.$obj->address.''.dol_escape_htmltag($obj->address).''.$obj->zip.''.dol_escape_htmltag($obj->zip).''.$obj->town.''.dol_escape_htmltag($obj->town).''; $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; + print dol_escape_htmltag($tmparray['label']); print ''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print $obj->rowid; + print dol_escape_htmltag($obj->rowid); print "'; + print ''; print $contactstatic->getNomUrl(1); print ''.$obj->firstname.''.dol_escape_htmltag($obj->firstname).''.$obj->poste.''.dol_escape_htmltag($obj->poste).''.$obj->address.''.dol_escape_htmltag($obj->address).''.$obj->zip.''.dol_escape_htmltag($obj->zip).''.$obj->town.''.dol_escape_htmltag($obj->town).''; $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; + print dol_escape_htmltag($tmparray['label']); print ''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if ($canbedisabled) { - print ''.$actl[$obj->active].''; + print ''.$actl[$obj->active].''; } else { print ''.$actl[$obj->active].''; } From 8d05c98701153f693e11dc779edb631f08f06fa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2022 13:31:20 +0200 Subject: [PATCH 100/476] Can modify creation date --- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index cc56b1c9cd7..97ec05d6985 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -115,7 +115,7 @@ class RecruitmentJobPosition extends CommonObject 'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>3,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>101, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>102, 'notnull'=>0, 'visible'=>0,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-4,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), '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,), From ebc90af5ed7990740d97f1bfcf1e7d85fb05350f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 14:43:25 +0200 Subject: [PATCH 101/476] Fix css --- htdocs/contact/list.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 59e57d03a60..eea44ab7387 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -938,7 +938,7 @@ if (!empty($arrayfields['p.tms']['checked'])) { // Status if (!empty($arrayfields['p.statut']['checked'])) { print ''; - print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status); + print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75'); print '
'; print ''."\n"; -print ''."\n"; +print ''."\n"; print '
'.$langs->trans("Tables").'
'.$langs->trans("List").'
'.img_picto('', 'list', 'class="pictofixedwidth"').$langs->trans("List").'
'; print ''; From e7ea57d183a7c881cba94949641e13d498620740 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 11 Sep 2022 19:22:51 +0200 Subject: [PATCH 105/476] FIX avoid warning (php7+) --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b63bb68c4a5..e6c69cadc96 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1448,9 +1448,9 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta // escape quotes and backslashes, newlines, etc. if ($escapeonlyhtmltags) { - $tmp = htmlspecialchars_decode($stringtoescape, ENT_COMPAT); + $tmp = htmlspecialchars_decode((string) $stringtoescape, ENT_COMPAT); } else { - $tmp = html_entity_decode($stringtoescape, ENT_COMPAT, 'UTF-8'); + $tmp = html_entity_decode((string) $stringtoescape, ENT_COMPAT, 'UTF-8'); } if (!$keepb) { $tmp = strtr($tmp, array(""=>'', ''=>'')); From 4a17fae9af464b21a64e708769f36108055e88b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Sep 2022 20:48:23 +0200 Subject: [PATCH 106/476] Add info on mitigation --- htdocs/admin/system/security.php | 15 +++++++++++++++ htdocs/core/tpl/login.tpl.php | 2 ++ 2 files changed, 17 insertions(+) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 5b3b8c9f280..b7074c51095 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -563,6 +563,21 @@ print '
'; print '
'; +print load_fiche_titre($langs->trans("LimitsAndMitigation"), '', 'folder'); + +print ''; +print 'For a higher security, we also recommend to implement limits and mitigation on number of endpoints per minutes for the following URL'."
"; +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)'."
"; + + + + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index f179ea9ed36..b7e6fd15dcb 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -137,9 +137,11 @@ $(document).ready(function () {
trans("CheckToCreateDatabase"); ?> + + trans("CheckToCreateDatabase"); ?>
trans("CheckToCreateUser"); ?> + + trans("CheckToCreateUser"); ?>
'.$langs->trans("Printer").' 1
'; print ''; @@ -208,6 +209,7 @@ print '
'.$langs->trans("Printer").' 2
'; print ''; @@ -241,6 +243,7 @@ print '
'.$langs->trans("Printer").' 3
'; print ''; diff --git a/htdocs/takepos/admin/other.php b/htdocs/takepos/admin/other.php index 6200fce8768..7f07b214085 100644 --- a/htdocs/takepos/admin/other.php +++ b/htdocs/takepos/admin/other.php @@ -82,7 +82,6 @@ print ''; print ''; print ''; - print '
'; // Marketplace diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 01f022a94cd..85aab47528f 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -25,9 +25,6 @@ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } @@ -182,7 +179,7 @@ function LoadPlace(place){ $( document ).ready(function() { - $.getJSON('./floors.php?action=getTables&floor=', function(data) { + $.getJSON('./floors.php?action=getTables&token=&floor=', function(data) { $.each(data, function(key, val) { $('body').append('
'+val.label+'
'); diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 2402c24acca..e1b24ec286d 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -109,7 +109,7 @@ top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss); */ function Save() { console.log("We click so we call page invoice.php with place= tva_tx="+vatRate); - parent.$("#poslines").load("invoice.php?action=freezone&place=&number="+$('#number').val()+"&tva_tx="+vatRate, {desc:$('#desc').val()}); + parent.$("#poslines").load("invoice.php?action=freezone&token=&place=&number="+$('#number').val()+"&tva_tx="+vatRate, {desc:$('#desc').val()}); parent.$.colorbox.close(); } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index e612d4cd8ee..5e1bd1350fb 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -28,9 +28,6 @@ // if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); // if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } @@ -325,7 +322,7 @@ function LoadProducts(position, issubcat) { }); idata=0; //product data counter - $.getJSON('/takepos/ajax/ajax.php?action=getProducts&category='+currentcat, function(data) { + $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&category='+currentcat, function(data) { console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs"); console.log(data); while (ishow < maxproduct) { @@ -415,7 +412,7 @@ function MoreProducts(moreorless) { if (pageproducts==0) return; //Return if no less pages pageproducts=pageproducts-1; } - $.getJSON('/takepos/ajax/ajax.php?action=getProducts&category='+currentcat, function(data) { + $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&category='+currentcat, function(data) { console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat); if (typeof (data[(maxproduct * pageproducts)]) == "undefined" && moreorless=="more"){ // Return if no more pages @@ -490,7 +487,7 @@ function ClickProduct(position, qty = 1) { function ChangeThirdparty(idcustomer) { console.log("ChangeThirdparty"); // Call page list.php to change customer - $("#poslines").load("../societe/list.php?action=change&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() { + $("#poslines").load("../societe/list.php?action=change&token=&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() { }); ClearSearch(); @@ -540,7 +537,7 @@ function Floors() { function FreeZone() { console.log("Open box to enter a free product"); - $.colorbox({href:"freezone.php?action=freezone&place="+place, width:"80%", height:"200px", transition:"none", iframe:"true", title:"trans("FreeZone"); ?>"}); + $.colorbox({href:"freezone.php?action=freezone&token=&place="+place, width:"80%", height:"200px", transition:"none", iframe:"true", title:"trans("FreeZone"); ?>"}); } function TakeposOrderNotes() { @@ -562,7 +559,7 @@ function New() { console.log("New with place = , js place="+place+", invoiceid="+invoiceid); - $.getJSON('/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) { + $.getJSON('/takepos/ajax/ajax.php?action=getInvoice&token=&id='+invoiceid, function(data) { var r; if (parseInt(data['paye']) === 1) { @@ -628,7 +625,7 @@ function Search2(keyCodeForEnter, moreorless) { pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; - $.getJSON('/takepos/ajax/ajax.php?action=search&term=' + search_term + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { + $.getJSON('/takepos/ajax/ajax.php?action=search&token=&term=' + search_term + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { for (i = 0; i < ; i++) { if (typeof (data[i]) == "undefined") { $("#prowatermark" + i).html(""); @@ -746,7 +743,7 @@ function Edit(number) { return; } else if (number=='qty') { if (editaction=='qty' && editnumber != '') { - $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { + $("#poslines").load("invoice.php?action=updateqty&token=&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#qty").html("trans("Qty"); ?>").removeClass('clicked'); @@ -760,7 +757,7 @@ function Edit(number) { } } else if (number=='p') { if (editaction=='p' && editnumber!="") { - $("#poslines").load("invoice.php?action=updateprice&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { + $("#poslines").load("invoice.php?action=updateprice&token=&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#price").html("trans("Price"); ?>").removeClass('clicked'); @@ -774,7 +771,7 @@ function Edit(number) { } } else if (number=='r') { if (editaction=='r' && editnumber!="") { - $("#poslines").load("invoice.php?action=updatereduction&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { + $("#poslines").load("invoice.php?action=updatereduction&token=&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#reduction").html("trans("ReductionShort"); ?>").removeClass('clicked'); @@ -814,14 +811,14 @@ function Edit(number) { function TakeposPrintingOrder(){ console.log("TakeposPrintingOrder"); - $("#poslines").load("invoice.php?action=order&place="+place, function() { + $("#poslines").load("invoice.php?action=order&token=&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } function TakeposPrintingTemp(){ console.log("TakeposPrintingTemp"); - $("#poslines").load("invoice.php?action=temp&place="+place, function() { + $("#poslines").load("invoice.php?action=temp&token=&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } @@ -843,11 +840,11 @@ function OpenDrawer(){ } function DolibarrOpenDrawer() { - console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&term="); + console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=&term="); $.ajax({ type: "GET", data: { token: '' }, - url: "", + url: "", }); } @@ -892,7 +889,7 @@ function ModalBox(ModalID) function DirectPayment(){ console.log("DirectPayment"); - $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=LIQ", function() { + $("#poslines").load("invoice.php?place="+place+"&action=valid&token=&pay=LIQ", function() { }); } @@ -908,7 +905,7 @@ function WeighingScale(){ url: '/scale/index.php', }) .done(function( editnumber ) { - $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { + $("#poslines").load("invoice.php?&token=&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; }); }); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6ec6f11ffc7..523a6ad2986 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1083,7 +1083,7 @@ function SendTicket(id) function PrintBox(id, action) { console.log("Open box before printing"); - $.colorbox({href:"printbox.php?facid="+id+"&action="+action, width:"80%", height:"200px", transition:"none", iframe:"true", title:"trans("PrintWithoutDetails"); ?>"}); + $.colorbox({href:"printbox.php?facid="+id+"&action="+action+"&token=", width:"80%", height:"200px", transition:"none", iframe:"true", title:"trans("PrintWithoutDetails"); ?>"}); } function Print(id, gift){ @@ -1106,7 +1106,7 @@ function TakeposPrinting(id){ function TakeposConnector(id){ console.log("TakeposConnector" + id); - $.get("/takepos/ajax/ajax.php?action=printinvoiceticket&term=&id="+id+"&token=", function(data, status) { + $.get("/takepos/ajax/ajax.php?action=printinvoiceticket&token=&term=&id="+id+"&token=", function(data, status) { $.ajax({ type: "POST", url: '/printer/index.php', @@ -1120,7 +1120,7 @@ function DolibarrTakeposPrinting(id) { $.ajax({ type: "GET", data: { token: '' }, - url: "" + id, + url: "" + id, }); } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index e9188aabfdc..1222ccd1786 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -110,9 +110,13 @@ function unexpectedDisconnect() { } function fetchConnectionToken() { global->STRIPE_LOCATION)) $urlconnexiontoken .= '&location='.$conf->global->STRIPE_LOCATION; - if (!empty($stripeacc)) $urlconnexiontoken .= '&stripeacc='.$stripeacc; + $urlconnexiontoken = DOL_URL_ROOT.'/stripe/ajax/ajax.php?action=getConnexionToken&token='.newToken().'&servicestatus='.urlencode($servicestatus); + if (!empty($conf->global->STRIPE_LOCATION)) { + $urlconnexiontoken .= '&location='.urlencode($conf->global->STRIPE_LOCATION); + } + if (!empty($stripeacc)) { + $urlconnexiontoken .= '&stripeacc='.urlencode($stripeacc); + } ?> // Do not cache or hardcode the ConnectionToken. The SDK manages the ConnectionToken's lifecycle. return fetch('', { method: "POST" }) @@ -318,7 +322,7 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { amountpayed = total_ttc; ?>; } console.log("We click on the payment mode to pay amount = "+amountpayed); - parent.$("#poslines").load("invoice.php?place=&action=valid&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() { + parent.$("#poslines").load("invoice.php?place=&action=valid&token=&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() { if (amountpayed > || amountpayed == || amountpayed==0 ) { console.log("Close popup"); parent.$.colorbox.close(); @@ -355,8 +359,10 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { function capturePaymentIntent(paymentIntentId) { const bodyContent = JSON.stringify({"id": paymentIntentId}) return fetch('', { method: "POST", @@ -416,7 +422,7 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { } else { document.getElementById("card-present-alert").innerHTML = '
trans('PaymentValidated'); ?>
'; console.log("Capture paymentIntent successfull "+paymentIntentId); - parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() { + parent.$("#poslines").load("invoice.php?place=&action=valid&token=&pay=CB&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() { if (amountpayed > || amountpayed == || amountpayed==0 ) { console.log("Close popup"); parent.$.colorbox.close(); @@ -455,7 +461,7 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { url: '/takepos/smpcb.php?status' }).done(function (data) { console.log(data); if (data === "SUCCESS") { - parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () { + parent.$("#poslines").load("invoice.php?place=&action=valid&token=&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () { //parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight); parent.$.colorbox.close(); //parent.setFocusOnSearchField(); // This does not have effect diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 4d89ce23f66..f1e633d994d 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -225,7 +225,7 @@ function AddProduct(placeid, productid){ // If is a public terminal first show product information if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { print 'place=placeid; - $("#phonediv1").load("auto_order.php?action=productinfo&place="+place+"&idproduct="+productid, function() { + $("#phonediv1").load("auto_order.php?action=productinfo&token='.newToken().'&place="+place+"&idproduct="+productid, function() { });'; } else { print 'AddProductConfirm(placeid, productid);'; @@ -234,7 +234,7 @@ function AddProduct(placeid, productid){ } function PublicPreOrder(){ - $("#phonediv1").load("auto_order.php?action=publicpreorder&place="+place, function() { + $("#phonediv1").load("auto_order.php?action=publicpreorder&token=&place="+place, function() { }); } @@ -260,7 +260,7 @@ function SetQty(place, selectedline, qty){ }); } else{ - $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() { + $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&token=&place="+place+"&idline="+selectedline+"&number="+qty, function() { }); } &place="+place+"&idline="+selectedline+"&number="+qty, function() { }); } trans('Note'); ?>", ""); - $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() { + $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&token=&place="+place+"&idline="+selectedline+"&number="+qty, function() { }); LoadCats(); } @@ -321,12 +321,12 @@ function TakeposPrintingOrder(){ console.log("TakeposPrintingOrder"); @@ -338,12 +338,12 @@ function Exit(){ function CheckPlease(payment){ if (payment==undefined){ - $("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() { + $("#phonediv1").load("auto_order.php?action=checkplease&token=&place="+place, function() { }); } else{ console.log("Request the check to the waiter"); - $("#phonediv1").load("auto_order.php?action=checkplease&place=&payment="+payment, function() { + $("#phonediv1").load("auto_order.php?action=checkplease&token=&place=&payment="+payment, function() { }); } } diff --git a/htdocs/takepos/printbox.php b/htdocs/takepos/printbox.php index dfceab9bbc4..53c07bcf1d7 100644 --- a/htdocs/takepos/printbox.php +++ b/htdocs/takepos/printbox.php @@ -75,7 +75,7 @@ top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss); function Save() { console.log("We click so we call page receipt.php with facid="); parent.$.colorbox.close(); - $.colorbox({href:"receipt.php?facid=&action=&label="+$('#label').val()+"&qty="+$('#qty').val(), width:"40%", height:"90%", transition:"none", iframe:"true", title:'trans("PrintTicket")); ?>'}); + $.colorbox({ href:"receipt.php?facid=&action=&token=&label="+$('#label').val()+"&qty="+$('#qty').val(), width:"40%", height:"90%", transition:"none", iframe:"true", title:'trans("PrintTicket")); ?>'}); } jQuery(document).ready(function(){ diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 67829003954..5d80acb0f81 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -185,13 +185,13 @@ if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->glob if (reductionType === 'percent') { var invoiceid = 0 ? $invoiceid : 0); ?>; - parent.$("#poslines").load("invoice.php?action=update_reduction_global&place=&number="+reductionNumber+"&invoiceid="+invoiceid, function() { + parent.$("#poslines").load("invoice.php?action=update_reduction_global&token=&place=&number="+reductionNumber+"&invoiceid="+invoiceid, function() { Reset(); parent.$.colorbox.close(); }); } else if (reductionType === 'amount') { var desc = "transnoentities('Reduction')); ?>"; - parent.$("#poslines").load("invoice.php?action=freezone&place=&number=-"+reductionNumber+"&desc="+desc, function() { + parent.$("#poslines").load("invoice.php?action=freezone&token=&place=&number=-"+reductionNumber+"&desc="+desc, function() { Reset(); parent.$.colorbox.close(); }); diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 31929a9c732..21252da1d26 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -107,7 +107,7 @@ function SendMail() { $.ajax({ type: "GET", data: { token: '' }, - url: "" + $("#email"). val(), + url: "" + $("#email"). val(), }); parent.$.colorbox.close(); } diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php index b39f9d1d215..0391e911ba5 100644 --- a/htdocs/takepos/split.php +++ b/htdocs/takepos/split.php @@ -164,7 +164,7 @@ $arrayOfValidBankAccount = array(); '; $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 '
'.$langs->trans("Scopes").''; - print ''; - print '
'.$langs->trans("Scopes").''; - //print ''; - print $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope']; - print '
'.$langs->trans("Scopes").''; + foreach ($scopestodispay as $scope => $val) { + print ''; + print ''; + } + 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 273/476] 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 274/476] 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 275/476] 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 282/476] 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 283/476] 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 284/476] 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 276/476] 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 277/476] 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 278/476] 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 279/476] 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 280/476] 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 281/476] 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 285/476] 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").''; foreach ($scopestodispay as $scope => $val) { - print ''; - print ''; + 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 287/476] 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 288/476] 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 289/476] 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 290/476] 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 291/476] 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 292/476] 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 293/476] 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 294/476] 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 8c7cb5b70bfccf98ed37db695eb2c6cd6b52800c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:15:15 +0200 Subject: [PATCH 295/476] 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 296/476] 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 297/476] 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 83c82085c294d6cdb0bbf25b8c1cbb122afcb67b Mon Sep 17 00:00:00 2001 From: melina Date: Tue, 20 Sep 2022 14:29:28 +0200 Subject: [PATCH 298/476] 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 299/476] 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 300/476] 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 301/476] 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 48f0a956822b73b50d6b4adabafda6f114e290ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 15:51:00 +0200 Subject: [PATCH 302/476] 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 303/476] 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 304/476] 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 305/476] 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 306/476] 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 307/476] 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 308/476] 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 309/476] 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 310/476] 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 311/476] 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 312/476] 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 313/476] 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 314/476] 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 315/476] 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 316/476] 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 317/476] 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 318/476] 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 319/476] 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 320/476] 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 321/476] 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 322/476] 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 323/476] 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 324/476] 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 325/476] 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 326/476] 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 327/476] 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 328/476] 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 329/476] 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 330/476] 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 331/476] 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 332/476] 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 333/476] 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 334/476] 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 335/476] 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 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 336/476] 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 337/476] 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 338/476] 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 339/476] 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 340/476] 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 341/476] 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 342/476] 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 343/476] 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 344/476] 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 345/476] 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 346/476] 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 347/476] 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 348/476] 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 349/476] 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 350/476] 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 351/476] 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 352/476] 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 353/476] 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 354/476] 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 355/476] 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 356/476] 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 357/476] 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 358/476] 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 359/476] 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 360/476] 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 361/476] 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 362/476] 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 363/476] 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 364/476] 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 365/476] 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 366/476] 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 367/476] 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 92aac0dca30b172a4fd4ceefac000941d676e31f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 23:52:17 +0200 Subject: [PATCH 368/476] 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 369/476] 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 370/476] 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 371/476] 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 372/476] 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 373/476] 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 374/476] 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 375/476] 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 376/476] 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 377/476] 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 378/476] 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 387/476] 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 388/476] 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 396/476] 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 397/476] 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 379/476] 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 380/476] 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 381/476] 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 382/476] 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 383/476] 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 384/476] 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 385/476] 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 386/476] 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 389/476] 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 390/476] 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 391/476] 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 392/476] 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 393/476] 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 394/476] 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 395/476] 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 402/476] 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 5534e95062c996aa6b79686911a9a8b0956f66ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Sep 2022 17:12:26 +0200 Subject: [PATCH 403/476] 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 404/476] 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 405/476] 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 406/476] 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 407/476] 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 408/476] 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 409/476] 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 410/476] 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 411/476] 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 636b3e4eb1fbb5366a329578e648f7a58cc434ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Sep 2022 11:54:38 +0200 Subject: [PATCH 412/476] 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 9d01e07db9691d3d443851a3a7c9b5e79be4fd5a Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 24 Sep 2022 12:43:24 +0200 Subject: [PATCH 413/476] 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 414/476] 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 87cfff36900003090d61abf574f77eb59ecf5846 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sat, 24 Sep 2022 13:02:15 +0200 Subject: [PATCH 415/476] 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 416/476] 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 417/476] 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 418/476] 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 419/476] 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 420/476] 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 421/476] 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 422/476] 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 423/476] 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 424/476] 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 425/476] 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 426/476] 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 427/476] 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 428/476] 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 '
'.$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 429/476] 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 430/476] 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 431/476] 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 432/476] 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 434/476] 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 435/476] 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 436/476] 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 438/476] 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 439/476] 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 58ac8d196c2ed8a674c330004cb045af86e9be8d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:01:40 +0200 Subject: [PATCH 440/476] Use isModEnabled --- htdocs/comm/card.php | 2 +- htdocs/comm/propal/card.php | 6 ++--- htdocs/comm/propal/list.php | 2 +- htdocs/commande/card.php | 30 ++++++++++++------------ htdocs/commande/class/commande.class.php | 6 ++--- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 1eca4555e91..961cb7309fe 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -545,7 +545,7 @@ if ($object->id > 0) { } // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { + if (isModEnabled('stock') && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { $langs->load('stocks'); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 5a92ff25695..3f21f89192b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1696,7 +1696,7 @@ if ($action == 'create') { if ($soc->fk_warehouse > 0) { $warehouse_id = $soc->fk_warehouse; } - if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { $warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; } @@ -1836,7 +1836,7 @@ if ($action == 'create') { } // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); print ''; print ''; print ''; print ''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } /*TODO Add link to expeditiondet_batch @@ -385,7 +385,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; // Warehouse - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print '\n"; print '';*/ - if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) { + if (!$conf->expedition_bon->enabled && isModEnabled('stock')) { // Entrepot $entrepot = new Entrepot($db); $entrepot->fetch($object->entrepot_id); From eb55b307c01602d31982c42c7fa9247fed03e2b3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:04:27 +0200 Subject: [PATCH 444/476] Use isModEnabled --- htdocs/expedition/card.php | 30 +++++++++---------- htdocs/expedition/class/expedition.class.php | 8 ++--- htdocs/expedition/shipment.php | 16 +++++----- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- .../class/fournisseur.commande.class.php | 4 +-- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d83b5bd75f5..6b819f58e83 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -391,7 +391,7 @@ if (empty($reshook)) { } } elseif (!$error) { $labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip"); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse"); } setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors'); @@ -739,7 +739,7 @@ if (empty($reshook)) { unset($_POST[$qty]); } } - } elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. + } elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. $qty = "qtyl".$line_id; $line->id = $line_id; $line->qty = GETPOST($qty, 'int'); @@ -865,7 +865,7 @@ if ($action == 'create') { $author = new User($db); $author->fetch($object->user_author_id); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $entrepot = new Entrepot($db); } @@ -1077,7 +1077,7 @@ if ($action == 'create') { } print ''.img_picto($langs->trans("Reset"), 'eraser').''; print ''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { if (empty($conf->productbatch->enabled)) { print ''; } else { @@ -1212,7 +1212,7 @@ if ($action == 'create') { } $warehouseObject = null; - if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + if (count($warehousePicking) == 1 || !($line->fk_product > 0) || !isModEnabled('stock')) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection print ''; //ship from preselected location $stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number @@ -1240,7 +1240,7 @@ if ($action == 'create') { print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } @@ -2255,7 +2255,7 @@ if ($action == 'create') { print $shipment_static->getNomUrl(1); print ' - '.$shipmentline_var['qty_shipped']; $htmltext = $langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour')); - if (!empty($conf->stock->enabled) && $shipmentline_var['warehouse'] > 0) { + if (isModEnabled('stock') && $shipmentline_var['warehouse'] > 0) { $warehousestatic->fetch($shipmentline_var['warehouse']); $htmltext .= '
'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); } @@ -2292,7 +2292,7 @@ if ($action == 'create') { // Batch number managment print ''; print ''; - } elseif (!empty($conf->stock->enabled)) { + } elseif (isModEnabled('stock')) { if ($lines[$i]->fk_product > 0) { if ($lines[$i]->entrepot_id > 0) { print ''; @@ -2331,7 +2331,7 @@ if ($action == 'create') { print ''; print ''; } - } elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. + } elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. print ''; print ''; // Qty to ship or shipped @@ -2349,7 +2349,7 @@ if ($action == 'create') { print ''; // Warehouse source - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); print ''; print ''; print ''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } else { print ''; @@ -794,7 +794,7 @@ if ($id > 0 || !empty($ref)) { $product->load_stock('warehouseopen'); } - if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && !empty($conf->stock->enabled)) { + if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && isModEnabled('stock')) { print ''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { //print ''; diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 632a8fcb6cb..29cf421059e 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -93,7 +93,7 @@ if ($idprod > 0) { } // After best supplier prices and before costprice - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { // Add price for pmp $price = $producttmp->pmp; if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6a8e8e360b3..f5be521dd3b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1097,7 +1097,7 @@ class CommandeFournisseur extends CommonOrder } // If stock is incremented on validate order, we must increment it - if (!$error && $movetoapprovestatus && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { + if (!$error && $movetoapprovestatus && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -2085,7 +2085,7 @@ class CommandeFournisseur extends CommonOrder } // If module stock is enabled and the stock increase is done on purchase order dispatching - if (!$error && $entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + if (!$error && $entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { $mouv = new MouvementStock($this->db); if ($product > 0) { // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) From 01dfbac1a1508ff6b736161f0c5aa2859a9f2f34 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:04:56 +0200 Subject: [PATCH 445/476] Use isModEnabled --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- htdocs/fourn/commande/card.php | 6 +++--- htdocs/fourn/commande/dispatch.php | 6 +++--- htdocs/fourn/facture/card.php | 8 ++++---- htdocs/product/canvas/product/tpl/card_create.tpl.php | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 3015be37169..3f7013fec34 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -762,7 +762,7 @@ class FactureFournisseur extends CommonInvoice // else we get the best supplier price if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { $buyprice = $producttmp->cost_price; - } elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { + } elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { $buyprice = $producttmp->pmp; } else { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { @@ -1812,7 +1812,7 @@ class FactureFournisseur extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { // Si on incrémente le produit principal et ses composants à la validation de facture fournisseur - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -1943,7 +1943,7 @@ class FactureFournisseur extends CommonInvoice } // Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente - if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fc18302eab0..d0a27b306ff 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -990,7 +990,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER if (!$idwarehouse || $idwarehouse == -1) { $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); @@ -1947,7 +1947,7 @@ if ($action == 'create') { } $formquestion = array(); - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -2561,7 +2561,7 @@ if ($action == 'create') { // Ship $hasreception = 0; - if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) { + if (isModEnabled('stock') && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) { $labelofbutton = $langs->trans('ReceiveProducts'); if ($conf->reception->enabled) { $labelofbutton = $langs->trans("CreateReception"); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 69e8a3c497b..79013dbb051 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -96,7 +96,7 @@ if (empty($conf->reception->enabled)) { // $id is id of a purchase order. $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); -if (empty($conf->stock->enabled)) { +if (!isModEnabled('stock')) { accessforbidden(); } @@ -408,7 +408,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontoreceive $error++; } else { // If module stock is enabled and the stock increase is done on purchase order dispatching - if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) && empty($supplierorderdispatch->fk_reception)) { + if ($entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) && empty($supplierorderdispatch->fk_reception)) { $mouv = new MouvementStock($db); if ($product > 0) { $mouv->origin = &$object; @@ -455,7 +455,7 @@ if ($action == 'updateline' && $permissiontoreceive) { $errors = $supplierorderdispatch->errors; } else { // If module stock is enabled and the stock increase is done on purchase order dispatching - if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + if ($entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { $mouv = new MouvementStock($db); if ($product > 0) { $mouv->origin = &$object; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c2bef9b2904..b15e5ae0adc 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -212,7 +212,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { $langs->load("stocks"); if (!$idwarehouse || $idwarehouse == -1) { $error++; @@ -1743,7 +1743,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { $langs->load("stocks"); if (!$idwarehouse || $idwarehouse == -1) { $error++; @@ -2720,7 +2720,7 @@ if ($action == 'create') { $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -2752,7 +2752,7 @@ if ($action == 'create') { } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 8813e4a8d7e..ca7f6000a82 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -43,7 +43,7 @@ print dol_get_fiche_head(''); -stock->enabled)) { ?> + @@ -72,7 +72,7 @@ print dol_get_fiche_head(''); -stock->enabled)) { ?> + From 3eba9559920cd63f616c5eff829a125cd52832c4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:05:35 +0200 Subject: [PATCH 446/476] Use isModEnabled --- htdocs/product/canvas/product/tpl/card_edit.tpl.php | 4 ++-- htdocs/product/card.php | 8 ++++---- htdocs/product/composition/card.php | 10 +++++----- htdocs/product/list.php | 10 +++++----- htdocs/projet/element.php | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index b21355c1c21..be4d4099d9b 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -42,7 +42,7 @@ dol_htmloutput_errors($object->error, $object->errors); -stock->enabled)) { ?> + @@ -69,7 +69,7 @@ dol_htmloutput_errors($object->error, $object->errors); -stock->enabled)) { ?> + diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5d1613b05f2..c856ef97a35 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -77,7 +77,7 @@ if (!empty($conf->bom->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'other')); -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { $langs->load("stocks"); } if (isModEnabled('facture')) { @@ -1457,7 +1457,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if ($type != 1 && !empty($conf->stock->enabled)) { + if ($type != 1 && isModEnabled('stock')) { // Default warehouse print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } // Qty in kit @@ -444,7 +444,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; // Real stock } @@ -493,7 +493,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; // Real stock } @@ -549,7 +549,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } @@ -566,7 +566,7 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; } else { $colspan = 10; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $colspan++; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7b6014c6bc1..0a17c8e936f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -234,10 +234,10 @@ $arrayfields = array( 'p.numbuyprice'=>array('label'=>"BuyingPriceNumShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>43), 'p.pmp'=>array('label'=>"PMPValueShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>44), 'p.cost_price'=>array('label'=>"CostPrice", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>45), - 'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50), - 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51), - 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52), - 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53), + 'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50), + 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51), + 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52), + 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53), 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60), 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100), 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101), @@ -1360,7 +1360,7 @@ if ($resql) { } // STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock. - if ((!empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock + if ((isModEnabled('stock') && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock if ($obj->fk_product_type != 1 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Not a service $option = 'nobatch'; if (empty($arrayfields['stock_virtual']['checked'])) { diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 8c7f2e0df51..bc29d2dca1e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; } if (isModEnabled("propal")) { @@ -84,7 +84,7 @@ if (!empty($conf->loan->enabled)) { require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; } -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; } if (isModEnabled('tax')) { @@ -716,7 +716,7 @@ if (!$showdatefilter) { $langs->loadLangs(array("suppliers", "bills", "orders", "proposals", "margins")); -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { $langs->load('stocks'); } From 2a8b32ff981482bc0573337f960a06332b2c9b8d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:06:06 +0200 Subject: [PATCH 447/476] Use isModEnabled --- htdocs/reception/card.php | 20 ++++++++++---------- htdocs/reception/class/reception.class.php | 10 +++++----- htdocs/reception/list.php | 2 +- htdocs/societe/card.php | 2 +- htdocs/user/card.php | 12 ++++++------ htdocs/user/list.php | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index da88e28fc6b..20a03e2d548 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -752,7 +752,7 @@ if ($action == 'create') { $author = new User($db); $author->fetch($objectsrc->user_author_id); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $entrepot = new Entrepot($db); } @@ -1039,7 +1039,7 @@ if ($action == 'create') { print ' / '.$langs->trans("Reset").')'; } print ''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } if (isModEnabled('productbatch')) { @@ -1173,7 +1173,7 @@ if ($action == 'create') { $warehouseObject = null; - if (!empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + if (isModEnabled('stock')) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection print ''; $stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number @@ -1200,7 +1200,7 @@ if ($action == 'create') { } // Stock - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print ''; } @@ -1889,7 +1889,7 @@ if ($action == 'create') { print ' - '.$receptionline_var['qty']; $htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour')); - if (!empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) { + if (isModEnabled('stock') && $receptionline_var['warehouse'] > 0) { $warehousestatic->fetch($receptionline_var['warehouse']); $htmltext .= '
'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); } @@ -1904,7 +1904,7 @@ if ($action == 'create') { if ($action == 'editline' && $lines[$i]->id == $line_id) { // edit mode 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 433/476] 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 437/476] 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 '
'.$langs->trans('Warehouse').''; @@ -2520,7 +2520,7 @@ if ($action == 'create') { } // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { $langs->load('stocks'); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 576c4ed31fa..63399aa7a34 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1095,7 +1095,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx')); $moreforfilter .= ''; } - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); $moreforfilter .= '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index ead1d09b44b..c48b4f780fc 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -58,7 +58,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } @@ -66,10 +66,10 @@ if (!empty($conf->variants->enabled)) { // Load translation files required by the page $langs->loadLangs(array('orders', 'sendings', 'companies', 'bills', 'propal', 'deliveries', 'products', 'other')); -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load('incoterm'); } -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $langs->load('margins'); } if (isModEnabled('productbatch')) { @@ -603,7 +603,7 @@ if (empty($reshook)) { $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - } elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) { + } elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) { // Set incoterm $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); if ($result < 0) { @@ -724,7 +724,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); @@ -1242,7 +1242,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (!$idwarehouse || $idwarehouse == -1) { $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); @@ -1262,7 +1262,7 @@ if (empty($reshook)) { if ( GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) - && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer) + && isModEnabled('facture') && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1336,7 +1336,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (!$idwarehouse || $idwarehouse == -1) { $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); @@ -1384,7 +1384,7 @@ if (empty($reshook)) { } // Check parameters - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (!$idwarehouse || $idwarehouse == -1) { $error++; setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); @@ -1705,7 +1705,7 @@ if ($action == 'create' && $usercancreate) { if ($soc->fk_warehouse > 0) { $warehouse_id = $soc->fk_warehouse; } - if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { $warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; } @@ -1838,7 +1838,7 @@ if ($action == 'create' && $usercancreate) { } // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); print '
'.$langs->trans('Warehouse').''; @@ -2077,7 +2077,7 @@ if ($action == 'create' && $usercancreate) { } $formquestion = array(); - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -2231,7 +2231,7 @@ if ($action == 'create' && $usercancreate) { $text = $langs->trans('ConfirmUnvalidateOrder', $object->ref); $formquestion = array(); - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -2270,7 +2270,7 @@ if ($action == 'create' && $usercancreate) { $text = $langs->trans('ConfirmCancelOrder', $object->ref); $formquestion = array(); - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -2483,7 +2483,7 @@ if ($action == 'create' && $usercancreate) { } // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { $langs->load('stocks'); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6d0693d6346..aa7a7f11a55 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -514,7 +514,7 @@ class Commande extends CommonOrder if (!$error) { // If stock is incremented on validate order, we must increment it - if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { + if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -642,7 +642,7 @@ class Commande extends CommonOrder } // If stock is decremented on validate order, we must reincrement it - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { $result = 0; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; @@ -827,7 +827,7 @@ class Commande extends CommonOrder dol_syslog(get_class($this)."::cancel", LOG_DEBUG); if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); From 5fc79979bcf0461a912ad0a483ad9a38acb39e49 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:02:13 +0200 Subject: [PATCH 441/476] Use isModEnabled --- htdocs/commande/list.php | 6 +++--- htdocs/compta/facture/class/facture.class.php | 8 ++++---- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/boxes/box_produits_alerte_stock.php | 2 +- htdocs/core/class/html.form.class.php | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 89831fbd929..5cde78cd09f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1305,7 +1305,7 @@ if ($resql) { print $langs->trans('ValidateInvoices'); print ''; - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; } else { @@ -1371,7 +1371,7 @@ if ($resql) { $moreforfilter .= ''; } // If Stock is enabled - if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); $moreforfilter .= '
'; @@ -2385,7 +2385,7 @@ if ($resql) { // Show shippable Icon (this creates subloops, so may be slow) if (!empty($arrayfields['shippable']['checked'])) { print '
'; - if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) { + if (!empty($show_shippable_command) && isModEnabled('stock')) { if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) { $generic_commande->getLinesArray(); // Load array ->lines $generic_commande->loadExpeditions(); // Load array ->expeditions diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a286e93b9d0..67d5568e438 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1012,7 +1012,7 @@ class Facture extends CommonInvoice // else we get the best supplier price if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { $buyprice = $producttmp->cost_price; - } elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { + } elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { $buyprice = $producttmp->pmp; } else { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { @@ -2655,7 +2655,7 @@ class Facture extends CommonInvoice } // If we decrease stock on invoice validation, we increase back if a warehouse id was provided - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) { + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -3162,7 +3162,7 @@ class Facture extends CommonInvoice $result = $this->thirdparty->set_as_client(); // If active we decrement the main product and its components at invoice validation - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) { + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -3475,7 +3475,7 @@ class Facture extends CommonInvoice } // If we decrease stock on invoice validation, we increase back - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6ab6b6943a7..95997812e4a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -912,12 +912,12 @@ if ($action == 'remove_file') { if (!$error && $massaction == 'validate' && $permissiontoadd) { $objecttmp = new $objectclass($db); - if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); $error++; } - if ($objecttmp->element == 'invoice_supplier' && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + if ($objecttmp->element == 'invoice_supplier' && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); $error++; diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 4be56eee072..f928ebd7c6f 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); - $tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock'); + $tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 14236b5e332..025bfcc8b34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2944,7 +2944,7 @@ class Form if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; } - if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { + if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (!empty($user->rights->stock->lire)) { if ($objp->stock > 0) { $opt .= ' class="product_line_stock_ok"'; @@ -3101,7 +3101,7 @@ class Form $outdefault_vat_code = $objp->default_vat_code; } - if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { + if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (!empty($user->rights->stock->lire)) { $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); @@ -3486,7 +3486,7 @@ class Form } } - if (!empty($conf->stock->enabled) && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { + if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { $novirtualstock = ($showstockinlist == 2); if (!empty($user->rights->stock->lire)) { From d7d51996891025fb7ab02cc270191b232f04dec7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:02:37 +0200 Subject: [PATCH 442/476] Use isModEnabled --- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/fourn.lib.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/project.lib.php | 6 +++--- htdocs/core/lib/sendings.lib.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 92a0255d76d..0ad7f6d6eb6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2948,7 +2948,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file; } } elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) { diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 6b66c8d68e7..c65013722d4 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -157,7 +157,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) $h++; } - if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) { + if (isModEnabled('stock') && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) { $langs->load("stocks"); $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id; $head[$h][1] = $langs->trans("OrderDispatch"); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 0d2edb4805e..cb79e006ba7 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -115,7 +115,7 @@ function product_prepare_head($object) } if ($object->isProduct() || ($object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { // If physical product we can stock (or service with option) - if (!empty($conf->stock->enabled) && $user->rights->stock->lire) { + if (isModEnabled('stock') && $user->rights->stock->lire) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; $head[$h][1] = $langs->trans("Stock"); $head[$h][2] = 'stock'; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 22668a16be4..a9a1869fb30 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -127,7 +127,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('contrat') - || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { + || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -135,7 +135,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!is_null($dataretrieved)) { $nbElements = $dataretrieved; } else { - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project'); } if (isModEnabled("propal")) { @@ -189,7 +189,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('project')) { $nbElements += $project->getElementCount('project_task', 'projet_task'); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $nbElements += $project->getElementCount('stock_mouvement', 'stock'); } if (!empty($conf->salaries->enabled)) { diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 8e3c4f7112c..ffc455ab5f1 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -276,7 +276,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''.$langs->trans("DateCreation").''.$langs->trans("DateDeliveryPlanned").''.$langs->trans("QtyPreparedOrShipped").''.$langs->trans("Warehouse").''.$objp->qty_shipped.''; if ($objp->warehouse_id > 0) { $warehousestatic->fetch($objp->warehouse_id); From 419a307b2b9262d151fa1549f8bdec0cbdbe84f2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:03:47 +0200 Subject: [PATCH 443/476] Use isModEnabled --- htdocs/core/modules/modCategorie.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 20 ++++++++++---------- htdocs/core/modules/modService.class.php | 18 +++++++++--------- htdocs/core/tpl/objectline_create.tpl.php | 18 +++++++++--------- htdocs/delivery/card.php | 6 +++--- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 96f84ecc198..c000ebdf783 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -154,7 +154,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->bank->enabled)) { $typeexample .= ($typeexample ? " / " : "")."8=Bank line"; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $typeexample .= ($typeexample ? " / " : "")."9=Warehouse"; } if (isModEnabled('agenda')) { diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 2023a5e2695..8d6a5fe0508 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -214,7 +214,7 @@ class modProduct extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); } if (isModEnabled('barcode')) { @@ -252,7 +252,7 @@ class modProduct extends DolibarrModules 'p.tva_tx'=>'Numeric', 'p.datec'=>'Date', 'p.tms'=>'Date' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); } if (isModEnabled('barcode')) { @@ -271,7 +271,7 @@ class modProduct extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category')); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); } if (isModEnabled('barcode')) { @@ -286,7 +286,7 @@ class modProduct extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_dependencies_array[$r] = array('category'=>'p.rowid'); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); } if (isModEnabled('barcode')) { @@ -316,7 +316,7 @@ class modProduct extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON e.rowid = p.fk_default_warehouse'; } $this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')'; @@ -409,7 +409,7 @@ class modProduct extends DolibarrModules 'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell", 'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); } if (isModEnabled('barcode')) { @@ -425,7 +425,7 @@ class modProduct extends DolibarrModules 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.datec'=>'Date', 'p.tms'=>'Date' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); } if (isModEnabled('barcode')) { @@ -441,7 +441,7 @@ class modProduct extends DolibarrModules 'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct", 'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct" ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct')); } if (isModEnabled('barcode')) { @@ -601,7 +601,7 @@ class modProduct extends DolibarrModules 'p.recuperableonly' => '^[0|1]$', ); - if (!empty($conf->stock->enabled)) {//if Stock module enabled + if (isModEnabled('stock')) {//if Stock module enabled $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( 'p.fk_default_warehouse'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', @@ -710,7 +710,7 @@ class modProduct extends DolibarrModules 'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"' ); //clauses copied from import_fields_array - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $import_sample = array_merge($import_sample, array( 'p.tobatch'=>"0 (don't use) / 1 (use batch) / 2 (use serial number)", 'p.seuil_stock_alerte' => '', diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index a6bfdd47433..7c8a88a5c7e 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -179,7 +179,7 @@ class modService extends DolibarrModules if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); } if (isModEnabled('barcode')) { @@ -215,7 +215,7 @@ class modService extends DolibarrModules 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.datec'=>'Date', 'p.tms'=>'Date' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); } if (isModEnabled('barcode')) { @@ -234,7 +234,7 @@ class modService extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category')); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); } if (isModEnabled('barcode')) { @@ -249,7 +249,7 @@ class modService extends DolibarrModules if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { $this->export_dependencies_array[$r] = array('category'=>'p.rowid'); } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); } if (isModEnabled('barcode')) { @@ -368,7 +368,7 @@ class modService extends DolibarrModules 'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell", 'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); } if (isModEnabled('barcode')) { @@ -384,7 +384,7 @@ class modService extends DolibarrModules 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.datec'=>'Date', 'p.tms'=>'Date' ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); } if (isModEnabled('barcode')) { @@ -400,7 +400,7 @@ class modService extends DolibarrModules 'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct", 'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct" ); - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct')); } if (isModEnabled('barcode')) { @@ -548,7 +548,7 @@ class modService extends DolibarrModules 'p.recuperableonly' => '^[0|1]$', ); - if (!empty($conf->stock->enabled)) {//if Stock module enabled + if (isModEnabled('stock')) {//if Stock module enabled $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( 'p.fk_default_warehouse'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', @@ -656,7 +656,7 @@ class modService extends DolibarrModules 'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"' ); //clauses copied from import_fields_array - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $import_sample = array_merge($import_sample, array( 'p.seuil_stock_alerte' => '', 'p.pmp' => '0', diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index a7eb433a021..70b684a387d 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -41,7 +41,7 @@ if (empty($object) || !is_object($object)) { exit; } $usemargins = 0; -if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) { +if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) { $usemargins = 1; } if (!isset($dateSelector)) { @@ -184,7 +184,7 @@ if ($nolinesbefore) { $freelines = true; $forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service) if ($object->element == 'contrat') { - if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { + if (!isModEnabled('product') && !isModEnabled('service') && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { $forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set } elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { $forceall = 3; @@ -196,7 +196,7 @@ if ($nolinesbefore) { if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) { echo ''.$object->getLibStatut(4)."
'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ? // Show warehouse combo list @@ -1423,7 +1423,7 @@ if ($action == 'create') { print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print $tmpwarehouseObject->getNomUrl(0).' '; @@ -2045,7 +2045,7 @@ if ($action == 'create') { } if ($action == 'editline') { $editColspan = 3; - if (empty($conf->stock->enabled)) { + if (!isModEnabled('stock')) { $editColspan--; } if (empty($conf->productbatch->enabled)) { @@ -2057,7 +2057,7 @@ if ($action == 'create') { } else { print $langs->trans("QtyShipped").' - '; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print $langs->trans("WarehouseSource").' - '; } if (isModEnabled('productbatch')) { @@ -2070,7 +2070,7 @@ if ($action == 'create') { } else { print ''.$langs->trans("QtyShipped").''.$langs->trans("WarehouseSource").''.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'
'.$lines[$i]->qty_shipped.' '.$unit_order.''; if ($lines[$i]->entrepot_id > 0) { $entrepot = new Entrepot($db); @@ -2452,7 +2452,7 @@ if ($action == 'create') { if (isModEnabled('productbatch')) { $colspan++; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $colspan++; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b1f3df3bbaf..4fcb145d62a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -707,7 +707,7 @@ class Expedition extends CommonObject } // If stock increment is done on sending (recommanded choice) - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -913,7 +913,7 @@ class Expedition extends CommonObject $line->rang = $orderline->rang; $line->product_type = $orderline->product_type; - if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) { + if (isModEnabled('stock') && !empty($orderline->fk_product)) { $fk_product = $orderline->fk_product; if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) { @@ -2150,7 +2150,7 @@ class Expedition extends CommonObject $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback // If stock increment is done on closing - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -2327,7 +2327,7 @@ class Expedition extends CommonObject $this->billed = 0; // If stock increment is done on closing - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 33ee4a761bb..7619ef140f8 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -38,7 +38,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; } if (isModEnabled("propal")) { @@ -431,7 +431,7 @@ if ($id > 0 || !empty($ref)) { print '
'; @@ -642,7 +642,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("QtyOrdered").''.$langs->trans("QtyShipped").''.$langs->trans("KeepToShip").''.$langs->trans("RealStock").' '; print $product->stock_reel; if ($product->stock_reel < $toBeShipped[$objp->fk_product]) { @@ -858,7 +858,7 @@ if ($id > 0 || !empty($ref)) { print '
'; // Bouton expedier sans gestion des stocks - if (empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { + if (!isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { if ($user->rights->expedition->creer) { print ''.$langs->trans("CreateShipment").''; if ($toBeShippedTotal <= 0) { @@ -874,11 +874,11 @@ if ($id > 0 || !empty($ref)) { // Bouton expedier avec gestion des stocks - if (!empty($conf->stock->enabled) && $object->statut == Commande::STATUS_DRAFT) { + if (isModEnabled('stock') && $object->statut == Commande::STATUS_DRAFT) { print $langs->trans("ValidateOrderFirstBeforeShipment"); } - if (!empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { + if (isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { if ($user->rights->expedition->creer) { //print load_fiche_titre($langs->trans("CreateShipment")); print '
'; @@ -896,7 +896,7 @@ if ($id > 0 || !empty($ref)) { //print '
'; print $langs->trans("WarehouseSource"); //print 'selectarray('statut_buy', $statutarray, $object->status_buy); ?>
trans("StockLimit"); ?>
selectarray('statut_buy', $statutarray, $object->status_buy); ?>
trans("StockLimit"); ?>
'.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); @@ -2017,7 +2017,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Stock - if ($object->isProduct() && !empty($conf->stock->enabled)) { + if ($object->isProduct() && isModEnabled('stock')) { // Default warehouse print '
'.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); @@ -2515,7 +2515,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Default warehouse - if ($object->isProduct() && !empty($conf->stock->enabled)) { + if ($object->isProduct() && isModEnabled('stock')) { $warehouse = new Entrepot($db); $warehouse->fetch($object->fk_default_warehouse); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index c10b5abe93e..3f3d23b764c 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -369,7 +369,7 @@ if ($id > 0 || !empty($ref)) { // Min customer price print ''.$langs->trans('MinCustomerPrice').''.$langs->trans('Stock').''.$value['stock'].'  
'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ? // Show warehouse combo list @@ -1686,7 +1686,7 @@ if ($action == 'create') { } if ($action == 'editline') { $editColspan = 3; - if (empty($conf->stock->enabled)) { + if (!isModEnabled('stock')) { $editColspan--; } if (empty($conf->productbatch->enabled)) { @@ -1698,7 +1698,7 @@ if ($action == 'create') { } else { print $langs->trans("QtyReceived").' - '; } - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { print $langs->trans("WarehouseSource").' - '; } if (isModEnabled('productbatch')) { @@ -1718,7 +1718,7 @@ if ($action == 'create') { } else { print ''.$langs->trans("QtyReceived").''.$langs->trans("WarehouseSource").''; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { if ($lines[$i]->fk_product > 0) { print ''; print ''; @@ -1944,7 +1944,7 @@ if ($action == 'create') { print ''; // Warehouse source - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { if ($lines[$i]->fk_entrepot > 0) { $entrepot = new Entrepot($db); $entrepot->fetch($lines[$i]->fk_entrepot); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e7825407057..47b4bcdeb0d 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -546,7 +546,7 @@ class Reception extends CommonObject } // If stock increment is done on reception (recommanded choice) - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -824,7 +824,7 @@ class Reception extends CommonObject } $fk_product = 0; - if (!empty($conf->stock->enabled) && !empty($supplierorderline->fk_product)) { + if (isModEnabled('stock') && !empty($supplierorderline->fk_product)) { $fk_product = $supplierorderline->fk_product; if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_RECEPTIONS)) { @@ -1554,7 +1554,7 @@ class Reception extends CommonObject // If stock increment is done on closing - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -1719,7 +1719,7 @@ class Reception extends CommonObject $this->billed = 0; // If stock increment is done on closing - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $numref = $this->ref; $langs->load("agenda"); @@ -1851,7 +1851,7 @@ class Reception extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); if ($this->db->query($sql)) { // If stock increment is done on closing - if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) { + if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 8179da3e42b..155e5185f57 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -716,7 +716,7 @@ if ($massaction == 'createbills') { print $langs->trans('ValidateInvoices'); print ''; print ''; // Warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { + if (isModEnabled('stock') && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { $langs->load('stocks'); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 507240f352f..cf30cc2bb99 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -58,7 +58,7 @@ if (isModEnabled('adherent')) { if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; } @@ -470,7 +470,7 @@ if (empty($reshook)) { $object->dateendvalidity = $dateendvalidity; $object->birth = $dateofbirth; - if (!empty($conf->stock->enabled)) { + if (isModEnabled('stock')) { $object->fk_warehouse = GETPOST('fk_warehouse', 'int'); } @@ -727,7 +727,7 @@ $formother = new FormOther($db); $formcompany = new FormCompany($db); $formadmin = new FormAdmin($db); $formfile = new FormFile($db); -if (!empty($conf->stock->enabled)) { +if (isModEnabled('stock')) { $formproduct = new FormProduct($db); } @@ -1229,7 +1229,7 @@ if ($action == 'create' || $action == 'adduserldap') { // TODO Move this into tab RH (HierarchicalResponsible must be on both tab) // Default warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { + if (isModEnabled('stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { print ''; @@ -1598,7 +1598,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "\n"; // Default warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { + if (isModEnabled('stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; print '
'.$lines[$i]->qty.''; - if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; } else { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b5a49e9e18d..6c5f46d3c6a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2967,7 +2967,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1); print '
'.$langs->trans("DefaultWarehouse").''; if ($object->fk_warehouse > 0) { @@ -2533,7 +2533,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '

'; // Default warehouse - if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { + if (isModEnabled('stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { print ''; print '
'.$langs->trans("DefaultWarehouse").''; print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1); print ' '; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 00dd178f814..04f8e5679fd 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -667,7 +667,7 @@ if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { $moreforfilter .= ''; } // Filter on warehouse -if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { +if (isModEnabled('stock') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); $moreforfilter .= '
'; From 49f1afccca09cf94d6714eec63c0a6e33d8ac838 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:09:29 +0200 Subject: [PATCH 448/476] Use isModEnabled --- htdocs/comm/propal/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3f21f89192b..84db90fd6e0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -55,7 +55,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } @@ -976,7 +976,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 025bfcc8b34..d34b6cce69f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2313,7 +2313,7 @@ class Form } $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); - if (!empty($conf->variants->enabled) && is_array($selected_combinations)) { + if (isModEnabled('variants') && is_array($selected_combinations)) { // Code to automatically insert with javascript the select of attributes under the select of product // when a parent of variant has been selected. $out .= ' diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index cb79e006ba7..59373e39cd3 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -94,7 +94,7 @@ function product_prepare_head($object) $h++; } - if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { + if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) { global $db; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d0a27b306ff..9303c6eaf31 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -58,7 +58,7 @@ if (isModEnabled('project')) { } require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } @@ -485,7 +485,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b15e5ae0adc..4528c0cb0c2 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -55,7 +55,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } if (isModEnabled('accounting')) { @@ -1465,7 +1465,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); From cce6d82741500c87e693c52972c1faf3ba6161fe Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:09:58 +0200 Subject: [PATCH 449/476] Use isModEnabled --- htdocs/product/admin/product.php | 2 +- htdocs/product/card.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- htdocs/product/list.php | 12 ++++++------ htdocs/product/stock/product.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index d530b57b125..7462431d087 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -545,7 +545,7 @@ print '
'.$langs->trans("VariantsAbility").''; //print ajax_constantonoff("PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0); //print $form->selectyesno("PRODUIT_SOUSPRODUITS", $conf->global->PRODUIT_SOUSPRODUITS, 1); -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { print ''.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("Module610Name")).''; } else { print yn(1).' ('.$langs->trans("ModuleIsEnabled", $langs->transnoentitiesnoconv("Module610Name")).')'; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c856ef97a35..3cb335fbdb2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2534,7 +2534,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Parent product. - if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { + if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) { $combination = new ProductCombination($db); if ($combination->fetchByFkProductChild($object->id) > 0) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0460642c746..30cf4393d1b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1279,7 +1279,7 @@ class Product extends CommonObject } if (!$error) { - if (!empty($conf->variants->enabled)) { + if (isModEnabled('variants')) { include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; $comb = new ProductCombination($this->db); @@ -4762,7 +4762,7 @@ class Product extends CommonObject public function isVariant() { global $conf; - if (!empty($conf->variants->enabled)) { + if (isModEnabled('variants')) { $sql = "SELECT rowid FROM ".$this->db->prefix()."product_attribute_combination WHERE fk_product_child = ".((int) $this->id)." AND entity IN (".getEntity('product').")"; $query = $this->db->query($sql); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 0a17c8e936f..2eb281e734c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -95,7 +95,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $type = GETPOST("type", "int"); //Show/hide child products -if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { +if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { $show_childproducts = GETPOST('search_show_childproducts'); } else { $show_childproducts = ''; @@ -419,7 +419,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ' p.fk_unit, cu.label as cu_label,'; } $sql .= ' MIN(pfp.unitprice) as minsellprice'; -if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { +if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { $sql .= ', pac.rowid prod_comb_id'; } // Add fields from extrafields @@ -448,7 +448,7 @@ 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())."'"; } -if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { +if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -469,7 +469,7 @@ if (dol_strlen($search_type) && $search_type != '-1') { } } -if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { +if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { $sql .= " AND pac.rowid IS NULL"; } @@ -580,7 +580,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ', p.fk_unit, cu.label'; } -if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { +if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { $sql .= ', pac.rowid'; } // Add fields from extrafields @@ -837,7 +837,7 @@ if ($resql) { } //Show/hide child products. Hidden by default - if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { + if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { $moreforfilter .= '
'; $moreforfilter .= ''; $moreforfilter .= ' '; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index bb89e670ee8..bd679a3f2d8 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -48,7 +48,7 @@ if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; From 0dacfd3facc523c2f42e490b8940915f390818bc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:10:17 +0200 Subject: [PATCH 450/476] Use isModEnabled --- htdocs/variants/admin/admin.php | 2 +- htdocs/variants/ajax/getCombinations.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/ajax/orderAttribute.php | 2 +- htdocs/variants/card.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index 082e1d6ef6e..6f7ec6b202c 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -26,7 +26,7 @@ $langs->loadLangs(array("admin", "products")); $action = GETPOST('action', 'alphanohtml'); // Security check -if (!$user->admin || empty($conf->variants->enabled)) { +if (!$user->admin || !isModEnabled('variants')) { accessforbidden(); } diff --git a/htdocs/variants/ajax/getCombinations.php b/htdocs/variants/ajax/getCombinations.php index fb8b4c147cc..dd1b49414c8 100644 --- a/htdocs/variants/ajax/getCombinations.php +++ b/htdocs/variants/ajax/getCombinations.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } if ($user->socid > 0) { // Protection if external user diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index ff9782f58a0..8f522bb8107 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'; // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } if ($user->socid > 0) { // Protection if external user diff --git a/htdocs/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index 6de1c7dcab9..2065bc27bdf 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -40,7 +40,7 @@ require '../../main.inc.php'; require DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php'; // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } if ($user->socid > 0) { // Protection if external user diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index e0f2d4f4d20..956d95f0a82 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -43,7 +43,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOST('lineid', 'alpha'); // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } if ($user->socid > 0) { // Protection if external user From 8ca01513d521c429ac9abb1470e28300cfa3c4a3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:10:24 +0200 Subject: [PATCH 451/476] Use isModEnabled --- htdocs/variants/combinations.php | 2 +- htdocs/variants/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 0480a22a59a..0f149a4dd6a 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -73,7 +73,7 @@ if ($id > 0 || $ref) { $selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array(); // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } if ($user->socid > 0) { // Protection if external user diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 930b01ff4e2..c2f2b3e9a15 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -137,7 +137,7 @@ $permissiontoadd = $user->rights->variants->write; $permissiontodelete = $user->rights->variants->delete; // Security check -if (empty($conf->variants->enabled)) { +if (!isModEnabled('variants')) { accessforbidden('Module not enabled'); } $socid = 0; From bcd5043eb254abf661771956a1de8d77875b3996 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:13:14 +0200 Subject: [PATCH 452/476] Use isModEnabled --- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/workflow.php | 2 +- htdocs/comm/card.php | 8 ++++---- htdocs/comm/index.php | 6 +++--- htdocs/comm/propal/card.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 0daf46c2588..37ca91adf2b 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -207,7 +207,7 @@ if (isModEnabled("expedition")) { if (isModEnabled("reception")) { $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } if (isModEnabled('supplier_proposal')) { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 824643093ad..b48e907045f 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -75,7 +75,7 @@ $workflowcodes = array( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'family'=>'create', 'position'=>25, - 'enabled'=>(!empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)), + 'enabled'=>(!empty($conf->ticket->enabled) && isModEnabled('ficheinter')), 'picto'=>'ticket' ), diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 961cb7309fe..3c8db30d7da 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -60,7 +60,7 @@ if (isModEnabled('contrat')) { if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } @@ -82,7 +82,7 @@ if (isModEnabled('facture')) { if (isModEnabled('project')) { $langs->load("projects"); } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $langs->load("interventions"); } if (!empty($conf->notification->enabled)) { @@ -1231,7 +1231,7 @@ if ($object->id > 0) { /* * Latest interventions */ - if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { + if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) { $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " WHERE f.fk_soc = s.rowid"; @@ -1564,7 +1564,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status == 1) { + if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer && $object->status == 1) { $langs->load("fichinter"); print ''; } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 01f3bba9eff..27f9b91a9d7 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } @@ -104,7 +104,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO $supplierorderstatic = new CommandeFournisseur($db); } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $fichinterstatic = new Fichinter($db); } @@ -519,7 +519,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO /* * Draft interventionals */ -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 84db90fd6e0..40046604137 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2880,7 +2880,7 @@ if ($action == 'create') { } // Create an intervention - if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateintervention) { $langs->load("interventions"); print ''.$langs->trans("AddIntervention").''; From 5eaffd64e751471eef539cb47c8618946b32c2ef Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:13:22 +0200 Subject: [PATCH 453/476] Use isModEnabled --- htdocs/commande/card.php | 2 +- htdocs/contact/consumption.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/project.lib.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c48b4f780fc..51bc2c9df9e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2827,7 +2827,7 @@ if ($action == 'create' && $usercancreate) { } // Create intervention - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $langs->load("interventions"); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index ff18b06c44a..fcab597d43a 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -170,7 +170,7 @@ if ($object->thirdparty->client) { } } -if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { +if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d34b6cce69f..7913c1d1ef7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8614,7 +8614,7 @@ class Form } } elseif ($objecttype == 'ficheinter') { $tplpath = 'fichinter'; - if (empty($conf->ficheinter->enabled)) { + if (!isModEnabled('ficheinter')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'invoice_supplier') { diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index e079cd431dd..948af4e2868 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a9a1869fb30..d6e29509cee 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -127,7 +127,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('contrat') - || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { + || isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -162,7 +162,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('contrat')) { $nbElements += $project->getElementCount('contract', 'contrat'); } - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $nbElements += $project->getElementCount('intervention', 'fichinter'); } if (isModEnabled("expedition")) { From 86163ff4308b3e2cff92fe3e74588d20a094fdbf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:13:41 +0200 Subject: [PATCH 454/476] Use isModEnabled --- .../modules/project/doc/doc_generic_project_odt.modules.php | 2 +- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 2 +- .../interface_20_modWorkflow_WorkflowManager.class.php | 4 ++-- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) 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 29050c6b780..8a8a4e373b7 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 @@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 35f00912143..73d1d4e3d12 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -59,7 +59,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 73312ec52cf..05717961076 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'TICKET_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // Auto link contract - if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { + if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { $societe = new Societe($this->db); $company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); @@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } // Automatically create intervention - if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { + if (isModEnabled('ficheinter') && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { $fichinter = new Fichinter($this->db); $fichinter->socid = (int) $object->fk_soc; $fichinter->fk_project = $projectid; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 88c3802fba5..27fa6925e21 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -352,7 +352,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } - if (!empty($conf->ficheinter->enabled)) { + if (isModEnabled('ficheinter')) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 77ae4408da3..1aa91371cee 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -147,7 +147,7 @@ if (isModEnabled('tax')) { if (isModEnabled('project')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { From 5d195880371b3763feff0e2c44d19384b5d47bec Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:13:47 +0200 Subject: [PATCH 455/476] Use isModEnabled --- htdocs/fichinter/index.php | 4 ++-- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/consumption.php | 2 +- htdocs/user/param_ihm.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 06e5ca0b21f..c7b150b7d2d 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -170,7 +170,7 @@ if ($resql) { /* * Draft orders */ -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -293,7 +293,7 @@ if ($resql) { * interventions to process */ -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e40a3528854..af6d576d159 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1369,7 +1369,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("suppliers"); print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { + if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer) { $langs->load("interventions"); print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bc29d2dca1e..16ccf195852 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -62,7 +62,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled("expedition")) { @@ -114,7 +114,7 @@ if (isModEnabled('commande')) { if (isModEnabled("propal")) { $langs->load("propal"); } -if (!empty($conf->ficheinter->enabled)) { +if (isModEnabled('ficheinter')) { $langs->load("interventions"); } if (isModEnabled('deplacement')) { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 9e5e9c8618d..b25ad6fa202 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1060,7 +1060,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser //'builddoc'=>$langs->trans("PDFMerge"), ); } - if ( !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { + if ( isModEnabled('ficheinter') && $user->rights->ficheinter->creer) { $langs->load("interventions"); $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0ff76102582..83961ac74cf 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -181,7 +181,7 @@ if ($object->client) { } } -if (!empty($conf->ficheinter->enabled) && !empty($user->rights->ficheinter->lire)) { +if (isModEnabled('ficheinter') && !empty($user->rights->ficheinter->lire)) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index a056bbd30df..79fbf1490d5 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -199,7 +199,7 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) { if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; } -if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || isModEnabled('contrat')) { +if (isModEnabled("propal") || isModEnabled('commande') || isModEnabled('ficheinter') || isModEnabled('contrat')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } if (!empty($conf->comptabilite->enabled) || isModEnabled('accounting')) { From e2c7cc13cae8c7850ecab8b7bbc69a9626d8a836 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:15:47 +0200 Subject: [PATCH 456/476] Use isModEnabled --- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/workflow.php | 6 +++--- htdocs/core/lib/functions.lib.php | 2 +- .../interface_20_modWorkflow_WorkflowManager.class.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index f997c44ef6e..dd4748a99f1 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -68,7 +68,7 @@ $conditions = array( 'USERSIGN' => 1, 'MAILING' => isModEnabled('mailing'), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), - 'TICKET' => !empty($conf->ticket->enabled), + 'TICKET' => isModEnabled('ticket'), ); // Picto $picto = array( diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 37ca91adf2b..02eef8a00d3 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -222,7 +222,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture-> if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } -if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { +if (isModEnabled('ticket') && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); } if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b48e907045f..8111b9e7b97 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -75,7 +75,7 @@ $workflowcodes = array( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'family'=>'create', 'position'=>25, - 'enabled'=>(!empty($conf->ticket->enabled) && isModEnabled('ficheinter')), + 'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')), 'picto'=>'ticket' ), @@ -174,13 +174,13 @@ $workflowcodes = array( 'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'family' => 'link_ticket', 'position' => 75, - 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), + 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), 'picto' => 'ticket' ), 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'family' => 'link_ticket', 'position' => 76, - 'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), + 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled), 'picto' => 'ticket' ), ); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 90bf079f687..a6b76fdc909 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7404,7 +7404,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/ } // add variables subtitutions ticket - if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { + if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket')) { $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; $substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__'; $substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 05717961076..267232a4a6b 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'TICKET_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // Auto link contract - if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { + if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { $societe = new Societe($this->db); $company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); @@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } // Automatically create intervention - if (isModEnabled('ficheinter') && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { + if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { $fichinter = new Fichinter($this->db); $fichinter->socid = (int) $object->fk_soc; $fichinter->fk_project = $projectid; From a6040867c8d14849b51484e5d69cc6777e5ae53f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:16:11 +0200 Subject: [PATCH 457/476] Use isModEnabled --- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- htdocs/public/ticket/create_ticket.php | 2 +- htdocs/public/ticket/index.php | 2 +- htdocs/public/ticket/list.php | 2 +- htdocs/public/ticket/view.php | 2 +- htdocs/user/param_ihm.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 847f4510536..089629234d6 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -61,7 +61,7 @@ class InterfaceTicketEmail extends DolibarrTriggers { $ok = 0; - if (empty($conf->ticket) || empty($conf->ticket->enabled)) { + if (empty($conf->ticket) || !isModEnabled('ticket')) { return 0; // Module not active, we do nothing } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index e982a4507b8..f459a36f909 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -91,7 +91,7 @@ if (!empty($conf->global->TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST)) $extrafields->fetch_name_optionals_label($object->table_element); -if (empty($conf->ticket->enabled)) { +if (!isModEnabled('ticket')) { httponly_accessforbidden('Module Ticket not enabled'); } diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index bec8417b492..84652017b37 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -59,7 +59,7 @@ $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); $suffix = ""; -if (empty($conf->ticket->enabled)) { +if (!isModEnabled('ticket')) { httponly_accessforbidden('Module Ticket not enabled'); } diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index fb0316dcd56..3fe6253b879 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -79,7 +79,7 @@ $object = new Ticket($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('ticketpubliclist', 'globalcard')); -if (empty($conf->ticket->enabled)) { +if (!isModEnabled('ticket')) { httponly_accessforbidden('Module Ticket not enabled'); } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 4bc9071218a..3f137148a89 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -73,7 +73,7 @@ if (isset($_SESSION['email_customer'])) { $object = new ActionsTicket($db); -if (empty($conf->ticket->enabled)) { +if (!isModEnabled('ticket')) { httponly_accessforbidden('Module Ticket not enabled'); } diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 79fbf1490d5..af93db7a1cb 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -211,7 +211,7 @@ if (isModEnabled('adherent')) { if (isModEnabled('agenda')) { $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda'; } -if (!empty($conf->ticket->enabled)) { +if (isModEnabled('ticket')) { $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets'; } From 3bb28205a3f464584f1a7ef1428b45fd1421c443 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:18:33 +0200 Subject: [PATCH 458/476] Use isModEnabled --- htdocs/blockedlog/class/blockedlog.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 4 ++-- htdocs/core/lib/project.lib.php | 2 +- htdocs/core/modules/modCategorie.class.php | 2 +- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index d6e1517344a..15af4a532fa 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -165,7 +165,7 @@ class BlockedLog */ // Donation - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; //$this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index aa54b3f330c..a2abdbb7cc6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1634,7 +1634,7 @@ class FormMail extends Form if (isModEnabled('adherent')) { $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; } - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; } if (isModEnabled('facture')) { @@ -1651,7 +1651,7 @@ class FormMail extends Form if (isModEnabled('adherent')) { $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; } - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; } if (isModEnabled('facture')) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d6e29509cee..81c27deee76 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -177,7 +177,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('expensereport')) { $nbElements += $project->getElementCount('expensereport', 'expensereport'); } - if (!empty($conf->don->enabled)) { + if (isModEnabled('don')) { $nbElements += $project->getElementCount('donation', 'don'); } if (!empty($conf->loan->enabled)) { diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index c000ebdf783..5ba96ad92aa 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -180,7 +180,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0]; $this->export_label[$r] = 'CatProdList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->enabled)'; + $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled('service')'; $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 611c556d98c..3693c818112 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -118,7 +118,7 @@ if (isModEnabled('adherent')) { } print '
'; } -if (!empty($conf->don->enabled)) { +if (isModEnabled('don')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'donation')."
\n"; From e707f1c03ca731a11fc44ccfcf80f24b778b3754 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:18:41 +0200 Subject: [PATCH 459/476] Use isModEnabled --- htdocs/don/index.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/element.php | 4 ++-- htdocs/public/donations/donateurs_code.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 9dc14918477..721cfb8d67a 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -91,7 +91,7 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation'); print '
'; if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this - if (!empty($conf->don->enabled) && $user->rights->don->lire) { + if (isModEnabled('don') && $user->rights->don->lire) { $listofsearchfields['search_donation'] = array('text'=>'Donation'); } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index af6d576d159..a63dab49dbb 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1381,7 +1381,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("trips"); print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->don->enabled) && $user->rights->don->creer) { + if (isModEnabled('don') && $user->rights->don->creer) { $langs->load("donations"); print dolGetButtonAction('', $langs->trans('AddDonation'), 'default', DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 16ccf195852..032677c27d8 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -77,7 +77,7 @@ if (isModEnabled('expensereport')) { if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (!empty($conf->don->enabled)) { +if (isModEnabled('don')) { require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; } if (!empty($conf->loan->enabled)) { @@ -123,7 +123,7 @@ if (isModEnabled('deplacement')) { if (isModEnabled('expensereport')) { $langs->load("trips"); } -if (!empty($conf->don->enabled)) { +if (isModEnabled('don')) { $langs->load("donations"); } if (!empty($conf->loan->enabled)) { diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 4acbaa5a256..509eb553288 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -57,7 +57,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; // Security check -if (empty($conf->don->enabled)) { +if (!isModEnabled('don')) { httponly_accessforbidden('Module Donation not enabled'); } From b3d156728bafe2a9ca466788c407f6d9ab5b835c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:22:58 +0200 Subject: [PATCH 460/476] Use isModEnabled --- htdocs/admin/workflow.php | 4 ++-- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/modules/modBanque.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- .../interface_50_modNotification_Notification.class.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 8111b9e7b97..10f32eed97d 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -133,7 +133,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array( 'family'=>'classify_supplier_order', 'position'=>63, - 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), + 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))), 'picto'=>'supplier_order', 'warning'=>'' ), @@ -141,7 +141,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array( 'family'=>'classify_supplier_order', 'position'=>64, - 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), + 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))), 'picto'=>'supplier_order', 'warning'=>'' ), diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 915a5083ce8..5f27cbf3477 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1026,7 +1026,7 @@ class FormCompany extends Form public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '') { global $conf, $langs; - if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) { + if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && !isModEnabled('fournisseur')) { return '' ; } diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index e44d8b59374..0cf58098967 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -162,7 +162,7 @@ class modBanque extends DolibarrModules "s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company" ); $this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG'); - if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) { + if ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order') || !isModEnabled('supplier_invoice')) { unset($this->export_fields_array[$r]['s.code_compta_fournisseur']); unset($this->export_entities_array[$r]['s.code_compta_fournisseur']); } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 5bc5c7da6cf..f5d26ed03ae 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -413,7 +413,7 @@ class modSociete extends DolibarrModules 't.libelle'=>"company", 's.entity'=>'company', ); // We define here only fields that use another picto - if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { unset($this->export_fields_array[$r]['s.code_fournisseur']); unset($this->export_entities_array[$r]['s.code_fournisseur']); } diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index dc02117da13..caf7c238d79 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -135,9 +135,9 @@ class InterfaceNotification extends DolibarrTriggers $element = $obj->elementtype; // Exclude events if related module is disabled - if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) { + if ($element == 'order_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))) { $qualified = 0; - } elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) { + } elseif ($element == 'invoice_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_invoice'))) { $qualified = 0; } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { $qualified = 0; From b1f425b703fdb37848b07cbc99e1a6c6b4d15bec Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:23:16 +0200 Subject: [PATCH 461/476] Use isModEnabled --- htdocs/fourn/facture/list.php | 4 ++-- htdocs/fourn/paiement/list.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 954d4fd5d75..413c2c3f853 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -213,8 +213,8 @@ 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'); -if ((empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) - || (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { +if ((!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (!isModEnabled('supplier_invoice') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { accessforbidden(); } if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 980413b05a0..c19fc90e5d7 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -124,8 +124,8 @@ if ($user->socid) { // require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; // $object = new PaiementFourn($db); // restrictedArea($user, $object->element); -if ((empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) - || (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { +if ((!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (!isModEnabled('supplier_invoice') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { accessforbidden(); } if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) From 37834d3c62cf9e48d0d2a418ecd954c57c99ea10 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:26:04 +0200 Subject: [PATCH 462/476] Use isModEnabled --- htdocs/user/param_ihm.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- htdocs/webhook/target_card.php | 2 +- htdocs/webhook/target_contact.php | 2 +- htdocs/webhook/target_note.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index af93db7a1cb..3d2e3240ce3 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -202,7 +202,7 @@ if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("propal") || isModEnabled('commande') || isModEnabled('ficheinter') || isModEnabled('contrat')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } -if (!empty($conf->comptabilite->enabled) || isModEnabled('accounting')) { +if (isModEnabled('comptabilite') || isModEnabled('accounting')) { $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea'; } if (isModEnabled('adherent')) { diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 4567ebde20c..83e859bd6db 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -163,7 +163,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index a2251d7d4a9..977132e236f 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -340,7 +340,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (isModEnabled('projet')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 0b7d0b59a76..8b6160becbb 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -146,7 +146,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) + if (isModEnabled('projet')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index eb41ce208ed..e09ace533a9 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -121,7 +121,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) + if (isModEnabled('projet')) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; From 43625c20612f20d82d065fb90be9411b9e2b6dc2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:26:20 +0200 Subject: [PATCH 463/476] Use isModEnabled --- htdocs/compta/accounting-files.php | 2 +- htdocs/projet/card.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 7e9264614cd..ea371e804f3 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -601,7 +601,7 @@ if (isModEnabled('multicompany') && is_object($mc)) { print '
'; // Project filter -if (!empty($conf->projet->enabled)) { +if (isModEnabled('projet')) { $formproject = new FormProjets($db); $langs->load('projects'); print ''.$langs->trans('Project').":"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index a63dab49dbb..52092eb8b94 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1276,7 +1276,7 @@ if ($action == 'create' && $user->rights->projet->creer) { if (empty($reshook)) { if ($action != "edit" && $action != 'presend') { // Create event - /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a + /*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a // "workflow" action so should appears somewhere else on // page. { @@ -1292,7 +1292,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Accounting Report /* - $accouting_module_activated = !empty($conf->comptabilite->enabled) || isModEnabled('accounting'); + $accouting_module_activated = isModEnabled('comptabilite') || isModEnabled('accounting'); if ($accouting_module_activated && $object->statut != Project::STATUS_DRAFT) { $start = dol_getdate((int) $object->date_start); $end = dol_getdate((int) $object->date_end); From aec9a7a60d1899e94400ed24b6efc712506bbee1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:30:09 +0200 Subject: [PATCH 464/476] Use isModEnabled --- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bom/bom_card.php | 12 ++++++------ htdocs/comm/card.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 4d1e6d4be56..b40ed122ec6 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -128,7 +128,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = assetPrepareHead($object); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index e0a463ec112..17fb19fe565 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = assetModelPrepareHead($object); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index ac3f672ad33..0c0ede5d30f 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = bomPrepareHead($object); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 294d57fea9c..af4050f455f 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -353,7 +353,7 @@ if (empty($reshook)) { } $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -362,7 +362,7 @@ if (empty($reshook)) { }*/ $formquestion = array(); - if (!empty($conf->bom->enabled)) { + if (isModEnabled('bom')) { $langs->load("mrp"); $forcecombo = 0; if ($conf->browser->name == 'ie') { @@ -381,7 +381,7 @@ if (empty($reshook)) { // Confirmation of closing if ($action == 'close') { $text = $langs->trans('ConfirmCloseBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -390,7 +390,7 @@ if (empty($reshook)) { }*/ $formquestion = array(); - if (!empty($conf->bom->enabled)) { + if (isModEnabled('bom')) { $langs->load("mrp"); $forcecombo = 0; if ($conf->browser->name == 'ie') { @@ -409,7 +409,7 @@ if (empty($reshook)) { // Confirmation of reopen if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -418,7 +418,7 @@ if (empty($reshook)) { }*/ $formquestion = array(); - if (!empty($conf->bom->enabled)) { + if (isModEnabled('bom')) { $langs->load("mrp"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $forcecombo = 0; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3c8db30d7da..f6ae06b1f7f 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -85,7 +85,7 @@ if (isModEnabled('project')) { if (isModEnabled('ficheinter')) { $langs->load("interventions"); } -if (!empty($conf->notification->enabled)) { +if (isModEnabled('notification')) { $langs->load("mails"); } From fc9e6c541e6370e8ba8ac1450a80a79391e4b89d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:30:33 +0200 Subject: [PATCH 465/476] Use isModEnabled --- htdocs/comm/propal/card.php | 4 ++-- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/contact/note.php | 2 +- htdocs/contact/project.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 40046604137..5b2d7197eb7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2209,7 +2209,7 @@ if ($action == 'create') { } } - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $formquestion = array_merge($formquestion, array( @@ -2248,7 +2248,7 @@ if ($action == 'create') { } $text = $langs->trans('ConfirmValidateProp', $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 51bc2c9df9e..ddaaa57eeba 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2062,7 +2062,7 @@ if ($action == 'create' && $usercancreate) { } $text = $langs->trans('ConfirmValidateOrder', $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3c407a834e6..767958e1c4d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4119,7 +4119,7 @@ if ($action == 'create') { } $text = $langs->trans('ConfirmValidateBill', $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index dc67ccc87d4..bf75a3350a7 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -87,7 +87,7 @@ if ($id > 0) { /* * Affichage onglets */ - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 2c5ffb78e5d..571fa57e428 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -68,7 +68,7 @@ if ($id) { } llxHeader('', $title); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = contact_prepare_head($object); From 9e957edc3b99347c369c60cd68a50bd8558d6044 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:30:51 +0200 Subject: [PATCH 466/476] Use isModEnabled --- htdocs/contrat/agenda.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 2 +- .../interface_50_modNotification_Notification.class.php | 2 +- htdocs/expedition/card.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 928dff1aea6..d46f2cb24a7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -138,7 +138,7 @@ if ($id > 0) { } llxHeader('', $title); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = contract_prepare_head($object); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 59373e39cd3..da6a6c5e1f8 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -547,7 +547,7 @@ function show_stats_for_company($product, $socid) } // BOM - if (!empty($conf->bom->enabled) && $user->rights->bom->read) { + if (isModEnabled('bom') && $user->rights->bom->read) { $nblines++; $ret = $product->load_stats_bom($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index f6690935416..9eb65532afc 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -107,7 +107,7 @@ function user_prepare_head(User $object) } // Notifications - if ($user->socid == 0 && !empty($conf->notification->enabled)) { + if ($user->socid == 0 && isModEnabled('notification')) { $nbNote = 0; $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index caf7c238d79..f25aabee871 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -66,7 +66,7 @@ class InterfaceNotification extends DolibarrTriggers */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { - if (empty($conf->notification) || empty($conf->notification->enabled)) { + if (empty($conf->notification) || !isModEnabled('notification')) { return 0; // Module not active, we do nothing } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6b819f58e83..ef47a95186d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1693,7 +1693,7 @@ if ($action == 'create') { $text = $langs->trans("ConfirmValidateSending", $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; From f9b1f89413132abfebd1923aab28f160d22e3563 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:31:12 +0200 Subject: [PATCH 467/476] Use isModEnabled --- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_card.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 9303c6eaf31..dff874725de 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1926,7 +1926,7 @@ if ($action == 'create') { $action = ''; } else { $text = $langs->trans('ConfirmValidateOrder', $newref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; @@ -1963,7 +1963,7 @@ if ($action == 'create') { ); } $text = $langs->trans("ConfirmApproveThisOrder", $object->ref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 4528c0cb0c2..0f02adf0a4e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2704,7 +2704,7 @@ if ($action == 'create') { $action = ''; } else { $text = $langs->trans('ConfirmValidateBill', $numref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index bae5f28376d..d5f7f8a6b36 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -128,7 +128,7 @@ if ($object->id > 0) { $help_url = ''; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = establishment_prepare_head($object); diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index ed9e9ecc196..a30a3f98f5a 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -138,7 +138,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = evaluationPrepareHead($object); diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 9c73d8c99b6..58c0d1e6b8d 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -353,7 +353,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateEvaluation', $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; From 75ed50a53c17c000546e1a97eda27452811da200 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:31:28 +0200 Subject: [PATCH 468/476] Use isModEnabled --- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_card.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 808ceea430f..3d371c878e3 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -138,7 +138,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = jobPrepareHead($object); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index fa0e6ab3aed..d06b3c50d57 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -140,7 +140,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = positionCardPrepareHead($object); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 9646aaccb88..f8d9472bb7c 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -139,7 +139,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = skillPrepareHead($object); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 475fbdccb30..026e2fad51d 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $help_url = ''; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = knowledgerecordPrepareHead($object); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index c68389f2b86..a5e1751172a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -294,7 +294,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'close') { $text = $langs->trans('ConfirmCloseKM', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -319,7 +319,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenKM', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); From ab9dda0f93b9a26f5e5c1a9e94032f6e7d491fbc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:31:42 +0200 Subject: [PATCH 469/476] Use isModEnabled --- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/mrp/mo_production.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index f0d7ffa1439..5b5860f6475 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -190,7 +190,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = myobjectPrepareHead($object); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 4bc0b797b47..2c12640a799 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -347,7 +347,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { $text = $langs->trans('ConfirmActionMyObject', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 491240cff55..d91735c592f 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -134,7 +134,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = moPrepareHead($object); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index c1869f755de..e52c0860aa2 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -427,7 +427,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 178858b718f..25c43e46920 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -473,7 +473,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); From be55f63b636e38ec4ec3ebb3c0ce5473e6449cb3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:31:56 +0200 Subject: [PATCH 470/476] Use isModEnabled --- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/partnership/partnership_card.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/card.php | 6 +++--- htdocs/product/note.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 3e62e6453de..dd886fc70d7 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $help_url = ''; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = partnershipPrepareHead($object); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 865888c69a3..996506841c5 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -370,7 +370,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel minwidth400', 'value' => '') // Field to complete private note (not replace) ); - // if (!empty($conf->notification->enabled)) { + // if (isModEnabled('notification')) { // require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; // $notify = new Notify($db); // $formquestion = array_merge($formquestion, array( diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 4914527552d..c0ecdb2ad0f 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -144,7 +144,7 @@ if ($id > 0 || $ref) { } llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $type = $langs->trans('Product'); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3cb335fbdb2..f455806e0ce 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -71,7 +71,7 @@ if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } -if (!empty($conf->bom->enabled)) { +if (isModEnabled('bom')) { require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; } @@ -2074,7 +2074,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - if (!$object->isService() && !empty($conf->bom->enabled)) { + if (!$object->isService() && isModEnabled('bom')) { print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).''; $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".((int) $object->id); print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); @@ -2584,7 +2584,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - if (!$object->isService() && !empty($conf->bom->enabled) && $object->finished) { + if (!$object->isService() && isModEnabled('bom') && $object->finished) { print '
'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).''; if ($object->fk_default_bom) { $bom_static = new BOM($db); diff --git a/htdocs/product/note.php b/htdocs/product/note.php index 6341ef6fa3b..0d7ad91af5f 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { /* * Affichage onglets */ - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } From 07943807618242c6ebae1c1b12ec0fd43bed6dac Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:32:12 +0200 Subject: [PATCH 471/476] Use isModEnabled --- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_card.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index e21bfcb19f2..b62dfa5b00d 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -116,7 +116,7 @@ if ($object->id > 0) { $help_url = ''; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) $langs->load("mails"); + if (isModEnabled('notification')) $langs->load("mails"); $head = stocktransferPrepareHead($object); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 20a03e2d548..7d4d58cbc83 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1323,7 +1323,7 @@ if ($action == 'create') { $text = $langs->trans("ConfirmValidateReception", $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 2aeb51628a6..9988140393d 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -129,7 +129,7 @@ if ($object->id > 0) { $help_url = 'Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = recruitmentCandidaturePrepareHead($object); diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 38adf67acc1..f2f4d37484b 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -129,7 +129,7 @@ if ($object->id > 0) { $help_url = ''; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = recruitmentjobpositionPrepareHead($object); diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 606786a4960..a23888fd8a9 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -285,7 +285,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '') // Field to complete private note (not replace) ); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); From 93709349d2529a0095869cc32ea69db672dc394c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:32:24 +0200 Subject: [PATCH 472/476] Use isModEnabled --- htdocs/societe/agenda.php | 2 +- htdocs/societe/card.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/document.php | 2 +- htdocs/societe/note.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 3a4ca2df6f5..550d8ca772d 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -121,7 +121,7 @@ if ($socid > 0) { } llxHeader('', $title); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6c5f46d3c6a..ee058f8685f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -77,7 +77,7 @@ if (isModEnabled('categorie')) { if (!empty($conf->incoterm->enabled)) { $langs->load("incoterm"); } -if (!empty($conf->notification->enabled)) { +if (isModEnabled('notification')) { $langs->load("mails"); } if (isModEnabled('accounting')) { diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 313947cbb0e..90267403a16 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -56,7 +56,7 @@ if (isModEnabled('categorie')) { if (!empty($conf->incoterm->enabled)) { $langs->load("incoterm"); } -if (!empty($conf->notification->enabled)) { +if (isModEnabled('notification')) { $langs->load("mails"); } diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index fccb1ae3044..ccb668f9055 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -118,7 +118,7 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); // Show tabs -if (!empty($conf->notification->enabled)) { +if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index dabc5d7e39e..a15f96fa1f6 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -91,7 +91,7 @@ if ($object->id > 0) { /* * Affichage onglets */ - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } From 3cf2048518357b8ec89c94141b37c314609e5e87 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:32:35 +0200 Subject: [PATCH 473/476] Use isModEnabled --- htdocs/societe/partnership.php | 2 +- htdocs/societe/price.php | 2 +- htdocs/societe/project.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/user/document.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 4e0552d3c15..b7bcd153092 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -164,7 +164,7 @@ if ($id > 0) { $object = new Societe($db); $result = $object->fetch($id); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a9f17f4b50a..5ff503c9eec 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -199,7 +199,7 @@ $object = new Societe($db); $result = $object->fetch($socid); llxHeader("", $langs->trans("ThirdParty").'-'.$langs->trans('PriceByCustomer')); -if (!empty($conf->notification->enabled)) { +if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index f704273db60..5a8ba6a46b2 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -84,7 +84,7 @@ if ($socid) { } llxHeader('', $title); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = societe_prepare_head($object); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index da70aa005d9..49f0fc408ce 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1530,7 +1530,7 @@ if ($action == 'create') { } $text = $langs->trans('ConfirmValidateAsk', $numref); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; $notify = new Notify($db); $text .= '
'; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 99191368186..b607cff7f3e 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -140,7 +140,7 @@ if ($object->id) { /* * Affichage onglets */ - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = user_prepare_head($object); From 4fd31ff59acf20165c0c976cfc84ffa8fbd948d8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:32:50 +0200 Subject: [PATCH 474/476] Use isModEnabled --- htdocs/webhook/target_agenda.php | 2 +- htdocs/webhook/target_card.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 83e859bd6db..17b9842c238 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -143,7 +143,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = targetPrepareHead($object); diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 977132e236f..83d0d4a1831 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -293,7 +293,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { $text = $langs->trans('ConfirmActionTarget', $object->ref); - /*if (!empty($conf->notification->enabled)) + /*if (isModEnabled('notification')) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index c09bef044c6..faada03fb4f 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $help_url = 'EN:Module_Workstation'; llxHeader('', $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = workstationPrepareHead($object); From 53add0254f28fecdf53cd88b6cbeafdbee7fc2b6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:34:47 +0200 Subject: [PATCH 475/476] Fix --- htdocs/core/modules/modCategorie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 5ba96ad92aa..4a8680502ae 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -180,7 +180,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0]; $this->export_label[$r] = 'CatProdList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled('service')'; + $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); From 93a019678660ebf9a5fd753b8c617735a6022b4d Mon Sep 17 00:00:00 2001 From: priojk Date: Sun, 25 Sep 2022 10:41:28 +0200 Subject: [PATCH 476/476] Removed empty lines, set length of accoutn numbers to 4 with leadin zeros. --- .../mysql/data/llx_accounting_account_de.sql | 754 ++++++++---------- 1 file changed, 326 insertions(+), 428 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_de.sql b/htdocs/install/mysql/data/llx_accounting_account_de.sql index 0165c3ec06e..e8026e32de1 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_de.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_de.sql @@ -24,328 +24,327 @@ -- SKR03 -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'SKR03', '0', '1', '0', 'Aufwendungen für die Ingangsetzung und Erweiterung des Geschäftsbetriebs'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'SKR03', '0', '2', '0', 'Aufwendungen für die Währungsumstellung auf den Euro'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'SKR03', '0', '10', '0', 'Konzessionen gewerbliche Schutzrechte und ähnliche Rechte und Werte sowie Lizenzen an solchen Rechten und Werten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'SKR03', '0', '15', '10', 'Konzessionen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'SKR03', '0', '20', '10', 'Gewerbliche Schutzrechte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'SKR03', '0', '25', '10', 'ähnliche Rechte und Werte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'SKR03', '0', '27', '10', 'EDV-Software'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'SKR03', '0', '30', '10', 'Lizenzen an gewerblichen Schutzrechten und ähnlichen Rechten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'SKR03', '0', '35', '0', 'Geschäfts- oder Firmenwert'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'SKR03', '0', '38', '0', 'Anzahlungen auf Geschäfts- oder Firmenwert'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'SKR03', '0', '39', '0', 'Anzahlungen auf immaterielle Vermögensgegenstände'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'SKR03', '0', '40', '0', 'Verschmelzungsmehrwert'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'SKR03', '0', '50', '0', 'Grundstücke grundstücksgleiche Rechte und Bauten einschließlich der Bauten auf fremden Grundstücken'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'SKR03', '0', '59', '50', 'Grundstücksanteil des häuslichen Arbeitszimmers.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'SKR03', '0', '60', '0', 'Grundstücke und grundstücksgleiche Rechte ohne Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'SKR03', '0', '65', '60', 'Unbebaute Grundstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'SKR03', '0', '70', '60', 'Grundstücksgleiche Rechte - (erbbaurecht Daürwohnrecht)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'SKR03', '0', '75', '60', 'Grundstücke mit Substanzverzehr'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'SKR03', '0', '79', '60', 'Anzahlungen auf Grundstücke und grundstücksgleiche Rechte ohne Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'SKR03', '0', '80', '0', 'Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'SKR03', '0', '85', '80', 'Grundstückswerte eigener bebauter Grundstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'SKR03', '0', '90', '80', 'Geschäftsbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'SKR03', '0', '100', '80', 'Fabrikbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'SKR03', '0', '110', '80', 'Garagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1055, 'SKR03', '0', '111', '80', 'Außenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1056, 'SKR03', '0', '112', '80', 'Hof- und Wegebefestigungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1057, 'SKR03', '0', '113', '80', 'Einrichtung Fabrik- und Geschäftsbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1058, 'SKR03', '0', '115', '80', 'Andere Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1059, 'SKR03', '0', '120', '80', 'Geschäfts- Fabrik- und andere Bauten im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1060, 'SKR03', '0', '129', '80', 'Anzahlungen auf Geshäfts- Fabrik- und andere Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1061, 'SKR03', '0', '140', '80', 'Wohnbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1062, 'SKR03', '0', '145', '80', 'Garagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1063, 'SKR03', '0', '146', '80', 'Aussenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1064, 'SKR03', '0', '147', '80', 'Hof- und Wegebefestigungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1065, 'SKR03', '0', '148', '80', 'Einrichtungen für Wohnbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1066, 'SKR03', '0', '149', '80', 'Gebäudeteil des häuslichen Arbeitszimmers'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1067, 'SKR03', '0', '150', '80', 'Wohnbauten im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1068, 'SKR03', '0', '159', '80', 'Anzahlgen auf Wohnbauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1069, 'SKR03', '0', '160', '0', 'Bauten auf fremden Grundstücken'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1070, 'SKR03', '0', '165', '160', 'Geschäftsbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1071, 'SKR03', '0', '170', '160', 'Fabrikbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1072, 'SKR03', '0', '175', '160', 'Garagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1073, 'SKR03', '0', '176', '160', 'Aussenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1074, 'SKR03', '0', '177', '160', 'Hof- und Wegebefestigungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1075, 'SKR03', '0', '178', '160', 'Einrichtung für Fabrik- und Geschäftsbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1076, 'SKR03', '0', '179', '160', 'Andere Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1077, 'SKR03', '0', '180', '160', 'Geschäfts- Fabrik- und andere Bauten im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1078, 'SKR03', '0', '189', '160', 'Anzahlungen auf Geschäfts- Fabrik- und andere Bauten auf fremden Grundstücken'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1079, 'SKR03', '0', '190', '160', 'Wohnbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1080, 'SKR03', '0', '191', '160', 'Garagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1081, 'SKR03', '0', '192', '160', 'Aussenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1082, 'SKR03', '0', '193', '160', 'Hof- und Wegebefestigungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1083, 'SKR03', '0', '194', '160', 'Einrichtungen für Wohnbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1084, 'SKR03', '0', '195', '160', 'Wohnbauten im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1085, 'SKR03', '0', '199', '160', 'Anzahlungen a. Wohnbauten auf fremden Grundstücken'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1087, 'SKR03', '0', '200', '0', 'Technische Anlagen und Maschinen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1088, 'SKR03', '0', '210', '200', 'Maschinen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1089, 'SKR03', '0', '220', '200', 'Maschinengebundene Werkzeuge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1090, 'SKR03', '0', '240', '200', 'Maschinelle Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1091, 'SKR03', '0', '260', '200', 'Transportanlagen und ähnliches'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1092, 'SKR03', '0', '280', '200', 'Betriebsvorrichtungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1093, 'SKR03', '0', '290', '200', 'Technische Anlagen und Maschinen im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1094, 'SKR03', '0', '299', '200', 'Anzahlungen auf technische Anlagen und Maschinen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1096, 'SKR03', '0', '300', '0', 'Andere Anlagen Betriebs- und Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1097, 'SKR03', '0', '310', '300', 'Andere Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1098, 'SKR03', '0', '320', '300', 'PKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1099, 'SKR03', '0', '350', '300', 'LKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1100, 'SKR03', '0', '380', '300', 'Sonstige Transportmittel'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1101, 'SKR03', '0', '400', '300', 'Betriebsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1102, 'SKR03', '0', '410', '300', 'Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1103, 'SKR03', '0', '420', '300', 'Büroeinrichtung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1104, 'SKR03', '0', '430', '300', 'Ladeneinrichtung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1105, 'SKR03', '0', '440', '300', 'Werkzeuge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1106, 'SKR03', '0', '450', '300', 'Einbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1107, 'SKR03', '0', '460', '300', 'Gerüst- und Schalungsmaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1108, 'SKR03', '0', '480', '300', 'Geringwertige Wirtschaftsgüter bis 410 Euro'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1109, 'SKR03', '0', '490', '300', 'Sonstige Betriebs- und Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1110, 'SKR03', '0', '498', '300', 'Andere Anlagen Betriebs- und Geschäftsausstattung im Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1111, 'SKR03', '0', '499', '300', 'Anzahlungen auf andere Anlagen Betriebs- und Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1114, 'SKR03', '0', '500', '0', 'Anteile an verbundenen Unternehmen (Anlagevermögen)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1115, 'SKR03', '0', '504', '500', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1117, 'SKR03', '0', '505', '500', 'Ausleihungen an verbundene Unternehmen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1119, 'SKR03', '0', '510', '500', 'Beteiligungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1120, 'SKR03', '0', '513', '510', 'Typisch stille Beteiligungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1121, 'SKR03', '0', '516', '510', 'Atypisch stille Beteiligungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1122, 'SKR03', '0', '517', '510', 'Andere Beteiligungen an Kapitalgesellschaften'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1123, 'SKR03', '0', '518', '510', 'Andere Beteiligungen an Personengesellschaften'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1124, 'SKR03', '0', '519', '510', 'Beteiligung einer GmbH&Co.KG an einer Komplementär GmbH'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1126, 'SKR03', '0', '520', '0', 'Ausleihungen an Unternehmen mit denen ein Beteiligungsverhältnis besteht'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1128, 'SKR03', '0', '525', '520', 'Wertpapiere des Anlagevermögens'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1129, 'SKR03', '0', '530', '525', 'Wertpapiere mit Gewinnbeteiligungsansprüchen die dem Halbeinkünfteverfahren unterliegen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1130, 'SKR03', '0', '535', '525', 'Festverzinsliche Wertpapiere'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1132, 'SKR03', '0', '540', '0', 'Sonstige Ausleihungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1133, 'SKR03', '0', '550', '540', 'Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1135, 'SKR03', '0', '570', '0', 'Genossenschaftsanteile zum langfristigen Verbleib'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1136, 'SKR03', '0', '580', '570', 'Ausleihungen an Gesellschafter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1137, 'SKR03', '0', '590', '570', 'Ausleihungen an nahe stehende Personen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1139, 'SKR03', '0', '595', '0', 'Rückdeckungsansprüche aus Lebensversicherungen zum langfristigen Verbleib'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1142, 'SKR03', '0', '600', '0', 'Anleihen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1143, 'SKR03', '0', '601', '600', 'Anleihen nicht konvertibel (bis 1 Jahr)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1144, 'SKR03', '0', '605', '600', 'Anleihen nicht konvertibel (1-5 Jahre)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1145, 'SKR03', '0', '610', '600', 'Anleihen nicht konvertibel (größer 5 Jahre)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1146, 'SKR03', '0', '615', '600', 'Anleihen konvertibel'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1147, 'SKR03', '0', '616', '600', 'Anleihen konvertibel(bis 1 Jahr)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1148, 'SKR03', '0', '620', '600', 'Anleihen konvertibel(1-5 Jahre)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1149, 'SKR03', '0', '625', '600', 'Anleihen konvertibel(größer 5 Jahre)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1151, 'SKR03', '0', '630', '0', 'Verbindlichkeiten gegenüber Kreditinstituten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1152, 'SKR03', '0', '631', '630', 'Verbindlichkeiten gegenüber Kreditinstitut ( bis 1Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1153, 'SKR03', '0', '640', '630', 'Verbindlichkeiten gegenüber Kreditinstitut (1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1154, 'SKR03', '0', '650', '630', 'Verbindlichkeiten gegenüber Kreditinstitut (größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1155, 'SKR03', '0', '660', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1156, 'SKR03', '0', '661', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen ( bis 1Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1157, 'SKR03', '0', '670', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen (1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1158, 'SKR03', '0', '680', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen (größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1159, 'SKR03', '0', '690', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1160, 'SKR03', '0', '691', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1161, 'SKR03', '0', '692', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1162, 'SKR03', '0', '693', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1163, 'SKR03', '0', '694', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1164, 'SKR03', '0', '695', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1165, 'SKR03', '0', '696', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1166, 'SKR03', '0', '697', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1167, 'SKR03', '0', '698', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1169, 'SKR03', '0', '699', '600', 'Gegenkonto 0630-0689 bei Aufteilung der Konten 0690-0698'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1171, 'SKR03', '0', '700', '600', 'Verbindlichkeiten gegenüber verbundenen Unternehmen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1172, 'SKR03', '0', '701', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( bis 1 Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1173, 'SKR03', '0', '705', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1174, 'SKR03', '0', '710', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1176, 'SKR03', '0', '715', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1177, 'SKR03', '0', '716', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( bis 1 Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1178, 'SKR03', '0', '720', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1179, 'SKR03', '0', '725', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( größer 5 Jahre)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1181, 'SKR03', '0', '730', '600', 'Verbindlichkeit gegenüber Gesellschaftern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1182, 'SKR03', '0', '731', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( bis 1 Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1183, 'SKR03', '0', '740', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1184, 'SKR03', '0', '750', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1185, 'SKR03', '0', '755', '730', 'Verbindlichkeit gegenüber Gesellschaftern für offene Ausschüttungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1186, 'SKR03', '0', '760', '730', 'Darlehen typisch stiller Gesellschafter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1187, 'SKR03', '0', '761', '730', 'Darlehen typisch stiller Gesellschafter ( bis 1 Jahr)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1188, 'SKR03', '0', '764', '730', 'Darlehen typisch stiller Gesellschafter ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1189, 'SKR03', '0', '767', '730', 'Darlehen typisch stiller Gesellschafter ( größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1190, 'SKR03', '0', '770', '730', 'Darlehen atypisch stiller Gesellschafter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1191, 'SKR03', '0', '771', '730', 'Darlehen atypisch stiller Gesellschafter ( bis 1 Jahr)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1192, 'SKR03', '0', '774', '730', 'Darlehen atypisch stiller Gesellschafter ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1193, 'SKR03', '0', '777', '730', 'Darlehen atypisch stiller Gesellschafter ( größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1194, 'SKR03', '0', '780', '730', 'Partiarische Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1195, 'SKR03', '0', '781', '730', 'Partiarische Darlehen ( bis 1 Jahr )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1196, 'SKR03', '0', '784', '730', 'Partiarische Darlehen ( 1 bis 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1197, 'SKR03', '0', '787', '730', 'Partiarische Darlehen ( größer 5 Jahre )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1198, 'SKR03', '0', '790', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1199, 'SKR03', '0', '791', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1200, 'SKR03', '0', '792', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1201, 'SKR03', '0', '793', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1202, 'SKR03', '0', '794', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1203, 'SKR03', '0', '795', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1204, 'SKR03', '0', '796', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1205, 'SKR03', '0', '797', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1206, 'SKR03', '0', '798', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1207, 'SKR03', '0', '799', '730', 'Gegenkonto 0730 - 0789 bei Aufteilung der Konten 0790 - 0798'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1210, 'SKR03', '0', '800', '0', 'Gezeichnetes Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1212, 'SKR03', '0', '801', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1213, 'SKR03', '0', '802', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1214, 'SKR03', '0', '803', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1215, 'SKR03', '0', '804', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1216, 'SKR03', '0', '805', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1217, 'SKR03', '0', '806', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1218, 'SKR03', '0', '807', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1219, 'SKR03', '0', '808', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1220, 'SKR03', '0', '809', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1221, 'SKR03', '0', '810', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1222, 'SKR03', '0', '811', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1223, 'SKR03', '0', '812', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1224, 'SKR03', '0', '813', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1225, 'SKR03', '0', '814', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1226, 'SKR03', '0', '815', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1227, 'SKR03', '0', '816', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1228, 'SKR03', '0', '817', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1229, 'SKR03', '0', '818', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1230, 'SKR03', '0', '819', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1232, 'SKR03', '0', '820', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1233, 'SKR03', '0', '821', '800', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1234, 'SKR03', '0', '822', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1235, 'SKR03', '0', '823', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1236, 'SKR03', '0', '824', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1237, 'SKR03', '0', '825', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1238, 'SKR03', '0', '826', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1239, 'SKR03', '0', '827', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1240, 'SKR03', '0', '828', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1241, 'SKR03', '0', '829', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1243, 'SKR03', '0', '830', '800', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1244, 'SKR03', '0', '831', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1245, 'SKR03', '0', '832', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1246, 'SKR03', '0', '833', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1247, 'SKR03', '0', '834', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1248, 'SKR03', '0', '835', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1249, 'SKR03', '0', '836', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1250, 'SKR03', '0', '837', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1251, 'SKR03', '0', '838', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1253, 'SKR03', '0', '839', '830', 'Eingeforderte Nachschüsse ( Forderungen Gegenkonto 0845 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1256, 'SKR03', '0', '840', '0', 'Kapitalrücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1257, 'SKR03', '0', '841', '840', 'Kapitalrücklage durch Ausgabe von Anteilen über Nennbetrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1258, 'SKR03', '0', '842', '840', 'Kapitalrücklage durch Ausgabe von Schuldverschreibungen für Wandlungsrechte und Optionsrechte zum Erwerb von Anteilen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1259, 'SKR03', '0', '843', '840', 'Kapitalrücklage durch Zuzahlungen gegen Gewährung eines Vorzugs für Anteile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1260, 'SKR03', '0', '844', '840', 'Kapitalrücklage durch andere Zuzahlungen in das Eigenkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1261, 'SKR03', '0', '845', '840', 'Eingefordertes Nachschusskapital ( Gegenkonto 0839 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1264, 'SKR03', '0', '846', '840', 'Gesetzliche Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1266, 'SKR03', '0', '850', '840', 'Rücklage für eigene Anteile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1268, 'SKR03', '0', '851', '840', 'Satzungsmässige Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1270, 'SKR03', '0', '855', '840', 'Andere Gewinnrücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1271, 'SKR03', '0', '856', '840', 'Eigenkapitalanteil von Wertaufholungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1273, 'SKR03', '0', '860', '0', 'Gewinnvortrag vor Verwendung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1274, 'SKR03', '0', '868', '860', 'Verlustvortrag vor Verwendung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1276, 'SKR03', '0', '869', '860', 'Vortrag auf neue Rechnung (Bilanz)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1278, 'SKR03', '0', '870', '0', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1279, 'SKR03', '0', '871', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1280, 'SKR03', '0', '872', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1281, 'SKR03', '0', '873', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1282, 'SKR03', '0', '874', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1283, 'SKR03', '0', '875', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1284, 'SKR03', '0', '876', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1285, 'SKR03', '0', '877', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1286, 'SKR03', '0', '878', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1287, 'SKR03', '0', '879', '870', 'Festkapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1288, 'SKR03', '0', '880', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1289, 'SKR03', '0', '881', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1290, 'SKR03', '0', '882', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1291, 'SKR03', '0', '883', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1292, 'SKR03', '0', '884', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1293, 'SKR03', '0', '885', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1294, 'SKR03', '0', '886', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1295, 'SKR03', '0', '887', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1296, 'SKR03', '0', '888', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1297, 'SKR03', '0', '889', '870', 'Variables Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1298, 'SKR03', '0', '890', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1299, 'SKR03', '0', '891', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1300, 'SKR03', '0', '892', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1301, 'SKR03', '0', '893', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1302, 'SKR03', '0', '894', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1303, 'SKR03', '0', '895', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1304, 'SKR03', '0', '896', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1305, 'SKR03', '0', '897', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1306, 'SKR03', '0', '898', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1307, 'SKR03', '0', '899', '870', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1309, 'SKR03', '0', '900', '0', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1310, 'SKR03', '0', '901', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1311, 'SKR03', '0', '902', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1312, 'SKR03', '0', '903', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1313, 'SKR03', '0', '904', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1314, 'SKR03', '0', '905', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1315, 'SKR03', '0', '906', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1316, 'SKR03', '0', '907', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1317, 'SKR03', '0', '908', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1318, 'SKR03', '0', '909', '1309', 'Kommandit-Kapital'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1319, 'SKR03', '0', '910', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1320, 'SKR03', '0', '911', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1321, 'SKR03', '0', '912', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1322, 'SKR03', '0', '913', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1323, 'SKR03', '0', '914', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1324, 'SKR03', '0', '915', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1325, 'SKR03', '0', '916', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1326, 'SKR03', '0', '917', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1327, 'SKR03', '0', '918', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1328, 'SKR03', '0', '919', '1309', 'Verlustausgleichskonto'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1329, 'SKR03', '0', '920', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1330, 'SKR03', '0', '921', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1331, 'SKR03', '0', '922', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1332, 'SKR03', '0', '923', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1333, 'SKR03', '0', '924', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1334, 'SKR03', '0', '925', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1335, 'SKR03', '0', '926', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1336, 'SKR03', '0', '927', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1337, 'SKR03', '0', '928', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1338, 'SKR03', '0', '929', '1309', 'Gesellschafter-Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1341, 'SKR03', '0', '930', '1309', 'Sonderposten mit Rücklageanteil steuerfreie Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1342, 'SKR03', '0', '931', '1341', 'Sonderposten mit Rücklageanteil nach § 6b EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1343, 'SKR03', '0', '932', '1341', 'Sonderposten mit Rücklageanteil nach Abschnitt 35 EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1344, 'SKR03', '0', '933', '1341', 'Sonderposten mit Rücklageanteil nach § 6d EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1345, 'SKR03', '0', '934', '1341', 'Sonderposten mit Rücklageanteil nach § 1 EntwLStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1347, 'SKR03', '0', '935', '1309', 'Sonderposten aus der Währungsumstellung auf den Euro'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1348, 'SKR03', '0', '936', '1341', 'Sonderposten mit Rücklageanteil nach § 7 d EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1349, 'SKR03', '0', '937', '1341', 'Sonderposten mit Rücklageanteil nach § 79 EStDV'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1350, 'SKR03', '0', '938', '1341', 'Sonderposten mit Rücklageanteil nach § 80 EStDV'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1351, 'SKR03', '0', '939', '1341', 'Sonderposten mit Rücklageanteil nach § 52 Abs.16 EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1352, 'SKR03', '0', '940', '1341', 'Sonderposten mit Rücklageanteil Sonderabschreibungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1353, 'SKR03', '0', '941', '1341', 'Sonderposten mit Rücklageanteil § 82 a EStDV'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1354, 'SKR03', '0', '942', '1341', 'Sonderposten mit Rücklageanteil § 82 d EStDV'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1355, 'SKR03', '0', '943', '1341', 'Sonderposten mit Rücklageanteil nach § 82 e EStDV'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1356, 'SKR03', '0', '944', '1341', 'Sonderposten mit Rücklageanteil nach § 14 BerlinFG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1357, 'SKR03', '0', '945', '1341', 'Sonderposten mit Rücklageanteil für Förderung nach § 3 Zonen-RFG/§ 4-6 FördergebietsG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1358, 'SKR03', '0', '946', '1341', 'Sonderposten mit Rücklageanteil nach § 4d EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1359, 'SKR03', '0', '947', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.1 EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1360, 'SKR03', '0', '948', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.3 u.7 EStG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1362, 'SKR03', '0', '949', '1309', 'Sonderposten für Zuschüsse und Zulagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1365, 'SKR03', '0', '950', '1309', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1367, 'SKR03', '0', '955', '1309', 'Steuerrückstellungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1368, 'SKR03', '0', '957', '1367', 'Gewerbesteuerrückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1369, 'SKR03', '0', '963', '1367', 'Körperschaftsteuerrückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1371, 'SKR03', '0', '965', '1309', 'Rückstellungen für Personalkosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1372, 'SKR03', '0', '966', '1309', 'Rückstellungen zur Erfüllung der Aufbewahrungspflichten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1373, 'SKR03', '0', '969', '1309', 'Rückstellung für latente Steuern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1374, 'SKR03', '0', '970', '1309', 'Sonstige Rückstellungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1375, 'SKR03', '0', '971', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung in den ersten drei Monaten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1376, 'SKR03', '0', '972', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung innerhalb des 4. bis 12. Monats'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1377, 'SKR03', '0', '973', '1309', 'Rückstellungen für Abraum- und Abfallbeseitigung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1378, 'SKR03', '0', '974', '1309', 'Rückstellungen für Gewährleistungen ( Gegenkonto 4790 )'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1379, 'SKR03', '0', '976', '1309', 'Rückstellungen für drohende Verluste aus schwebenden Geschäften'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1380, 'SKR03', '0', '977', '1309', 'Rückstellungen für Abschluss- und Prüfungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1381, 'SKR03', '0', '978', '1309', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1382, 'SKR03', '0', '979', '1309', 'Rückstellungen für Umweltschutz'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1385, 'SKR03', '0', '980', '1309', 'Aktive Rechnungsabgrenzung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1387, 'SKR03', '0', '983', '1385', 'Abgrenzung aktive latente Steuern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1388, 'SKR03', '0', '984', '1309', 'Als Aufwand berücksichtigte Zölle und Verbrauchsteuern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1389, 'SKR03', '0', '985', '1309', 'Als Aufwand berücksichtigte Umsatzsteuer auf Anzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1390, 'SKR03', '0', '986', '1309', 'Damnum / Disagio'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1393, 'SKR03', '0', '990', '1309', 'Passive Rechnungsabgrenzung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1395, 'SKR03', '0', '992', '1393', 'Abgenzungsposten zur unterjährigen Kostenverrechnung für BWA'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1396, 'SKR03', '0', '993', '1393', 'Forderungen aus Lieferungen und Leistungen H-Saldo'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1397, 'SKR03', '0', '996', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1398, 'SKR03', '0', '997', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1399, 'SKR03', '0', '998', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1400, 'SKR03', '0', '999', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr'); - +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'SKR03', '0', '0001', '0', 'Aufwendungen für die Ingangsetzung und Erweiterung des Geschäftsbetriebs'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'SKR03', '0', '0002', '0', 'Aufwendungen für die Währungsumstellung auf den Euro'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'SKR03', '0', '0010', '0', 'Konzessionen gewerbliche Schutzrechte und ähnliche Rechte und Werte sowie Lizenzen an solchen Rechten und Werten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'SKR03', '0', '0015', '10', 'Konzessionen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'SKR03', '0', '0020', '10', 'Gewerbliche Schutzrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'SKR03', '0', '0025', '10', 'ähnliche Rechte und Werte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'SKR03', '0', '0027', '10', 'EDV-Software'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'SKR03', '0', '0030', '10', 'Lizenzen an gewerblichen Schutzrechten und ähnlichen Rechten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'SKR03', '0', '0035', '0', 'Geschäfts- oder Firmenwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'SKR03', '0', '0038', '0', 'Anzahlungen auf Geschäfts- oder Firmenwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'SKR03', '0', '0039', '0', 'Anzahlungen auf immaterielle Vermögensgegenstände'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'SKR03', '0', '0040', '0', 'Verschmelzungsmehrwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'SKR03', '0', '0050', '0', 'Grundstücke grundstücksgleiche Rechte und Bauten einschließlich der Bauten auf fremden Grundstücken'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'SKR03', '0', '0059', '50', 'Grundstücksanteil des häuslichen Arbeitszimmers.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'SKR03', '0', '0060', '0', 'Grundstücke und grundstücksgleiche Rechte ohne Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'SKR03', '0', '0065', '60', 'Unbebaute Grundstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'SKR03', '0', '0070', '60', 'Grundstücksgleiche Rechte - (erbbaurecht Daürwohnrecht)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'SKR03', '0', '0075', '60', 'Grundstücke mit Substanzverzehr'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'SKR03', '0', '0079', '60', 'Anzahlungen auf Grundstücke und grundstücksgleiche Rechte ohne Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'SKR03', '0', '0080', '0', 'Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'SKR03', '0', '0085', '80', 'Grundstückswerte eigener bebauter Grundstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'SKR03', '0', '0090', '80', 'Geschäftsbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'SKR03', '0', '0100', '80', 'Fabrikbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'SKR03', '0', '0110', '80', 'Garagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1055, 'SKR03', '0', '0111', '80', 'Außenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1056, 'SKR03', '0', '0112', '80', 'Hof- und Wegebefestigungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1057, 'SKR03', '0', '0113', '80', 'Einrichtung Fabrik- und Geschäftsbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1058, 'SKR03', '0', '0115', '80', 'Andere Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1059, 'SKR03', '0', '0120', '80', 'Geschäfts- Fabrik- und andere Bauten im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1060, 'SKR03', '0', '0129', '80', 'Anzahlungen auf Geshäfts- Fabrik- und andere Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1061, 'SKR03', '0', '0140', '80', 'Wohnbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1062, 'SKR03', '0', '0145', '80', 'Garagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1063, 'SKR03', '0', '0146', '80', 'Aussenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1064, 'SKR03', '0', '0147', '80', 'Hof- und Wegebefestigungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1065, 'SKR03', '0', '0148', '80', 'Einrichtungen für Wohnbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1066, 'SKR03', '0', '0149', '80', 'Gebäudeteil des häuslichen Arbeitszimmers'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1067, 'SKR03', '0', '0150', '80', 'Wohnbauten im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1068, 'SKR03', '0', '0159', '80', 'Anzahlgen auf Wohnbauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1069, 'SKR03', '0', '0160', '0', 'Bauten auf fremden Grundstücken'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1070, 'SKR03', '0', '0165', '160', 'Geschäftsbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1071, 'SKR03', '0', '0170', '160', 'Fabrikbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1072, 'SKR03', '0', '0175', '160', 'Garagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1073, 'SKR03', '0', '0176', '160', 'Aussenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1074, 'SKR03', '0', '0177', '160', 'Hof- und Wegebefestigungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1075, 'SKR03', '0', '0178', '160', 'Einrichtung für Fabrik- und Geschäftsbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1076, 'SKR03', '0', '0179', '160', 'Andere Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1077, 'SKR03', '0', '0180', '160', 'Geschäfts- Fabrik- und andere Bauten im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1078, 'SKR03', '0', '0189', '160', 'Anzahlungen auf Geschäfts- Fabrik- und andere Bauten auf fremden Grundstücken'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1079, 'SKR03', '0', '0190', '160', 'Wohnbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1080, 'SKR03', '0', '0191', '160', 'Garagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1081, 'SKR03', '0', '0192', '160', 'Aussenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1082, 'SKR03', '0', '0193', '160', 'Hof- und Wegebefestigungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1083, 'SKR03', '0', '0194', '160', 'Einrichtungen für Wohnbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1084, 'SKR03', '0', '0195', '160', 'Wohnbauten im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1085, 'SKR03', '0', '0199', '160', 'Anzahlungen a. Wohnbauten auf fremden Grundstücken'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1087, 'SKR03', '0', '0200', '0', 'Technische Anlagen und Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1088, 'SKR03', '0', '0210', '200', 'Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1089, 'SKR03', '0', '0220', '200', 'Maschinengebundene Werkzeuge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1090, 'SKR03', '0', '0240', '200', 'Maschinelle Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1091, 'SKR03', '0', '0260', '200', 'Transportanlagen und ähnliches'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1092, 'SKR03', '0', '0280', '200', 'Betriebsvorrichtungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1093, 'SKR03', '0', '0290', '200', 'Technische Anlagen und Maschinen im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1094, 'SKR03', '0', '0299', '200', 'Anzahlungen auf technische Anlagen und Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1096, 'SKR03', '0', '0300', '0', 'Andere Anlagen Betriebs- und Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1097, 'SKR03', '0', '0310', '300', 'Andere Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1098, 'SKR03', '0', '0320', '300', 'PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1099, 'SKR03', '0', '0350', '300', 'LKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1100, 'SKR03', '0', '0380', '300', 'Sonstige Transportmittel'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1101, 'SKR03', '0', '0400', '300', 'Betriebsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1102, 'SKR03', '0', '0410', '300', 'Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1103, 'SKR03', '0', '0420', '300', 'Büroeinrichtung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1104, 'SKR03', '0', '0430', '300', 'Ladeneinrichtung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1105, 'SKR03', '0', '0440', '300', 'Werkzeuge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1106, 'SKR03', '0', '0450', '300', 'Einbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1107, 'SKR03', '0', '0460', '300', 'Gerüst- und Schalungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1108, 'SKR03', '0', '0480', '300', 'Geringwertige Wirtschaftsgüter bis 410 Euro'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1109, 'SKR03', '0', '0490', '300', 'Sonstige Betriebs- und Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1110, 'SKR03', '0', '0498', '300', 'Andere Anlagen Betriebs- und Geschäftsausstattung im Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1111, 'SKR03', '0', '0499', '300', 'Anzahlungen auf andere Anlagen Betriebs- und Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1114, 'SKR03', '0', '0500', '0', 'Anteile an verbundenen Unternehmen (Anlagevermögen)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1115, 'SKR03', '0', '0504', '500', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1117, 'SKR03', '0', '0505', '500', 'Ausleihungen an verbundene Unternehmen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1119, 'SKR03', '0', '0510', '500', 'Beteiligungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1120, 'SKR03', '0', '0513', '510', 'Typisch stille Beteiligungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1121, 'SKR03', '0', '0516', '510', 'Atypisch stille Beteiligungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1122, 'SKR03', '0', '0517', '510', 'Andere Beteiligungen an Kapitalgesellschaften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1123, 'SKR03', '0', '0518', '510', 'Andere Beteiligungen an Personengesellschaften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1124, 'SKR03', '0', '0519', '510', 'Beteiligung einer GmbH&Co.KG an einer Komplementär GmbH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1126, 'SKR03', '0', '0520', '0', 'Ausleihungen an Unternehmen mit denen ein Beteiligungsverhältnis besteht'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1128, 'SKR03', '0', '0525', '520', 'Wertpapiere des Anlagevermögens'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1129, 'SKR03', '0', '0530', '525', 'Wertpapiere mit Gewinnbeteiligungsansprüchen die dem Halbeinkünfteverfahren unterliegen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1130, 'SKR03', '0', '0535', '525', 'Festverzinsliche Wertpapiere'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1132, 'SKR03', '0', '0540', '0', 'Sonstige Ausleihungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1133, 'SKR03', '0', '0550', '540', 'Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1135, 'SKR03', '0', '0570', '0', 'Genossenschaftsanteile zum langfristigen Verbleib'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1136, 'SKR03', '0', '0580', '570', 'Ausleihungen an Gesellschafter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1137, 'SKR03', '0', '0590', '570', 'Ausleihungen an nahe stehende Personen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1139, 'SKR03', '0', '0595', '0', 'Rückdeckungsansprüche aus Lebensversicherungen zum langfristigen Verbleib'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1142, 'SKR03', '0', '0600', '0', 'Anleihen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1143, 'SKR03', '0', '0601', '600', 'Anleihen nicht konvertibel (bis 1 Jahr)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1144, 'SKR03', '0', '0605', '600', 'Anleihen nicht konvertibel (1-5 Jahre)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1145, 'SKR03', '0', '0610', '600', 'Anleihen nicht konvertibel (größer 5 Jahre)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1146, 'SKR03', '0', '0615', '600', 'Anleihen konvertibel'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1147, 'SKR03', '0', '0616', '600', 'Anleihen konvertibel(bis 1 Jahr)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1148, 'SKR03', '0', '0620', '600', 'Anleihen konvertibel(1-5 Jahre)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1149, 'SKR03', '0', '0625', '600', 'Anleihen konvertibel(größer 5 Jahre)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1151, 'SKR03', '0', '0630', '0', 'Verbindlichkeiten gegenüber Kreditinstituten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1152, 'SKR03', '0', '0631', '630', 'Verbindlichkeiten gegenüber Kreditinstitut ( bis 1Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1153, 'SKR03', '0', '0640', '630', 'Verbindlichkeiten gegenüber Kreditinstitut (1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1154, 'SKR03', '0', '0650', '630', 'Verbindlichkeiten gegenüber Kreditinstitut (größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1155, 'SKR03', '0', '0660', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1156, 'SKR03', '0', '0661', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen ( bis 1Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1157, 'SKR03', '0', '0670', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen (1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1158, 'SKR03', '0', '0680', '630', 'Verbindlichkeit. gegenüber Kreditinstituten aus Teilzahlungsverträgen (größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1159, 'SKR03', '0', '0690', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1160, 'SKR03', '0', '0691', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1161, 'SKR03', '0', '0692', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1162, 'SKR03', '0', '0693', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1163, 'SKR03', '0', '0694', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1164, 'SKR03', '0', '0695', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1165, 'SKR03', '0', '0696', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1166, 'SKR03', '0', '0697', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1167, 'SKR03', '0', '0698', '630', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1169, 'SKR03', '0', '0699', '600', 'Gegenkonto 0630-0689 bei Aufteilung der Konten 0690-0698'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1171, 'SKR03', '0', '0700', '600', 'Verbindlichkeiten gegenüber verbundenen Unternehmen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1172, 'SKR03', '0', '0701', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( bis 1 Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1173, 'SKR03', '0', '0705', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1174, 'SKR03', '0', '0710', '700', 'Verbindlichkeiten gegenüber verbundenen Unternehmen ( größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1176, 'SKR03', '0', '0715', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1177, 'SKR03', '0', '0716', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( bis 1 Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1178, 'SKR03', '0', '0720', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1179, 'SKR03', '0', '0725', '600', 'Verbindlichkeit. gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( größer 5 Jahre)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1181, 'SKR03', '0', '0730', '600', 'Verbindlichkeit gegenüber Gesellschaftern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1182, 'SKR03', '0', '0731', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( bis 1 Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1183, 'SKR03', '0', '0740', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1184, 'SKR03', '0', '0750', '730', 'Verbindlichkeit gegenüber Gesellschaftern ( größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1185, 'SKR03', '0', '0755', '730', 'Verbindlichkeit gegenüber Gesellschaftern für offene Ausschüttungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1186, 'SKR03', '0', '0760', '730', 'Darlehen typisch stiller Gesellschafter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1187, 'SKR03', '0', '0761', '730', 'Darlehen typisch stiller Gesellschafter ( bis 1 Jahr)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1188, 'SKR03', '0', '0764', '730', 'Darlehen typisch stiller Gesellschafter ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1189, 'SKR03', '0', '0767', '730', 'Darlehen typisch stiller Gesellschafter ( größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1190, 'SKR03', '0', '0770', '730', 'Darlehen atypisch stiller Gesellschafter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1191, 'SKR03', '0', '0771', '730', 'Darlehen atypisch stiller Gesellschafter ( bis 1 Jahr)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1192, 'SKR03', '0', '0774', '730', 'Darlehen atypisch stiller Gesellschafter ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1193, 'SKR03', '0', '0777', '730', 'Darlehen atypisch stiller Gesellschafter ( größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1194, 'SKR03', '0', '0780', '730', 'Partiarische Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1195, 'SKR03', '0', '0781', '730', 'Partiarische Darlehen ( bis 1 Jahr )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1196, 'SKR03', '0', '0784', '730', 'Partiarische Darlehen ( 1 bis 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1197, 'SKR03', '0', '0787', '730', 'Partiarische Darlehen ( größer 5 Jahre )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1198, 'SKR03', '0', '0790', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1199, 'SKR03', '0', '0791', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1200, 'SKR03', '0', '0792', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1201, 'SKR03', '0', '0793', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1202, 'SKR03', '0', '0794', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1203, 'SKR03', '0', '0795', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1204, 'SKR03', '0', '0796', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1205, 'SKR03', '0', '0797', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1206, 'SKR03', '0', '0798', '730', '(frei in Bilanz kein Restlaufzeitvermerk)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1207, 'SKR03', '0', '0799', '730', 'Gegenkonto 0730 - 0789 bei Aufteilung der Konten 0790 - 0798'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1210, 'SKR03', '0', '0800', '0', 'Gezeichnetes Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1212, 'SKR03', '0', '0801', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1213, 'SKR03', '0', '0802', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1214, 'SKR03', '0', '0803', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1215, 'SKR03', '0', '0804', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1216, 'SKR03', '0', '0805', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1217, 'SKR03', '0', '0806', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1218, 'SKR03', '0', '0807', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1219, 'SKR03', '0', '0808', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1220, 'SKR03', '0', '0809', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1221, 'SKR03', '0', '0810', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1222, 'SKR03', '0', '0811', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1223, 'SKR03', '0', '0812', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1224, 'SKR03', '0', '0813', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1225, 'SKR03', '0', '0814', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1226, 'SKR03', '0', '0815', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1227, 'SKR03', '0', '0816', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1228, 'SKR03', '0', '0817', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1229, 'SKR03', '0', '0818', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1230, 'SKR03', '0', '0819', '801', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert (Aktivausweis)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1232, 'SKR03', '0', '0820', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1233, 'SKR03', '0', '0821', '800', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1234, 'SKR03', '0', '0822', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1235, 'SKR03', '0', '0823', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1236, 'SKR03', '0', '0824', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1237, 'SKR03', '0', '0825', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1238, 'SKR03', '0', '0826', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1239, 'SKR03', '0', '0827', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1240, 'SKR03', '0', '0828', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1241, 'SKR03', '0', '0829', '820', 'Ausstehende Einlagen auf das gezeichnete Kapital nicht eingefordert (Passivausweis von gezeichnetem Kapital offen abgesetzt eingeforderte ausstehende Einlagen s. Konten 0830 - 0838 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1243, 'SKR03', '0', '0830', '800', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1244, 'SKR03', '0', '0831', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1245, 'SKR03', '0', '0832', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1246, 'SKR03', '0', '0833', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1247, 'SKR03', '0', '0834', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1248, 'SKR03', '0', '0835', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1249, 'SKR03', '0', '0836', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1250, 'SKR03', '0', '0837', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1251, 'SKR03', '0', '0838', '830', 'Ausstehende Einlagen auf das gezeichnete Kapital eingefordert ( Forderungen nicht eingeforderte ausstehende Einlagen s. Konten 0820 - 0829 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1253, 'SKR03', '0', '0839', '830', 'Eingeforderte Nachschüsse ( Forderungen Gegenkonto 0845 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1256, 'SKR03', '0', '0840', '0', 'Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1257, 'SKR03', '0', '0841', '840', 'Kapitalrücklage durch Ausgabe von Anteilen über Nennbetrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1258, 'SKR03', '0', '0842', '840', 'Kapitalrücklage durch Ausgabe von Schuldverschreibungen für Wandlungsrechte und Optionsrechte zum Erwerb von Anteilen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1259, 'SKR03', '0', '0843', '840', 'Kapitalrücklage durch Zuzahlungen gegen Gewährung eines Vorzugs für Anteile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1260, 'SKR03', '0', '0844', '840', 'Kapitalrücklage durch andere Zuzahlungen in das Eigenkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1261, 'SKR03', '0', '0845', '840', 'Eingefordertes Nachschusskapital ( Gegenkonto 0839 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1264, 'SKR03', '0', '0846', '840', 'Gesetzliche Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1266, 'SKR03', '0', '0850', '840', 'Rücklage für eigene Anteile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1268, 'SKR03', '0', '0851', '840', 'Satzungsmässige Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1270, 'SKR03', '0', '0855', '840', 'Andere Gewinnrücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1271, 'SKR03', '0', '0856', '840', 'Eigenkapitalanteil von Wertaufholungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1273, 'SKR03', '0', '0860', '0', 'Gewinnvortrag vor Verwendung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1274, 'SKR03', '0', '0868', '860', 'Verlustvortrag vor Verwendung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1276, 'SKR03', '0', '0869', '860', 'Vortrag auf neue Rechnung (Bilanz)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1278, 'SKR03', '0', '0870', '0', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1279, 'SKR03', '0', '0871', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1280, 'SKR03', '0', '0872', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1281, 'SKR03', '0', '0873', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1282, 'SKR03', '0', '0874', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1283, 'SKR03', '0', '0875', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1284, 'SKR03', '0', '0876', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1285, 'SKR03', '0', '0877', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1286, 'SKR03', '0', '0878', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1287, 'SKR03', '0', '0879', '870', 'Festkapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1288, 'SKR03', '0', '0880', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1289, 'SKR03', '0', '0881', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1290, 'SKR03', '0', '0882', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1291, 'SKR03', '0', '0883', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1292, 'SKR03', '0', '0884', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1293, 'SKR03', '0', '0885', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1294, 'SKR03', '0', '0886', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1295, 'SKR03', '0', '0887', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1296, 'SKR03', '0', '0888', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1297, 'SKR03', '0', '0889', '870', 'Variables Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1298, 'SKR03', '0', '0890', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1299, 'SKR03', '0', '0891', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1300, 'SKR03', '0', '0892', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1301, 'SKR03', '0', '0893', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1302, 'SKR03', '0', '0894', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1303, 'SKR03', '0', '0895', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1304, 'SKR03', '0', '0896', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1305, 'SKR03', '0', '0897', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1306, 'SKR03', '0', '0898', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1307, 'SKR03', '0', '0899', '870', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1309, 'SKR03', '0', '0900', '0', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1310, 'SKR03', '0', '0901', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1311, 'SKR03', '0', '0902', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1312, 'SKR03', '0', '0903', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1313, 'SKR03', '0', '0904', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1314, 'SKR03', '0', '0905', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1315, 'SKR03', '0', '0906', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1316, 'SKR03', '0', '0907', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1317, 'SKR03', '0', '0908', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1318, 'SKR03', '0', '0909', '1309', 'Kommandit-Kapital'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1319, 'SKR03', '0', '0910', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1320, 'SKR03', '0', '0911', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1321, 'SKR03', '0', '0912', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1322, 'SKR03', '0', '0913', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1323, 'SKR03', '0', '0914', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1324, 'SKR03', '0', '0915', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1325, 'SKR03', '0', '0916', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1326, 'SKR03', '0', '0917', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1327, 'SKR03', '0', '0918', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1328, 'SKR03', '0', '0919', '1309', 'Verlustausgleichskonto'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1329, 'SKR03', '0', '0920', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1330, 'SKR03', '0', '0921', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1331, 'SKR03', '0', '0922', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1332, 'SKR03', '0', '0923', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1333, 'SKR03', '0', '0924', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1334, 'SKR03', '0', '0925', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1335, 'SKR03', '0', '0926', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1336, 'SKR03', '0', '0927', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1337, 'SKR03', '0', '0928', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1338, 'SKR03', '0', '0929', '1309', 'Gesellschafter-Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1341, 'SKR03', '0', '0930', '1309', 'Sonderposten mit Rücklageanteil steuerfreie Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1342, 'SKR03', '0', '0931', '1341', 'Sonderposten mit Rücklageanteil nach § 6b EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1343, 'SKR03', '0', '0932', '1341', 'Sonderposten mit Rücklageanteil nach Abschnitt 35 EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1344, 'SKR03', '0', '0933', '1341', 'Sonderposten mit Rücklageanteil nach § 6d EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1345, 'SKR03', '0', '0934', '1341', 'Sonderposten mit Rücklageanteil nach § 1 EntwLStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1347, 'SKR03', '0', '0935', '1309', 'Sonderposten aus der Währungsumstellung auf den Euro'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1348, 'SKR03', '0', '0936', '1341', 'Sonderposten mit Rücklageanteil nach § 7 d EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1349, 'SKR03', '0', '0937', '1341', 'Sonderposten mit Rücklageanteil nach § 79 EStDV'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1350, 'SKR03', '0', '0938', '1341', 'Sonderposten mit Rücklageanteil nach § 80 EStDV'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1351, 'SKR03', '0', '0939', '1341', 'Sonderposten mit Rücklageanteil nach § 52 Abs.16 EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1352, 'SKR03', '0', '0940', '1341', 'Sonderposten mit Rücklageanteil Sonderabschreibungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1353, 'SKR03', '0', '0941', '1341', 'Sonderposten mit Rücklageanteil § 82 a EStDV'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1354, 'SKR03', '0', '0942', '1341', 'Sonderposten mit Rücklageanteil § 82 d EStDV'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1355, 'SKR03', '0', '0943', '1341', 'Sonderposten mit Rücklageanteil nach § 82 e EStDV'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1356, 'SKR03', '0', '0944', '1341', 'Sonderposten mit Rücklageanteil nach § 14 BerlinFG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1357, 'SKR03', '0', '0945', '1341', 'Sonderposten mit Rücklageanteil für Förderung nach § 3 Zonen-RFG/§ 4-6 FördergebietsG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1358, 'SKR03', '0', '0946', '1341', 'Sonderposten mit Rücklageanteil nach § 4d EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1359, 'SKR03', '0', '0947', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.1 EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1360, 'SKR03', '0', '0948', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.3 u.7 EStG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1362, 'SKR03', '0', '0949', '1309', 'Sonderposten für Zuschüsse und Zulagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1365, 'SKR03', '0', '0950', '1309', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1367, 'SKR03', '0', '0955', '1309', 'Steuerrückstellungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1368, 'SKR03', '0', '0957', '1367', 'Gewerbesteuerrückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1369, 'SKR03', '0', '0963', '1367', 'Körperschaftsteuerrückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1371, 'SKR03', '0', '0965', '1309', 'Rückstellungen für Personalkosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1372, 'SKR03', '0', '0966', '1309', 'Rückstellungen zur Erfüllung der Aufbewahrungspflichten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1373, 'SKR03', '0', '0969', '1309', 'Rückstellung für latente Steuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1374, 'SKR03', '0', '0970', '1309', 'Sonstige Rückstellungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1375, 'SKR03', '0', '0971', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung in den ersten drei Monaten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1376, 'SKR03', '0', '0972', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung innerhalb des 4. bis 12. Monats'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1377, 'SKR03', '0', '0973', '1309', 'Rückstellungen für Abraum- und Abfallbeseitigung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1378, 'SKR03', '0', '0974', '1309', 'Rückstellungen für Gewährleistungen ( Gegenkonto 4790 )'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1379, 'SKR03', '0', '0976', '1309', 'Rückstellungen für drohende Verluste aus schwebenden Geschäften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1380, 'SKR03', '0', '0977', '1309', 'Rückstellungen für Abschluss- und Prüfungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1381, 'SKR03', '0', '0978', '1309', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1382, 'SKR03', '0', '0979', '1309', 'Rückstellungen für Umweltschutz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1385, 'SKR03', '0', '0980', '1309', 'Aktive Rechnungsabgrenzung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1387, 'SKR03', '0', '0983', '1385', 'Abgrenzung aktive latente Steuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1388, 'SKR03', '0', '0984', '1309', 'Als Aufwand berücksichtigte Zölle und Verbrauchsteuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1389, 'SKR03', '0', '0985', '1309', 'Als Aufwand berücksichtigte Umsatzsteuer auf Anzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1390, 'SKR03', '0', '0986', '1309', 'Damnum / Disagio'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1393, 'SKR03', '0', '0990', '1309', 'Passive Rechnungsabgrenzung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1395, 'SKR03', '0', '0992', '1393', 'Abgenzungsposten zur unterjährigen Kostenverrechnung für BWA'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1396, 'SKR03', '0', '0993', '1393', 'Forderungen aus Lieferungen und Leistungen H-Saldo'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1397, 'SKR03', '0', '0996', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1398, 'SKR03', '0', '0997', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1399, 'SKR03', '0', '0998', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1400, 'SKR03', '0', '0999', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1403, 'SKR03', '1', '1000', '0', 'Kasse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1404, 'SKR03', '1', '1010', '1403', 'Nebenkasse 1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1405, 'SKR03', '1', '1020', '1403', 'Nebenkasse 2'); @@ -385,7 +384,6 @@ 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) VALUES (__ENTITY__, 1447, 'SKR03', '1', '1340', '1425', 'Anteile an verbundenen Unternehmen (Umlaufvermögen)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1448, 'SKR03', '1', '1344', '1425', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1450, 'SKR03', '1', '1345', '1425', 'Eigene Anteile'); --- TODO Fix value for account_parent INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1456, 'SKR03', '1', '1350', '0', 'GmbH-Anteile zum kurzfristigen Verbleib'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1457, 'SKR03', '1', '1352', '0', 'Genossenschaftsanteile zum kurzfristigen Verbleib'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1458, 'SKR03', '1', '1355', '0', 'Ansprüche aus Rückdeckungsversicherung'); @@ -532,7 +530,6 @@ 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) VALUES (__ENTITY__, 1608, 'SKR03', '1', '1590', '0', 'Durchlaufende Posten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1609, 'SKR03', '1', '1591', '0', 'Durchlaufende Posten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1610, 'SKR03', '1', '1592', '0', 'Fremdgeld'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1612, 'SKR03', '1', '1593', '0', 'Verrechnungskonto erhaltene Anzahlungen bei Buchung über Debitorenkonto'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1613, 'SKR03', '1', '1594', '0', 'Forderungen gegen verbundene Unternehmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1614, 'SKR03', '1', '1595', '0', 'Forderungen gegen verbundene Unternehmen ( bis 1 Jahr )'); @@ -540,7 +537,6 @@ 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) VALUES (__ENTITY__, 1616, 'SKR03', '1', '1597', '0', 'Forderungen gegen Unternehmen mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1617, 'SKR03', '1', '1598', '0', 'Forderungen gegen Unternehmen mit denen ein Beteiligungsverhältnis besteht ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1618, 'SKR03', '1', '1599', '0', 'Forderungen gegen Unternehmen mit denen ein Beteiligungsverhältnis besteht ( größer 1 Jahr )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1621, 'SKR03', '1', '1600', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1622, 'SKR03', '1', '1601', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1623, 'SKR03', '1', '1602', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen'); @@ -567,12 +563,10 @@ 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) VALUES (__ENTITY__, 1644, 'SKR03', '1', '1625', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1645, 'SKR03', '1', '1626', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1646, 'SKR03', '1', '1628', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1648, 'SKR03', '1', '1630', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber verbundenen Unternehmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1649, 'SKR03', '1', '1631', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber verbundenen Unternehmen ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1650, 'SKR03', '1', '1635', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber verbundenen Unternehmen ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1651, 'SKR03', '1', '1638', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber verbundenen Unternehmen ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1653, 'SKR03', '1', '1640', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1654, 'SKR03', '1', '1641', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1655, 'SKR03', '1', '1645', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Unternehmen mit denen ein Beteiligungsverhältnis besteht ( 1 bis 5 Jahre )'); @@ -581,14 +575,11 @@ 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) VALUES (__ENTITY__, 1658, 'SKR03', '1', '1651', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Gesellschaftern ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1659, 'SKR03', '1', '1655', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Gesellschaftern ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1660, 'SKR03', '1', '1658', '0', 'Verbindlichkeiten aus Lieferungen und Leistungen gegenüber Gesellschaftern ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1662, 'SKR03', '1', '1659', '0', 'Gegenkonto 1625 - 1658 bei Aufteilung Kreditorenkonto'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1664, 'SKR03', '1', '1660', '0', 'Schuldwechsel'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1665, 'SKR03', '1', '1661', '0', 'Schuldwechsel ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1666, 'SKR03', '1', '1680', '0', 'Schuldwechsel ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1667, 'SKR03', '1', '1690', '0', 'Schuldwechsel ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1669, 'SKR03', '1', '1700', '0', 'Sonstige Verbindlichkeiten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1670, 'SKR03', '1', '1701', '0', 'Sonstige Verbindlichkeiten ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1671, 'SKR03', '1', '1702', '0', 'Sonstige Verbindlichkeiten ( 1 bis 5 Jahre )'); @@ -598,9 +589,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) VALUES (__ENTITY__, 1675, 'SKR03', '1', '1706', '0', 'Darlehen ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1676, 'SKR03', '1', '1707', '0', 'Darlehen ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1677, 'SKR03', '1', '1708', '0', 'Darlehen ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1679, 'SKR03', '1', '1709', '0', 'Gewinnverfügungskonto stiller Gesellschafter'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1681, 'SKR03', '1', '1710', '0', 'Erhaltene Anzahlungen ( Verbindlichkeiten )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1682, 'SKR03', '1', '1711', '0', 'Erhaltene versteuerte Anzahlungen 7% USt ( Verbindlichkeiten )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1683, 'SKR03', '1', '1716', '0', 'Erhaltene versteuerte Anzahlungen 15% USt ( Verbindlichkeiten )'); @@ -609,7 +598,6 @@ 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) VALUES (__ENTITY__, 1686, 'SKR03', '1', '1719', '0', 'Erhaltene Anzahlungen ( bis 1 Jahr )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1687, 'SKR03', '1', '1720', '0', 'Erhaltene Anzahlungen ( 1 bis 5 Jahre )'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1688, 'SKR03', '1', '1721', '0', 'Erhaltene Anzahlungen ( größer 5 Jahre )'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1690, 'SKR03', '1', '1722', '0', 'Erhaltene Anzahlungen (von Vorräten offen abgesetzt)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1691, 'SKR03', '1', '1730', '0', 'Kreditkartenabrechnung'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1692, 'SKR03', '1', '1731', '0', 'Agenturwarenabrechnung'); @@ -639,7 +627,6 @@ 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) VALUES (__ENTITY__, 1716, 'SKR03', '1', '1755', '0', 'Lohn- und Gehaltsverrechnungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1717, 'SKR03', '1', '1756', '0', 'Lohn- und Gehaltsverrechnung § 11 Abs. 2 EStG für § 4/3 EStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1718, 'SKR03', '1', '1759', '0', 'Voraussichtliche Beitragsschuld gegenüber den sozialversicherungsträgern'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1720, 'SKR03', '1', '1760', '0', 'Umsatzsteuer nicht fällig'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1721, 'SKR03', '1', '1761', '0', 'Umsatzsteuer nicht fällig 7%'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1722, 'SKR03', '1', '1762', '0', 'Umsatzsteuer nicht fällig aus im Inland steuerpflichtigen EG-Lieferant'); @@ -673,10 +660,8 @@ 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) VALUES (__ENTITY__, 1750, 'SKR03', '1', '1790', '0', 'Umsatzsteuer Vorjahr'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1751, 'SKR03', '1', '1791', '0', 'Umsatzsteuer frühere Jahre'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1752, 'SKR03', '1', '1792', '0', 'Sonstige Verrechnungskonten (Interimskonten)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1754, 'SKR03', '1', '1793', '0', 'Verrechnungskonto geleistete Anzahlungen bei Buchung über Kreditkonto'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1755, 'SKR03', '1', '1795', '0', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit (für § 4/3 EStG)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1757, 'SKR03', '1', '1800', '0', 'Privatentnahmen allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1758, 'SKR03', '1', '1801', '0', 'Privatentnahmen allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1759, 'SKR03', '1', '1802', '0', 'Privatentnahmen allgemein'); @@ -777,7 +762,6 @@ 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) VALUES (__ENTITY__, 1854, 'SKR03', '1', '1897', '0', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1855, 'SKR03', '1', '1898', '0', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1856, 'SKR03', '1', '1899', '0', 'Privateinlagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1859, 'SKR03', '1', '1900', '0', 'Privatentnahmen allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1860, 'SKR03', '1', '1901', '0', 'Privatentnahmen allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1861, 'SKR03', '1', '1902', '0', 'Privatentnahmen allgemein'); @@ -878,14 +862,11 @@ 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) VALUES (__ENTITY__, 1956, 'SKR03', '1', '1997', '0', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1957, 'SKR03', '1', '1998', '0', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1958, 'SKR03', '1', '1999', '0', 'Privateinlagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1961, 'SKR03', '2', '2000', '0', 'Außerordentliche Aufwendungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1962, 'SKR03', '2', '2001', '0', 'Außerordentliche Aufwendungen finanzwirksam'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1963, 'SKR03', '2', '2005', '0', 'Außerordentliche Aufwendungen nicht finanzwirksam'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1966, 'SKR03', '2', '2010', '0', 'Betriebsfremde Aufwendungen (soweit nicht außerordentlich)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1967, 'SKR03', '2', '2020', '0', 'Periodenfremde Aufwendungen (soweit nicht außerordentlich)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1970, 'SKR03', '2', '2100', '0', 'Zinsen und ähnliche Aufwendungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1971, 'SKR03', '2', '2103', '0', 'Steuerlich abzugsfähige andere Nebenleistungen zu steuern'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1972, 'SKR03', '2', '2104', '0', 'Steuerlich nicht abzugsfähige andere Nebenleistungen zu Steuern'); @@ -908,15 +889,12 @@ 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) VALUES (__ENTITY__, 1989, 'SKR03', '2', '2139', '0', 'Diskontaufwendungen an verbundene Unternehmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1990, 'SKR03', '2', '2140', '0', 'Zinsähnliche Aufwendungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1991, 'SKR03', '2', '2149', '0', 'Zinsähnliche Aufwendungen an verbundene Unternehmen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1993, 'SKR03', '2', '2150', '0', 'Aufwendungen aus Kursdifferenzen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1994, 'SKR03', '2', '2166', '0', 'Aufwendungen Bewertung Finanzmittelfonds'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1995, 'SKR03', '2', '2170', '0', 'Nicht abziehbare Vorsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1996, 'SKR03', '2', '2171', '0', 'Nicht abziehbare Vorsteuer 7%'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1997, 'SKR03', '2', '2175', '0', 'Nicht abziehbare Vorsteuer 16%'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1998, 'SKR03', '2', '2176', '0', 'Nicht abziehbare Vorsteuer 19%'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2001, 'SKR03', '2', '2200', '0', 'Körperschaftsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2002, 'SKR03', '2', '2203', '0', 'Körperschaftsteuer für Vorjahre'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2003, 'SKR03', '2', '2204', '0', 'Körperschaftsteuererstattungen für Vorjahre'); @@ -933,11 +911,9 @@ 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) VALUES (__ENTITY__, 2014, 'SKR03', '2', '2280', '0', 'Steuernachzahlungen Vorjahre für Steuern vom Einkommen und Ertrag'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2015, 'SKR03', '2', '2282', '0', 'Steuererstattungen Vorjahre für Steuern vom Einkommen und Ertrag'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2016, 'SKR03', '2', '2284', '0', 'Erträge aus der Auflösung von Rückstellungen für Steuern vom Einkommen und Ertrag'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2018, 'SKR03', '2', '2285', '0', 'Steuernachzahlungen Vorjahre für sonstige Steuern'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2019, 'SKR03', '2', '2287', '0', 'Steuererstattungen Vorjahre für sonstige Steuern'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2020, 'SKR03', '2', '2289', '0', 'Erträge aus der Auflösung von Rückstellungen für sonstige Steuern'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2023, 'SKR03', '2', '2300', '0', 'Sonstige Aufwendungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2024, 'SKR03', '2', '2307', '0', 'Sonstige Aufwendungen betriebsfremde und regelmäßig'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2025, 'SKR03', '2', '2309', '0', 'Sonstige Aufwendungen unregelmässig'); @@ -945,7 +921,6 @@ 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) VALUES (__ENTITY__, 2027, 'SKR03', '2', '2311', '0', 'Anlagenabgänge immaterielle Vermögensgegenstände (Restbuchwert bei Buchverlust)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2028, 'SKR03', '2', '2312', '0', 'Anlagenabgänge Finanzanlagen (Restbuchwert bei Buchverlust)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2029, 'SKR03', '2', '2313', '0', 'Anlagenabgänge Finanzanlagen 100% / 50% nicht abzugsfähig (inländische Kap. Ges.) (Restbuchwert bei Buchverlust)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2031, 'SKR03', '2', '2315', '0', 'Anlagenabgänge Sachanlagen (Restbuchwert bei Buchgewinn)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2032, 'SKR03', '2', '2316', '0', 'Anlagenabgänge immaterielle Vermögensgegenstände (Restbuchwert bei Buchgewinn)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2033, 'SKR03', '2', '2317', '0', 'Anlagenabgänge Finanzanlagen (Restbuchwert bei Buchgewinn)'); @@ -964,7 +939,6 @@ 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) VALUES (__ENTITY__, 2046, 'SKR03', '2', '2348', '0', 'Aufwendungen aus der Zuschreibung von steuerlich niedriger bewerteten Verbindlichkeiten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2047, 'SKR03', '2', '2349', '0', 'Aufwendungen aus der Zuschreibung von steuerlich niedriger bewerteten Rückstellungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2048, 'SKR03', '2', '2350', '0', 'Grundstücksaufwendungen neutral'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2050, 'SKR03', '2', '2375', '0', 'Grundsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2051, 'SKR03', '2', '2380', '0', 'Zuwendungen Spenden steuerlich nicht abziehbar'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2052, 'SKR03', '2', '2381', '0', 'Zuwendungen Spenden für wissenschaftliche und kulturelle Zwecke'); @@ -987,28 +961,18 @@ 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) VALUES (__ENTITY__, 2069, 'SKR03', '2', '2407', '0', 'Forderungsverluste 15% USt (übliche Höhe)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2070, 'SKR03', '2', '2408', '0', 'Forderungsverluste aus im Inland steuerpflichtigen EG-Lieferungen 19% USt (übliche Höhe)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2071, 'SKR03', '2', '2409', '0', 'Forderungsverluste aus im Inland steuerpflichtigen EG-Lieferungen 15% USt (übliche Höhe)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2073, 'SKR03', '2', '2430', '0', 'Forderungsverluste unüblich hoch'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2074, 'SKR03', '2', '2450', '0', 'Einstellung in die Pauschalwertberichtigung zu Forderungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2075, 'SKR03', '2', '2451', '0', 'Einstellung in die Einzelwertberichtigung zu Forderungen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2077, 'SKR03', '2', '2490', '0', 'Aufwendungen aus Verlustübernahme'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2079, 'SKR03', '2', '2492', '0', 'Abgeführte Gewinne auf Grund einer Gewinngemeinschaft'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2080, 'SKR03', '2', '2493', '0', 'Abgeführte Gewinnanteile an stille Gesellschafter § 8 GewStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2081, 'SKR03', '2', '2494', '0', 'Abgeführte Gewinne auf Grund eines Gewinn- oder Teilgewinnabführungsvetrags'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2083, 'SKR03', '2', '2495', '0', 'Einstellungen in die Kapitalrücklage nach den Vorschriften über die vereinfachte Kapitalherabsetzung'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2085, 'SKR03', '2', '2496', '0', 'Einstellung in die gesetzliche Rücklage'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2087, 'SKR03', '2', '2497', '0', 'Einstellungen in satzungsmäßige Rücklagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2089, 'SKR03', '2', '2498', '0', 'Einstellung in die Rücklage für eigene Anteile'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2091, 'SKR03', '2', '2499', '0', 'Einstellung in andere Gewinnrücklagen'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2094, 'SKR03', '2', '2500', '0', 'Außerordentliche Erträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2095, 'SKR03', '2', '2501', '0', 'Außerordentliche Erträge finanzwirksam'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2096, 'SKR03', '2', '2505', '0', 'Außerordentliche Erträge nicht finanzwirksam'); @@ -1020,19 +984,16 @@ 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) VALUES (__ENTITY__, 2106, 'SKR03', '2', '2617', '0', 'Gewinne aus Anteilen an nicht steuerbefreiten inländischen Kapitalgesellschaften § 9 Nr. 2a GewStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2107, 'SKR03', '2', '2618', '0', 'Gewinnanteile aus Mitunternehmerschaften § 9 GewStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2108, 'SKR03', '2', '2619', '0', 'Erträge aus Beteiligungen an verbundenen Unternehmen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2110, 'SKR03', '2', '2620', '0', 'Erträge aus anderen Wertpapieren und Ausleihungen des Finanzanlagevermögen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2111, 'SKR03', '2', '2625', '0', 'laufende Erträge aus Anteilen an Kapitalgesellschaften (Finanzanlagevermögen) 100% / 50% steuerfrei (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2112, 'SKR03', '2', '2626', '0', 'Laufende Erträge aus Anteilen an Kapitalgesellschaften (verbundene Unternehmen) 100% / 50% steuerfrei (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2113, 'SKR03', '2', '2649', '0', 'Erträge aus anderen Wertpapieren und Ausleihungen des Finanzanlagevermögen aus verbundenen Unternehmen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2115, 'SKR03', '2', '2650', '0', 'Sonstige Zinsen und ähnliche Erträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2116, 'SKR03', '2', '2655', '0', 'laufende Erträge aus Anteilen an Kapitalgesellschaften (Umlaufvermögen) 100% / 50% steuerfrei (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2117, 'SKR03', '2', '2656', '0', 'laufende Erträge aus Anteilen an Kapitalgesellschaften (verbundene Unternehmen) 100% / 50% steuerfrei (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2118, 'SKR03', '2', '2657', '0', 'Zinserträge § 233a AO'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2119, 'SKR03', '2', '2658', '0', 'Zinserträge § 233a AO Sonderfall Anlage A KSt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2120, 'SKR03', '2', '2659', '0', 'Sonstige Zinsen und ähnliche Erträge aus verbundenen Unternehmen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2122, 'SKR03', '2', '2660', '0', 'Erträge aus Kursdifferenzen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2123, 'SKR03', '2', '2661', '0', 'Nicht realisierbare Währungsdifferenzen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2124, 'SKR03', '2', '2662', '0', 'Realisierte Währungsdifferenzen'); @@ -1043,7 +1004,6 @@ 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) VALUES (__ENTITY__, 2129, 'SKR03', '2', '2667', '0', 'Bank Währungsverlust (Konto)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2130, 'SKR03', '2', '2668', '0', 'Währungsdifferenz zum Kontenausgleich'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2131, 'SKR03', '2', '2669', '0', 'Nicht realisierbare Währungsdifferenzen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2133, 'SKR03', '2', '2670', '0', 'Diskonterträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2134, 'SKR03', '2', '2671', '0', 'Bank Bewertungsertrag'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2135, 'SKR03', '2', '2672', '0', 'Rundungsdifferenzen'); @@ -1051,7 +1011,6 @@ 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) VALUES (__ENTITY__, 2137, 'SKR03', '2', '2679', '0', 'Diskonterträge verbundene Unternehmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2138, 'SKR03', '2', '2680', '0', 'Zinsähnliche Erträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2139, 'SKR03', '2', '2689', '0', 'Zinsähnliche Erträge aus verbundenen Unternehmen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2142, 'SKR03', '2', '2700', '0', 'Sonstige Erträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2143, 'SKR03', '2', '2705', '0', 'Sonstige Erträge betrieblich und regelmäßig'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2144, 'SKR03', '2', '2707', '0', 'Sonstige Erträge betriebsfremd und regelmäßig'); @@ -1082,33 +1041,22 @@ 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) VALUES (__ENTITY__, 2169, 'SKR03', '2', '2742', '0', 'Versicherungsentschädigungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2170, 'SKR03', '2', '2743', '0', 'Investitionszuschüsse (steuerpflichtig)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2171, 'SKR03', '2', '2744', '0', 'Investitionszulagen (steuerfrei)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2173, 'SKR03', '2', '2745', '0', 'Erträge aus Kapitalherabsetzung'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2174, 'SKR03', '2', '2746', '0', 'Steuerfreie Erträge aus der Auflösung von Sonderposten mit Rücklageanteil'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2175, 'SKR03', '2', '2747', '0', 'Sonstige steuerfreie Betriebseinnahmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2176, 'SKR03', '2', '2749', '0', 'Erstattungen Aufwendungsausgleichsgesetz'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2177, 'SKR03', '2', '2750', '0', 'Grundstückserträge'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2179, 'SKR03', '2', '2790', '0', 'Erträge aus Verlustübernahme'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2181, 'SKR03', '2', '2792', '0', 'Erhaltene Gewinne auf Grund einer Gewinngemeinschaft'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2182, 'SKR03', '2', '2794', '0', 'Erhaltene Gewinne auf Grund eines Gewinn- oder Teilgewinnabführungsvetrags'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2184, 'SKR03', '2', '2795', '0', 'Entnahmen aus der Kapitalrücklage'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2186, 'SKR03', '2', '2796', '0', 'Entnahmen aus der gesetzlichen Rücklage'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2188, 'SKR03', '2', '2797', '0', 'Entnahmen aus satzungsmäßigen Rücklagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2190, 'SKR03', '2', '2798', '0', 'Entnahmen aus der Rücklage für eigene Anteile'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2192, 'SKR03', '2', '2799', '0', 'Entnahmen aus anderen Gewinnrücklagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2194, 'SKR03', '2', '2860', '0', 'Gewinnvortrag nach Verwendung'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2195, 'SKR03', '2', '2868', '0', 'Verlustvortrag nach Verwendung'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2197, 'SKR03', '2', '2869', '0', 'Vortrag auf neue Rechnung (GuV)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2199, 'SKR03', '2', '2870', '0', 'Vorabausschüttung'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2202, 'SKR03', '2', '2890', '0', 'Verrechneter kalkulatorischer Unternehmerlohn'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2203, 'SKR03', '2', '2891', '0', 'Verrechnete kalkulatorische Miete und Pacht'); @@ -1116,11 +1064,9 @@ 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) VALUES (__ENTITY__, 2205, 'SKR03', '2', '2893', '0', 'Verrechnete kalkulatorische Abschreibungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2206, 'SKR03', '2', '2894', '0', 'Verrechnete kalkulatorische Wagnisse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2207, 'SKR03', '2', '2895', '0', 'Verrechneter kalkulatorische Lohn für unentgeltliche Mitarbeiter'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2209, 'SKR03', '2', '2990', '0', 'Aufwendungen/Erträge aus Umrechnungsdifferenzen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2212, 'SKR03', '3', '3000', '0', 'Roh- Hilfs- und Betriebsstoffe'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2213, 'SKR03', '3', '3090', '0', 'Energiestoffe (Fertigung'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2215, 'SKR03', '3', '3100', '0', 'Fremdleistungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2219, 'SKR03', '3', '3110', '2215', 'Bauleistungen eines im Inland ansässigen Unternehmens 7% Vorsteuer und 7% Umsatzsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2220, 'SKR03', '3', '3115', '2215', 'Leistungen eines im Ausland ansässigen Unternehmens 7% Vorsteuer und 7% Umsatzsteuer'); @@ -1142,7 +1088,6 @@ 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) VALUES (__ENTITY__, 2236, 'SKR03', '3', '3151', '2215', 'Erhaltene Skonti aus Leistungen für die als Leistungsempfänger die Steuer nach § 13b UStG geschuldet wird 19% Vorsteuer und 19% Umsatzsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2237, 'SKR03', '3', '3152', '2215', 'Erhaltene Skonti aus Leistungen für die als Leistungsempfänger die Steuer nach § 13b UStG geschuldet wird 16% Vorsteuer und 16% Umsatzsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2238, 'SKR03', '3', '3153', '2215', 'Erhaltene Skonti aus Leistungen für die als Leistungsempfänger die Steuer nach § 13b UStG geschuldet wird ohne Vorsteuer aber mit Umsatzsteuer'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2240, 'SKR03', '3', '3200', '0', 'Wareneingang'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2241, 'SKR03', '3', '3300', '2240', 'Wareneingang 7% Vorsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2242, 'SKR03', '3', '3301', '2240', 'Wareneingang 7% Vorsteuer'); @@ -1273,7 +1218,6 @@ 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) VALUES (__ENTITY__, 2367, 'SKR03', '3', '3725', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 19% Vorsteuer und 19% Umsatzsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2368, 'SKR03', '3', '3726', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 16% Vorsteuer und 16% Umsatzsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2369, 'SKR03', '3', '3727', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 15% Vorsteuer und 15% Umsatzsteuer'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2372, 'SKR03', '3', '3730', '0', 'Erhaltene Skonti'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2373, 'SKR03', '3', '3731', '0', 'Erhaltene Skonti 7% Vorsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2374, 'SKR03', '3', '3735', '0', 'Erhaltene Skonti 16% Vorsteuer'); @@ -1299,7 +1243,6 @@ 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) VALUES (__ENTITY__, 2394, 'SKR03', '3', '3800', '0', 'Bezugsnebenkosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2395, 'SKR03', '3', '3830', '0', 'Leergut'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2396, 'SKR03', '3', '3850', '0', 'Zölle und Einfuhrabgaben'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2399, 'SKR03', '3', '3960', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2400, 'SKR03', '3', '3961', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2401, 'SKR03', '3', '3962', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); @@ -1310,7 +1253,6 @@ 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) VALUES (__ENTITY__, 2406, 'SKR03', '3', '3967', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2407, 'SKR03', '3', '3968', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2408, 'SKR03', '3', '3969', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2411, 'SKR03', '3', '3970', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2412, 'SKR03', '3', '3971', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2413, 'SKR03', '3', '3972', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); @@ -1321,7 +1263,6 @@ 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) VALUES (__ENTITY__, 2418, 'SKR03', '3', '3977', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2419, 'SKR03', '3', '3978', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2420, 'SKR03', '3', '3979', '0', 'Bestand Roh- Hilfs- und Betriebsstoffe'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2422, 'SKR03', '3', '3980', '0', 'Bestand Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2423, 'SKR03', '3', '3981', '0', 'Bestand Waren'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2424, 'SKR03', '3', '3982', '0', 'Bestand Waren'); @@ -1332,7 +1273,6 @@ 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) VALUES (__ENTITY__, 2429, 'SKR03', '3', '3987', '0', 'Lager Differenzkorrektur Marktwert'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2430, 'SKR03', '3', '3988', '0', 'Lager Bestand Zwischenkonto'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2431, 'SKR03', '3', '3989', '0', 'Bestand Waren'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2434, 'SKR03', '3', '3990', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2435, 'SKR03', '3', '3991', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2436, 'SKR03', '3', '3992', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); @@ -1343,7 +1283,6 @@ 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) VALUES (__ENTITY__, 2441, 'SKR03', '3', '3997', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2442, 'SKR03', '3', '3998', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2443, 'SKR03', '3', '3999', '0', 'Verrechnete Stoffkosten (Gegenkonto zu 4000-99)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2446, 'SKR03', '4', '4000', '0', 'Material-und Stoffverbrauch'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2447, 'SKR03', '4', '4001', '2446', 'Material-und Stoffverbrauch'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2448, 'SKR03', '4', '4002', '2446', 'Material-und Stoffverbrauch'); @@ -1444,8 +1383,6 @@ 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) VALUES (__ENTITY__, 2543, 'SKR03', '4', '4097', '2446', 'Material-und Stoffverbrauch'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2544, 'SKR03', '4', '4098', '2446', 'Material-und Stoffverbrauch'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2545, 'SKR03', '4', '4099', '2446', 'Material-und Stoffverbrauch'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2548, 'SKR03', '4', '4100', '0', 'Löhne und Gehälter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2549, 'SKR03', '4', '4110', '2548', 'Löhne'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2550, 'SKR03', '4', '4120', '2548', 'Gehälter'); @@ -1454,11 +1391,9 @@ 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) VALUES (__ENTITY__, 2553, 'SKR03', '4', '4126', '2548', 'Tantiemen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2554, 'SKR03', '4', '4127', '2548', 'Geschäftsführergehälter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2555, 'SKR03', '4', '4128', '2548', 'Vergütungen an angestellte Mitunternehmer §15 EStG'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2557, 'SKR03', '4', '4130', '2548', 'Gesetzliche Soziale Aufwendungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2558, 'SKR03', '4', '4137', '2548', 'Gesetzliche soziale Aufwendungen für Mitunternehmer §15 EStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2559, 'SKR03', '4', '4138', '2548', 'Beiträge zur Berufsgenossenschaft'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2561, 'SKR03', '4', '4139', '2548', 'Ausgleichsabgabe i. S. d. Schwerbehindertengesetz'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2562, 'SKR03', '4', '4140', '2548', 'Freiwillige soziale Aufwendungen lohnsteuerfrei'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2563, 'SKR03', '4', '4145', '2548', 'Freiwillige soziale Aufwendungen lohnsteuerpflichtig'); @@ -1475,8 +1410,6 @@ 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) VALUES (__ENTITY__, 2574, 'SKR03', '4', '4180', '2548', 'Bedienungsgelder'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2575, 'SKR03', '4', '4190', '2548', 'Aushilfslöhne'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2576, 'SKR03', '4', '4199', '2548', 'Pauschale Steuer für Aushilfen'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2579, 'SKR03', '4', '4200', '0', 'Raumkosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2580, 'SKR03', '4', '4210', '2579', 'Miete'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2581, 'SKR03', '4', '4218', '2579', 'Gewerbesteuerlich zu berücksichtigende Miete §8 GewStG'); @@ -1497,9 +1430,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) VALUES (__ENTITY__, 2596, 'SKR03', '4', '4301', '2579', 'Nicht abziehbare Vorsteuer 7%'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2597, 'SKR03', '4', '4305', '2579', 'Nicht abziehbare Vorsteuer 16%'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2598, 'SKR03', '4', '4306', '2579', 'Nicht abziehbare Vorsteuer 19%'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2600, 'SKR03', '4', '4320', '2579', 'Gewerbesteuer'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2602, 'SKR03', '4', '4340', '2579', 'Sonstige Betriebssteuern'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2603, 'SKR03', '4', '4350', '2579', 'Verbrauchsteuer'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2604, 'SKR03', '4', '4355', '2579', 'ökosteuer'); @@ -1659,7 +1590,6 @@ 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) VALUES (__ENTITY__, 2758, 'SKR03', '4', '4809', '2579', 'Sonstige Reparaturen und Instandhaltungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2759, 'SKR03', '4', '4810', '2579', 'Mietleasing'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2760, 'SKR03', '4', '4814', '2579', 'Gewerbesteuerlich zu berücksichtigendes Mietleasing § 8 GewStG'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2762, 'SKR03', '4', '4815', '2579', 'Kaufleasing'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2763, 'SKR03', '4', '4820', '2579', 'Abschreibung auf Aufwendungen für die Ingangsetzung und Erweiterung des Geschäftsbetriebs'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2764, 'SKR03', '4', '4821', '2579', 'Abschreibung auf Aufwendungen für die Währungsumstellung auf den Euro'); @@ -1681,7 +1611,6 @@ 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) VALUES (__ENTITY__, 2780, 'SKR03', '4', '4860', '2579', 'Abschreibungen auf aktivierte geringwertiger Wirtschaftsgüter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2781, 'SKR03', '4', '4862', '2579', 'Abschreibung auf Sammelposten WG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2782, 'SKR03', '4', '4865', '2579', 'Außerplanmäßige Abschreibungen auf aktivierte geringwertiger Wirtschaftsgüter'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2784, 'SKR03', '4', '4870', '2579', 'Abschreibungen auf Finanzanlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2785, 'SKR03', '4', '4871', '2579', 'Abschreibungen auf Finanzanlagen 100% / 50% nicht abzugsfähig (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2786, 'SKR03', '4', '4872', '2579', 'Abschreibungen auf Grund von Verlustanteilen an Mitunternehmerschaften § 8 GewStG'); @@ -1690,7 +1619,6 @@ 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) VALUES (__ENTITY__, 2789, 'SKR03', '4', '4875', '2579', 'Abschreibungen auf Wertpapiere des Umlaufvermögens'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2790, 'SKR03', '4', '4876', '2579', 'Abschreibungen auf Wertpapiere des Umlaufvermögens 100% / 50% nicht abzugsfähig (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2791, 'SKR03', '4', '4879', '2579', 'Vorwegnahme künftiger Wertschwankungen bei Wertpapieren des Umlaufvermögens'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2793, 'SKR03', '4', '4880', '2579', 'Abschreibungen auf Umlaufvermögen ohne Wertpapiere (soweit unübliche Höhe)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2794, 'SKR03', '4', '4882', '2579', 'Abschreibungen auf Umlaufvermögen steuerrechtlich bedingt (soweit unübliche Höhe)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2795, 'SKR03', '4', '4885', '2579', 'Vorwegnahme künftiger Wertschwankungen im Umlaufvermögen außer Vorräte und Wertpapiere des Umlaufvermögens'); @@ -1711,7 +1639,6 @@ 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) VALUES (__ENTITY__, 2810, 'SKR03', '4', '4949', '2579', 'Haftungsvergütung an Mitunternehmer § 15 EStG'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2811, 'SKR03', '4', '4950', '2579', 'Rechts- und Beratungskosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2812, 'SKR03', '4', '4955', '2579', 'Buchführungskosten'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2814, 'SKR03', '4', '4957', '2579', 'Abschluss- und Prüfungskosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2815, 'SKR03', '4', '4960', '2579', 'Mieten für Einrichtungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2816, 'SKR03', '4', '4964', '2579', 'Aufwendungen für die zeitlich befristetete Überlassung von Rechten (Lizenzen,Konzessionen)'); @@ -1724,32 +1651,24 @@ 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) VALUES (__ENTITY__, 2823, 'SKR03', '4', '4976', '2579', 'Aufwendungen aus der Veräußerung von Anteilen an Kapitalgesellschaften 100% / 50% nicht abzugsfähig (inländische Kap. Ges.)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2824, 'SKR03', '4', '4980', '2579', 'Betriebsbedarf'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2825, 'SKR03', '4', '4985', '2579', 'Werkzeuge und Kleingeräte'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2828, 'SKR03', '4', '4990', '0', 'Kalkulatorischer Unternehmerlohn'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2829, 'SKR03', '4', '4991', '0', 'Kalkulatorische Miete und Pacht'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2830, 'SKR03', '4', '4992', '0', 'Kalkulatorische Zinsen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2831, 'SKR03', '4', '4993', '0', 'Kalkulatorische Abschreibungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2832, 'SKR03', '4', '4994', '0', 'Kalkulatorische Wagnisse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2833, 'SKR03', '4', '4995', '0', 'Kalkulatorischer Lohn für unentgeltliche Mitarbeiter'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2836, 'SKR03', '4', '4996', '0', 'Herstellungskosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2837, 'SKR03', '4', '4997', '0', 'Verwaltungskosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2838, 'SKR03', '4', '4998', '0', 'Vertriebskosten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2839, 'SKR03', '4', '4999', '0', 'Gegenkonto 4996 - 4998'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2841, 'SKR03', '7', '7000', '0', 'Unfertige Erzeugnisse und Leistungen (Bestand)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2842, 'SKR03', '7', '7050', '2841', 'Unfertige Erzeugnisse (Bestand)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2843, 'SKR03', '7', '7080', '2841', 'Unfertige Leistungen (Bestand)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2845, 'SKR03', '7', '7090', '2841', 'In Ausführung befindliche Bauaufträge'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2847, 'SKR03', '7', '7095', '2841', 'In Arbeit befindliche Aufträge'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2849, 'SKR03', '7', '7100', '0', 'Fertige Erzeugnisse und Waren (Bestand)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2850, 'SKR03', '7', '7110', '2849', 'Fertige Erzeugnisse (Bestand)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2851, 'SKR03', '7', '7140', '2849', 'Waren (Bestand)'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2854, 'SKR03', '8', '8000', '0', '(Zur freien Verfügung)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2855, 'SKR03', '8', '8001', '2854', '(Zur freien Verfügung)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2856, 'SKR03', '8', '8002', '2854', '(Zur freien Verfügung)'); @@ -1901,7 +1820,6 @@ 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) VALUES (__ENTITY__, 3002, 'SKR03', '8', '8348', '2854', 'Erlöse 16% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3003, 'SKR03', '8', '8349', '2854', 'Erlöse 16% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3004, 'SKR03', '8', '8400', '2854', 'Erlöse 19% USt'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3006, 'SKR03', '8', '8401', '2854', 'Vorausberechnete Einnahmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3007, 'SKR03', '8', '8402', '2854', 'Sontige Einnahmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3008, 'SKR03', '8', '8403', '2854', 'Konto Kasse Ertrag'); @@ -1926,12 +1844,10 @@ 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) VALUES (__ENTITY__, 3028, 'SKR03', '8', '8576', '2854', 'Provision sonstige Erträge 7 % USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3029, 'SKR03', '8', '8578', '2854', 'Provision sonstige Erträge 16 % USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3030, 'SKR03', '8', '8579', '2854', 'Provision sonstige Erträge 19 % USt'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3033, 'SKR03', '8', '8580', '2854', 'Statistisches Konto Erlöse zum Allgemeinen Umsatzsteuerersatz (EüR)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3034, 'SKR03', '8', '8581', '2854', 'Statistisches Konto Erlöse zum ermäßigten Umsatzsteuerersatz (EüR)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3035, 'SKR03', '8', '8582', '2854', 'Statistisches Konto Erlöse steuerfrei und nicht steuerbar (EüR)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3036, 'SKR03', '8', '8589', '2854', 'Gegenkonto 8580-8582 bei Aufteilung der Erlöse nach Steuersätzen (EüR)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3038, 'SKR03', '8', '8590', '2854', 'Verrechnete sonstige Sachbezüge (keine Waren)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3039, 'SKR03', '8', '8591', '2854', 'Sachbezüge 7% USt (Waren)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3040, 'SKR03', '8', '8595', '2854', 'Sachbezüge 19% USt (Waren)'); @@ -1960,11 +1876,8 @@ 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) VALUES (__ENTITY__, 3063, 'SKR03', '8', '8644', '2854', 'Sonstige Erlöse betrieblich und regelmäßig 19% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3064, 'SKR03', '8', '8648', '2854', 'Sonstige Erlöse betrieblich und regelmäßig 16% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3065, 'SKR03', '8', '8649', '2854', 'Sonstige Erlöse betrieblich und regelmäßig 16% USt'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3067, 'SKR03', '8', '8650', '2854', 'Erlöse Zinsen und Diskontspesen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3068, 'SKR03', '8', '8660', '2854', 'Erlöse Zinsen und Diskontspesen aus verbundenen Unternehmen'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3071, 'SKR03', '8', '8700', '0', 'Erlösschmälerungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3072, 'SKR03', '8', '8701', '3071', 'Nicht abgerechnete Einnahmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3073, 'SKR03', '8', '8705', '3071', 'Erlösschmälerungen'); @@ -2002,7 +1915,6 @@ 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) VALUES (__ENTITY__, 3105, 'SKR03', '8', '8791', '3071', 'Gewährte Rabatte 19% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3106, 'SKR03', '8', '8794', '3071', 'Gewährte Rabatte 16% USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3107, 'SKR03', '8', '8795', '3071', 'Gewährte Rabatte 16% USt'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3109, 'SKR03', '8', '8800', '0', 'Erlöse aus Verkäufen Sachanlagevermögen (Bei Buchverlust)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3110, 'SKR03', '8', '8801', '3109', 'Erlöse aus Verkäufen Sachanlagevermögen 19% USt (Bei Buchverlust)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3111, 'SKR03', '8', '8802', '3109', 'Erlöse aus Verkäufen Sachanlagevermögen 19% USt (Bei Buchverlust)'); @@ -2078,17 +1990,12 @@ 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) VALUES (__ENTITY__, 3181, 'SKR03', '8', '8949', '0', 'Unentgeltliche Zuwendung von Waren ohne USt'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3182, 'SKR03', '8', '8950', '0', 'Nicht steuerbare Umsätze (Innenumsätze)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3183, 'SKR03', '8', '8955', '0', 'Umsatzsteuervergütungen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3185, 'SKR03', '8', '8960', '0', 'Bestandsveränderungen- unfertige Erzeugnisse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3186, 'SKR03', '8', '8970', '0', 'Bestandsveränderungen- unfertige Leistungen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3188, 'SKR03', '8', '8975', '0', 'Bestandsveränderungen - in Ausführung befindliche Bauaufträge'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3190, 'SKR03', '8', '8977', '0', 'Bestandsveränderungen - in Arbeit befindliche Aufträge'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3191, 'SKR03', '8', '8980', '0', 'Bestandsveränderungen - fertige Erzeugnisse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3192, 'SKR03', '8', '8990', '0', 'Andere aktivierte Eigenleistungen'); - - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3195, 'SKR03', '9', '9000', '0', 'Saldenvorträge Sachkonten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3196, 'SKR03', '9', '9001', '3195', 'Saldenvorträge Sachkonten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3197, 'SKR03', '9', '9002', '3195', 'Saldenvorträge Sachkonten'); @@ -2118,7 +2025,6 @@ 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) VALUES (__ENTITY__, 3221, 'SKR03', '9', '9096', '3215', 'Offene Posten aus 1996'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3222, 'SKR03', '9', '9097', '3215', 'Offene Posten aus 1997'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3223, 'SKR03', '9', '9098', '3215', 'Offene Posten aus 1998'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3225, 'SKR03', '9', '9101', '3195', 'Verkaufstage'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3226, 'SKR03', '9', '9102', '3195', 'Anzahl der Barkunden'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3227, 'SKR03', '9', '9103', '3195', 'Beschäftigte Personen'); @@ -2134,17 +2040,13 @@ 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) VALUES (__ENTITY__, 3237, 'SKR03', '9', '9140', '3195', 'Auftragsbestand'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3238, 'SKR03', '9', '9190', '3195', 'Gegenkonto für statistischen Mengeneinheiten Konten 9101 - 9107 und Konten 9116 - 9118'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3239, 'SKR03', '9', '9199', '3195', 'Gegenkonto zu Konten 9120 9135 - 9140'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3241, 'SKR03', '9', '9200', '3195', 'Beschäftigte Personen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3242, 'SKR03', '9', '9209', '3195', 'Gegenkonto zu 9200'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3243, 'SKR03', '9', '9210', '3195', 'Produktive Löhne'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3244, 'SKR03', '9', '9219', '3195', 'Gegenkonto zu 9210'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3247, 'SKR03', '9', '9220', '3195', 'Gezeichnetes Kapital in DM (Art. 42 Abs. 3 S. 1 EGHGB)'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3249, 'SKR03', '9', '9221', '3195', 'Gezeichnetes Kapital in Euro (Art. 42 Abs. 3 S. 2 EGHGB)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3250, 'SKR03', '9', '9229', '3195', 'Gegenkonto zu Konten 9022 - 9221'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3252, 'SKR03', '9', '9230', '3195', 'Baukostenzuschüsse'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3253, 'SKR03', '9', '9232', '3195', 'Investitionszulagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3254, 'SKR03', '9', '9234', '3195', 'Investitionszuschüsse'); @@ -2158,16 +2060,13 @@ 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) VALUES (__ENTITY__, 3262, 'SKR03', '9', '9246', '3195', 'Forderungen aus Verkäufen immaterieller Vermögensgegenständen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3263, 'SKR03', '9', '9247', '3195', 'Forderungen aus Verkäufe von Finanzanlagen bei sonstigen Vermögensgegenständen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3264, 'SKR03', '9', '9249', '3195', 'Gegenkonto zu Konten 9245 - 9247'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3266, 'SKR03', '9', '9250', '3195', 'Eigenkapitalersetzende Gesellschafterdarlehen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3267, 'SKR03', '9', '9255', '3195', 'Ungesicherte Gesellschafterdarlehen mit Restlaufzeit größer 5 Jahre'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3268, 'SKR03', '9', '9259', '3195', 'Gegenkonto zu 9250 und 9255'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3270, 'SKR03', '9', '9260', '3195', 'Kurzfristige Rückstellungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3271, 'SKR03', '9', '9262', '3195', 'Mittelfristige Rückstellungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3272, 'SKR03', '9', '9264', '3195', 'Langfristige Rückstellungen außer Pensionen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3273, 'SKR03', '9', '9269', '3195', 'Gegenkonto zu Konten 9260 - 9268'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3275, 'SKR03', '9', '9270', '3195', 'Gegenkonto zu 9271 bis 9278 (soll-Buchung)'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3276, 'SKR03', '9', '9271', '3195', 'Verbindlichkeiten aus der Begebung und übertragung von Wechsel'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3277, 'SKR03', '9', '9272', '3195', 'Verbindlichkeiten aus der Begebung und übertragung von Wechseln gegenüber verbundenen Unternehmen'); @@ -2178,7 +2077,6 @@ 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) VALUES (__ENTITY__, 3282, 'SKR03', '9', '9277', '3195', 'Haftung aus der Bestellung von Sicherheiten für fremde Verbindlichkeiten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3283, 'SKR03', '9', '9278', '3195', 'Haftung aus der Bestellung von Sicherheiten für fremde Verbindlichkeiten gegenüber verbundenen Unternehmen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3284, 'SKR03', '9', '9279', '3195', 'Verpflichtungen aus Trendhandvermögen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3286, 'SKR03', '9', '9280', '3195', 'Gegenkonto zu Konten 9281 - 9284'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3287, 'SKR03', '9', '9281', '3195', 'Verpflichtungen aus Miet- und Leasingverträgen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3288, 'SKR03', '9', '9282', '3195', 'Verpflichtungen aus Miet- und Leasingverträgen gegenüber verbundenen Unternehmen'); @@ -2192,10 +2090,8 @@ 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) VALUES (__ENTITY__, 3296, 'SKR03', '9', '9291', '3195', 'Gegenkonto zu 9290'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3297, 'SKR03', '9', '9292', '3195', 'Statistisches Konto Fremdgeld'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3298, 'SKR03', '9', '9293', '3195', 'Gegenkonto zu 9292'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3300, 'SKR03', '9', '9295', '3195', 'Einlagen stiller Gesellschafter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3302, 'SKR03', '9', '9297', '3195', 'Steuerrechtlicher Ausgleichsposten'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3304, 'SKR03', '9', '9400', '3195', 'Privatentnahmen Allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3305, 'SKR03', '9', '9401', '3195', 'Privatentnahmen Allgemein'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3306, 'SKR03', '9', '9402', '3195', 'Privatentnahmen Allgemein'); @@ -2296,7 +2192,6 @@ 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) VALUES (__ENTITY__, 3401, 'SKR03', '9', '9497', '3195', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3402, 'SKR03', '9', '9498', '3195', 'Privateinlagen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3403, 'SKR03', '9', '9499', '3195', 'Privateinlagen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3405, 'SKR03', '9', '9500', '3195', 'Anteil für Konto 0900 Teilhafter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3406, 'SKR03', '9', '9501', '3195', 'Anteil für Konto 0901 Teilhafter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3407, 'SKR03', '9', '9502', '3195', 'Anteil für Konto 0902 Teilhafter'); @@ -2569,7 +2464,6 @@ 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) VALUES (__ENTITY__, 3674, 'SKR03', '9', '9799', '3195', 'Restanteil Teilhafter'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3675, 'SKR03', '9', '9800', '3195', 'Lösch- und Korrekturschlüssel'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3676, 'SKR03', '9', '9801', '3195', 'Lösch- und Korrekturschlüssel'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3678, 'SKR03', '9', '9810', '3195', 'Gesellschafter Darlehen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3679, 'SKR03', '9', '9811', '3195', 'Gesellschafter Darlehen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3680, 'SKR03', '9', '9812', '3195', 'Gesellschafter Darlehen'); @@ -2600,7 +2494,6 @@ 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) VALUES (__ENTITY__, 3705, 'SKR03', '9', '9837', '3195', 'Verrechnungskonto für Einzahlungsverpflichtungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3706, 'SKR03', '9', '9838', '3195', 'Verrechnungskonto für Einzahlungsverpflichtungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3707, 'SKR03', '9', '9839', '3195', 'Verrechnungskonto für Einzahlungsverpflichtungen'); - INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3709, 'SKR03', '9', '9840', '3195', 'Gesellschafter-Darlehen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3710, 'SKR03', '9', '9841', '3195', 'Gesellschafter-Darlehen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3711, 'SKR03', '9', '9842', '3195', 'Gesellschafter-Darlehen'); @@ -2705,6 +2598,11 @@ 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) VALUES (__ENTITY__, 3820, 'SKR03', '9', '9959', '3195', 'Ausstehende Einlagen auf das Kommandit-Kapital eingefordert'); + + + + + -- SKR04 -- Some lines of SKR04 has been disabled because the field account_parent were wrong or there is a doubt, it must be the rowid of parent line and not the account_number of parent line